/* Diligence workspace: navy header, near-white ground, gold accents (the Diligence look) */

@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/cormorant-garamond-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url(../fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url(../fonts/poppins-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url(../fonts/poppins-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url(../fonts/poppins-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-display: swap; src: url(../fonts/lato-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Lato"; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/lato-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url(../fonts/lato-latin-700-normal.woff2) format("woff2"); }

:root {
  --navy: #0D1A2B;
  --navy-2: #16273D;
  --ink: #1B2D4D;
  --gold: #C9A14E;
  --gold-logo: #CDBB81;
  --gold-deep: #9E7A2F;
  --paper: #FAF8F4;
  --sheet: #FFFFFF;
  --line: #E8E2D6;
  --line-2: #DCD3C2;
  --slate: #6E84A3;
  --text: #1D2633;
  --muted: #667085;
  --ok: #4F8A63;
  --warn: #B4683A;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --display: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --body: "Lato", "Helvetica Neue", Arial, sans-serif;

  --hero-h: 318px;
  --r-sheet: 16px;
  --r-ctrl: 10px;
  --shadow-sheet: 0 1px 0 rgba(13, 26, 43, .03), 0 18px 40px -28px rgba(13, 26, 43, .28);
  --ease: cubic-bezier(.22, .7, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- intro */
.intro { position: fixed; inset: 0; z-index: 1000; background: #000; overflow: hidden; }
.intro.fade { transition: opacity .45s ease; opacity: 0; pointer-events: none; }
.intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.intro-halo {
  position: absolute; left: 50%; top: 50%; width: 64vmin; height: 26vmin; border-radius: 50%;
  pointer-events: none; mix-blend-mode: screen; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 236, 200, .5), rgba(240, 210, 150, .12) 40%, rgba(240, 210, 150, 0) 70%);
}
.intro-vignette { position: absolute; inset: 0; pointer-events: none; transition: opacity .6s ease;
  background: radial-gradient(120% 90% at 50% 46%, rgba(13, 26, 43, 0) 55%, rgba(4, 9, 16, .55) 100%); }
/* Fallback when 3D is unavailable */
.intro-flat { position: absolute; left: 50%; top: 46%; width: min(46vw, 560px); transform: translate(-50%, -50%);
  perspective: 1200px; }
.intro-flat img { width: 100%; display: block; animation: flatIn 2.6s var(--ease) both; }
.intro-flat::after { content: ""; position: absolute; inset: -10% -20%; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 44%, rgba(255, 244, 220, .35) 50%, transparent 56%);
  mix-blend-mode: screen; animation: flatSheen 1.1s 2.5s ease-in-out both; }
@keyframes flatIn { from { transform: rotateY(-450deg) scale(2.6); opacity: 0; } 15% { opacity: 1; } to { transform: rotateY(0) scale(1); opacity: 1; } }
@keyframes flatSheen { 0% { opacity: 0; transform: translateX(-60%); } 20% { opacity: .9; } 100% { opacity: 0; transform: translateX(60%); } }

body.intro-running .hero-logo { opacity: 0; }
body.intro-running .hero-bar,
body.intro-running .hero-greeting,
body.intro-running .hero-rule,
body.intro-running .hero-arcs { opacity: 0; }
body.intro-running .content,
body.intro-running .foot { opacity: 0; transform: translateY(14px); }
body.intro-running.intro-rising .hero-bar,
body.intro-running.intro-rising .hero-greeting,
body.intro-running.intro-rising .hero-rule,
body.intro-running.intro-rising .hero-arcs { opacity: 1; }
body.intro-running.intro-rising .hero-arcs { opacity: .38; }
body.intro-running.intro-rising .content,
body.intro-running.intro-rising .foot { opacity: 1; transform: none; }
.hero-bar, .hero-greeting, .hero-rule, .hero-arcs, .content, .foot {
  transition: opacity .7s var(--ease), transform .8s var(--ease);
}
.hero-greeting { transition-delay: .12s; }
.hero-bar { transition-delay: .25s; }
.content { transition-delay: .05s; }
body.booting .content, body.booting .foot { opacity: 0; }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; min-height: var(--hero-h); background: var(--navy); color: #fff; overflow: hidden;
  display: flex; flex-direction: column; padding: 0 clamp(16px, 4vw, 48px);
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 161, 78, .55) 30%, rgba(201, 161, 78, .55) 70%, transparent); }
.hero-arcs { position: absolute; right: -150px; top: -170px; width: 470px; height: 470px; color: var(--gold); opacity: .38; pointer-events: none; }
.hero-bar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.hero-date { margin: 0; font: 400 13px/1 var(--body); color: #9FB0C6; letter-spacing: .02em; }
.hero-actions { display: flex; align-items: center; gap: 8px; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px 0 12px; min-width: 280px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); color: #C9D3E0;
  font: 400 13.5px/1 var(--body); transition: background .2s, border-color .2s;
}
.search-trigger:hover { background: rgba(255, 255, 255, .09); border-color: rgba(201, 161, 78, .5); }
.search-trigger svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.search-trigger span { flex: 1; text-align: left; }
kbd { font: 500 11px/1 var(--display); padding: 5px 7px; border-radius: 6px; background: rgba(255, 255, 255, .1); color: #DCE3EC; letter-spacing: .04em; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14);
  background: transparent; color: #C9D3E0; transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(201, 161, 78, .5); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.hero-center { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 0 40px; }
.hero-logo { width: 300px; height: auto; aspect-ratio: 4774 / 1408; display: block; transition: opacity .35s ease; }
.hero-rule { width: 56px; height: 1px; background: var(--gold); margin: 22px 0 16px; }
.hero-greeting { margin: 0; font: italic 400 clamp(28px, 3.4vw, 38px)/1.15 var(--serif); letter-spacing: .005em; color: #F4F1EA; text-align: center; }

/* ---------------------------------------------------------------- layout */
.content { max-width: 1240px; margin: 0 auto; padding: 56px clamp(16px, 4vw, 48px) 24px; }
.block + .block { margin-top: 72px; }
.block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.block-head h2 { margin: 0; font: italic 500 clamp(30px, 3vw, 40px)/1.05 var(--serif); color: var(--ink); letter-spacing: -.005em; }
.block-head .count { font: 400 15px/1 var(--body); font-style: normal; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.block-tools { display: flex; align-items: center; gap: 14px; }

.text-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; border: 0; background: none; color: var(--ink);
  font: 500 14px/1 var(--display); border-bottom: 1px solid rgba(201, 161, 78, .7); border-radius: 0; transition: color .2s, border-color .2s; }
.text-btn:hover { color: var(--gold-deep); border-color: var(--gold-deep); }
.text-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.text-btn.small { font-size: 13px; }
.text-btn.danger { color: #8B2F0B; border-color: rgba(139, 47, 11, .35); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px;
  font: 500 14px/1 var(--display); border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s, box-shadow .2s; white-space: nowrap; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.btn.small { height: 34px; padding: 0 13px; font-size: 13px; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--ink); box-shadow: 0 0 0 3px rgba(201, 161, 78, .22); }
.btn-outline { background: var(--sheet); color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--gold); color: var(--navy); }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); background: rgba(13, 26, 43, .05); }
.btn-ghost-light { background: rgba(255, 255, 255, .06); color: #E7ECF3; border-color: rgba(255, 255, 255, .16); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .12); border-color: rgba(201, 161, 78, .6); }
.icon-btn.light { color: #E7ECF3; }

/* ---------------------------------------------------------------- applications */
.app-groups { display: grid; gap: 34px; }
.group-label { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font: 500 14px/1 var(--display); color: var(--ink); }
.group-label::before { content: ""; width: 22px; height: 1px; background: var(--gold); }
.group-label small { font: 400 13px/1 var(--body); color: var(--muted); }

/* Each application is its own card: a round medallion icon, the name and description
   centred beneath it, and a footer with status and the Open button. */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 22px; }
.app {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--sheet); border: 1px solid var(--line); border-radius: 20px; padding: 34px 22px 18px; min-height: 318px;
  cursor: pointer; outline-offset: 3px;
  box-shadow: 0 1px 2px rgba(13, 26, 43, .04), 0 14px 30px -24px rgba(13, 26, 43, .38);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .35s ease;
}
/* gold hairline that draws across the top edge on hover */
.app::before { content: ""; position: absolute; top: -1px; left: 50%; width: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(201, 161, 78, 0), var(--gold) 30%, var(--gold) 70%, rgba(201, 161, 78, 0));
  transform: translateX(-50%); transition: width .55s var(--ease); }
.app:hover, .app:focus-visible { transform: translateY(-5px); border-color: rgba(201, 161, 78, .55);
  box-shadow: 0 2px 4px rgba(13, 26, 43, .05), 0 30px 50px -30px rgba(13, 26, 43, .5), 0 0 0 4px rgba(201, 161, 78, .07); }
.app:hover::before, .app:focus-visible::before { width: 72%; }

.app-corner { position: absolute; top: 12px; left: 14px; right: 10px; display: flex; align-items: center; justify-content: space-between; }
.app-version { font: 500 11px/1 var(--display); color: var(--slate); padding: 5px 9px; border-radius: 999px; background: #F3F4F7; letter-spacing: .03em; }
.kebab { width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; color: #98A1AF; display: grid; place-items: center; margin-left: auto;
  transition: background .2s, color .2s; }
.kebab:hover, .kebab[aria-expanded="true"] { background: rgba(13, 26, 43, .06); color: var(--ink); }
.kebab svg { width: 18px; height: 18px; fill: currentColor; }

/* Medallion */
.medal-wrap { position: relative; width: 84px; height: 84px; margin: 4px 0 22px; flex: none; }
.medal-wrap::before { /* fine gold ring around the medallion */
  content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid rgba(201, 161, 78, .32);
  transition: inset .45s var(--ease), border-color .35s ease, box-shadow .45s var(--ease), opacity .35s; }
.medal {
  position: relative; width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  color: var(--gold-logo);
  background: radial-gradient(circle at 32% 26%, #2A4166 0%, #172A44 46%, #0B1626 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 1px rgba(201, 161, 78, .3), inset 0 -10px 18px rgba(0, 0, 0, .25),
    0 12px 20px -12px rgba(13, 26, 43, .6), 0 2px 5px rgba(13, 26, 43, .14);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), color .3s ease;
}
.medal svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35)); position: relative; z-index: 1; }
.medal::after { /* one pass of light across the medallion on hover */
  content: ""; position: absolute; inset: -20%; z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 246, 225, .38) 50%, transparent 62%);
  transform: translateX(-70%); }
.app:hover .medal, .app:focus-visible .medal {
  transform: translateY(-7px) scale(1.08); color: #EBD9A3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 0 0 1px rgba(201, 161, 78, .6), inset 0 -10px 18px rgba(0, 0, 0, .2),
    0 26px 30px -16px rgba(13, 26, 43, .55), 0 0 26px -4px rgba(201, 161, 78, .35);
}
.app:hover .medal::after, .app:focus-visible .medal::after { animation: medalSheen .9s .08s var(--ease) both; }
.app:hover .medal-wrap::before, .app:focus-visible .medal-wrap::before { inset: -12px; border-color: rgba(201, 161, 78, .75); transform: translateY(-7px); }
.medal-wrap::before { transform: translateY(0); }
.medal-wrap::before { transition: inset .45s var(--ease), border-color .35s ease, transform .5s var(--ease); }
@keyframes medalSheen { 0% { opacity: 0; transform: translateX(-70%); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateX(70%); } }
.medal-status { position: absolute; right: 3px; bottom: 3px; z-index: 3; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff;
  background: var(--ok); transition: transform .5s var(--ease); }
.medal-status.wait { background: var(--gold); animation: pulse 1.2s ease-in-out infinite; }
.app:hover .medal-status { transform: translateY(-7px); }

.app-name { margin: 0 0 8px; font: 600 17.5px/1.3 var(--display); color: var(--ink); letter-spacing: -.005em; }
.app-desc { margin: 0 auto; max-width: 30ch; font: 400 14.5px/1.55 var(--body); color: var(--muted); flex: 1; }
.app-foot { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 14px;
  border-top: 1px solid #F0EBE1; text-align: left; }
.app-where { display: flex; align-items: center; gap: 7px; font: 400 13px/1.3 var(--body); color: var(--muted); min-width: 0; }
.app-where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #C3C9D2; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(79, 138, 99, .16); }
.dot.wait { background: var(--gold); animation: pulse 1.2s ease-in-out infinite; }
.dot.off-missing { background: var(--warn); }
@keyframes pulse { 50% { opacity: .35; } }
.open-btn { height: 34px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--navy); color: #fff; font: 500 13px/1 var(--display); flex: none;
  transition: background .2s, box-shadow .2s; }
.open-btn:hover { background: var(--ink); box-shadow: 0 0 0 3px rgba(201, 161, 78, .22); }
.app:hover .open-btn { background: var(--ink); }
.app.missing .app-desc::after { content: " The file has moved: use Edit to point to it."; color: var(--warn); }

.add-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 318px; padding: 28px 22px;
  border: 1.5px dashed var(--line-2); border-radius: 20px; background: rgba(255, 255, 255, .45); color: var(--muted);
  transition: border-color .3s, background .3s, transform .45s var(--ease);
}
.add-tile:hover, .add-tile:focus-visible { border-color: var(--gold); background: #fff; transform: translateY(-3px); }
.add-tile .plus { width: 84px; height: 84px; margin: 0 0 22px; border-radius: 50%; border: 1px dashed rgba(201, 161, 78, .7); display: grid; place-items: center;
  transition: transform .45s var(--ease), background .3s; }
.add-tile:hover .plus { transform: scale(1.06); background: rgba(201, 161, 78, .07); }
.add-tile .plus svg { width: 26px; height: 26px; fill: none; stroke: var(--gold-deep); stroke-width: 1.5; stroke-linecap: round; }
.add-tile b { display: block; font: 600 16px/1.3 var(--display); color: var(--ink); margin-bottom: 6px; }
.add-tile span.sub { font: 400 13.5px/1.5 var(--body); color: var(--muted); max-width: 24ch; }

/* ---------------------------------------------------------------- documents */
.doc-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; flex-wrap: wrap; }
.doc-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; min-width: 260px; flex: 0 1 320px;
  background: var(--sheet); border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); }
.doc-search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 161, 78, .16); }
.doc-search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; flex: none; }
.doc-search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14px; color: var(--text); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip { height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 400 13px/1 var(--body); }
.chip:hover { color: var(--ink); border-color: var(--gold); }
.chip[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.doc-sort select { height: 36px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--sheet); padding: 0 30px 0 13px; font-size: 13px; color: var(--ink);
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%239E7A2F' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 34px 26px; }
.doc { position: relative; display: flex; flex-direction: column; cursor: pointer; border-radius: 10px; outline-offset: 4px; }
.page {
  position: relative; aspect-ratio: 17 / 22; background: #fff; border-radius: 3px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(13, 26, 43, .07), 0 1px 2px rgba(13, 26, 43, .06), 0 14px 30px -18px rgba(13, 26, 43, .45);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.page::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0) 70%, rgba(13, 26, 43, .04)); pointer-events: none; }
.doc:hover .page { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(201, 161, 78, .45), 0 2px 4px rgba(13, 26, 43, .06), 0 24px 40px -20px rgba(13, 26, 43, .5); }
.page img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.page .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line-2); }
.page .ph svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.page .ph.loading::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(201, 161, 78, .08) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pin { position: absolute; top: 0; left: 14px; width: 18px; height: 26px; background: var(--gold); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); z-index: 2; }
.doc-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; z-index: 3; }
.doc:hover .doc-actions, .doc:focus-within .doc-actions { opacity: 1; }
.doc-actions button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(13, 26, 43, .82); color: #fff; display: grid; place-items: center; backdrop-filter: blur(4px); }
.doc-actions button:hover { background: var(--navy); color: var(--gold-logo); }
.doc-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.doc-actions .kebab-dark svg { fill: currentColor; stroke: none; }
.doc-title { margin: 14px 0 4px; font: 500 14.5px/1.38 var(--display); color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-cat { font: 500 12px/1.3 var(--display); color: var(--gold-deep); margin: 0 0 2px; }
.doc-meta { font: 400 12.5px/1.4 var(--body); color: var(--muted); margin: 0; }
.doc-add { border: 1.5px dashed var(--line-2); border-radius: 6px; aspect-ratio: 17 / 22; display: grid; place-items: center; text-align: center; padding: 18px;
  color: var(--muted); background: transparent; transition: border-color .2s, background .2s, color .2s; font: 400 13.5px/1.45 var(--body); }
.doc-add:hover { border-color: var(--gold); background: #fff; color: var(--ink); }
.doc-add strong { display: block; font: 500 14px/1.3 var(--display); color: var(--ink); margin: 12px 0 4px; }
.doc-add svg { width: 34px; height: 34px; margin: 0 auto; fill: none; stroke: var(--gold-deep); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.doc-empty { grid-column: 1 / -1; padding: 30px 0; color: var(--muted); }

/* ---------------------------------------------------------------- drop zone */
.dropzone { position: fixed; inset: 0; z-index: 900; background: rgba(250, 248, 244, .86); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.dropzone-card { width: min(560px, 100%); padding: 48px 32px; text-align: center; border: 1.5px dashed var(--gold); border-radius: 22px; background: rgba(255, 255, 255, .7); }
.dropzone-card svg { width: 56px; height: 56px; margin: 0 auto 14px; fill: none; stroke: var(--gold-deep); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.dz-title { margin: 0 0 6px; font: italic 500 30px/1.1 var(--serif); color: var(--ink); }
.dz-sub { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- viewer */
.viewer { position: fixed; inset: 0; z-index: 800; background: rgba(9, 18, 30, .94); display: flex; flex-direction: column; padding: 0 clamp(12px, 3vw, 36px) clamp(12px, 3vw, 28px);
  animation: fadeIn .25s ease both; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; color: #fff; flex-wrap: wrap; padding: 10px 0; }
.viewer-title h3 { margin: 0 0 3px; font: italic 500 26px/1.15 var(--serif); color: #F4F1EA; }
.viewer-title p { margin: 0; font-size: 13px; color: #9FB0C6; }
.viewer-actions { display: flex; align-items: center; gap: 8px; }
.viewer-frame { flex: 1; border-radius: 10px; overflow: hidden; background: #2b3442; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7); animation: rise .35s var(--ease) both; }
.viewer-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #525659; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.99); } }

/* ---------------------------------------------------------------- palette */
.palette { position: fixed; inset: 0; z-index: 850; background: rgba(9, 18, 30, .5); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px;
  animation: fadeIn .15s ease both; }
.palette-card { width: min(620px, 100%); background: var(--sheet); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(9, 18, 30, .55); overflow: hidden; animation: rise .22s var(--ease) both; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 60px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.palette-input input { flex: 1; border: 0; outline: 0; font-size: 17px; color: var(--text); background: transparent; }
.palette-input kbd { background: #F1F3F6; color: var(--muted); }
.palette-list { list-style: none; margin: 0; padding: 8px; max-height: 56vh; overflow: auto; }
.palette-list .pl-group { padding: 12px 10px 6px; font: 500 12px/1 var(--display); color: var(--slate); }
.palette-list .pl-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; cursor: pointer; }
.palette-list .pl-item[aria-selected="true"] { background: #F6F2E9; }
.pl-ico { width: 32px; height: 32px; border-radius: 9px; background: var(--navy); color: var(--gold-logo); display: grid; place-items: center; flex: none; }
.pl-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pl-ico.doc { background: #F2EDE1; color: var(--gold-deep); }
.pl-text { min-width: 0; }
.pl-text b { display: block; font: 500 14.5px/1.3 var(--display); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-text span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-empty { padding: 22px 12px; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- dialogs */
.dlg { border: 0; padding: 0; border-radius: 18px; width: min(620px, calc(100vw - 32px)); background: var(--sheet); color: var(--text);
  box-shadow: 0 40px 90px -30px rgba(9, 18, 30, .6); }
.dlg.narrow { width: min(480px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(9, 18, 30, .5); backdrop-filter: blur(3px); }
.dlg[open] { animation: rise .25s var(--ease) both; }
.dlg form { padding: 26px 28px 22px; }
.dlg h3 { margin: 0 0 18px; font: italic 500 30px/1.1 var(--serif); color: var(--ink); }
.dlg-text { margin: -6px 0 6px; color: var(--muted); }
.field { margin-bottom: 16px; }
.field label, .field .label, .row2 label { display: block; margin-bottom: 6px; font: 500 13px/1.2 var(--display); color: var(--ink); }
.field input, .field textarea, .field select, .row2 input {
  width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-ctrl); padding: 10px 12px; background: #fff; font-size: 14.5px; outline: 0;
}
.field textarea { resize: vertical; min-height: 60px; }
.field input:focus, .field textarea:focus, .field select:focus, .row2 input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 161, 78, .16); }
.hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.hint.indent { margin: -4px 0 16px 28px; }
.with-btn { display: flex; gap: 8px; }
.with-btn input { flex: 1; min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.row2 .field { margin-bottom: 16px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); font: 400 13.5px/1 var(--body); color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.seg input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.when-file, .when-server, .when-web { display: none; }
form[data-type="file"] .when-file, form[data-type="server"] .when-server, form[data-type="web"] .when-web { display: block; }
.icon-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-pick button { width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); display: grid; place-items: center; }
.icon-pick button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-pick button[aria-pressed="true"] { background: var(--navy); color: var(--gold-logo); border-color: var(--navy); }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 16px; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); }
.asst-checks { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.field .asst-checks .check { display: flex; align-items: flex-start; gap: 10px; margin: 2px 0 0; font: 400 14.5px/1.35 var(--body); color: var(--text); }
.dlg-actions { display: flex; align-items: center; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- menu & toasts */
.menu { position: fixed; z-index: 700; min-width: 210px; background: var(--sheet); border-radius: 12px; padding: 6px; border: 1px solid var(--line);
  box-shadow: 0 20px 50px -18px rgba(9, 18, 30, .4); animation: fadeIn .12s ease both; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 11px; border: 0; background: transparent; border-radius: 8px; text-align: left; font-size: 14px; color: var(--text); }
.menu button:hover, .menu button:focus-visible { background: #F6F2E9; outline: 0; }
.menu button.danger { color: #8B2F0B; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
/* Messages sit in the top layer (popover) so they stay visible above open dialogs. */
#toasts[popover], #offline[popover] { margin: 0; overflow: visible; }
#toasts[popover] { border: 0; padding: 0; background: transparent; color: inherit; height: auto; }
.offline:not(:popover-open) { display: none; }
.offline { position: fixed; inset: 14px auto auto 50%; transform: translateX(-50%); z-index: 960; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px);
  background: #fff; color: var(--ink); border: 1px solid rgba(201, 161, 78, .65); border-radius: 999px; padding: 10px 18px; font-size: 14px; line-height: 1.4;
  box-shadow: 0 18px 40px -18px rgba(9, 18, 30, .45); animation: rise .25s var(--ease) both; }
.toasts { position: fixed; inset: auto auto 26px 50%; transform: translateX(-50%); z-index: 950; display: grid; gap: 8px; justify-items: center; width: min(560px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 14px; background: var(--navy); color: #F1F4F8; border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 1.4;
  box-shadow: 0 18px 40px -16px rgba(9, 18, 30, .6); animation: rise .25s var(--ease) both; border-left: 3px solid var(--gold); }
.toast.err { border-left-color: #D9895B; }
.toast button { border: 0; background: none; color: var(--gold-logo); font: 500 13px/1 var(--display); padding: 4px 2px; white-space: nowrap; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }

/* ---------------------------------------------------------------- footer & closed */
.foot { max-width: 1240px; margin: 40px auto 0; padding: 26px clamp(16px, 4vw, 48px) 46px; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.foot p { margin: 0; }
.closed { position: fixed; inset: 0; z-index: 1100; background: var(--navy); color: #C9D3E0; display: grid; place-content: center; justify-items: center; gap: 22px; text-align: center; padding: 16px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 760px) {
  :root { --hero-h: 280px; }
  .search-trigger { min-width: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .hero-logo { width: 230px; }
  .hero-date { font-size: 12px; }
  .doc-search { flex: 1 1 100%; min-width: 0; }
  .doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; }
  .row2 { grid-template-columns: 1fr; }
  .viewer-actions .btn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
/* The menu is a popover too (top layer), placed by script next to what opened it. */
#menu[popover] { margin: 0; inset: auto; overflow: visible; color: var(--text); }

/* A tile's count (the Client Book: tasks and transfers for this person) */
.tile { position: relative; }
.tile-badge { position: absolute; top: 6px; right: calc(50% - 40px); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #C2453A; color: #fff;
  font: 600 11.5px/22px var(--display); text-align: center; box-shadow: 0 0 0 2px var(--paper); pointer-events: none; }
/* The Client Book inside the phone app */
.bookpanel { position: fixed; inset: 0; z-index: 795; background: var(--paper); }
.bookpanel iframe { width: 100%; height: 100%; border: 0; display: block; }
