:root {
  --ink: #1f1d1a;
  --muted: rgba(31, 29, 26, 0.58);
  --quiet: rgba(31, 29, 26, 0.38);
  --paper: #f4f1ec;
  --paper-soft: #faf8f4;
  --white: rgba(255, 255, 255, 0.82);
  --champagne: #b58f5e;
  --champagne-soft: rgba(181, 143, 94, 0.16);
  --line: rgba(31, 29, 26, 0.09);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(205, 179, 138, 0.1), transparent 34rem),
    linear-gradient(180deg, #f8f5f0 0%, var(--paper) 100%);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; }

.documents-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 245, 240, 0.86);
  border-bottom: 1px solid rgba(31, 29, 26, 0.065);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.documents-header-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.documents-identity { display: flex; align-items: center; gap: 15px; }
.documents-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-family: var(--serif);
  text-decoration: none;
  line-height: 1;
}
.documents-brand > span { font-size: 28px; font-weight: 400; }
.documents-brand > i {
  position: relative;
  width: 13px;
  height: 31px;
  display: grid;
  place-items: center;
  font-style: normal;
}
.documents-brand > i::before,
.documents-brand > i::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
  height: 9px;
  background: currentColor;
  opacity: 0.55;
}
.documents-brand > i::before { top: 0; }
.documents-brand > i::after { bottom: 0; }
.documents-brand b { font-size: 11px; font-weight: 400; }
.documents-identity-label {
  color: rgba(168, 143, 104, 0.92);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}
.documents-top-nav { display: flex; align-items: center; gap: 18px; }
.documents-top-nav a {
  color: rgba(31, 29, 26, 0.58);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}
.documents-top-nav a:hover { color: var(--ink); }

.documents-main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 80px;
}
.documents-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  padding: 0 0 45px;
}
.documents-eyebrow {
  margin: 0 0 10px;
  color: rgba(168, 143, 104, 0.9);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.documents-hero h1,
.documents-login-card h1,
.document-view-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.035em;
}
.documents-hero h1 { font-size: clamp(48px, 7vw, 74px); line-height: 0.96; }
.documents-hero > div:first-child > p:last-child {
  max-width: 650px;
  margin: 19px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.documents-session-card {
  min-width: 220px;
  padding: 18px 20px;
  border: 1px solid rgba(181, 143, 94, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  display: grid;
  gap: 4px;
}
.documents-session-card > span { color: var(--quiet); font-size: 9px; font-weight: 760; letter-spacing: 0.14em; text-transform: uppercase; }
.documents-session-card > strong { font-family: var(--serif); font-size: 19px; font-weight: 400; }
.documents-session-card > small { color: rgba(168, 143, 104, 0.9); font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.documents-session-card > a { width: fit-content; margin-top: 6px; color: var(--muted); font-size: 11px; }

.documents-section { margin-top: 34px; }
.documents-section-internal { margin-top: 62px; }
.documents-section-heading {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 15px;
  padding-bottom: 15px;
}
.documents-section-heading::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(181,143,94,.42), rgba(181,143,94,.14) 58%, transparent);
}
.documents-section-heading > div { display: flex; align-items: center; gap: 15px; }
.documents-section-heading > div > span { color: rgba(168,143,104,.72); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.documents-section-heading p { margin: 0 0 3px; color: var(--quiet); font-size: 9px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.documents-section-heading h2 { margin: 0; font-family: var(--serif); font-size: 25px; font-weight: 400; }
.documents-section-heading > small { color: var(--quiet); font-size: 10px; }

.documents-list { display: grid; gap: 10px; }
.document-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  padding: 20px 20px 18px;
  border: 1px solid rgba(31,29,26,.075);
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  box-shadow: 0 8px 26px rgba(31,29,26,.025);
}
.document-card-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.document-card-heading p { margin: 0 0 5px; color: rgba(168,143,104,.9); font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.document-card-heading h3 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 400; line-height: 1.1; }
.document-access-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(31,29,26,.055);
  color: rgba(31,29,26,.48);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.document-access-badge.is-shared { background: rgba(181,143,94,.12); color: #826a48; }
.document-card-meta { display: flex; flex-wrap: wrap; gap: 6px 15px; margin-top: 12px; color: var(--quiet); font-size: 10px; }
.document-card-meta span:not(:last-child)::after { content: "·"; margin-left: 15px; color: rgba(181,143,94,.5); }
.document-card-summary { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.document-card-actions { align-self: center; display: flex; align-items: center; gap: 12px; }
.document-open-button {
  min-width: 84px;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .09em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}
.document-quick-downloads { display: flex; gap: 5px; }
.document-quick-downloads a,
.document-view-downloads a {
  padding: 9px 10px;
  border: 1px solid rgba(31,29,26,.08);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 780;
  letter-spacing: .08em;
  text-decoration: none;
}
.document-manage { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid rgba(31,29,26,.055); }
.document-manage summary { width: fit-content; cursor: pointer; color: var(--quiet); font-size: 10px; font-weight: 700; }
.document-manage-form { display: grid; grid-template-columns: minmax(200px, 1fr) auto auto; gap: 14px; align-items: end; margin-top: 14px; }
.document-manage-form > label { display: grid; gap: 5px; }
.document-manage-form > label span,
.document-manage-form legend { color: var(--quiet); font-size: 9px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.document-manage-form input[type="text"] { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid rgba(31,29,26,.1); border-radius: 10px; background: rgba(255,255,255,.72); color: var(--ink); }
.document-manage-form fieldset { display: flex; gap: 10px; padding: 0; border: 0; }
.document-manage-form fieldset label { color: var(--muted); font-size: 10px; white-space: nowrap; }
.document-manage-form > div { display: flex; gap: 6px; }
.document-manage-actions > button { min-height: 39px; padding: 8px 12px; border: 1px solid rgba(31,29,26,.08); border-radius: 10px; background: var(--ink); color: #fff; cursor: pointer; font-size: 9px; font-weight: 760; }
.document-manage-actions > button.is-danger { background: transparent; color: rgba(130,55,45,.78); }

.documents-empty { padding: 34px 24px; border: 1px dashed rgba(181,143,94,.22); border-radius: 18px; text-align: center; color: var(--muted); }
.documents-empty > span { display: block; margin-bottom: 8px; color: rgba(181,143,94,.62); font-family: var(--serif); }
.documents-empty strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 18px; font-weight: 400; }
.documents-empty p { margin: 6px 0 0; font-size: 11px; }
.documents-system-warning { padding: 16px 18px; border: 1px solid rgba(181,143,94,.24); border-radius: 14px; background: rgba(181,143,94,.08); display: grid; gap: 3px; font-size: 12px; }
.documents-system-warning code { font-size: 11px; }

body.documents-site.documents-login-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 12%, rgba(205, 179, 138, 0.18), transparent 34%),
    #fffdf9;
}

.documents-login-shell {
  position: fixed;
  inset: 0;
  z-index: 999;
  min-height: 100vh;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(
      180deg,
      rgba(255,253,249,0.68),
      rgba(255,253,249,0.82)
    );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.documents-login-page .documents-header {
  display: none;
}

.documents-login-card {
  width: min(92vw, 440px);
  padding: 2rem;
  border-radius: 1.5rem;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.82),
      rgba(255,255,255,0.70)
    );
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow:
    0 20px 60px rgba(31,29,26,0.10),
    inset 0 1px 0 rgba(255,255,255,0.6);
  text-align: center;
}

.documents-login-kicker {
  margin: 0;
  color: rgba(168, 143, 104, 0.9);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.documents-login-card h1 {
  width: 100%;
  margin: 0.9rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 7vw, 4.4rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1;
  text-align: center;
  text-wrap: balance;
}

.documents-login-intro {
  color: #736b61;
  line-height: 1.7;
}

.documents-login-form {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.documents-login-field {
  display: grid;
  gap: 0.45rem;
}

.documents-login-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.documents-login-form input {
  width: 100%;
  border: 1px solid rgba(31, 29, 26, 0.14);
  border-radius: 999px;
  padding: 1rem 1.2rem;
  background: white;
  color: #1f1d1a;
  font: inherit;
  text-align: center;
  outline: none;
}

.documents-login-form input:focus {
  border-color: rgba(31, 29, 26, 0.42);
  box-shadow: none;
}

.documents-login-form button {
  border: 1px solid #1f1d1a;
  border-radius: 999px;
  padding: 1rem 1.2rem;
  background: #1f1d1a;
  color: #fffdf9;
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.documents-notice {
  margin: 1.1rem 0 0;
  padding: 0.78rem 0.9rem;
  border-radius: 0.85rem;
  background: rgba(31,29,26,.045);
  color: #736b61;
  font-size: 0.86rem;
  line-height: 1.5;
}

.documents-notice.is-error {
  color: #773f38;
  background: rgba(162, 80, 69, 0.08);
  border: 1px solid rgba(162, 80, 69, 0.2);
}

.document-view-shell { width: min(1440px, calc(100% - 30px)); margin: 0 auto; padding: 26px 0 36px; }
.document-view-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.document-back-link { display: inline-block; margin-bottom: 10px; color: var(--quiet); font-size: 10px; font-weight: 720; text-decoration: none; }
.document-view-title > p { margin: 0 0 4px; color: rgba(168,143,104,.9); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.document-view-title h1 { font-size: clamp(28px, 4vw, 42px); }
.document-view-title > div { display: flex; flex-wrap: wrap; gap: 8px 15px; margin-top: 8px; color: var(--quiet); font-size: 10px; }
.document-view-downloads { display: flex; flex-wrap: wrap; gap: 6px; }
.document-view-downloads a { padding: 10px 13px; background: rgba(255,255,255,.58); }
.document-view-frame-shell { overflow: hidden; min-height: 70vh; border: 1px solid rgba(31,29,26,.08); border-radius: 20px; background: #e9e7e3; box-shadow: 0 14px 44px rgba(31,29,26,.05); }
.document-view-frame { display: block; width: 100%; height: calc(100vh - 205px); min-height: 680px; border: 0; background: #fff; }
.documents-message-page { min-height: calc(100vh - 150px); display: grid; place-content: center; justify-items: center; padding: 40px; text-align: center; }
.documents-message-page h1 { margin: 0; font-family: var(--serif); font-size: 36px; font-weight: 400; }
.documents-message-page p { color: var(--muted); }
.documents-message-page a { margin-top: 8px; padding: 10px 15px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 10px; text-decoration: none; }
.documents-footer { width: min(1120px, calc(100% - 40px)); min-height: 54px; margin: 0 auto; border-top: 1px solid rgba(31,29,26,.06); display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--quiet); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 760px) {
  .documents-header-inner { width: calc(100% - 28px); min-height: 61px; }
  .documents-brand > span { font-size: 24px; }
  .documents-brand > i { height: 27px; }
  .documents-identity { gap: 10px; }
  .documents-identity-label { font-size: 8px; letter-spacing: .16em; }
  .documents-top-nav { gap: 11px; }
  .documents-top-nav a { font-size: 8px; }
  .documents-main { width: calc(100% - 28px); padding: 40px 0 64px; }
  .documents-hero { grid-template-columns: 1fr; align-items: start; gap: 22px; padding-bottom: 28px; }
  .documents-hero h1 { font-size: 50px; }
  .documents-session-card { min-width: 0; width: 100%; padding: 14px 15px; }
  .documents-section { margin-top: 26px; }
  .documents-section-internal { margin-top: 46px; }
  .documents-section-heading { align-items: center; }
  .documents-section-heading h2 { font-size: 21px; }
  .document-card { grid-template-columns: 1fr; gap: 15px; padding: 17px 16px; }
  .document-card-heading { gap: 9px; }
  .document-card-heading h3 { font-size: 20px; }
  .document-card-actions { justify-content: space-between; }
  .document-open-button { flex: 1; max-width: 150px; }
  .document-card-meta span::after { display: none; }
  .document-manage-form { grid-template-columns: 1fr; }
  .document-manage-form fieldset { flex-wrap: wrap; }
  .document-view-shell { width: calc(100% - 16px); padding-top: 15px; }
  .document-view-toolbar { align-items: start; flex-direction: column; padding: 0 7px; }
  .document-view-downloads { width: 100%; }
  .document-view-downloads a { flex: 1; text-align: center; }
  .document-view-frame-shell { border-radius: 14px; }
  .document-view-frame { height: calc(100vh - 225px); min-height: 600px; }
  .documents-footer { width: calc(100% - 28px); flex-direction: column; justify-content: center; gap: 4px; padding: 14px 0; text-align: center; }
}

/* ========================================================================== 
   Dokumenter · oversikt og dokumentvisning finpuss 2026-08-09
   ========================================================================== */

/* Oversikten får litt bedre arbeidsbredde uten å miste det lette uttrykket. */
.documents-header-inner {
  width: min(1240px, calc(100% - 40px));
}

.documents-main {
  width: min(1240px, calc(100% - 40px));
  padding-top: 52px;
}

.documents-hero {
  position: relative;
  align-items: center;
  padding-bottom: 34px;
}

.documents-hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(181,143,94,.5), rgba(181,143,94,.15) 58%, transparent 100%);
}

.documents-hero h1 {
  font-size: clamp(44px, 5.6vw, 66px);
}

.documents-hero > div:first-child > p:last-child {
  margin-top: 15px;
}

/* Admin-/delt-status er informasjon, ikke et konkurrerende hovedkort. */
.documents-session-card {
  min-width: 230px;
  padding: 7px 0 7px 20px;
  border: 0;
  border-left: 1px solid rgba(181, 143, 94, 0.42);
  border-radius: 0;
  background: transparent;
}

.documents-section {
  margin-top: 38px;
}

.documents-section-internal {
  margin-top: 54px;
}

.documents-section-heading {
  margin-bottom: 12px;
  padding-bottom: 13px;
}

.documents-section-heading > small {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.35rem 0.58rem;
  border: 1px solid rgba(31,29,26,.07);
  border-radius: 999px;
  background: rgba(255,255,255,.44);
}

.document-card {
  border-color: rgba(31,29,26,.07);
  background: rgba(255,255,255,.68);
  box-shadow: 0 7px 22px rgba(31,29,26,.022);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.document-card:hover {
  border-color: rgba(181,143,94,.25);
  background: rgba(255,255,255,.82);
  box-shadow: 0 10px 28px rgba(31,29,26,.03);
}

.documents-section-internal .document-access-badge.is-admin {
  background: rgba(31,29,26,.045);
}

/* Selve dokumentet er arbeidsflaten: nesten full nettleserbredde. */
.document-view-shell {
  width: calc(100% - 20px);
  max-width: none;
  margin: 0 auto;
  padding: 20px 0 24px;
}

.document-view-toolbar {
  align-items: flex-start;
  margin: 0 auto 14px;
  padding: 0 5px;
}

.document-view-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}

/* Samme uttrykk og plassering som den universelle tilbakeknappen i admin. */
.document-back-link {
  --document-back-border: rgba(31, 29, 26, 0.105);
  --document-back-text: rgba(31, 29, 26, 0.62);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  width: fit-content;
  min-height: 2.45rem;
  margin: 0;
  padding: 0.43rem 0.78rem 0.43rem 0.48rem;
  border: 1px solid var(--document-back-border);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.5);
  color: var(--document-back-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 4px 14px rgba(31,29,26,.018);
  font-size: 0.72rem;
  font-weight: 680;
  letter-spacing: 0.025em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.document-back-link-icon {
  display: grid;
  place-items: center;
  width: 1.42rem;
  height: 1.42rem;
  flex: 0 0 1.42rem;
  border-radius: 50%;
  background: rgba(205, 179, 138, 0.13);
  color: rgba(112, 88, 54, 0.82);
}

.document-back-link-icon svg {
  display: block;
  width: 0.82rem;
  height: 0.82rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.document-back-link:hover {
  border-color: rgba(205,179,138,.58);
  background: rgba(255,253,249,.95);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88), 0 8px 20px rgba(31,29,26,.04);
}

.document-view-downloads {
  justify-content: flex-end;
}

.document-view-frame-shell {
  min-height: calc(100vh - 168px);
  border-radius: 16px;
}

.document-view-frame {
  height: calc(100vh - 168px);
  min-height: 720px;
}

@media (max-width: 760px) {
  .documents-main {
    width: calc(100% - 28px);
    padding-top: 34px;
  }

  .documents-hero {
    padding-bottom: 24px;
  }

  .documents-session-card {
    width: 100%;
    padding: 10px 0 10px 14px;
  }

  .document-view-shell {
    width: calc(100% - 10px);
    padding-top: 10px;
  }

  .document-view-toolbar {
    padding: 0 5px;
  }

  .document-view-toolbar-actions {
    width: 100%;
    align-items: flex-start;
  }

  .document-view-downloads {
    width: 100%;
    justify-content: flex-start;
  }

  .document-back-link {
    width: fit-content;
  }

  .document-view-frame-shell {
    min-height: calc(100vh - 210px);
    border-radius: 11px;
  }

  .document-view-frame {
    height: calc(100vh - 210px);
    min-height: 620px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .document-card,
  .document-back-link {
    transition: none;
  }
}

.document-manage-form {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, .9fr) auto;
}

.document-manage-form fieldset {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.document-manage-form fieldset label {
  white-space: normal;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .document-manage-form {
    grid-template-columns: 1fr;
  }
}

/* ========================================================================== 
   Dokumenter · arkiv, header og ren dokumentvisning · 2026-08-09
   ========================================================================== */

/* Logoen og «Dokumenter» leses som én signatur. Labelen følger bunnen av M,
   ikke den høyere dekorstreken rundt ampersanden. */
.documents-identity {
  align-items: flex-end;
  gap: 9px;
}

.documents-identity-label {
  margin-bottom: 1px;
  transform: translateY(-2px);
  line-height: 1;
}

.documents-header-back-link {
  flex: 0 0 auto;
}

/* Renere intro – arkivet skal være arbeidsflate, ikke en ny bryllupsforside. */
.documents-hero {
  padding-bottom: 30px;
}

.documents-hero h1 {
  font-size: clamp(42px, 5vw, 60px);
}

.documents-hero > div:first-child > p:last-child {
  max-width: 560px;
  margin-top: 12px;
  font-size: 14px;
}

/* Seksjonene oppfører seg som elegante dokumentmapper. */
.documents-section {
  position: relative;
  margin-top: 46px;
  padding: 14px;
  border: 1px solid rgba(181, 143, 94, 0.16);
  border-radius: 0 20px 20px 20px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 14px 42px rgba(31, 29, 26, 0.025);
}

.documents-section::before {
  content: "";
  position: absolute;
  top: -13px;
  left: -1px;
  width: min(230px, 42%);
  height: 13px;
  border: 1px solid rgba(181, 143, 94, 0.16);
  border-bottom: 0;
  border-radius: 11px 11px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,.68), rgba(255,255,255,.4));
}

.documents-section-internal {
  margin-top: 58px;
}

.documents-section-heading {
  margin: 0 2px 7px;
  padding: 10px 8px 16px;
}

.documents-list {
  gap: 7px;
}

.document-card {
  border-color: rgba(31, 29, 26, 0.06);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: none;
}

.document-card:hover {
  border-color: rgba(181, 143, 94, 0.25);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 7px 20px rgba(31, 29, 26, 0.025);
}

.document-card-actions {
  min-width: 220px;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}

.document-open-button {
  min-width: 96px;
}

.document-download-group {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.document-download-label {
  color: rgba(31, 29, 26, 0.34);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

.document-quick-downloads {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.document-quick-downloads a,
.document-view-downloads a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 31px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.5);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.document-quick-downloads a:hover,
.document-view-downloads a:hover {
  border-color: rgba(181, 143, 94, 0.36);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.document-download-icon {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Inne på et dokument er portalen kun en ramme rundt selve dokumentet. */
.document-view-page .documents-header-inner {
  width: calc(100% - 28px);
  max-width: none;
}

.document-view-page .documents-header {
  background: rgba(248, 245, 240, 0.93);
}

.document-view-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.document-view-frame-shell {
  min-height: calc(100vh - 68px);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.document-view-frame {
  width: 100%;
  height: calc(100vh - 68px);
  min-height: 720px;
  background: #fff;
}

/* Samme rolige footer som på bryllups-/RSVP-sidene. */
.documents-footer {
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 0 20px;
  border-top: 1px solid rgba(31, 29, 26, 0.07);
  background: rgba(248, 245, 240, 0.72);
  text-transform: none;
}

.documents-footer-inner {
  width: min(1240px, 100%);
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: rgba(31, 29, 26, 0.46);
  font-size: 11px;
  letter-spacing: 0;
}

.documents-footer-actions {
  display: inline-flex;
  align-items: center;
}

.documents-footer-link {
  color: rgba(31, 29, 26, 0.52);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.documents-footer-link:hover {
  color: var(--ink);
}

@media (max-width: 760px) {
  .documents-identity {
    gap: 7px;
  }

  .documents-identity-label {
    transform: translateY(-1px);
  }

  .documents-section {
    padding: 9px;
    border-radius: 0 16px 16px 16px;
  }

  .documents-section::before {
    width: 42%;
  }

  .documents-section-heading {
    padding-inline: 5px;
  }

  .document-card-actions {
    min-width: 0;
    width: 100%;
    align-items: stretch;
  }

  .document-open-button {
    width: 100%;
    max-width: none;
  }

  .document-download-group {
    justify-items: start;
  }

  .document-quick-downloads {
    width: 100%;
    justify-content: flex-start;
  }

  .document-quick-downloads a {
    flex: 1 1 auto;
  }

  .document-view-page .documents-header-inner {
    width: calc(100% - 20px);
  }

  .documents-header-back-link {
    min-height: 2.2rem;
    padding: 0.36rem 0.62rem 0.36rem 0.4rem;
    font-size: 0.64rem;
  }

  .document-view-frame-shell {
    min-height: calc(100vh - 61px);
  }

  .document-view-frame {
    height: calc(100vh - 61px);
    min-height: 620px;
  }

  .documents-footer {
    padding-inline: 14px;
  }

  .documents-footer-inner {
    min-height: 72px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    text-align: center;
  }
}

/* ========================================================================== 
   Dokumenter · kompakt arkiv, én scroll og sticky footer · 2026-08-09
   ========================================================================== */

body.documents-site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.documents-header {
  flex: 0 0 auto;
}

.documents-main,
.documents-login-shell,
.documents-message-page,
.document-view-shell {
  flex: 1 0 auto;
}

.documents-footer {
  flex: 0 0 auto;
  margin-top: auto;
}

/* Dokumentradene skal leses som filer i en mappe, ikke som store kort. */
.document-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 17px;
}

.document-card-heading {
  align-items: center;
}

.document-card-heading h3 {
  font-size: 20px;
}

.document-card-meta {
  margin-top: 9px;
  gap: 5px 12px;
  color: rgba(31, 29, 26, 0.42);
  font-size: 9.5px;
}

.document-card-meta span:not(:last-child)::after {
  margin-left: 12px;
}

.document-card-summary,
.document-download-group,
.document-download-label {
  display: none !important;
}

.document-card-actions {
  min-width: 0;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.document-open-button {
  min-width: 76px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
}

.document-quick-downloads {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 5px;
}

.document-quick-downloads a {
  min-height: 32px;
  padding: 7px 9px;
}

.documents-section-heading p {
  display: none;
}

.documents-section-heading > div {
  align-items: baseline;
}

.documents-section-heading {
  padding-top: 8px;
}

/* Én vertikal scroll: iframe vokser med dokumentet, siden håndterer scrollingen. */
.document-view-frame-shell {
  min-height: 0 !important;
  overflow: visible !important;
}

.document-view-frame {
  display: block;
  height: auto;
  min-height: 0 !important;
  overflow: hidden;
}


@media (max-width: 760px) {
  .document-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px;
  }

  .document-card-actions {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
  }

  .document-open-button {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    min-width: 72px;
  }

  .document-quick-downloads {
    width: auto;
    flex: 0 1 auto;
  }

  .document-quick-downloads a {
    flex: 0 0 auto;
    padding-inline: 8px;
  }
}

/* Fallback: hvis iframe-autosizing ikke støttes, behold en brukbar dokumentflate. */
.document-view-frame {
  height: calc(100vh - 132px);
  min-height: 620px !important;
}

.document-view-frame.is-autosized {
  min-height: 0 !important;
}

@media (max-width: 760px) {
  .document-view-frame {
    height: calc(100vh - 133px);
    min-height: 520px !important;
  }

  .document-view-frame.is-autosized {
    min-height: 0 !important;
  }
}


/* ========================================================================== 
   Dokumenter · finpuss dokumentrad, administrer og header · 2026-08-09
   ========================================================================== */

.documents-identity {
  align-items: flex-end;
}

.documents-identity-label {
  margin-bottom: 1px;
  transform: translateY(-4px);
}

.document-card-heading p {
  margin-bottom: 6px;
}

.document-access-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  text-align: center;
}

.document-card-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.document-open-button {
  order: 2;
}

.document-quick-downloads {
  order: 1;
}

.document-manage {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid rgba(31,29,26,.05);
}

.document-manage summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 1.9rem;
  padding: 0.18rem 0.15rem 0.18rem 0;
  color: rgba(31,29,26,.44);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .02em;
  text-transform: none;
}

.document-manage summary::-webkit-details-marker {
  display: none;
}

.document-manage summary svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.document-manage[open] summary svg {
  transform: rotate(180deg);
}

.document-manage-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(250px, 0.9fr) auto;
  gap: 16px;
  align-items: end;
  margin-top: 12px;
}

.document-manage-name,
.document-manage-access {
  min-width: 0;
}

.document-manage-name {
  display: grid;
  gap: 6px;
}

.document-manage-name > span,
.document-manage-legend {
  color: rgba(31,29,26,.42);
  font-size: 9px;
  font-weight: 780;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.document-manage-name input[type="text"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid rgba(31,29,26,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.76);
  color: var(--ink);
}

.document-manage-access {
  display: grid;
  gap: 8px;
}

.document-manage-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.document-access-choice {
  position: relative;
}

.document-access-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.document-access-choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 98px;
  padding: 8px 14px;
  border: 1px solid rgba(31,29,26,.09);
  border-radius: 999px;
  background: rgba(255,255,255,.5);
  color: rgba(31,29,26,.62);
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.document-access-choice input:checked + span {
  border-color: rgba(181,143,94,.42);
  background: rgba(205,179,138,.12);
  color: rgba(109,85,53,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}

.document-manage-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.document-manage-actions button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgba(31,29,26,.08);
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 780;
}

.document-manage-actions button.is-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: rgba(130,55,45,.78);
}

.document-trash-icon {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 980px) {
  .document-manage-form {
    grid-template-columns: 1fr;
  }

  .document-manage-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .documents-identity-label {
    transform: translateY(-3px);
  }

  .document-card-actions {
    justify-content: space-between;
  }

  .document-open-button {
    order: 2;
    margin-left: auto;
  }

  .document-quick-downloads {
    order: 1;
  }
}

/* ========================================================================== 
   Dokumenter · filvisning og arkivhierarki · 2026-08-09
   ========================================================================== */

/* Header-signaturen: Dokumenter følger M-bokstavens optiske bunnlinje. */
.documents-identity-label {
  transform: translateY(-3px) !important;
}

/* Arkivet starter direkte under headeren. Identiteten ligger allerede i toppen. */
.documents-main {
  padding-top: 38px !important;
}

.documents-main > .documents-section:first-of-type {
  margin-top: 0 !important;
}

/* Tilgang fremgår av mappen dokumentet ligger i, så hvert kort trenger ikke
   gjenta Kun admin / Delt. */
.document-access-badge {
  display: none !important;
}

.document-card {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  padding-block: 15px !important;
}

.document-card-heading {
  align-items: center !important;
}

.document-card-actions {
  align-self: center !important;
  margin-left: auto !important;
  gap: 6px !important;
}

.document-open-button {
  min-width: 96px !important;
  min-height: 40px !important;
  padding: 10px 17px !important;
  font-size: 10px !important;
}

.document-quick-downloads a {
  min-height: 34px !important;
}

/* Administrer er et lite egenskapsområde, ikke et rått HTML-skjema. */
.document-manage {
  grid-column: 1 / -1;
  margin-top: 3px;
  padding-top: 0 !important;
  border-top: 1px solid rgba(31,29,26,.05);
}

.document-manage summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 0;
  padding: 8px 2px;
  border: 0 !important;
  outline: 0 !important;
  color: rgba(31,29,26,.42);
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
}

.document-manage summary::-webkit-details-marker { display:none; }

.document-manage summary svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

.document-manage[open] summary svg { transform: rotate(180deg); }

.document-manage-form {
  display: grid !important;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, .42fr) auto !important;
  align-items: end !important;
  gap: 15px !important;
  margin: 0 0 4px !important;
  padding: 14px !important;
  border: 1px solid rgba(181,143,94,.13);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(205,179,138,.055), rgba(255,255,255,.52) 45%, rgba(255,255,255,.28));
}

.document-manage-name,
.document-manage-access {
  display: grid !important;
  gap: 6px !important;
  min-width: 0;
}

.document-manage-name > span,
.document-manage-legend {
  color: rgba(168,143,104,.92) !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: .13em !important;
  text-transform: uppercase;
}

.document-manage-name input[type="text"],
.document-manage-select-shell select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(31,29,26,.095);
  border-radius: 11px;
  background: rgba(255,255,255,.75);
  color: var(--ink);
  outline: none;
}

.document-manage-name input[type="text"] {
  padding: 9px 12px;
}

.document-manage-name input[type="text"]:focus,
.document-manage-select-shell select:focus {
  border-color: rgba(181,143,94,.48);
  box-shadow: 0 0 0 3px rgba(181,143,94,.07);
}

.document-manage-select-shell {
  position: relative;
  display: block;
}

.document-manage-select-shell select {
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 36px 9px 12px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 720;
}

.document-manage-select-shell svg {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 10px;
  height: 7px;
  transform: translateY(-50%);
  fill: none;
  stroke: rgba(31,29,26,.48);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.document-manage-actions {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 7px !important;
}

.document-manage-actions button {
  min-height: 42px !important;
  padding: 9px 14px !important;
  border-radius: 11px !important;
  font-size: 9px !important;
  font-weight: 780 !important;
}

.document-manage-actions button.is-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(130,55,45,.12) !important;
  background: rgba(255,255,255,.44) !important;
  color: rgba(130,55,45,.72) !important;
}

.document-trash-icon {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
}

/* Dokumentvisning er en appflate: header + selve filen. Ingen ytre side eller footer. */
body.document-view-page {
  height: 100vh !important;
  min-height: 100vh !important;
  overflow: hidden !important;
  background: #fffdf9 !important;
}

body.document-view-page .documents-header {
  flex: 0 0 auto;
}

body.document-view-page .document-view-shell {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #fffdf9 !important;
}

body.document-view-page .document-view-frame-shell {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fffdf9 !important;
  box-shadow: none !important;
}

body.document-view-page .document-view-frame {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 0 !important;
  background: #fffdf9 !important;
}

/* Footeren er statuslinjen til selve arkivet. */
.documents-footer-actions {
  gap: 12px;
}

.documents-footer-session {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(31,29,26,.44);
  font-size: 10px;
}

.documents-footer-session > span {
  color: rgba(31,29,26,.36);
}

.documents-footer-session strong {
  color: rgba(31,29,26,.66);
  font-weight: 720;
}

.documents-footer-session small {
  color: rgba(168,143,104,.9);
  font-size: 9px;
  font-weight: 780;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.documents-footer-divider {
  width: 1px;
  height: 18px;
  background: linear-gradient(180deg, transparent, rgba(181,143,94,.34), transparent);
}

@media (max-width: 980px) {
  .document-manage-form {
    grid-template-columns: 1fr 1fr !important;
  }
  .document-manage-actions {
    grid-column: 1 / -1;
    justify-content: flex-end !important;
  }
}

@media (max-width: 760px) {
  .documents-identity-label { transform: translateY(-2px) !important; }
  .documents-main { padding-top: 26px !important; }
  .document-card { grid-template-columns: 1fr !important; }
  .document-card-actions { width:100%; justify-content:flex-end !important; }
  .document-open-button { margin-left:auto !important; }
  .document-manage-form { grid-template-columns:1fr !important; padding:12px !important; }
  .document-manage-actions { grid-column:auto; justify-content:flex-start !important; flex-wrap:wrap; }
  .documents-footer-actions { flex-wrap:wrap; justify-content:center; }
}

/* ========================================================================== 
   Dokumenter · filter, tydelig dato og administrer-finpuss · 2026-08-09
   ========================================================================== */

.documents-filterbar {
  display: grid;
  grid-template-columns: minmax(13rem, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  padding: 10px;
  border: 1px solid rgba(31,29,26,.065);
  border-radius: 16px;
  background: rgba(255,255,255,.46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.documents-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.documents-search svg {
  position: absolute;
  left: 13px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: rgba(31,29,26,.38);
  stroke-width: 1.45;
  stroke-linecap: round;
  pointer-events: none;
}

.documents-search input {
  width: 100%;
  min-height: 40px;
  padding: 9px 13px 9px 37px;
  border: 1px solid rgba(31,29,26,.075);
  border-radius: 12px;
  background: rgba(255,255,255,.7);
  color: var(--ink);
  outline: none;
  font-size: 11px;
}

.documents-search input:focus {
  border-color: rgba(181,143,94,.44);
  box-shadow: 0 0 0 3px rgba(181,143,94,.07);
}

.documents-search input::placeholder {
  color: rgba(31,29,26,.34);
}

.documents-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(31,29,26,.065);
  border-radius: 999px;
  background: rgba(255,255,255,.56);
}

.documents-filter-group button {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(31,29,26,.48);
  cursor: pointer;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .025em;
  white-space: nowrap;
}

.documents-filter-group button.is-active {
  background: rgba(205,179,138,.13);
  color: rgba(104,78,45,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.documents-filter-empty {
  margin: 34px 0;
  padding: 28px 20px;
  border: 1px dashed rgba(181,143,94,.22);
  border-radius: 16px;
  color: rgba(31,29,26,.46);
  text-align: center;
  font-size: 11px;
}

.document-generated-at {
  color: rgba(31,29,26,.55);
}

.document-generated-at strong {
  margin-right: 4px;
  color: rgba(168,143,104,.94);
  font-size: .92em;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.document-open-button {
  min-width: 92px !important;
  min-height: 42px !important;
  padding-inline: 18px !important;
}

.document-manage-form {
  grid-template-columns: minmax(240px, 1fr) minmax(210px, .48fr) auto !important;
  padding: 16px !important;
  border-color: rgba(181,143,94,.16) !important;
  background:
    linear-gradient(135deg, rgba(205,179,138,.065), rgba(255,255,255,.64) 46%, rgba(255,255,255,.34)) !important;
}

.document-manage-select-shell.is-enhanced {
  position: relative;
  z-index: 8;
}

.document-manage-select-shell.is-open {
  z-index: 60;
}

.document-manage-select-shell.is-enhanced > svg {
  display: none !important;
}

.document-manage-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.document-manage-select-toggle {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid rgba(31,29,26,.095);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(250,247,241,.82));
  color: rgba(31,29,26,.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 720;
  text-align: left;
}

.document-manage-select-toggle:hover,
.document-manage-select-shell.is-open .document-manage-select-toggle {
  border-color: rgba(181,143,94,.4);
  background: #fffdf9;
}

.document-manage-select-toggle:focus-visible {
  outline: none;
  border-color: rgba(181,143,94,.55);
  box-shadow: 0 0 0 3px rgba(181,143,94,.08);
}

.document-manage-select-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid rgba(130,106,72,.86);
  border-bottom: 1.5px solid rgba(130,106,72,.86);
  transform: rotate(45deg) translate(-1px,-1px);
  transition: transform 160ms ease;
}

.document-manage-select-shell.is-open .document-manage-select-chevron {
  transform: rotate(225deg) translate(-1px,-1px);
}

.document-manage-select-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  display: grid;
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(31,29,26,.09);
  border-radius: 12px;
  background: rgba(255,253,249,.99);
  box-shadow: 0 18px 42px rgba(31,29,26,.12), inset 0 1px 0 rgba(255,255,255,.98);
  backdrop-filter: blur(12px);
}

.document-manage-select-menu[hidden] { display:none !important; }

.document-manage-select-option {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(31,29,26,.65);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 650;
  text-align: left;
}

.document-manage-select-option:hover,
.document-manage-select-option:focus-visible,
.document-manage-select-option.is-active {
  outline: none;
  background: rgba(205,179,138,.11);
  color: rgba(90,67,43,.95);
}

.document-manage-select-mark {
  color: rgba(168,143,104,.95);
  opacity: 0;
}

.document-manage-select-option.is-active .document-manage-select-mark { opacity:1; }

.document-manage-actions button.is-danger {
  min-width: 72px !important;
  padding-inline: 12px !important;
}

.documents-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.documents-footer-link-arrow {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .64;
  transition: opacity 160ms ease, transform 160ms ease;
}

.documents-footer-link:hover .documents-footer-link-arrow {
  opacity: 1;
  transform: translate(1px,-1px);
}

@media (max-width: 980px) {
  .documents-filterbar {
    grid-template-columns: 1fr;
  }
  .documents-filter-group {
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
  }
  .document-manage-form {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 760px) {
  .documents-filterbar { margin-bottom: 18px; }
  .documents-filter-group { width: 100%; }
  .documents-filter-group button { flex: 1 0 auto; }
  .document-manage-form { grid-template-columns:1fr !important; }
}

/* ========================================================================== 
   Dokumenter · v8 finpuss: filter-dropdown, dato-label og sidevisning
   ========================================================================== */

.document-generated-at {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  margin-top: -2px;
  padding: 4px 8px;
  border: 1px solid rgba(31,29,26,.065);
  border-radius: 999px;
  background: rgba(31,29,26,.028);
  color: rgba(31,29,26,.49);
  font-size: 9px;
  font-weight: 680;
  letter-spacing: .01em;
  line-height: 1;
  white-space: nowrap;
}

.document-generated-at svg {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  fill: none;
  stroke: rgba(31,29,26,.42);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.document-card-meta > .document-generated-at::after {
  display: none !important;
}

/* Administrer-dropdown: samme rolige filteruttrykk som gjestelisten,
   men samme høyde/radius som navnefeltet i dokumentkortet. */
.document-manage-form .document-manage-select-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 42px !important;
  padding: 9px 12px !important;
  border: 1px solid rgba(31,29,26,.095) !important;
  border-radius: 11px !important;
  background: linear-gradient(180deg, rgba(255,253,249,.98), rgba(255,253,249,.78)) !important;
  color: rgba(31,29,26,.7) !important;
  box-shadow: 0 5px 16px rgba(31,29,26,.025), inset 0 1px 0 rgba(255,255,255,.78) !important;
  font: inherit !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .01em !important;
  line-height: 1 !important;
  text-transform: none !important;
  text-align: left !important;
  cursor: pointer !important;
}

.document-manage-form .document-manage-select-toggle:hover {
  border-color: rgba(31,29,26,.18) !important;
  background: rgba(255,253,249,.98) !important;
}

.document-manage-form .document-manage-select-toggle:focus-visible,
.document-manage-select-shell.is-open .document-manage-select-toggle {
  outline: none !important;
  border-color: rgba(205,179,138,.72) !important;
  background: #fffdf9 !important;
  box-shadow: 0 0 0 3px rgba(205,179,138,.1), 0 10px 24px rgba(31,29,26,.045) !important;
}

.document-manage-select-menu {
  top: calc(100% + 6px) !important;
  right: 0 !important;
  left: 0 !important;
  gap: 3px !important;
  width: 100% !important;
  min-width: 100% !important;
  padding: 5px !important;
  border: 1px solid rgba(31,29,26,.08) !important;
  border-radius: 13px !important;
  background: rgba(255,253,249,.985) !important;
  box-shadow: 0 20px 48px rgba(31,29,26,.13), inset 0 1px 0 rgba(255,255,255,.8) !important;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.document-manage-select-option {
  min-height: 38px !important;
  padding: 9px 10px !important;
  border-radius: 9px !important;
  color: rgba(31,29,26,.62) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .01em !important;
  text-transform: none !important;
}

.document-manage-select-option:hover,
.document-manage-select-option:focus-visible,
.document-manage-select-option.is-active {
  background: rgba(205,179,138,.12) !important;
  color: var(--ink) !important;
}

/* Detaljert bordoppsett: flytende sidenavigasjon oppå dokumentet. */
.document-view-shell {
  position: relative;
}

.document-view-page-navigation {
  position: absolute;
  z-index: 30;
  top: 12px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid rgba(31,29,26,.075);
  border-radius: 999px;
  background: rgba(255,253,249,.93);
  box-shadow: 0 10px 28px rgba(31,29,26,.07), inset 0 1px 0 rgba(255,255,255,.82);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  overflow: hidden;
}

.document-view-page-navigation[hidden] { display: none !important; }

.document-view-page-navigation button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: rgba(31,29,26,.55);
  cursor: pointer;
  font: 500 15px/1 var(--sans);
  transition: background 150ms ease, color 150ms ease;
}

.document-view-page-navigation button:hover:not(:disabled),
.document-view-page-navigation button:focus-visible {
  outline: none;
  background: rgba(205,179,138,.1);
  color: var(--ink);
}

.document-view-page-navigation button:disabled {
  cursor: default;
  opacity: .28;
}

.document-view-page-navigation > span {
  min-width: 92px;
  padding: 0 8px;
  color: rgba(143,111,69,.85);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .document-view-page-navigation {
    top: 8px;
    right: 9px;
    min-height: 32px;
  }
  .document-view-page-navigation button { width: 32px; height: 32px; }
  .document-view-page-navigation > span { min-width: 82px; font-size: 8px; }
}

/* View-headeren skal være identisk med Dokumenter-oversikten. */
body.document-view-page .documents-header-inner {
  width: min(1240px, calc(100% - 40px)) !important;
  max-width: none !important;
}

/* Navigatoren flyter på høyre side i stedet for å stjele vertikal dokumentplass. */
.document-view-page-navigation {
  top: 50% !important;
  right: 14px !important;
  transform: translateY(-50%);
}

@media (max-width: 760px) {
  body.document-view-page .documents-header-inner {
    width: calc(100% - 28px) !important;
  }
  .document-view-page-navigation {
    top: 50% !important;
    right: 7px !important;
  }
}

/* ========================================================================== 
   Dokumenter · v9 regresjonsfix: filtre, metadata og dropdown · 2026-08-09
   ========================================================================== */

/* Author CSS skal aldri overstyre HTML hidden-attributtet. */
.documents-site [hidden] {
  display: none !important;
}

/* Metadata leses som like, diskrete dokumentlabels. */
.document-card-meta {
  align-items: center;
  gap: 6px !important;
}

.document-card-meta > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 25px;
  margin: 0 !important;
  padding: 5px 9px;
  border: 1px solid rgba(31,29,26,.065);
  border-radius: 999px;
  background: rgba(31,29,26,.026);
  color: rgba(31,29,26,.48);
  font-size: 9px;
  font-weight: 680;
  letter-spacing: .01em;
  line-height: 1;
  white-space: nowrap;
}

.document-card-meta > span::after {
  display: none !important;
  content: none !important;
}

.document-card-meta > .document-generated-at {
  margin: 0 !important;
  background: rgba(255,255,255,.58);
}

/* Administrer > Tilgang: samme komponentuttrykk som Admin brukere > Tilgang. */
.document-filter-dropdown {
  position: relative;
  width: 100%;
  min-width: 0;
}

.document-filter-dropdown.is-open {
  z-index: 80;
}

/* Kopiert fra Admin brukere > Tilgang (.admin-users-dropdown .admin-filter-toggle). */
.document-manage-form .document-filter-toggle {
  position: relative;
  width: 100%;
  min-height: 3.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(31,29,26,0.095);
  border-radius: 0.95rem;
  background:
    linear-gradient(
      180deg,
      rgba(255,253,249,0.98),
      rgba(255,253,249,0.74)
    );
  color: rgba(31,29,26,0.72);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-align: left;
  text-transform: none;
  cursor: pointer;
  box-shadow:
    0 8px 22px rgba(31,29,26,0.035),
    inset 0 1px 0 rgba(255,255,255,0.72);
  transition:
    border-color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.document-manage-form .document-filter-toggle::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  flex: 0 0 0.42rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.72;
  transition: transform 220ms ease;
}

.document-manage-form .document-filter-toggle:hover:not(:disabled) {
  border-color: rgba(31,29,26,0.18);
  background:
    linear-gradient(
      180deg,
      rgba(255,253,249,0.98),
      rgba(255,253,249,0.74)
    );
  color: rgba(31,29,26,0.72);
  box-shadow:
    0 10px 26px rgba(31,29,26,0.05),
    inset 0 1px 0 rgba(255,255,255,0.78);
}

.document-manage-form .document-filter-toggle:focus-visible {
  outline: none;
  border-color: rgba(205,179,138,0.75);
  box-shadow:
    0 0 0 4px rgba(205,179,138,0.11),
    0 12px 28px rgba(31,29,26,0.055),
    inset 0 1px 0 rgba(255,255,255,0.8);
}

.document-manage-form .document-filter-toggle[aria-expanded="true"] {
  border-color: rgba(205,179,138,0.75);
  background: white;
  color: rgba(31,29,26,0.72);
  box-shadow:
    0 0 0 4px rgba(205,179,138,0.11),
    0 12px 28px rgba(31,29,26,0.055),
    inset 0 1px 0 rgba(255,255,255,0.8);
}

.document-manage-form .document-filter-toggle[aria-expanded="true"]::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

/* Kopiert fra Admin brukere > Tilgang (.admin-users-dropdown .admin-filter-menu). */
.document-manage-form .document-filter-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 0.45rem);
  left: 0;
  right: auto;
  width: max-content;
  min-width: 100%;
  max-width: min(27rem, calc(100vw - 2rem));
  padding: 0.35rem;
  border: 1px solid rgba(31,29,26,0.08);
  border-radius: 1.1rem;
  background: rgba(255,253,249,0.98);
  box-shadow:
    0 20px 48px rgba(31,29,26,0.13),
    inset 0 1px 0 rgba(255,255,255,0.78);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.document-manage-form .document-filter-menu[hidden] {
  display: none !important;
}

.document-manage-form .document-filter-menu button {
  width: 100%;
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 0.85rem;
  padding: 0.78rem 0.85rem;
  background: transparent;
  color: rgba(31,29,26,0.62);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.document-manage-form .document-filter-menu button:hover,
.document-manage-form .document-filter-menu button:focus-visible,
.document-manage-form .document-filter-menu button.is-active {
  outline: none;
  background: rgba(205,179,138,0.12);
  color: var(--ink);
}

.document-manage-form .document-filter-menu button.is-active::after {
  content: "✓";
  color: rgba(168,143,104,0.95);
}

@media (max-width: 780px) {
  .document-manage-form .document-filter-menu {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }

  .document-manage-form .document-filter-menu button {
    white-space: normal;
  }
}

/* Detaljert bordoppsett: navigatoren skal alltid ligge over filflaten. */
body.document-view-page .document-view-shell {
  position: relative !important;
}

body.document-view-page .document-view-page-navigation {
  position: fixed !important;
  z-index: 120 !important;
  top: 50% !important;
  right: 18px !important;
  transform: translateY(-50%) !important;
}

@media (max-width: 760px) {
  .document-card-meta > span {
    min-height: 24px;
    padding: 5px 8px;
    font-size: 8.5px;
  }

  body.document-view-page .document-view-page-navigation {
    right: 8px !important;
  }
}


/* ==========================================================================
   Dokumenter-login · samme input-komponent som admin-auth v15 · v17
   ========================================================================== */
body.documents-site.documents-login-page .documents-login-form input {
  width: 100%;
  min-height: 3.55rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(31,29,26,.11);
  border-radius: .92rem;
  background: rgba(255,255,255,.88);
  color: #1f1d1a;
  font: inherit;
  font-size: .92rem;
  text-align: center;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.86);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body.documents-site.documents-login-page .documents-login-form input:hover {
  border-color: rgba(31,29,26,.18);
}

body.documents-site.documents-login-page .documents-login-form input:focus {
  border-color: rgba(181,143,94,.68);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(205,179,138,.09), inset 0 1px 0 rgba(255,255,255,.92);
}

body.documents-site.documents-login-page .documents-login-form input:-webkit-autofill,
body.documents-site.documents-login-page .documents-login-form input:-webkit-autofill:hover,
body.documents-site.documents-login-page .documents-login-form input:-webkit-autofill:active {
  -webkit-text-fill-color: #1f1d1a !important;
  caret-color: #1f1d1a;
  -webkit-box-shadow: 0 0 0 1000px rgba(255,255,255,.98) inset !important;
  box-shadow: 0 0 0 1000px rgba(255,255,255,.98) inset !important;
  border-color: rgba(31,29,26,.11) !important;
  transition: background-color 9999s ease-out 0s;
}

body.documents-site.documents-login-page .documents-login-form input:-webkit-autofill:focus {
  border-color: rgba(181,143,94,.68) !important;
  -webkit-box-shadow: 0 0 0 4px rgba(205,179,138,.09), 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 4px rgba(205,179,138,.09), 0 0 0 1000px #fff inset !important;
}

/* v21 · Dokumenter > Administrer: Navn og Tilgang skal ha identisk feltstørrelse. */
.document-manage-name input[type="text"],
.document-manage-form .document-filter-toggle {
  min-height: 42px !important;
  height: 42px;
  border-radius: 11px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

.document-manage-name input[type="text"] {
  padding: 9px 12px !important;
  font-weight: 500;
  letter-spacing: 0 !important;
}

.document-manage-form .document-filter-toggle {
  padding: 9px 12px !important;
  gap: 10px;
  font-weight: 650;
  letter-spacing: .02em !important;
}

/* ========================================================================== 
   Dokumenter · Detaljert bordoppsett · flytende dokumentnavigator · v39
   ========================================================================== */
body.document-view-page .document-view-frame-shell.has-page-navigation {
  position: relative !important;
  isolation: isolate;
}

/* Navigatoren ligger fast nederst i visningsflaten som i en dokumentleser.
   Den påvirker derfor aldri dokumentets høyde eller nedlastet/utskrevet fil. */
body.document-view-page .document-view-page-navigation {
  position: fixed !important;
  z-index: 240 !important;
  top: auto !important;
  right: auto !important;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  min-height: 2.72rem;
  padding: 0.24rem;
  border: 1px solid rgba(31, 29, 26, 0.085);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.92);
  box-shadow:
    0 16px 42px rgba(31, 29, 26, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  overflow: hidden;
}

body.document-view-page .document-view-page-navigation[hidden] {
  display: none !important;
}

body.document-view-page .document-view-page-navigation button {
  display: grid;
  place-items: center;
  min-width: 2.22rem;
  width: 2.22rem;
  height: 2.22rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(31, 29, 26, 0.68);
  font: inherit;
  font-family: var(--font-sans);
  font-size: 1.22rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease,
    opacity 150ms ease,
    transform 150ms ease;
}

body.document-view-page .document-view-page-navigation button:hover:not(:disabled),
body.document-view-page .document-view-page-navigation button:focus-visible {
  outline: none;
  background: rgba(205, 179, 138, 0.14);
  color: rgba(31, 29, 26, 0.94);
}

body.document-view-page .document-view-page-navigation button:first-child:hover:not(:disabled) {
  transform: translateX(-1px);
}

body.document-view-page .document-view-page-navigation button:last-child:hover:not(:disabled) {
  transform: translateX(1px);
}

body.document-view-page .document-view-page-navigation button:disabled {
  cursor: default;
  opacity: 0.26;
}

body.document-view-page .document-view-page-status {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.38rem;
  min-width: 8.2rem;
  max-width: min(17rem, 58vw);
  padding: 0 0.72rem;
  white-space: nowrap;
}

body.document-view-page .document-view-page-status strong {
  min-width: 0;
  overflow: hidden;
  color: rgba(31, 29, 26, 0.88);
  font-size: 0.7rem;
  font-weight: 720;
  letter-spacing: 0.015em;
  text-overflow: ellipsis;
}

body.document-view-page .document-view-page-status > span {
  color: rgba(168, 143, 104, 0.9);
  font-size: 0.58rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.document-view-page .document-view-page-status > span[aria-hidden="true"] {
  color: rgba(31, 29, 26, 0.26);
  font-size: 0.66rem;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  body.document-view-page .document-view-page-navigation {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: 2.5rem;
    max-width: calc(100vw - 24px);
  }

  body.document-view-page .document-view-page-navigation button {
    min-width: 2rem;
    width: 2rem;
    height: 2rem;
    font-size: 1.08rem;
  }

  body.document-view-page .document-view-page-status {
    min-width: 7rem;
    max-width: calc(100vw - 7rem);
    gap: 0.3rem;
    padding-inline: 0.5rem;
  }

  body.document-view-page .document-view-page-status strong {
    font-size: 0.64rem;
  }

  body.document-view-page .document-view-page-status > span {
    font-size: 0.53rem;
  }
}


/* ==========================================================================
   Dokumenter · samme champagnefade under header som Bordkart · 2026-08-10
   ========================================================================== */
.documents-header {
  border-bottom: 0 !important;
}

.documents-header::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(205, 179, 138, 0.52) 12%,
      rgba(205, 179, 138, 0.52) 88%,
      transparent 100%
    ) center bottom / 100% 1px no-repeat,
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(205, 179, 138, 0.12) 12%,
      rgba(205, 179, 138, 0.38) 34%,
      rgba(205, 179, 138, 0.5) 50%,
      rgba(205, 179, 138, 0.38) 66%,
      rgba(205, 179, 138, 0.12) 88%,
      transparent 100%
    ) center bottom / 58% 2px no-repeat;
}


/* ========================================================================== 
   Dokumenter · seksjonsikon · 2026-08-10
   ========================================================================== */
.documents-section-heading > div {
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
}

.documents-section-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.72rem;
  height: 1.72rem;
  color: rgba(181, 143, 94, 0.84);
  transform: translateY(1px);
}

.documents-section-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.documents-section-icon .documents-section-icon-sparkle {
  fill: rgba(181, 143, 94, 0.18);
  stroke-width: 1.15;
}

@media (max-width: 640px) {
  .documents-section-heading > div {
    gap: 0.56rem;
  }

  .documents-section-icon {
    width: 1.48rem;
    height: 1.48rem;
  }
}

/* ========================================================================== 
   Dokumenter · v89 tydelig dokumenttype og roligere metadata · 2026-08-11
   ========================================================================== */

/* Litt mer luft mellom filkortene gjør like navn enklere å skanne som
   separate dokumenter uten å gjøre hvert kort større. */
.documents-list {
  gap: 12px !important;
}

.document-card {
  padding: 17px 18px !important;
  border-color: rgba(31, 29, 26, 0.075) !important;
  background: rgba(255, 255, 255, 0.68) !important;
  box-shadow: 0 7px 22px rgba(31, 29, 26, 0.018) !important;
}

.document-card:hover {
  border-color: rgba(181, 143, 94, 0.24) !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: 0 9px 24px rgba(31, 29, 26, 0.026) !important;
}

/* Metadata deles i to nivåer: identitet/status først, teknisk metadata under. */
.document-card-meta {
  display: grid !important;
  gap: 8px !important;
  margin-top: 12px !important;
}

.document-card-meta-primary,
.document-card-meta-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.document-card-meta-primary {
  gap: 7px;
}

.document-card-meta-secondary {
  gap: 6px 14px;
  color: rgba(31, 29, 26, 0.42);
  font-size: 9px;
}

/* Dokumenttypen er den viktigste skanneinformasjonen. */
.document-card-meta .document-meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  margin: 0 !important;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

.document-card-meta .document-meta-pill-type {
  border-color: rgba(181, 143, 94, 0.24);
  background: rgba(205, 179, 138, 0.15);
  color: rgba(116, 89, 51, 0.94);
  font-size: 8.8px;
  font-weight: 790;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

/* Kildestatus er sekundær og skal aldri konkurrere med dokumenttypen. */
.document-card-meta .document-meta-pill-source {
  border-color: rgba(31, 29, 26, 0.07);
  background: rgba(31, 29, 26, 0.025);
  color: rgba(31, 29, 26, 0.48);
  font-size: 8.8px;
  font-weight: 680;
  letter-spacing: 0.01em;
}

.document-card-meta .document-meta-pill-source.is-published {
  border-color: rgba(181, 143, 94, 0.17);
  background: rgba(205, 179, 138, 0.075);
  color: rgba(116, 89, 51, 0.72);
}

.document-card-meta .document-meta-pill-source.is-draft {
  color: rgba(31, 29, 26, 0.46);
}

.document-card-meta .document-meta-pill-source.is-attention {
  border-style: dashed;
  color: rgba(31, 29, 26, 0.56);
}

/* Dato, omfang og versjon er bevisst ikke pills. De er nyttige etter at
   dokumenttypen er identifisert, men skal ikke dominere kortet. */
.document-card-meta-secondary > .document-generated-at,
.document-card-meta-secondary > .document-meta-detail {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  min-height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: rgba(31, 29, 26, 0.43) !important;
  font-size: 9px !important;
  font-weight: 620 !important;
  letter-spacing: 0.01em !important;
  line-height: 1.35 !important;
  white-space: nowrap;
}

.document-card-meta-secondary > .document-generated-at svg {
  width: 10px;
  height: 10px;
  flex-basis: 10px;
  stroke: rgba(31, 29, 26, 0.36);
}

.document-card-meta-secondary > * + *::before {
  content: "·";
  margin-right: 8px;
  color: rgba(181, 143, 94, 0.52);
  font-weight: 700;
}

.document-card-meta > span,
.document-card-meta > span::after,
.document-card-meta-primary > span::after,
.document-card-meta-secondary > span::after {
  content: none !important;
}

@media (max-width: 760px) {
  .documents-list {
    gap: 10px !important;
  }

  .document-card {
    padding: 16px !important;
  }

  .document-card-meta {
    gap: 7px !important;
    margin-top: 11px !important;
  }

  .document-card-meta .document-meta-pill {
    min-height: 26px;
    padding: 6px 9px;
  }

  .document-card-meta .document-meta-pill-type,
  .document-card-meta .document-meta-pill-source {
    font-size: 8.2px;
  }

  .document-card-meta-secondary {
    gap: 5px 10px;
  }

  .document-card-meta-secondary > .document-generated-at,
  .document-card-meta-secondary > .document-meta-detail {
    font-size: 8.5px !important;
  }

  .document-card-meta-secondary > * + *::before {
    margin-right: 5px;
  }
}

/* ========================================================================== 
   Dokumenter · v91 tittelnær dokumentstatus · 2026-08-11
   ========================================================================== */

/* Utkast/publisert hører til selve dokumentet og ligger derfor ved tittelen,
   mens dokumenttypen får stå alene som den viktigste pillen under. */
.document-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 9px;
  min-width: 0;
}

.document-card-title-row h3 {
  min-width: 0;
}

.document-title-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 20px;
  padding: 3px 7px;
  border: 1px solid rgba(31, 29, 26, 0.075);
  border-radius: 999px;
  background: rgba(31, 29, 26, 0.025);
  color: rgba(31, 29, 26, 0.43);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1;
  white-space: nowrap;
}

.document-title-status.is-published {
  border-color: rgba(181, 143, 94, 0.18);
  background: rgba(205, 179, 138, 0.09);
  color: rgba(116, 89, 51, 0.76);
}

.document-title-status.is-draft {
  color: rgba(31, 29, 26, 0.43);
}

.document-title-status.is-attention {
  border-style: dashed;
  color: rgba(31, 29, 26, 0.54);
}

@media (max-width: 760px) {
  .document-card-title-row {
    gap: 6px 8px;
  }

  .document-title-status {
    min-height: 19px;
    padding: 3px 6px;
    font-size: 7.7px;
  }
}

/* ========================================================================== 
   Dokumenter · v92 kompakt inline dokumentmetadata · 2026-08-11
   ========================================================================== */

/* Dokumenttype, dato og relevant omfang ligger på samme skannelinje. Typen
   beholder pill-uttrykket, mens resten fortsatt er dempet metadata. */
.document-card-meta.document-card-meta-inline {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px !important;
  margin-top: 9px !important;
  color: rgba(31, 29, 26, 0.42);
  font-size: 9px;
}

.document-card-meta-inline > .document-meta-pill-type {
  flex: 0 0 auto;
}

.document-card-meta-inline > .document-generated-at,
.document-card-meta-inline > .document-meta-detail {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  min-height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: rgba(31, 29, 26, 0.43) !important;
  font-size: 9px !important;
  font-weight: 620 !important;
  letter-spacing: 0.01em !important;
  line-height: 1.35 !important;
  white-space: nowrap;
}

.document-card-meta-inline > .document-generated-at svg {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  stroke: rgba(31, 29, 26, 0.36);
}

/* Punktum skiller bare den dempede metadataen. Dokumenttype-pill står rent. */
.document-card-meta-inline > .document-generated-at + .document-meta-detail::before,
.document-card-meta-inline > .document-meta-detail + .document-meta-detail::before {
  content: "·" !important;
  display: inline-block !important;
  margin-right: 7px;
  color: rgba(181, 143, 94, 0.52);
  font-weight: 700;
}

/* Eldre pill-/separatorregler skal ikke gjøre dato og omfang til bokser igjen. */
.document-card-meta-inline > .document-generated-at::after,
.document-card-meta-inline > .document-meta-detail::after {
  display: none !important;
  content: none !important;
}

@media (max-width: 760px) {
  .document-card-meta.document-card-meta-inline {
    gap: 6px 10px !important;
    margin-top: 8px !important;
  }

  .document-card-meta-inline > .document-generated-at,
  .document-card-meta-inline > .document-meta-detail {
    font-size: 8.5px !important;
  }

  .document-card-meta-inline > .document-generated-at + .document-meta-detail::before,
  .document-card-meta-inline > .document-meta-detail + .document-meta-detail::before {
    margin-right: 5px;
  }
}
\n\n/* ========================================================================== 
   Dokumenter · v93 renere dokumentkort + mobilkomprimering · 2026-08-12
   ========================================================================== */

/* Antall plasserte gjester og antall bord er fjernet fra kortoversikten.
   Dokumenttype + genereringstid er nok til å identifisere dokumentet raskt. */

@media (max-width: 760px) {
  .document-card {
    gap: 9px !important;
    padding: 13px 14px !important;
  }

  .document-card-heading p {
    margin-bottom: 4px !important;
  }

  .document-card-title-row {
    gap: 5px 7px;
  }

  .document-card-meta.document-card-meta-inline {
    gap: 6px 9px !important;
    margin-top: 7px !important;
  }

  .document-card-meta .document-meta-pill {
    min-height: 24px;
    padding: 5px 8px;
  }

  .document-card-meta .document-meta-pill-type {
    font-size: 7.9px;
  }

  .document-card-meta-inline > .document-generated-at,
  .document-card-meta-inline > .document-meta-detail {
    font-size: 8.4px !important;
  }
}

/* ========================================================================== 
   Dokumenter · v94 mobilfilter, touch-scroll og proporsjonale dokumenter · 2026-08-12
   ========================================================================== */

/* Mobilfiltrene finnes i markup også på desktop, men desktop beholder de
   raske segmentknappene som før. */
.documents-mobile-filters {
  display: none;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.documents-site,
.documents-main,
.document-view-frame-shell,
.document-view-frame {
  touch-action: pan-x pan-y pinch-zoom;
}

.document-view-frame {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 760px) {
  /* Arkivet skal oppføre seg som en vanlig mobilside. Dette overstyrer eldre
     app-/login-regler som kunne låse hele viewporten og stoppe scrolling. */
  html,
  body.documents-site {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }

  .documents-main {
    overflow: visible;
  }

  body.documents-site.documents-login-page {
    height: auto !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .documents-login-shell {
    position: relative !important;
    inset: auto !important;
    width: 100%;
    min-height: 100dvh;
    height: auto;
    padding:
      max(18px, env(safe-area-inset-top, 0px))
      max(16px, env(safe-area-inset-right, 0px))
      max(18px, env(safe-area-inset-bottom, 0px))
      max(16px, env(safe-area-inset-left, 0px));
    overflow: visible;
    -webkit-overflow-scrolling: touch;
  }

  .documents-login-card {
    width: min(100%, 430px);
    padding: clamp(1.35rem, 5vw, 1.8rem);
  }

  /* Mobil: søk øverst, deretter to rolige dropdowns. Ingen horisontal
     chip-scroll som gjør det vanskelig å se hvilket filter som er aktivt. */
  .documents-filterbar {
    grid-template-columns: 1fr !important;
    gap: 9px;
    margin-bottom: 18px;
    padding: 9px;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.55);
  }

  .documents-search input {
    min-height: 43px;
    border-radius: 13px;
    font-size: 16px; /* hindrer automatisk input-zoom på iOS */
  }

  .documents-filter-group {
    display: none !important;
  }

  .documents-mobile-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .documents-mobile-filter-field {
    display: grid;
    gap: 5px;
    min-width: 0;
  }

  .documents-mobile-filter-field > span:first-child {
    padding-left: 3px;
    color: rgba(31, 29, 26, 0.38);
    font-size: 8px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .documents-mobile-filter-select {
    position: relative;
    display: block;
    min-width: 0;
  }

  .documents-mobile-filter-select select {
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 9px 34px 9px 11px;
    border: 1px solid rgba(31, 29, 26, 0.075);
    border-radius: 12px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.78);
    color: rgba(31, 29, 26, 0.72);
    outline: none;
    font: inherit;
    font-size: 11px;
    font-weight: 680;
  }

  .documents-mobile-filter-select select:focus {
    border-color: rgba(181, 143, 94, 0.4);
    box-shadow: 0 0 0 3px rgba(181, 143, 94, 0.07);
  }

  .documents-mobile-filter-select svg {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 10px;
    height: 7px;
    transform: translateY(-50%);
    fill: none;
    stroke: rgba(31, 29, 26, 0.42);
    stroke-width: 1.45;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
  }

  .documents-mobile-filter-field:only-child {
    grid-column: 1 / -1;
  }

  /* Dokumentvisning beholder en fast leseflate under headeren, mens selve
     iframe-dokumentet får håndtere vanlig finger-scroll og pinch-zoom. */
  body.document-view-page {
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
    touch-action: pan-x pan-y pinch-zoom;
  }

  body.document-view-page .document-view-shell,
  body.document-view-page .document-view-frame-shell {
    min-width: 0;
  }

  body.document-view-page .document-view-frame {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
  }
}

@media (max-width: 420px) {
  .documents-mobile-filters {
    gap: 7px;
  }

  .documents-mobile-filter-select select {
    padding-left: 10px;
    font-size: 10.5px;
  }
}

@media (max-width: 340px) {
  .documents-mobile-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) and (max-height: 620px) {
  .documents-login-shell {
    align-items: flex-start;
  }
}

/* ========================================================================== 
   Dokumenter · v95 mobilfilter, navigator og stabil dokumentflate · 2026-08-12
   ========================================================================== */

/* Antallet i seksjonsheaderen skal aldri brytes til «X» + «dokumenter». */
.documents-section-heading > small {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Chevron-ikonene er SVG-er slik at de kan sentreres geometrisk i stedet for
   å være avhengig av baseline/metrics i ‹ og ›-tegnene. */
body.document-view-page .document-view-page-navigation button svg {
  display: block;
  width: 0.88rem;
  height: 0.88rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: none;
}

/* Hele view.php bruker samme bakgrunn helt ut til viewport-kanten. Dette
   hindrer at en annen «bunnflate» blir synlig når nettleseren zoomes ut. */
body.document-view-page {
  height: 100dvh !important;
  min-height: 100dvh !important;
  background: #fffdf9 !important;
}

body.document-view-page::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background: #fffdf9;
  pointer-events: none;
}

body.document-view-page .document-view-shell,
body.document-view-page .document-view-frame-shell,
body.document-view-page .document-view-frame {
  background: #fffdf9 !important;
}

@media (max-width: 760px) {
  .documents-section-heading {
    gap: 10px;
  }

  .documents-section-heading > div {
    min-width: 0;
  }

  .documents-section-heading > small {
    min-height: 1.6rem;
    padding: 0.3rem 0.5rem;
    font-size: 8.5px;
  }

  /* Egen dropdown-komponent på mobil. Native <select>-menyer kan ikke styles
     konsekvent mellom iOS/Android, derfor brukes samme rolige popup-prinsipp
     som ellers i admin. */
  .documents-mobile-filter-field {
    position: relative;
  }

  .documents-mobile-filter-dropdown {
    position: relative;
    min-width: 0;
  }

  .documents-mobile-filter-toggle {
    width: 100%;
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 9px 11px 9px 12px;
    border: 1px solid rgba(31, 29, 26, 0.075);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: rgba(31, 29, 26, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
    font: inherit;
    font-size: 11px;
    font-weight: 680;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
  }

  .documents-mobile-filter-toggle:focus-visible,
  .documents-mobile-filter-field.is-open .documents-mobile-filter-toggle {
    outline: none;
    border-color: rgba(181, 143, 94, 0.4);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 0 0 3px rgba(181, 143, 94, 0.07), inset 0 1px 0 rgba(255,255,255,.94);
  }

  .documents-mobile-filter-toggle > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .documents-mobile-filter-toggle svg {
    width: 10px;
    height: 7px;
    flex: 0 0 10px;
    fill: none;
    stroke: rgba(31, 29, 26, 0.42);
    stroke-width: 1.45;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 150ms ease;
  }

  .documents-mobile-filter-field.is-open .documents-mobile-filter-toggle svg {
    transform: rotate(180deg);
  }

  .documents-mobile-filter-menu {
    position: absolute;
    z-index: 80;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 5px;
    border: 1px solid rgba(31, 29, 26, 0.08);
    border-radius: 13px;
    background: rgba(255, 253, 249, 0.98);
    box-shadow: 0 16px 38px rgba(31, 29, 26, 0.12), inset 0 1px 0 rgba(255,255,255,.94);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    overflow: hidden;
  }

  .documents-mobile-filter-menu[hidden] {
    display: none !important;
  }

  .documents-mobile-filter-menu button {
    width: 100%;
    min-height: 37px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: rgba(31, 29, 26, 0.62);
    font: inherit;
    font-size: 10.5px;
    font-weight: 650;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .documents-mobile-filter-menu button:hover,
  .documents-mobile-filter-menu button:focus-visible,
  .documents-mobile-filter-menu button.is-active {
    outline: none;
    background: rgba(205, 179, 138, 0.13);
    color: rgba(31, 29, 26, 0.9);
  }

  .documents-mobile-filter-menu button.is-active {
    font-weight: 760;
  }

  body.document-view-page .document-view-page-navigation button svg {
    width: 0.8rem;
    height: 0.8rem;
  }
}


/* ========================================================================== 
   Dokumenter · v96 mobil leseflate · 2026-08-12
   ========================================================================== */
@media (max-width: 760px) {
  /* Sidevelgeren skal oppleves som en lett kontroll, ikke som et flytende kort
     med tung skygge mot dokumentet. */
  body.document-view-page .document-view-page-navigation {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94) !important;
    border-color: rgba(31, 29, 26, 0.075) !important;
    background: rgba(255, 253, 249, 0.94) !important;
  }

  /* Litt mer tydelig avstand mellom portalheader og selve filflaten, uten at
     det blir et stort visuelt tomrom. */
  body.document-view-page .document-view-frame-shell {
    min-height: 0 !important;
  }
}


/* ==========================================================================
   Dokumenter · v99 · Slettedialog matcher Bordkart-dialogene 1:1
   ========================================================================== */
body.documents-modal-open {
  overflow: hidden !important;
}

.documents-delete-dialog[hidden] {
  display: none !important;
}

.documents-delete-dialog {
  position: fixed;
  z-index: 500;
  inset: 0;
}

/* Samme backdrop som Bordkart .seating-dialog-backdrop. */
.documents-delete-dialog-backdrop {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(0.8rem, 2vw, 1.4rem);
  background:
    radial-gradient(
      circle at 50% 24%,
      rgba(255, 253, 249, 0.14),
      transparent 28rem
    ),
    rgba(31, 29, 26, 0.34);
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  opacity: 0;
}

/* Samme kortgeometri, flate og skygge som Bordkart .seating-dialog. */
.documents-delete-dialog-panel {
  width: min(32rem, 100%);
  padding: clamp(1.25rem, 2.5vw, 1.65rem);
  border: 1px solid rgba(205, 179, 138, 0.34);
  border-radius: 1.55rem;
  background:
    radial-gradient(
      circle at 18% 0%,
      rgba(205, 179, 138, 0.1),
      transparent 17rem
    ),
    linear-gradient(
      180deg,
      rgba(255, 254, 251, 0.99),
      rgba(255, 252, 247, 0.99)
    );
  box-shadow:
    0 34px 90px rgba(31, 29, 26, 0.24),
    0 8px 24px rgba(31, 29, 26, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  color: var(--ink);
  opacity: 0;
  transform: translateY(10px) scale(0.985);
}

.documents-delete-dialog.is-open .documents-delete-dialog-backdrop {
  opacity: 1;
  animation: documentsDialogBackdropIn 180ms ease both;
}

.documents-delete-dialog.is-open .documents-delete-dialog-panel {
  animation: documentsDialogCardIn 220ms cubic-bezier(0.22, 0.8, 0.25, 1) both;
}

/* Samme serif-tittel og champagne-linje som Bordkart. */
.documents-delete-dialog h2 {
  position: relative;
  margin: 0 0 1.05rem;
  padding: 0 0 0.88rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.85rem, 4.2vw, 2.5rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.documents-delete-dialog h2::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(205, 179, 138, 0.82) 0%,
    rgba(205, 179, 138, 0.38) 48%,
    rgba(205, 179, 138, 0) 100%
  );
}

.documents-delete-dialog p#documents-delete-dialog-description {
  margin: -0.15rem 0 1.15rem;
  max-width: 42rem;
  color: rgba(31, 29, 26, 0.55);
  font-size: 0.84rem;
  line-height: 1.65;
}

.documents-delete-dialog p#documents-delete-dialog-description strong {
  color: inherit;
  font-weight: 700;
}

/* Samme action-rad og pilleknapper som Bordkart. */
.documents-delete-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(205, 179, 138, 0.18);
}

.documents-delete-dialog-actions button {
  min-height: 2.65rem;
  padding: 0.72rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.69rem;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(31, 29, 26, 0.08);
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.documents-delete-dialog-actions button:hover,
.documents-delete-dialog-actions button:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 10px 22px rgba(31, 29, 26, 0.12);
}

.documents-delete-dialog-cancel {
  border-color: rgba(31, 29, 26, 0.56) !important;
  background: rgba(255, 255, 255, 0.48) !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.documents-delete-dialog-cancel:hover,
.documents-delete-dialog-cancel:focus-visible {
  border-color: rgba(174, 134, 72, 0.72) !important;
  background: rgba(205, 179, 138, 0.09) !important;
  color: rgba(143, 103, 47, 1) !important;
}

.documents-delete-dialog-confirm {
  border-color: rgba(166, 63, 58, 0.86) !important;
  background: rgba(166, 63, 58, 0.92) !important;
  color: #fff !important;
}

.documents-delete-dialog-confirm:hover,
.documents-delete-dialog-confirm:focus-visible {
  border-color: rgba(166, 63, 58, 0.92) !important;
  background: transparent !important;
  color: rgba(145, 49, 45, 1) !important;
}

@keyframes documentsDialogBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes documentsDialogCardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .documents-delete-dialog.is-open .documents-delete-dialog-backdrop,
  .documents-delete-dialog.is-open .documents-delete-dialog-panel {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 560px) {
  .documents-delete-dialog-backdrop {
    align-items: end;
    padding: 0.5rem;
  }

  .documents-delete-dialog-panel {
    width: min(32rem, 100%);
    max-height: calc(100svh - 1rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.15rem 1rem max(1rem, env(safe-area-inset-bottom, 0px));
    border-radius: 1.45rem;
  }

  .documents-delete-dialog h2 {
    margin-bottom: 0.9rem;
    padding-bottom: 0.78rem;
    font-size: clamp(1.75rem, 8.2vw, 2.15rem);
  }

  .documents-delete-dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .documents-delete-dialog-actions button {
    width: 100%;
    min-width: 0;
  }
}

/* Detaljert bordoppsett skal aldri vise den brede ark-layouten et øyeblikk
   før JS rekker å tilpasse den til telefon/tablet. Filflaten beholdes i
   layouten, men blir først synlig etter at første fit er ferdig. */
@media (max-width: 1180px) {
  iframe.document-view-frame[data-document-paged-tables]:not(.is-layout-ready) {
    visibility: hidden !important;
    opacity: 0 !important;
  }

  iframe.document-view-frame[data-document-paged-tables].is-layout-ready {
    visibility: visible !important;
    opacity: 1 !important;
    transition: opacity 120ms ease;
  }
}

@media (max-width: 760px) {
  .documents-delete-dialog-backdrop {
    align-items: end;
    padding: 12px;
  }

  .documents-delete-dialog-panel {
    width: 100%;
    padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 18px 18px;
    transform: translateY(18px);
  }

  .documents-delete-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .documents-delete-dialog-actions button {
    width: 100%;
    min-height: 44px;
  }
}

/* ========================================================================== 
   v241 · Testmodus for Medhjelper-tilgang
   ========================================================================== */
.documents-access-test-banner {
  position: sticky;
  z-index: 120;
  top: 0;
  width: 100%;
  background: linear-gradient(90deg, rgba(48, 43, 36, 0.985), rgba(39, 35, 30, 0.985));
  color: rgba(255, 253, 249, 0.9);
  border-bottom: 1px solid rgba(205, 179, 138, 0.24);
  box-shadow: 0 8px 24px rgba(31, 29, 26, 0.08);
}

.documents-access-test-banner-inner {
  width: min(92vw, 1180px);
  min-height: 2.75rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.42rem 0;
}

.documents-access-test-banner-inner > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  line-height: 1;
}

.documents-access-test-mark {
  width: 0.5rem;
  height: 0.5rem;
  flex: 0 0 0.5rem;
  border-radius: 50%;
  background: rgba(221, 193, 147, 0.95);
  box-shadow: 0 0 0 4px rgba(205, 179, 138, 0.10);
}

.documents-access-test-banner strong {
  color: #fffdf9;
  font-size: 0.68rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.documents-access-test-banner-inner > div > span:not(.documents-access-test-mark) {
  color: rgba(230, 208, 172, 0.96);
  font-size: 0.72rem;
  font-weight: 700;
}

.documents-access-test-banner small {
  color: rgba(255, 253, 249, 0.55);
  font-size: 0.61rem;
}

.documents-access-test-banner form { margin: 0; }

.documents-access-test-banner button {
  appearance: none;
  padding: 0.42rem 0.66rem;
  border: 1px solid rgba(221, 193, 147, 0.42);
  border-radius: 999px;
  background: rgba(205, 179, 138, 0.08);
  color: rgba(255, 253, 249, 0.88);
  font: inherit;
  font-size: 0.61rem;
  font-weight: 700;
  cursor: pointer;
}

.documents-access-test-banner button:hover,
.documents-access-test-banner button:focus-visible {
  border-color: rgba(221, 193, 147, 0.7);
  background: rgba(205, 179, 138, 0.16);
  color: #fffdf9;
}

@media (max-width: 620px) {
  .documents-access-test-banner-inner {
    width: min(94vw, 42rem);
    gap: 0.65rem;
  }

  .documents-access-test-banner small {
    display: none;
  }
}

/* ========================================================================== 
   v6.8.46 · iOS/Safari – hindre automatisk fokus-zoom i skjemaer
   Safari zoomer inn når et redigerbart felt har tekst under 16 px. Dette
   gjelder kun iOS/WebKit-touch og endrer ikke vanlig pinch-zoom.
   ========================================================================== */
@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]):not([type="hidden"]),
  textarea,
  select {
    font-size: 16px !important;
  }
}

