/* Deadline 365 — product finish layer.
   Warm paper, blueprint light, layered depth and restrained motion. */

:root {
  --wow-ease: cubic-bezier(.22,.61,.36,1);
  --wow-shadow-sm: 0 1px 2px rgba(28, 22, 14, .05), 0 10px 24px -18px rgba(28, 22, 14, .28);
  --wow-shadow: 0 1px 2px rgba(28, 22, 14, .05), 0 26px 60px -34px rgba(28, 22, 14, .42);
  --wow-shadow-lift: 0 2px 3px rgba(28, 22, 14, .05), 0 34px 70px -32px rgba(28, 22, 14, .5);
  --wow-radius: 14px;
  --wow-glow: color-mix(in srgb, var(--accent) 14%, transparent);
  --wow-grid: color-mix(in srgb, var(--ink) 4.5%, transparent);
}

html[data-theme="dark"] {
  --wow-shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 16px 38px -24px rgba(0,0,0,.8);
  --wow-shadow: 0 2px 3px rgba(0,0,0,.35), 0 34px 80px -36px rgba(0,0,0,.9);
  --wow-shadow-lift: 0 3px 4px rgba(0,0,0,.4), 0 42px 90px -34px rgba(0,0,0,.95);
  --wow-glow: color-mix(in srgb, var(--accent) 18%, transparent);
  --wow-grid: rgba(255,255,255,.045);
}

/* ---------- atmosphere ---------- */
body.d365-app2 {
  background-color: var(--paper, #fbf8f1);
  background-image:
    radial-gradient(1200px 560px at 82% -12%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 68%),
    radial-gradient(900px 520px at 2% -8%, color-mix(in srgb, var(--info, #2563eb) 4%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 36%, var(--paper, #fbf8f1)), var(--paper, #fbf8f1) 460px);
  background-attachment: fixed;
}
body.d365-app2 .main { position: relative; isolation: isolate; }
body.d365-app2 .main::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cpath d='M72 0H0V72' fill='none' stroke='%23a16207' stroke-opacity='.055' stroke-width='.7'/%3E%3Ccircle cx='0' cy='0' r='1.1' fill='%23a16207' fill-opacity='.09'/%3E%3C/svg%3E");
  mask-image: linear-gradient(180deg, rgba(0,0,0,.7), transparent 82%);
}
html[data-theme="dark"] body.d365-app2 .main::before { opacity: .55; }
body.d365-app2 .site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
body.d365-app2 .nav-links a { border-radius: 8px; transition: background .16s var(--wow-ease), color .16s var(--wow-ease); }

/* ---------- paper depth ---------- */
body.d365-app2 .panel,
body.d365-app2 .card,
body.d365-app2 .ws-card,
body.d365-app2 .brief-hero,
body.d365-app2 .success-card,
body.d365-app2 .map-sheet-card,
body.d365-app2 .map-check-card {
  border-radius: var(--wow-radius);
  box-shadow: var(--wow-shadow-sm);
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
}
body.d365-app2 .panel { transition: box-shadow .22s var(--wow-ease), border-color .22s var(--wow-ease); }
body.d365-app2 .card,
body.d365-app2 .ws-src,
body.d365-app2 .choice {
  transition: transform .2s var(--wow-ease), box-shadow .2s var(--wow-ease), border-color .2s var(--wow-ease);
}
@media (hover: hover) {
  body.d365-app2 .card:hover,
  body.d365-app2 .ws-src:hover,
  body.d365-app2 .choice:hover {
    transform: translateY(-2px);
    box-shadow: var(--wow-shadow-lift);
  }
  body.d365-app2 .panel:hover { box-shadow: var(--wow-shadow); }
}

/* buttons */
body.d365-app2 .btn,
body.d365-app2 .ws-lf-sync,
body.d365-app2 .sheet-scroll-hint {
  transition: transform .16s var(--wow-ease), box-shadow .16s var(--wow-ease), background-color .16s var(--wow-ease), border-color .16s var(--wow-ease);
}
body.d365-app2 .btn:hover { transform: translateY(-1px); }
body.d365-app2 .btn:active { transform: translateY(0); }
body.d365-app2 .btn-primary {
  box-shadow: 0 10px 24px -13px color-mix(in srgb, var(--accent) 72%, transparent), inset 0 1px 0 rgba(255,255,255,.24);
  overflow: hidden; position: relative; isolation: isolate;
}
body.d365-app2 .btn-primary::after {
  content: ""; position: absolute; inset: -60% -20%; z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%);
  transform: translateX(-80%) rotate(4deg);
  transition: transform .55s var(--wow-ease);
}
body.d365-app2 .btn-primary:hover::after { transform: translateX(80%) rotate(4deg); }
body.d365-app2 .status-pill { box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
body.d365-app2 .icon-btn { transition: transform .16s var(--wow-ease), background .16s var(--wow-ease); }
body.d365-app2 .icon-btn:hover { transform: translateY(-1px); }

/* headings get a little warm contrast */
body.d365-app2 .page-title,
body.d365-app2 .flow-title,
body.d365-app2 .panel-title,
body.d365-app2 .brief-hero h1 {
  text-wrap: balance;
}

/* ---------- page entrance ---------- */
@keyframes wow-rise { from { opacity: 0; transform: translateY(16px) scale(.995); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes wow-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wow-float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
@keyframes wow-shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }
@keyframes wow-ring { to { transform: rotate(360deg) } }

.wow-ready [data-wow] {
  opacity: 0;
  animation: wow-rise .72s var(--wow-ease) forwards;
  animation-delay: calc(var(--wow-i, 0) * 55ms);
}
.wow-ready .wow-art-stack { animation: wow-rise .85s var(--wow-ease) .1s both, wow-float 7s ease-in-out 1.1s infinite; }
.wow-ready .ba-sheet { animation: wow-float 8s ease-in-out infinite; }

/* ---------- mapping hero art ---------- */
.map-head { align-items: center !important; gap: 24px !important; margin-bottom: 20px !important; }
.map-head-copy { max-width: 720px; }
.wow-kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 9px;
  font: 750 9px/1 var(--mono, monospace); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-text, var(--accent));
}
.wow-kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .65; }
.map-head-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.map-head-art { position: relative; flex: none; width: 276px; height: 166px; perspective: 950px; pointer-events: auto; }
.wow-art-stack { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(9deg) rotateY(-15deg) rotateZ(1deg); transition: transform .35s var(--wow-ease); }
.wow-art-sheet {
  position: absolute; left: 50px; top: 24px; width: 182px; height: 112px;
  border-radius: 11px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: linear-gradient(150deg, var(--surface), color-mix(in srgb, var(--surface) 75%, var(--surface-2)));
  box-shadow: var(--wow-shadow-sm);
}
.wow-art-sheet.s2 { transform: translate3d(14px, 11px, -22px) rotate(-2.5deg); opacity: .95; }
.wow-art-sheet.s3 { transform: translate3d(28px, 22px, -44px) rotate(-5deg); opacity: .65; }
.wow-art-photo {
  position: absolute; right: 0; bottom: 0; width: 112px; height: 80px; padding: 4px;
  border-radius: 10px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  box-shadow: var(--wow-shadow); transform: translate3d(0, 0, 30px) rotate(4deg);
}
.wow-art-photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; filter: saturate(.72) contrast(.92); }
.wow-art-front {
  position: absolute; left: 25px; top: 12px; width: 196px; height: 128px; padding: 12px 13px;
  border-radius: 12px; border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: var(--wow-shadow); transform: translateZ(40px) rotate(-1deg);
}
.wow-art-front-top { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.wow-art-front-top img { width: 17px; height: 17px; display: block; }
.wow-art-front-top i { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--line); margin-left: auto; box-shadow: 8px 0 0 var(--line), 16px 0 0 var(--line); }
.wow-art-maprow { display: flex; align-items: center; gap: 5px; margin: 7px 0; }
.wow-art-mapdot { width: 5px; height: 5px; border-radius: 50%; background: var(--wow-c, var(--accent)); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--wow-c, var(--accent)) 14%, transparent); }
.wow-art-mapline { height: 5px; flex: 1; border-radius: 99px; background: color-mix(in srgb, var(--wow-c, var(--accent)) 20%, var(--surface-2)); }
.wow-art-maprow b { font: 750 7px/1 var(--mono, monospace); letter-spacing: .07em; color: var(--wow-c, var(--accent)); }
.wow-art-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  height: 19px; padding: 0 7px; border-radius: 99px; border: 1px solid var(--attn-ok-line, var(--line));
  background: var(--attn-ok-bg, var(--surface-2)); color: var(--attn-ok, var(--ink));
  font: 750 8px/1 var(--mono, monospace); letter-spacing: .06em; text-transform: uppercase;
}
.wow-art-badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.wow-art-orbit {
  position: absolute; left: 110px; top: 48px; width: 110px; height: 110px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  transform: translateZ(-30px) rotateX(62deg);
  box-shadow: 0 0 60px var(--wow-glow);
}

/* ---------- map cards ---------- */
body.d365-app2 .map-sheet-card {
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-2));
  box-shadow: var(--wow-shadow);
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
}
body.d365-app2 .map-sheet-card > .between:first-child {
  background:
    radial-gradient(600px 120px at 12% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 88%, var(--surface-2)));
}
body.d365-app2 .map-sheet-card .sheet-mapbar { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
body.d365-app2 .map-check-card {
  background:
    radial-gradient(300px 180px at 100% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--wow-shadow);
}
body.d365-app2 .map-check-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 20%, transparent) 55%, transparent);
  border-radius: var(--wow-radius) var(--wow-radius) 0 0;
}
body.d365-app2 .map-score {
  background: linear-gradient(150deg, var(--surface), var(--surface-2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--wow-shadow-sm);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
}
body.d365-app2 .map-progress-track i {
  background-image: linear-gradient(90deg, var(--accent), #ffb27a, var(--accent));
  background-size: 200% 100%;
  animation: wow-shimmer 3.2s linear infinite;
}
body.d365-app2 .map-cta {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 -14px 40px -28px rgba(20,16,10,.55);
}
body.d365-app2 .sheet-table thead th {
  background: linear-gradient(180deg, var(--surface-2), color-mix(in srgb, var(--surface-2) 72%, var(--surface)));
}
body.d365-app2 .sheet-table tbody tr { transition: background .14s var(--wow-ease); }
body.d365-app2 .sheet-table tbody tr:hover td { background-color: color-mix(in srgb, var(--surface-2) 55%, transparent); }
body.d365-app2 .sheet-map-select { transition: border-color .16s var(--wow-ease), background .16s var(--wow-ease); }
body.d365-app2 .sheet-clear { transition: transform .15s var(--wow-ease), background .15s var(--wow-ease), border-color .15s var(--wow-ease); }
body.d365-app2 .sheet-clear:hover { transform: rotate(4deg) scale(1.06); }

.map-card-title { display: flex; align-items: center; gap: 8px; }
.map-card-logo { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: color-mix(in srgb, var(--surface-2) 80%, var(--surface)); border: 1px solid var(--line); }
.map-card-logo img { width: 16px; height: 16px; display: block; }
body.d365-app2 .map-score {
  --map-pct: 0%;
  width: 70px; height: 70px; min-width: 70px; padding: 0 !important;
  display: grid !important; place-items: center; align-content: center; text-align: center;
  border: 0 !important; border-radius: 50% !important;
  background: conic-gradient(var(--accent) var(--map-pct), var(--surface-2) 0) !important;
  position: relative; box-shadow: var(--wow-shadow-sm);
}
body.d365-app2 .map-score::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); z-index: 0; }
body.d365-app2 .map-score b, body.d365-app2 .map-score span { position: relative; z-index: 1; }
body.d365-app2 .map-score b { font-size: 15px; }
body.d365-app2 .map-score span { margin-top: 1px; }
/* login / start: a little editorial stage beside the form */
body.flow {
  background-color: var(--paper, #fbf8f1);
  background-image:
    radial-gradient(900px 480px at 24% 24%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 30%, var(--paper, #fbf8f1)), var(--paper, #fbf8f1) 520px);
  background-attachment: fixed;
}
body.flow { overflow-x: hidden; }
body.flow .auth-wrap { position: relative; }
body.flow .auth-wrap::before {
  content: ""; position: absolute; left: 14%; top: 50%; width: 460px; height: 460px; border-radius: 50%;
  transform: translateY(-50%); pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 9%, transparent), transparent 68%);
  opacity: .7;
}
body.flow .auth-wrap > * { position: relative; z-index: 1; }
/* login / start: a little editorial stage beside the form */
.auth-wrap { grid-template-columns: minmax(0, 420px) 320px !important; gap: clamp(36px, 6vw, 84px) !important; align-items: center !important; justify-content: center; }
.auth-showcase { position: relative; width: 320px; height: 230px; perspective: 950px; animation: wow-rise .8s var(--wow-ease) .08s both; }
.auth-showcase .wow-art-stack { transform: rotateX(9deg) rotateY(-15deg) scale(1.16); left: -8px; top: -2px; }
.auth-showcase .wow-art-orbit { left: 120px; top: 54px; width: 125px; height: 125px; }
.auth-showcase-copy { position: absolute; left: 8px; bottom: -4px; display: flex; flex-direction: column; gap: 2px; }
.auth-showcase-copy span { font: 750 8px/1 var(--mono, monospace); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text, var(--accent)); }
.auth-showcase-copy b { font-family: var(--serif, Georgia, serif); font-size: 17px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); }
body.flow .auth-card { box-shadow: var(--wow-shadow) !important; border-radius: 18px !important; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: minmax(0, 420px) !important; } .auth-showcase { display: none; } }

/* ---------- activation + workspace moments ---------- */
body.d365-app2 .success-card { box-shadow: var(--wow-shadow); }
body.d365-app2 .act-flow { transition: box-shadow .2s var(--wow-ease), transform .2s var(--wow-ease); }
@media (hover: hover) { body.d365-app2 .act-flow:hover { transform: translateY(-1px); box-shadow: var(--wow-shadow-sm); } }
body.d365-app2 .ws-src.is-active { box-shadow: var(--wow-shadow); }
body.d365-app2 .ws-list-foot { background: linear-gradient(180deg, var(--surface-2), color-mix(in srgb, var(--surface-2) 70%, var(--surface))); }
body.d365-app2 .ws-sum-due { letter-spacing: -.04em; }
body.d365-app2 .brief-hero { box-shadow: var(--wow-shadow); }

@media (max-width: 1180px) { .map-head-art { display: none; } }
@media (max-width: 760px) {
  body.d365-app2 .panel { border-radius: 12px; }
  body.d365-app2 .site-header { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
}
@media (prefers-reduced-motion: reduce) {
  .wow-ready [data-wow], .wow-ready .wow-art-stack, .wow-ready .ba-sheet { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
  body.d365-app2 .card:hover, body.d365-app2 .ws-src:hover, body.d365-app2 .choice:hover, body.d365-app2 .btn:hover { transform: none; }
  .map-progress-track i { animation: none; }
}

/* quiet 3D paper stack for compact app headers */
.app-top { position: relative; }
.app-top > * { position: relative; z-index: 1; }
.page-corner-art {
  position: absolute; right: 158px; top: -20px; width: 156px; height: 98px;
  pointer-events: none; z-index: 0; opacity: .62;
  transform: rotate(-2deg);
}
.pca-sheet {
  position: absolute; left: 22px; top: 14px; width: 108px; height: 69px;
  border-radius: 8px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: linear-gradient(150deg, var(--surface), color-mix(in srgb, var(--surface) 65%, var(--surface-2)));
  box-shadow: var(--wow-shadow-sm);
}
.pca-s2 { transform: translate3d(10px, 8px, 0) rotate(-3deg); opacity: .7; }
.pca-s3 { transform: translate3d(18px, 16px, 0) rotate(-5deg); opacity: .4; }
.pca-s1 { z-index: 2; }
.pca-photo {
  position: absolute; right: 0; bottom: 0; width: 68px; height: 46px; padding: 3px; z-index: 3;
  border-radius: 7px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  box-shadow: var(--wow-shadow-sm); transform: rotate(4deg);
}
.pca-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 4px; filter: saturate(.7) contrast(.92); }
@media (max-width: 1180px) { .page-corner-art { display: none; } }

/* compact theme control for keyword/template pages that ship without app.css */
.wow-theme-btn{width:36px;height:36px;border-radius:50%;border:1px solid var(--line);background:var(--surface);color:var(--muted);display:inline-grid;place-items:center;cursor:pointer;flex:none;transition:transform .16s var(--wow-ease),border-color .16s var(--wow-ease),color .16s var(--wow-ease)}
.wow-theme-btn:hover{transform:translateY(-1px);border-color:var(--line-strong);color:var(--ink)}
.wow-theme-btn .wow-sun{display:none}
html[data-theme="dark"] .wow-theme-btn .wow-moon{display:none}
html[data-theme="dark"] .wow-theme-btn .wow-sun{display:inline-grid}
@media (prefers-color-scheme: dark){html:not([data-theme="light"]) .wow-theme-btn .wow-moon{display:none}html:not([data-theme="light"]) .wow-theme-btn .wow-sun{display:inline-grid}}

/* The four keyword landing pages use the older system-font stylesheet.
   Scope a canonical light/dark palette so the shared theme toggle actually
   controls the page instead of only the OS preference. */
html[data-theme="dark"] body.keyword-landing {
  --bg:#0b0b0f; --bg-soft:rgba(255,255,255,.03);
  --surface:rgba(255,255,255,.06); --surface-2:rgba(255,255,255,.04);
  --ink:#f5f5f7; --ink-2:rgba(235,235,245,.76); --mut:rgba(235,235,245,.76); --faint:rgba(235,235,245,.70);
  --line:rgba(255,255,255,.10); --line-soft:rgba(255,255,255,.07);
  --link:#ff9a5c; --accent:#ff7a2f; --accent-ink:#160d05; --accent-hover:#ff8b4a;
  --accent-soft:rgba(255,122,47,.13); --btn2-bg:rgba(255,255,255,.08); --btn2-ink:#f5f5f7;
  --btn2-hover:rgba(255,255,255,.13); --input-bg:rgba(255,255,255,.05); --input-border:#48484a;
  --nav-bg:rgba(11,11,15,.72); --shadow-sm:0 1px 3px rgba(0,0,0,.5);
  --shadow:0 18px 50px rgba(0,0,0,.40); --shadow-lg:0 28px 70px -20px rgba(0,0,0,.75);
  color-scheme: dark; background: var(--bg); color: var(--ink);
}
html[data-theme="light"] body.keyword-landing {
  --bg:#ffffff; --bg-soft:#f5f5f7; --surface:#ffffff; --surface-2:#f5f5f7;
  --ink:#1d1d1f; --ink-2:#6e6e73; --mut:#6e6e73; --faint:#6e6e73;
  --line:#d2d2d7; --line-soft:rgba(0,0,0,.07); --link:#c2410c; --accent:#ff6b1a;
  --accent-ink:#241305; --accent-hover:#ed5d0d; --accent-soft:rgba(255,107,26,.10);
  --btn2-bg:#f5f5f7; --btn2-ink:#1d1d1f; --btn2-hover:#e8e8ed; --input-bg:#ffffff;
  --input-border:#b6b6bd; --nav-bg:rgba(255,255,255,.72);
  --shadow-sm:0 1px 3px rgba(0,0,0,.05); --shadow:0 10px 40px rgba(0,0,0,.06);
  --shadow-lg:0 24px 60px -18px rgba(0,0,0,.28);
  color-scheme: light; background: var(--bg); color: var(--ink);
}
body.keyword-landing .wow-theme-btn { width: 34px; height: 34px; }

/* Lien reference status chip: keep the light-theme label above 4.5:1. */
html:not([data-theme="dark"]) body.liref-page .pill.ok,
html[data-theme="light"] body.liref-page .pill.ok { color: #0b5f33 !important; }

/* With inline column mapping, the sheet is the primary surface on narrow screens.
   Put it before the checklist instead of hiding the controls below the fold. */
@media (max-width: 1049px) {
  body.d365-app2 .map-grid > .map-side { order: 0 !important; }
}

/* The decorative atlas is paper-bright; soften it on dark so it does not pull
   focus away from the deadline answer. */
html[data-theme="dark"] .lien-atlas img { filter: brightness(.76) saturate(.88) contrast(.96); }
html[data-theme="dark"] .lien-atlas { border-color: color-mix(in srgb, var(--line) 80%, transparent); }

/* Reserve the atlas column so the headline and lede never run underneath it. */
@media (min-width: 1241px) {
  body.liref-page .liref-h { max-width: calc(100% - 395px); }
}

/* Keep keyboard focus visible when a skip link lands on <main>. */
main:focus { outline: none; }
main:focus-visible { outline: 2px solid var(--link, var(--accent)); outline-offset: 4px; }

/* Mobile mapping fallback: keep the table header mapping controls visible
   instead of hiding the only field selectors below 560px. */
@media (max-width: 560px) {
  body.d365-app2 #sheet-preview { display: block; width: 100%; white-space: normal; font-size: 13px; }
  body.d365-app2 #sheet-preview thead { display: block; border-bottom: 1px solid var(--line); }
  body.d365-app2 #sheet-preview thead tr { display: block; padding: 6px 14px 10px; }
  body.d365-app2 #sheet-preview thead th {
    display: block; min-width: 0; width: auto; padding: 8px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  }
  body.d365-app2 #sheet-preview thead th:last-child { border-bottom: 0; }
  body.d365-app2 #sheet-preview thead th .sheet-colmap { display: flex; align-items: center; gap: 7px; }
  body.d365-app2 #sheet-preview thead th .sheet-map-control { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
  body.d365-app2 #sheet-preview thead th .sheet-fieldmap { display: flex; flex: 1; min-width: 0; }
  body.d365-app2 #sheet-preview thead th .sheet-map-select {
    width: 100%; max-width: none; height: 34px; font-size: 11px; border-radius: 7px; padding: 0 7px;
  }
  body.d365-app2 .map-mobile-note {
    display: block; margin: 0 0 8px; font-size: 11px; line-height: 1.45; color: var(--muted);
  }
}

/* FR header labels are longer than EN. Keep the one-row marketing header
   inside 1280–1550px viewports instead of letting the actions clip. */
@media (min-width: 1280px) and (max-width: 1550px) {
  .site-header .hdr { gap: 20px; }
  .site-header .nav-links { gap: 2px; }
  .site-header .nav-links a { padding-left: 8px; padding-right: 8px; font-size: 14px; }
  .site-header .hdr-actions { gap: 8px; }
}

/* Keep the mobile app bar dark; wow's paper surface must not override the app shell. */
@media (max-width:1149px){
  body.d365-app2 .site-header{
    background:#0b0c10;
    border-bottom:1px solid rgba(255,255,255,.10);
    -webkit-backdrop-filter:none; backdrop-filter:none;
  }
  body.d365-app2 .site-header .word span{ color:#f7f7f9; }
  body.d365-app2 .site-header .word span:last-child{ color:rgba(255,255,255,.62); }
  body.d365-app2 .site-header .appbar-context .abc-page{ color:#f7f7f9; }
}

/* auth stage carries three honest reassurances, not just decoration */
.auth-showcase{height:360px}
.auth-showcase-copy{bottom:84px}
.auth-proof{position:absolute;left:8px;right:0;bottom:0;display:grid;gap:6px;margin:0;padding:0;list-style:none}
.auth-proof li{display:flex;align-items:center;gap:7px;font:500 11.5px/1.35 var(--sans, sans-serif);color:var(--mut)}
.auth-proof li span{width:15px;height:15px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--accent-soft);color:var(--accent-text);font-size:9px;font-weight:800}
@media(max-width:900px){.auth-proof{display:none}}

/* give the auth stage enough width to balance the form */
@media(min-width:901px){
  .auth-wrap{grid-template-columns:minmax(0,420px) minmax(300px,420px)!important}
  .auth-showcase{width:420px;height:410px}
  .auth-showcase .wow-art-stack{left:14px;top:8px;transform:rotateX(9deg) rotateY(-15deg) scale(1.28)}
  .auth-showcase-copy{bottom:118px}
  .auth-proof{left:8px;gap:9px}
  .auth-proof li{font-size:13px}
}

