:root {
  color-scheme: light;
  --wine-950: #341016;
  --wine-900: #4b151e;
  --wine-800: #641c28;
  --wine-700: #7a2230;
  --wine-600: #963445;
  --wine-100: #f1dfe1;
  --wine-50: #f8eeef;
  --ink: #241b1b;
  --ink-soft: #4f4140;
  --muted: #756966;
  --paper: #f5f0e7;
  --paper-deep: #ece3d5;
  --cream: #fffaf0;
  --white: #fffefb;
  --brass: #a57c52;
  --line: rgba(73, 42, 39, 0.16);
  --line-strong: rgba(73, 42, 39, 0.28);
  --success: #456a55;
  --danger: #9a2939;
  --shadow-sm: 0 8px 24px rgba(53, 20, 24, 0.08);
  --shadow-md: 0 20px 56px rgba(53, 20, 24, 0.14);
  --shadow-lg: 0 32px 96px rgba(43, 13, 18, 0.24);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
  --max-width: 1240px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon, .history-action-icon { width: 1.1em; height: 1.1em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible {
  outline: 3px solid rgba(150, 52, 69, 0.35);
  outline-offset: 3px;
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 18px; top: -80px; z-index: 1000; padding: 12px 18px; background: var(--ink); color: white; transition: top 160ms ease; }
.skip-link:focus { top: 18px; }

/* === BRAND & HEADER === */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  min-height: 80px;
  padding: 14px max(24px, calc((100vw - var(--max-width)) / 2));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  color: var(--cream);
  transition: color 240ms ease, background 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.site-header.scrolled, .site-header.workspace-mode {
  color: var(--ink);
  background: rgba(245, 240, 231, 0.92);
  box-shadow: 0 1px 0 var(--line), 0 12px 36px rgba(49, 20, 24, 0.06);
  backdrop-filter: blur(18px);
}

.site-header.workspace-mode { position: sticky; }

.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; }
.brand-logo { width: 42px; height: 42px; display: block; flex: 0 0 auto; border-radius: 5px; object-fit: cover; box-shadow: 0 5px 15px rgba(38,10,15,.14); }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-family: var(--serif); font-size: 19px; letter-spacing: 0.16em; }
.brand-copy small { font-size: 8px; letter-spacing: 0.2em; opacity: 0.7; }

.site-nav { display: flex; align-items: center; gap: 34px; font-size: 14px; }
.site-nav a { position: relative; padding: 8px 0; opacity: 0.82; transition: opacity 160ms ease; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 2px; height: 1px; background: currentColor; transition: right 220ms ease; }
.site-nav a:hover { opacity: 1; }
.site-nav a:hover::after { right: 0; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }

/* === USER IDENTITY === */
.user-menu { position: relative; }
.user-menu-trigger { min-height: 48px; padding: 4px 10px 4px 5px; display: flex; align-items: center; gap: 10px; color: inherit; background: transparent; border: 1px solid transparent; cursor: pointer; transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease; }
.user-menu-trigger:hover, .user-menu.open .user-menu-trigger { color: var(--wine-800); background: rgba(255,254,251,.72); border-color: var(--line); transform: translateY(-1px); }
.avatar { position: relative; display: grid; place-items: center; overflow: hidden; color: var(--cream); background: linear-gradient(145deg, var(--wine-600), var(--wine-950)); border-radius: 50%; font-family: var(--serif); font-weight: 700; isolation: isolate; }
.avatar::after { content: ""; position: absolute; inset: 2px; border: 1px solid rgba(255,255,255,.34); border-radius: inherit; pointer-events: none; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.avatar-header { width: 38px; height: 38px; box-shadow: 0 7px 18px rgba(58,17,24,.18); transition: transform 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms ease; }
.user-menu-trigger:hover .avatar-header { transform: scale(1.07) rotate(-2deg); box-shadow: 0 10px 25px rgba(58,17,24,.27); }
.header-username { max-width: 96px; overflow: hidden; font-family: var(--serif); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-caret { width: 15px; height: 15px; color: currentColor; opacity: .58; transition: transform 180ms ease; }
.user-menu.open .user-menu-caret { transform: rotate(180deg); }
.user-popover { position: absolute; z-index: 75; top: calc(100% + 10px); right: 0; width: 315px; padding: 18px; visibility: hidden; color: var(--ink); background: rgba(255,254,251,.98); border: 1px solid var(--line-strong); box-shadow: var(--shadow-md); opacity: 0; transform: translateY(-9px) scale(.98); transform-origin: top right; pointer-events: none; transition: opacity 170ms ease, transform 210ms cubic-bezier(.2,.8,.2,1), visibility 170ms; }
.user-popover::before { content: ""; position: absolute; top: -11px; right: 24px; width: 20px; height: 11px; background: linear-gradient(135deg, transparent 50%, rgba(255,254,251,.98) 51%); transform: rotate(-45deg); }
.user-popover::after { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.user-menu:hover .user-popover, .user-menu:focus-within .user-popover, .user-menu.open .user-popover { visibility: visible; opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.popover-profile { display: grid; grid-template-columns: 52px minmax(0,1fr); align-items: center; gap: 13px; }
.avatar-popover { width: 52px; height: 52px; font-size: 18px; }
.popover-profile strong { display: block; overflow: hidden; font-family: var(--serif); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.popover-profile small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.popover-stats { margin: 17px 0 12px; padding: 13px 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.popover-stats span { padding: 0 10px; color: var(--muted); font-size: 11px; }
.popover-stats span + span { border-left: 1px solid var(--line); }
.popover-stats strong { display: block; margin-bottom: 2px; color: var(--wine-800); font-family: var(--serif); font-size: 20px; }
.popover-action { width: 100%; padding: 11px 9px; display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); background: transparent; cursor: pointer; text-align: left; transition: color 160ms ease, background 160ms ease, padding 160ms ease; }
.popover-action:hover { padding-inline: 13px; color: var(--wine-700); background: var(--wine-50); }
.popover-logout { margin-top: 2px; color: var(--muted); font-size: 12px; }

/* === BUTTON SYSTEM === */
.button {
  position: relative;
  min-height: 46px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 680;
  letter-spacing: 0.02em;
  overflow: hidden;
  transition: transform 150ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.button::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.2), transparent 80%); transform: translateX(-120%); transition: transform 420ms ease; }
.button:hover::before { transform: translateX(120%); }
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(1px) scale(0.985); transition-duration: 60ms; }
.button[disabled] { opacity: 0.58; pointer-events: none; }
.button-primary { background: var(--wine-700); color: var(--cream); box-shadow: 0 8px 20px rgba(77, 20, 29, 0.22); }
.button-primary:hover { background: var(--wine-600); box-shadow: 0 12px 28px rgba(77, 20, 29, 0.28); }
.button-quiet { min-height: 40px; padding: 0 14px; color: inherit; background: transparent; }
.button-quiet:hover { background: rgba(255, 255, 255, 0.1); }
.site-header.scrolled .button-quiet:hover, .site-header.workspace-mode .button-quiet:hover { background: rgba(122, 34, 48, 0.08); }
.button-outline { background: transparent; color: var(--wine-700); border: 1px solid rgba(122, 34, 48, 0.35); }
.button-outline:hover { background: var(--wine-50); border-color: var(--wine-700); }
.button-soft { color: var(--wine-700); background: var(--wine-50); border: 1px solid var(--wine-100); }
.button-soft:hover { background: var(--wine-100); }
.button-cream { color: var(--wine-900); background: var(--cream); box-shadow: 0 10px 28px rgba(28, 8, 12, 0.18); }
.button-cream:hover { background: white; box-shadow: 0 16px 36px rgba(28, 8, 12, 0.22); }
.button-large { min-height: 58px; padding: 0 30px; }
.button-compact { min-height: 42px; padding: 0 18px; }
.button-full { width: 100%; }

/* === HERO === */
.hero {
  min-height: min(900px, 100vh);
  padding: 142px max(24px, calc((100vw - var(--max-width)) / 2)) 82px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(460px, 1.05fr);
  align-items: center;
  gap: clamp(48px, 6vw, 96px);
  color: var(--cream);
  background:
    radial-gradient(circle at 12% 25%, rgba(190, 96, 103, 0.20), transparent 32%),
    linear-gradient(120deg, var(--wine-950) 0%, var(--wine-900) 58%, #5c1b25 100%);
  overflow: hidden;
}
.hero::before { content: ""; position: absolute; inset: 0; opacity: 0.08; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E"); }
.hero-copy, .hero-visual { position: relative; z-index: 1; }
.kicker { margin: 0 0 24px; display: flex; align-items: center; gap: 12px; color: var(--wine-700); font-size: 12px; font-weight: 750; letter-spacing: 0.16em; text-transform: uppercase; }
.kicker span { width: 28px; height: 1px; background: currentColor; }
.hero .kicker, .kicker-light { color: #e5b8ba; }
.hero h1 { margin: 0; font-family: var(--display); font-size: clamp(54px, 6.4vw, 94px); font-weight: 400; line-height: 1.04; letter-spacing: 0.01em; text-wrap: balance; }
.hero h1 em { color: #f1c8c2; font-style: normal; }
.hero-lead { max-width: 620px; margin: 30px 0 0; color: rgba(255, 250, 240, 0.76); font-family: var(--serif); font-size: clamp(17px, 1.35vw, 20px); line-height: 1.9; text-wrap: pretty; }
.hero-actions { margin-top: 38px; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.text-link { display: inline-flex; align-items: center; gap: 10px; padding: 10px 0; color: rgba(255, 250, 240, 0.78); border-bottom: 1px solid rgba(255,255,255,.25); font-size: 14px; transition: color 160ms ease, border-color 160ms ease; }
.text-link:hover { color: white; border-color: white; }
.trust-strip { margin-top: 46px; display: flex; gap: 24px; flex-wrap: wrap; color: rgba(255, 250, 240, 0.62); font-size: 12px; }
.trust-strip span { display: flex; align-items: center; gap: 8px; }
.trust-strip .icon { width: 16px; height: 16px; color: #d5a5a5; }

.hero-visual { align-self: stretch; min-height: 610px; margin-right: min(-4vw, -30px); }
.hero-visual picture { display: block; width: 100%; height: 100%; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center; box-shadow: var(--shadow-lg); filter: saturate(.84) contrast(1.02); }
.hero-visual::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); pointer-events: none; }
.visual-caption { position: absolute; left: -44px; bottom: -25px; width: min(390px, 72%); padding: 22px; display: grid; grid-template-columns: auto 1fr; gap: 16px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow-md); }
.visual-caption span { color: var(--wine-700); font-family: var(--serif); font-size: 12px; }
.visual-caption p { margin: 0; font-family: var(--serif); font-size: 13px; line-height: 1.8; }
.visual-caption strong { font-size: 16px; }
.signal-card { position: absolute; top: 35px; right: -24px; width: 210px; padding: 19px; color: var(--ink); background: rgba(255, 250, 240, 0.92); border: 1px solid rgba(255,255,255,.45); backdrop-filter: blur(16px); box-shadow: var(--shadow-md); }
.signal-card span, .signal-card small { display: block; color: var(--muted); font-size: 10px; line-height: 1.6; }
.signal-card strong { display: block; margin-top: 5px; color: var(--wine-700); font-family: var(--serif); font-size: 21px; }
.signal-line { width: 100%; height: 30px; margin: 8px 0 6px; color: var(--wine-600); border-bottom: 1px solid var(--line); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* === PUBLIC CONTENT === */
.statement-band { min-height: 110px; padding: 26px max(24px, calc((100vw - var(--max-width)) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 30px; background: var(--wine-700); color: var(--cream); }
.statement-band p { margin: 0; font-family: var(--serif); font-size: clamp(19px, 2vw, 27px); }
.statement-band span { flex: 0 0 auto; color: rgba(255,250,240,.65); font-size: 11px; letter-spacing: .15em; }
.content-section { padding: 120px max(24px, calc((100vw - var(--max-width)) / 2)); }
.section-heading { max-width: 720px; }
.section-heading h2, .dimension-copy h2, .closing-cta h2 { margin: 0; font-family: var(--display); font-size: clamp(42px, 5vw, 70px); font-weight: 400; line-height: 1.16; letter-spacing: .01em; text-wrap: balance; }
.section-heading > p:last-child, .dimension-copy > p { margin: 26px 0 0; color: var(--muted); font-family: var(--serif); font-size: 17px; line-height: 1.9; }
.method-section { background: var(--paper); }
.statement-grid { margin-top: 64px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.statement-card { position: relative; min-height: 410px; padding: 34px 34px 38px; display: flex; flex-direction: column; border-right: 1px solid var(--line-strong); transition: color 240ms ease, background 240ms ease, transform 240ms ease; overflow: hidden; }
.statement-card:first-child { border-left: 1px solid var(--line-strong); }
.statement-card::before { content: ""; position: absolute; inset: auto 0 0; height: 0; background: var(--wine-700); transition: height 320ms cubic-bezier(.2,.8,.2,1); }
.statement-card:hover { color: var(--cream); transform: translateY(-8px); }
.statement-card:hover::before { height: 100%; }
.statement-card > * { position: relative; z-index: 1; }
.card-index { color: var(--wine-700); font-family: var(--serif); font-size: 12px; transition: color 240ms ease; }
.statement-card:hover .card-index, .statement-card:hover > span, .statement-card:hover p { color: rgba(255,250,240,.7); }
.statement-glyph { width: 110px; height: 110px; margin: 34px 0 24px; color: var(--wine-700); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: color 240ms ease, transform 300ms ease; }
.statement-card:hover .statement-glyph { color: #eac5c3; transform: translateY(-3px); }
.statement-card h3 { margin: auto 0 14px; font-family: var(--serif); font-size: 26px; }
.statement-card p { margin: 0; color: var(--muted); font-family: var(--serif); font-size: 15px; line-height: 1.85; transition: color 240ms ease; }
.statement-card > span { margin-top: 26px; color: var(--wine-700); font-size: 11px; letter-spacing: .13em; transition: color 240ms ease; }

.dimensions-section { display: grid; grid-template-columns: minmax(0, .85fr) minmax(480px, 1.15fr); gap: 100px; color: var(--cream); background: var(--wine-950); }
.dimension-copy { position: sticky; top: 130px; align-self: start; }
.dimension-copy > p { color: rgba(255,250,240,.65); }
.dimension-copy .button { margin-top: 36px; }
.dimension-list { border-top: 1px solid rgba(255,255,255,.18); }
.dimension-item { padding: 32px 0; display: grid; grid-template-columns: 58px 1fr; gap: 22px; border-bottom: 1px solid rgba(255,255,255,.18); transition: padding 220ms ease, background 220ms ease; }
.dimension-item:hover { padding-left: 18px; background: linear-gradient(90deg, rgba(255,255,255,.05), transparent); }
.dimension-item > span { color: #d8a8ab; font-family: var(--serif); font-size: 12px; }
.dimension-item h3 { margin: 0; font-family: var(--serif); font-size: 25px; }
.dimension-item p { margin: 11px 0 0; color: rgba(255,250,240,.58); font-family: var(--serif); font-size: 15px; line-height: 1.8; }

.workflow-section { background: var(--cream); }
.workflow-heading { max-width: 880px; }
.workflow-list { margin: 68px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; border-top: 1px solid var(--line-strong); }
.workflow-list li { position: relative; padding: 34px 24px 12px 0; border-right: 1px solid var(--line-strong); min-height: 250px; }
.workflow-list li:last-child { border-right: 0; padding-left: 24px; }.workflow-list li:not(:first-child) { padding-left: 24px; }
.workflow-list li > span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--wine-700); border: 1px solid var(--wine-700); border-radius: 50%; font-family: var(--serif); }
.workflow-list h3 { margin: 54px 0 12px; font-family: var(--serif); font-size: 21px; }
.workflow-list p { margin: 0; color: var(--muted); font-family: var(--serif); font-size: 14px; line-height: 1.8; }

.closing-cta { padding: 100px max(24px, calc((100vw - var(--max-width)) / 2)); display: flex; align-items: flex-end; justify-content: space-between; gap: 50px; color: var(--cream); background: var(--wine-700); }
.closing-cta h2 { max-width: 850px; font-size: clamp(38px, 4vw, 60px); }
.site-footer { padding: 50px max(24px, calc((100vw - var(--max-width)) / 2)); display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 40px; background: var(--ink); color: rgba(255,250,240,.64); font-size: 12px; }
.footer-brand { color: var(--cream); }
.site-footer p { text-align: center; }
.site-footer > a { padding: 10px 0; display: inline-flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(255,255,255,.2); }
.site-footer > a .icon { transform: rotate(180deg); }

/* === AUTH MODAL === */
.auth-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(31, 12, 15, .64); backdrop-filter: blur(8px); animation: fadeIn 180ms ease both; }
.auth-modal { position: fixed; z-index: 90; left: 50%; top: 50%; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 36px); padding: 42px; overflow-y: auto; color: var(--ink); background: var(--cream); box-shadow: var(--shadow-lg); transform: translate(-50%, -50%); animation: modalIn 260ms cubic-bezier(.2,.85,.25,1) both; }
.auth-modal::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--wine-700); }
.modal-close { position: absolute; right: 18px; top: 14px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); background: transparent; border-radius: 50%; cursor: pointer; transition: color 160ms ease, background 160ms ease, transform 160ms ease; }
.modal-close:hover { color: var(--wine-700); background: var(--wine-50); transform: rotate(5deg); }
.auth-logo { width: 64px; height: 64px; display: block; margin-bottom: 32px; border-radius: 8px; object-fit: cover; box-shadow: 0 10px 26px rgba(66,14,24,.2); }
.auth-modal .kicker { margin-bottom: 16px; }
.auth-modal h2 { margin: 0; font-family: var(--serif); font-size: clamp(27px, 4vw, 36px); line-height: 1.35; }
.auth-intro { margin: 16px 0 26px; color: var(--muted); font-family: var(--serif); line-height: 1.8; }
.auth-note { display: block; color: var(--muted); text-align: center; line-height: 1.6; }

/* === FORM SYSTEM === */
label { display: block; margin-top: 18px; color: var(--ink-soft); font-size: 13px; font-weight: 680; }
input, textarea { width: 100%; margin-top: 8px; padding: 14px 16px; color: var(--ink); background: rgba(255,255,255,.72); border: 1px solid var(--line-strong); border-radius: 2px; outline: 0; transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
input { min-height: 50px; }
textarea { resize: vertical; min-height: 126px; line-height: 1.7; }
input:hover, textarea:hover { border-color: rgba(122,34,48,.46); }
input:focus, textarea:focus { background: white; border-color: var(--wine-700); box-shadow: 0 0 0 4px rgba(122,34,48,.1); }
input::placeholder, textarea::placeholder { color: #a69b97; }
.code-row { display: grid; grid-template-columns: 1fr 142px; gap: 12px; align-items: end; }
.code-row .button { min-height: 50px; margin-top: 8px; padding: 0 12px; }
.message { min-height: 22px; margin: 14px 0; color: var(--muted); line-height: 1.6; }

/* === WORKSPACE === */
.app-shell { max-width: 1500px; min-height: calc(100vh - 80px); margin: 0 auto; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.workspace-sidebar { position: sticky; top: 80px; height: calc(100vh - 80px); padding: 48px 32px 32px; display: flex; flex-direction: column; color: var(--cream); background: var(--wine-950); }
.workspace-intro p { margin: 0 0 9px; color: #d9a9ac; font-size: 11px; letter-spacing: .15em; }
.workspace-intro h2 { margin: 0; font-family: var(--display); font-size: 34px; font-weight: 400; }
.workspace-intro small { display: block; margin-top: 18px; color: rgba(255,250,240,.52); font-family: var(--serif); line-height: 1.8; }
.workspace-steps { margin: 48px 0 0; padding: 0; list-style: none; }
.step { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: center; padding: 15px 0; opacity: .42; transition: opacity 180ms ease, transform 180ms ease; }
.step.active { opacity: 1; transform: translateX(4px); }
.step > span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-family: var(--serif); font-size: 12px; }
.step strong { font-family: var(--serif); font-size: 14px; }
.step small { display: block; margin-top: 4px; color: rgba(255,250,240,.52); font-size: 10px; }
.sidebar-back { margin-top: auto; padding: 12px 0; display: flex; gap: 9px; align-items: center; color: rgba(255,250,240,.7); background: transparent; cursor: pointer; font-size: 12px; text-align: left; transition: color 160ms ease, transform 160ms ease; }
.sidebar-back:hover { color: white; transform: translateX(-3px); }
.workspace { padding: 64px clamp(28px, 5vw, 74px) 100px; background: var(--paper); }
.workspace-header { margin-bottom: 42px; display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.workspace-header .kicker { margin-bottom: 12px; }
.workspace-header h1 { margin: 0; font-family: var(--display); font-size: clamp(38px, 4.4vw, 62px); font-weight: 400; }
.workspace-private { padding: 8px 12px; color: var(--success); border: 1px solid rgba(69,106,85,.28); background: rgba(69,106,85,.06); font-size: 11px; }
.panel { margin-bottom: 24px; padding: clamp(26px, 3.2vw, 42px); background: rgba(255,254,251,.82); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: box-shadow 220ms ease, border-color 220ms ease, transform 220ms ease; }
.panel:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-title > div { display: flex; align-items: flex-start; gap: 18px; }
.panel-number { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; color: var(--wine-700); border: 1px solid var(--wine-700); border-radius: 50%; font-family: var(--serif); font-size: 11px; }
.panel-title p { margin: 0 0 5px; color: var(--wine-700); font-size: 10px; font-weight: 750; letter-spacing: .14em; }
.panel-title h2 { margin: 0; font-family: var(--serif); font-size: clamp(22px, 2.4vw, 29px); }
.panel-description { max-width: 740px; margin: 18px 0 0 56px; color: var(--muted); font-family: var(--serif); font-size: 14px; line-height: 1.8; }
.badge { flex: 0 0 auto; padding: 7px 11px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); font-size: 11px; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.stock-search { position: relative; margin-top: 22px; }
.stock-input-wrap { position: relative; }
.stock-input-wrap input { margin-top: 0; padding-right: 92px; }
.stock-input-wrap input[aria-expanded="true"] { border-color: var(--wine-700); box-shadow: 0 0 0 3px rgba(116,37,50,.08); }
.stock-search-status { position: absolute; top: 50%; right: 14px; color: var(--muted); font-size: 11px; transform: translateY(-50%); pointer-events: none; }
.stock-search-status.searching { display: inline-flex; align-items: center; gap: 6px; }
.stock-results { position: absolute; z-index: 20; top: calc(100% + 7px); left: 0; right: 0; max-height: 390px; overflow-y: auto; display: grid; background: #fffefb; border: 1px solid var(--line-strong); box-shadow: var(--shadow-md); }
.stock-results .message { margin: 0; padding: 16px 18px; }
.stock-item { position: relative; width: 100%; padding: 13px 46px 13px 16px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; transition: color 180ms ease, background 180ms ease, padding-left 180ms ease; }
.stock-item:last-child { border-bottom: 0; }
.stock-item .stock-item-arrow { position: absolute; right: 14px; top: 50%; width: 17px; height: 17px; color: var(--wine-700); opacity: 0; transform: translate(-5px,-50%); transition: opacity 180ms ease, transform 180ms ease; }
.stock-item:hover, .stock-item:focus-visible, .stock-item.active { color: var(--wine-700); outline: 0; background: var(--wine-50); padding-left: 21px; }
.stock-item:hover .stock-item-arrow, .stock-item:focus-visible .stock-item-arrow, .stock-item.active .stock-item-arrow { opacity: 1; transform: translate(0,-50%); }
.stock-item small { display: block; margin-top: 5px; color: var(--muted); }
.selected { margin-top: 16px; padding: 17px 19px; color: var(--cream); background: var(--wine-800); border-left: 4px solid #d2a6a5; }
.selected span { margin-left: 8px; color: rgba(255,250,240,.68); font-size: 12px; }
.report-list { margin-top: 20px; }
.report-item { padding: 14px 0; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.progress { height: 7px; margin-top: 30px; background: var(--wine-100); overflow: hidden; }
.progress > div { width: 0; height: 100%; background: linear-gradient(90deg, var(--wine-700), #c26b76); transition: width 440ms ease; }
.report { font-family: var(--serif); font-size: 16px; line-height: 1.9; }
.report #reportContent { max-width: 1120px; margin: 0 auto; }
.report h1, .report h2, .report h3, .report h4 { font-family: var(--serif); }
.report h1 { margin: 0 0 24px; font-size: clamp(30px, 4vw, 48px); line-height: 1.35; }
.report h2 { margin: 64px 0 24px; padding-top: 22px; border-top: 1px solid var(--line); font-size: clamp(23px, 2.5vw, 31px); line-height: 1.45; }
.report > div > p, .report > div > ol { max-width: 900px; }
.report li::marker { color: var(--wine-600); }
.report table { width: 100%; margin: 24px 0; border-collapse: collapse; font-family: var(--sans); font-size: 13px; }
.report th, .report td { min-width: 112px; padding: 12px; border: 1px solid var(--line-strong); text-align: left; vertical-align: top; }
.report th { color: var(--wine-800); background: var(--wine-50); }
.report blockquote { margin: 20px 0; padding: 13px 20px; color: var(--wine-800); background: var(--wine-50); border-left: 4px solid var(--wine-700); font-family: var(--sans); font-size: 13px; line-height: 1.75; }

.driver-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; font-family: var(--sans); }
.driver-card { min-height: 210px; padding: 24px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(53,20,24,.05); }
.driver-card h3 { margin: 0; color: var(--wine-800); font-size: 18px; }
.driver-card > p { margin: 7px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.driver-card ul { margin: 0; padding-left: 20px; }
.driver-card li { margin-top: 10px; color: var(--ink-soft); font-size: 14px; line-height: 1.75; }
.driver-card li.empty { color: var(--muted); }

.risk-groups, .anomaly-groups { display: grid; gap: 14px; font-family: var(--sans); }
.risk-group, .anomaly-group { overflow: hidden; background: var(--white); border: 1px solid var(--line); }
.risk-group { border-left-width: 5px; }
.risk-high { border-left-color: var(--danger); }
.risk-medium { border-left-color: #a46b32; }
.risk-low { border-left-color: var(--success); }
.risk-unknown { border-left-color: var(--muted); }
.risk-group h3, .anomaly-group > h3 { margin: 0; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(245,240,231,.62); font-size: 16px; }
.risk-group h3 span, .anomaly-group > h3 span { color: var(--muted); font-family: var(--sans); font-size: 11px; font-weight: 500; }
.risk-group ul { margin: 0; padding: 12px 24px 18px 42px; }
.risk-group li { padding: 5px 0; color: var(--ink-soft); font-size: 14px; line-height: 1.75; }

.anomaly-group > ul { margin: 0; padding: 0; list-style: none; }
.anomaly-item { padding: 18px 20px; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; border-top: 1px solid var(--line); }
.anomaly-item:first-child { border-top: 0; }
.anomaly-item strong { display: block; margin-bottom: 3px; color: var(--wine-700); font-size: 11px; }
.anomaly-item h4 { margin: 0; color: var(--ink); font-size: 15px; line-height: 1.55; }
.anomaly-item p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.severity { width: 42px; height: 25px; display: inline-grid; place-items: center; border-radius: 999px; font-size: 11px; font-weight: 700; }
.severity-high { color: #8f2232; background: #f7dfe2; }
.severity-medium { color: #825321; background: #f5ead8; }
.severity-low { color: #3d654e; background: #e1eee6; }
.severity-info { color: var(--muted); background: var(--paper); }

.judgement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; font-family: var(--sans); }
.judgement-card { padding: 24px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(53,20,24,.05); }
.judgement-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.judgement-card header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.judgement-card h3 { margin: 0; font-size: 17px; }
.judgement-card header strong { color: var(--wine-700); font-family: var(--serif); font-size: 28px; line-height: 1; }
.judgement-card header strong span { margin-left: 3px; color: var(--muted); font-family: var(--sans); font-size: 11px; font-weight: 500; }
.judgement-card progress { width: 100%; height: 7px; margin: 18px 0 14px; display: block; overflow: hidden; border: 0; border-radius: 0; accent-color: var(--wine-700); }
.judgement-card progress::-webkit-progress-bar { background: var(--wine-100); }
.judgement-card progress::-webkit-progress-value { background: var(--wine-700); }
.judgement-strong progress { accent-color: var(--success); }
.judgement-strong progress::-webkit-progress-value { background: var(--success); }
.judgement-watch progress { accent-color: #a46b32; }
.judgement-watch progress::-webkit-progress-value { background: #a46b32; }
.judgement-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.75; }

/* === PROFILE & ANALYSIS ARCHIVE === */
.profile-page { min-height: calc(100vh - 80px); background: var(--paper); }
.profile-hero { padding: 50px max(28px, calc((100vw - var(--max-width)) / 2)) 42px; color: var(--cream); background: radial-gradient(circle at 78% 8%, rgba(218,155,160,.16), transparent 27%), linear-gradient(125deg, var(--wine-950), var(--wine-800)); }
.profile-back { padding: 9px 0; display: flex; align-items: center; gap: 9px; color: rgba(255,250,240,.66); background: transparent; cursor: pointer; font-size: 12px; transition: color 160ms ease, transform 160ms ease; }
.profile-back:hover { color: var(--cream); transform: translateX(-3px); }
.profile-identity { margin-top: 34px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 25px; }
.profile-identity p { margin: 0 0 8px; color: #dfafb1; font-size: 10px; font-weight: 750; letter-spacing: .16em; }
.profile-identity h1 { margin: 0; font-family: var(--display); font-size: clamp(38px, 5vw, 64px); font-weight: 400; }
.profile-identity > div > span { display: block; margin-top: 8px; color: rgba(255,250,240,.62); font-size: 13px; }
.profile-avatar-wrap { position: relative; }
.avatar-profile { width: 104px; height: 104px; font-size: 34px; box-shadow: 0 18px 50px rgba(20,4,8,.32); }
.avatar-edit { position: absolute; left: 50%; bottom: -10px; min-width: 82px; padding: 7px 10px; color: var(--wine-900); background: var(--cream); border: 1px solid rgba(255,255,255,.55); box-shadow: 0 8px 22px rgba(20,4,8,.22); cursor: pointer; font-size: 11px; white-space: nowrap; transform: translateX(-50%); transition: transform 160ms ease, box-shadow 160ms ease; }
.avatar-edit:hover { box-shadow: 0 12px 28px rgba(20,4,8,.3); transform: translateX(-50%) translateY(-2px); }
.avatar-edit:active { transform: translateX(-50%) translateY(1px) scale(.98); }
.profile-stat-grid { max-width: 680px; margin: 38px 0 0 130px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.18); }
.profile-stat-grid > div { padding: 19px 22px 0 0; }
.profile-stat-grid > div + div { padding-left: 22px; border-left: 1px solid rgba(255,255,255,.18); }
.profile-stat-grid strong { display: block; font-family: var(--serif); font-size: 24px; }
.profile-stat-grid span { display: block; margin-top: 5px; color: rgba(255,250,240,.52); font-size: 11px; }
.profile-layout { max-width: var(--max-width); margin: 0 auto; padding: 52px 28px 110px; display: grid; grid-template-columns: 225px minmax(0, 1fr); gap: 46px; align-items: start; }
.profile-nav { position: sticky; top: 108px; padding: 8px 0; display: grid; gap: 7px; border-top: 1px solid var(--line-strong); }
.profile-nav > p { margin: 17px 15px 12px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .15em; }
.profile-nav-item { position: relative; min-height: 78px; padding: 14px 15px 14px 51px; display: grid; gap: 4px; color: var(--muted); background: transparent; border: 1px solid transparent; cursor: pointer; text-align: left; transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease; }
.profile-nav-item > span { position: absolute; left: 15px; top: 17px; color: var(--wine-600); font-family: var(--serif); font-size: 11px; }
.profile-nav-item strong { color: var(--ink); font-family: var(--serif); font-size: 15px; }
.profile-nav-item small { font-size: 11px; }
.profile-nav-item:hover { color: var(--wine-700); background: rgba(255,254,251,.55); border-color: var(--line); transform: translateX(3px); }
.profile-nav-item.active { color: var(--wine-700); background: var(--white); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.profile-nav-item.active::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--wine-700); }
.profile-content { min-width: 0; }
.profile-view { animation: profileViewIn 240ms ease both; }
.profile-settings-card { padding: clamp(27px, 4vw, 48px); display: grid; grid-template-columns: minmax(250px,.7fr) minmax(380px,1.3fr); column-gap: 70px; background: rgba(255,254,251,.86); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.profile-section-heading { grid-row: 1 / span 7; }
.profile-section-heading p, .history-heading p { margin: 0 0 8px; color: var(--wine-700); font-size: 10px; font-weight: 750; letter-spacing: .15em; }
.profile-section-heading h2, .history-heading h2 { margin: 0; font-family: var(--display); font-size: clamp(31px, 4vw, 45px); font-weight: 400; }
.profile-section-heading > span { display: block; margin-top: 18px; color: var(--muted); font-family: var(--serif); font-size: 13px; line-height: 1.8; }
.profile-form label { margin-top: 0; }
.profile-field-row, .phone-change-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.profile-field-row .button, .phone-change-row .button { min-height: 50px; margin-top: 8px; }
.phone-change-row { grid-template-columns: 1fr 150px; }
.profile-form > .button { margin-top: 14px; }
.profile-field-note { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.profile-divider { height: 1px; margin: 27px 0; background: var(--line); }
.history-section { min-height: 420px; }
.history-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.history-heading > span { max-width: 360px; color: var(--muted); font-family: var(--serif); font-size: 13px; text-align: right; }
.history-list { margin-top: 27px; border-top: 1px solid var(--line-strong); }
.history-loading, .history-empty { padding: 48px 0; color: var(--muted); font-family: var(--serif); text-align: center; }
.history-item { position: relative; padding: 24px 12px; display: grid; grid-template-columns: minmax(150px,.8fr) minmax(170px,1.2fr) 94px minmax(260px,auto); align-items: center; gap: 20px; border-bottom: 1px solid var(--line-strong); transition: color 180ms ease, background 180ms ease, padding 180ms ease; }
.history-item:hover { padding-inline: 20px; background: rgba(255,254,251,.68); }
.history-stock strong { display: block; font-family: var(--serif); font-size: 18px; }
.history-stock small, .history-date { color: var(--muted); font-size: 11px; }
.history-periods { display: flex; gap: 7px; flex-wrap: wrap; }
.history-periods span { padding: 5px 9px; color: var(--wine-700); background: var(--wine-50); border: 1px solid var(--wine-100); font-size: 11px; }
.history-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.history-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.history-status.success::before { background: var(--success); box-shadow: 0 0 0 4px rgba(69,106,85,.09); }
.history-status.failed::before { background: var(--danger); }
.history-item > div:last-child { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.history-action { position: relative; min-height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); background: transparent; border-radius: 999px; cursor: pointer; font-family: var(--serif); font-size: 12px; letter-spacing: .01em; transition: color 170ms ease, background 170ms ease, box-shadow 170ms ease, transform 170ms ease; }
.history-action-icon { width: 17px; height: 17px; padding: 2px; overflow: visible; border-radius: 50%; box-sizing: content-box; transition: background 170ms ease, transform 170ms ease; }
.history-open { color: var(--wine-700); background: rgba(122,34,48,.07); }
.history-open .history-action-icon { background: rgba(122,34,48,.09); }
.history-email .history-action-icon { background: rgba(165,124,82,.1); }
.history-delete { padding-inline: 10px; color: #897d79; }
.history-delete .history-action-icon { background: rgba(117,105,102,.08); }
.history-action:hover:not([disabled]) { color: var(--wine-800); background: var(--white); box-shadow: 0 8px 22px rgba(53,20,24,.1); transform: translateY(-2px); }
.history-action:hover:not([disabled]) .history-action-icon { background: var(--wine-50); transform: scale(1.08); }
.history-delete:hover { color: var(--danger); background: rgba(154,41,57,.07); box-shadow: none; }
.history-action:active:not([disabled]) { box-shadow: none; transform: translateY(0) scale(.97); }
.history-action[disabled] { cursor: default; opacity: .4; }
.history-report { margin-top: 36px; }
.history-toolbar-sentinel { width: 1px; height: 1px; }
.history-report-toolbar { position: sticky; z-index: 32; top: 80px; margin: -1px calc(-1 * clamp(26px, 3.2vw, 42px)) 38px; padding: 13px clamp(26px, 3.2vw, 42px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(255,254,251,.96); border-bottom: 1px solid transparent; transition: padding 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease; backdrop-filter: blur(16px); }
.history-report-toolbar.is-stuck { padding-block: 10px; border-color: var(--line); box-shadow: 0 12px 28px rgba(53,20,24,.1); }
.history-report-toolbar > span { color: var(--muted); font-family: var(--serif); font-size: 13px; }

/* === SOFT CONFIRM DIALOG === */
.dialog-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(38,17,20,.52); backdrop-filter: blur(10px) saturate(.8); animation: fadeIn 180ms ease both; }
.confirm-dialog { position: fixed; z-index: 110; left: 50%; top: 50%; width: min(480px, calc(100vw - 32px)); padding: 40px 42px 34px; color: var(--ink); background: rgba(255,250,240,.98); border: 1px solid rgba(122,34,48,.14); border-radius: 24px; box-shadow: 0 32px 100px rgba(43,13,18,.28); transform: translate(-50%, -50%); animation: softDialogIn 260ms cubic-bezier(.2,.85,.25,1) both; }
.dialog-close { position: absolute; right: 18px; top: 16px; width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); background: transparent; border-radius: 50%; cursor: pointer; transition: color 160ms ease, background 160ms ease, transform 160ms ease; }
.dialog-close .icon, .modal-close .icon { width: 20px; height: 20px; }
.dialog-close:hover { color: var(--wine-700); background: var(--wine-50); transform: rotate(5deg); }
.dialog-mark { width: 52px; height: 52px; margin-bottom: 24px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(122,34,48,.1), rgba(165,124,82,.1)); border-radius: 50%; }
.dialog-mark .icon { width: 24px; height: 24px; color: var(--wine-700); }
.dialog-kicker { margin: 0 0 8px; color: var(--wine-600); font-size: 9px; font-weight: 750; letter-spacing: .17em; }
.confirm-dialog h2 { margin: 0; font-family: var(--display); font-size: clamp(30px, 5vw, 40px); font-weight: 400; line-height: 1.3; }
.confirm-dialog > p:not(.dialog-kicker) { margin: 15px 0 0; color: var(--muted); font-family: var(--serif); font-size: 13px; line-height: 1.85; }
.dialog-record { margin-top: 25px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(255,254,251,.72); border-radius: 14px; }
.dialog-record strong { font-family: var(--serif); font-size: 15px; }
.dialog-record span { color: var(--muted); font-size: 11px; text-align: right; }
.dialog-actions { margin-top: 28px; display: flex; justify-content: flex-end; gap: 10px; }
.dialog-button { min-height: 46px; padding: 0 21px; border-radius: 999px; cursor: pointer; font-family: var(--serif); font-size: 13px; transition: color 170ms ease, background 170ms ease, box-shadow 170ms ease, transform 170ms ease; }
.dialog-button:hover { transform: translateY(-2px); }
.dialog-button:active { transform: translateY(0) scale(.98); }
.dialog-button-cancel { color: var(--ink-soft); background: rgba(117,105,102,.08); }
.dialog-button-cancel:hover { background: rgba(117,105,102,.14); }
.dialog-button-danger { color: var(--cream); background: var(--wine-700); box-shadow: 0 10px 24px rgba(122,34,48,.2); }
.dialog-button-danger:hover { background: var(--wine-600); box-shadow: 0 14px 30px rgba(122,34,48,.27); }
.dialog-button.is-loading { position: relative; color: transparent; pointer-events: none; }

/* === FEEDBACK & MOTION === */
.toast-region { position: fixed; z-index: 120; right: 24px; bottom: 24px; display: grid; gap: 10px; pointer-events: none; }
.toast { min-width: 240px; max-width: min(380px, calc(100vw - 48px)); padding: 14px 18px; color: var(--cream); background: var(--ink); box-shadow: var(--shadow-md); border-left: 4px solid #d4a5a7; animation: toastIn 260ms ease both; font-size: 13px; line-height: 1.6; }
.toast.error { border-left-color: #dc6675; }
.button.is-loading, .history-action.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.loading-icon, .stock-search-spinner { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; animation: spin 650ms linear infinite; }
.loading-icon { position: absolute; left: 50%; top: 50%; color: white !important; transform: translate(-50%, -50%); animation-name: spinCentered; }
.button-outline.is-loading .loading-icon, .button-soft.is-loading .loading-icon, .history-action.is-loading .loading-icon { color: var(--wine-700) !important; }
.stock-search-spinner { width: 13px; height: 13px; color: var(--wine-600); }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.75,.25,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 100ms; }.reveal-delay-2 { transition-delay: 180ms; }.reveal-delay-3 { transition-delay: 260ms; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -47%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes softDialogIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinCentered { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes profileViewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* === RESPONSIVE === */
@media (max-width: 1050px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 150px; }
  .hero-copy { max-width: 760px; }
  .hero-visual { min-height: 560px; margin: 20px 0 10px 50px; }
  .dimensions-section { grid-template-columns: 1fr; gap: 60px; }
  .dimension-copy { position: static; }
  .workflow-list { grid-template-columns: 1fr 1fr; }
  .workflow-list li:nth-child(2) { border-right: 0; }
  .workflow-list li:nth-child(n+3) { border-top: 1px solid var(--line-strong); }
  .app-shell { grid-template-columns: 220px minmax(0,1fr); }
  .workspace-sidebar { padding-inline: 22px; }
  .profile-settings-card { grid-template-columns: 1fr; }
  .profile-section-heading { grid-row: auto; margin-bottom: 34px; }
  .profile-layout { grid-template-columns: 190px minmax(0,1fr); gap: 26px; }
  .history-item { grid-template-columns: minmax(135px,.8fr) minmax(170px,1.2fr); }
  .history-date { display: none; }
  .history-item > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .site-header { min-height: 68px; padding: 10px 18px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-copy strong { font-size: 16px; }.brand-copy small { display: none; }
  .header-actions { gap: 2px; }
  .header-actions .button { min-height: 40px; padding-inline: 12px; font-size: 13px; }
  #openLogin { display: none; }
  .header-username, .user-menu-caret { display: none; }
  .user-menu-trigger { padding-right: 5px; }
  .user-popover { position: fixed; top: 65px; right: 12px; width: min(315px, calc(100vw - 24px)); }
  .hero { min-height: auto; padding: 120px 20px 74px; gap: 46px; }
  .hero h1 { font-size: clamp(48px, 14vw, 68px); }
  .hero-lead { font-size: 16px; }
  .hero-actions { align-items: stretch; flex-direction: column; gap: 14px; }
  .hero-actions .button { width: 100%; }.text-link { justify-content: center; width: 100%; border-bottom: 0; }
  .trust-strip { gap: 13px; flex-direction: column; }
  .hero-visual { min-height: 410px; margin: 0 0 28px 16px; }
  .hero-visual img { object-position: 58% center; }
  .visual-caption { left: -16px; bottom: -30px; width: 88%; }
  .signal-card { display: none; }
  .statement-band { align-items: flex-start; flex-direction: column; }
  .statement-grid { grid-template-columns: 1fr; }
  .statement-card, .statement-card:first-child { min-height: 330px; border: 0; border-left: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
  .statement-card:hover { transform: none; }
  .content-section { padding: 82px 20px; }
  .section-heading h2, .dimension-copy h2 { font-size: 42px; }
  .dimensions-section { grid-template-columns: 1fr; gap: 56px; }
  .dimension-item { grid-template-columns: 40px 1fr; }
  .workflow-list { grid-template-columns: 1fr; }
  .workflow-list li, .workflow-list li:not(:first-child), .workflow-list li:last-child { min-height: auto; padding: 28px 0; border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .workflow-list h3 { margin-top: 30px; }
  .closing-cta { padding: 76px 20px; align-items: stretch; flex-direction: column; }
  .closing-cta .button { width: 100%; }
  .site-footer { padding: 44px 20px; grid-template-columns: 1fr; text-align: left; }
  .site-footer p { text-align: left; line-height: 1.7; }
  .auth-modal { padding: 34px 24px 28px; }
  .code-row { grid-template-columns: 1fr; }
  .code-row .button { margin-top: 0; }
  .app-shell { display: block; }
  .workspace-sidebar { position: static; width: auto; height: auto; padding: 30px 20px; }
  .workspace-intro small { max-width: 450px; }
  .workspace-steps { margin-top: 28px; display: grid; grid-template-columns: repeat(4, minmax(88px,1fr)); gap: 10px; overflow-x: auto; }
  .step { min-width: 88px; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
  .step small { display: none; }
  .sidebar-back { margin-top: 22px; }
  .workspace { padding: 42px 18px 80px; }
  .workspace-header { align-items: flex-start; flex-direction: column; }
  .workspace-private { display: none; }
  .panel { padding: 25px 20px; }
  .panel-description { margin-left: 0; }
  .grid.two { grid-template-columns: 1fr; }
  .actions .button { flex: 1; min-width: 140px; }
  .report { font-size: 15px; }
  .report h2 { margin-top: 48px; }
  .driver-grid, .judgement-grid { grid-template-columns: 1fr; }
  .judgement-card:last-child:nth-child(odd) { grid-column: auto; }
  .anomaly-item { grid-template-columns: 42px minmax(0, 1fr); padding-inline: 15px; gap: 10px; }
  .report table { display: block; overflow-x: auto; white-space: nowrap; }
  .profile-hero { padding: 34px 20px 38px; }
  .profile-identity { margin-top: 25px; gap: 18px; }
  .avatar-profile { width: 80px; height: 80px; font-size: 27px; }
  .profile-identity h1 { font-size: 38px; }
  .profile-stat-grid { margin-left: 0; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .profile-stat-grid > div { padding-right: 10px; }
  .profile-stat-grid > div + div { padding-left: 10px; }
  .profile-stat-grid strong { font-size: 19px; }
  .profile-layout { padding: 28px 18px 78px; display: block; }
  .profile-nav { position: sticky; z-index: 31; top: 68px; margin: 0 -18px 28px; padding: 9px 18px; display: flex; gap: 8px; overflow-x: auto; background: rgba(245,240,231,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
  .profile-nav > p { display: none; }
  .profile-nav-item { min-width: 150px; min-height: 62px; padding: 10px 12px 10px 42px; }
  .profile-nav-item > span { left: 12px; top: 13px; }
  .profile-nav-item:hover { transform: none; }
  .profile-settings-card { padding: 25px 20px; }
  .profile-field-row, .phone-change-row { grid-template-columns: 1fr; }
  .profile-field-row .button, .phone-change-row .button { margin-top: 0; width: 100%; }
  .history-heading { align-items: flex-start; flex-direction: column; }
  .history-heading > span { text-align: left; }
  .history-item { padding: 21px 4px; grid-template-columns: 1fr auto; gap: 14px; }
  .history-periods { grid-column: 1 / -1; grid-row: 2; }
  .history-item > div:last-child { grid-column: 1 / -1; grid-row: 3; flex-wrap: wrap; justify-content: flex-start; }
  .history-status { margin-right: auto; }
  .history-action { min-height: 42px; padding-inline: 11px; }
  .confirm-dialog { padding: 34px 24px 26px; border-radius: 20px; }
  .dialog-record { align-items: flex-start; flex-direction: column; gap: 5px; }
  .dialog-record span { text-align: left; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-button { padding-inline: 12px; }
  .history-report { padding-inline: 16px; }
  .history-report-toolbar { top: 68px; margin-inline: -16px; padding-inline: 16px; align-items: flex-start; flex-direction: column; gap: 7px; }
  .history-report-toolbar.is-stuck { align-items: center; flex-direction: row; }
  .history-report-toolbar.is-stuck > span { overflow: hidden; max-width: 55vw; text-overflow: ellipsis; white-space: nowrap; }
  .toast-region { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
