:root {
  --ink: #102f2a;
  --forest: #143d35;
  --forest-soft: #1f5147;
  --paper: #f2efe6;
  --paper-deep: #e7e1d4;
  --white: #fffdf8;
  --accent: #e9683d;
  --muted: #706c63;
  --line: rgba(16, 47, 42, 0.16);
  --display: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; min-height: 100vh; font-family: var(--sans); background: var(--paper); }
button, input, textarea { font: inherit; }

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 800; letter-spacing: .12em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--paper); background: var(--forest); font-family: var(--display); font-size: 20px; font-weight: 400; }
.product-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .18em; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .65fr);
  gap: clamp(44px, 8vw, 120px);
  align-items: center;
  max-width: 1440px;
  min-height: 650px;
  margin: 0 auto;
  padding: clamp(64px, 9vw, 130px) clamp(20px, 7vw, 108px);
}

.eyebrow { margin: 0 0 24px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; max-width: 900px; font-family: var(--display); font-size: clamp(42px, 5.4vw, 78px); font-weight: 500; line-height: 1.16; letter-spacing: -.045em; word-break: keep-all; }
.hero-lead { max-width: 660px; margin: 30px 0 32px; color: var(--muted); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.75; word-break: keep-all; }

.google-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-width: 264px; min-height: 54px; padding: 12px 22px; border: 1px solid rgba(16,47,42,.2); border-radius: 6px; background: var(--white); color: var(--ink); font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 9px 24px rgba(16,47,42,.08); transition: transform .15s ease, box-shadow .15s ease; }
.google-button:hover { transform: translateY(-2px); box-shadow: 0 13px 30px rgba(16,47,42,.13); }
.google-button:focus-visible { outline: 3px solid rgba(233,104,61,.3); outline-offset: 3px; }
.google-button svg { width: 21px; height: 21px; flex: none; }
.login-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }

.evidence-card { position: relative; overflow: hidden; padding: clamp(28px, 3.3vw, 46px); border-radius: 10px; background: var(--forest); color: var(--white); box-shadow: 0 28px 70px rgba(16,47,42,.2); }
.evidence-card::before { content: ""; position: absolute; top: -110px; right: -70px; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.evidence-card::after { content: ""; position: absolute; top: -65px; right: -25px; width: 170px; height: 170px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; }
.card-topline { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: rgba(255,255,255,.62); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.status-badge { display: inline-flex; padding: 5px 8px; border-radius: 100px; color: #ffd8c9; background: rgba(233,104,61,.17); border: 1px solid rgba(233,104,61,.45); }
.card-code { margin: 54px 0 12px; color: #d7c59c; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.evidence-card h2 { margin: 0 0 36px; font-family: var(--display); font-size: clamp(27px, 2.7vw, 42px); font-weight: 500; line-height: 1.3; letter-spacing: -.025em; word-break: keep-all; }
.trace-list { margin: 0; border-top: 1px solid rgba(255,255,255,.15); }
.trace-list div { display: grid; grid-template-columns: 52px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.trace-list dt { color: #d7c59c; font-size: 12px; font-weight: 700; }
.trace-list dd { margin: 0; color: rgba(255,255,255,.76); font-size: 13px; }
.sample-note { margin: 22px 0 0; color: rgba(255,255,255,.45); font-size: 11px; line-height: 1.6; }

.principles { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principles article { min-height: 250px; padding: 42px clamp(24px, 5vw, 72px); border-right: 1px solid var(--line); }
.principles article:last-child { border-right: 0; }
.principles span { display: block; margin-bottom: 40px; color: var(--accent); font-family: var(--display); font-size: 18px; }
.principles h2 { margin: 0 0 12px; font-family: var(--display); font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
.principles p { max-width: 380px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; word-break: keep-all; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 26px clamp(20px, 5vw, 72px); color: var(--muted); font-size: 11px; letter-spacing: .06em; }

[hidden] { display: none !important; }
.auth-loading { min-height: 68vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 13px; }
.loading-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 7px rgba(233,104,61,.13); }
.google-button:disabled, .text-button:disabled { cursor: wait; opacity: .6; }

.workspace { max-width: 1440px; min-height: 70vh; margin: 0 auto; padding: clamp(58px, 8vw, 112px) clamp(20px, 7vw, 108px); }
.workspace-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 44px; margin-bottom: 58px; }
.workspace-head h1 { font-size: clamp(42px, 5vw, 72px); }
.workspace-head > div:first-child > p:last-child { margin: 24px 0 0; color: var(--muted); font-size: 16px; }
.account-panel { display: grid; grid-template-columns: 42px minmax(150px, 1fr); gap: 4px 12px; align-items: center; min-width: 290px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,253,248,.55); }
.account-avatar { grid-row: span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--paper); background: var(--forest); font-family: var(--display); font-size: 20px; }
.account-panel strong, .account-panel span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-panel strong { font-size: 13px; }
.account-panel span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.account-panel .role-badge { display: inline-flex; width: fit-content; margin-top: 7px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 100px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.account-panel .role-badge.is-admin { color: #a64220; border-color: rgba(233,104,61,.35); background: rgba(233,104,61,.1); }
.text-button { grid-column: 2; justify-self: start; padding: 0; border: 0; border-bottom: 1px solid currentColor; color: var(--muted); background: transparent; font-size: 11px; cursor: pointer; }
.workspace-actions { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.workspace-actions p { margin: 0; color: var(--muted); font-size: 12px; }
.primary-action { min-height: 46px; padding: 11px 18px; border: 0; border-radius: 5px; color: var(--white); background: var(--accent); font-weight: 800; cursor: pointer; box-shadow: 0 8px 20px rgba(233,104,61,.17); }
.primary-action:disabled { cursor: wait; opacity: .58; }
.intake-panel { margin-bottom: 22px; padding: clamp(24px, 4vw, 42px); border: 1px solid var(--line); border-radius: 9px; background: var(--white); }
.intake-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 30px; }
.intake-heading span, .case-section > div:first-child > span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.intake-heading h2, .case-section h2 { margin: 8px 0 0; font-family: var(--display); font-size: 32px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.intake-panel label { display: grid; gap: 8px; color: var(--ink); font-size: 12px; font-weight: 700; }
.intake-panel input, .intake-panel select, .intake-panel textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: #fbfaf6; color: var(--ink); outline: none; }
.intake-panel input, .intake-panel select { min-height: 46px; padding: 10px 12px; }
.intake-panel textarea { resize: vertical; min-height: 176px; padding: 14px; line-height: 1.65; }
.intake-panel input:focus, .intake-panel select:focus, .intake-panel textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233,104,61,.1); }
.exact-field { margin-top: 20px; }
.exact-field > span { justify-self: end; color: var(--muted); font-size: 10px; font-weight: 500; }
.consent-field { grid-template-columns: 18px 1fr !important; align-items: flex-start; margin-top: 18px; color: var(--muted) !important; font-weight: 500 !important; line-height: 1.55; }
.consent-field input { width: 16px; min-height: 16px; margin: 2px 0 0; }
.form-submit { display: flex; align-items: center; gap: 16px; margin-top: 24px; }
.form-submit p { margin: 0; color: var(--muted); font-size: 12px; }
.workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.metric-card, .boundary-card { padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.metric-card > span, .boundary-card > span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.metric-card strong { display: block; margin: 18px 0 10px; color: var(--forest); font-family: var(--display); font-size: 54px; font-weight: 500; }
.metric-card p, .boundary-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.boundary-card { grid-column: 1 / -1; min-height: 240px; color: var(--white); background: var(--forest); }
.boundary-card > span { color: #d7c59c; }
.boundary-card h2 { max-width: 650px; margin: 34px 0 14px; font-family: var(--display); font-size: clamp(30px, 3.5vw, 48px); font-weight: 500; }
.boundary-card p { max-width: 720px; color: rgba(255,255,255,.62); }
.admin-boundary { background: #1b2d36; }
.case-section { margin-top: 66px; }
.case-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.empty-state { grid-column: 1 / -1; margin: 0; padding: 34px; border: 1px dashed var(--line); border-radius: 7px; color: var(--muted); font-size: 13px; text-align: center; }
.case-card { padding: 24px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.case-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 10px; }
.case-status { color: var(--accent); font-weight: 800; letter-spacing: .08em; }
.case-card h3 { margin: 28px 0 10px; font-family: var(--display); font-size: 26px; font-weight: 500; }
.case-card p { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.case-card small { display: block; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.5; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .evidence-card { max-width: 650px; }
  .principles { grid-template-columns: 1fr; }
  .principles article { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .principles article:last-child { border-bottom: 0; }
  .principles span { margin-bottom: 22px; }
  .workspace-head { align-items: flex-start; flex-direction: column; }
  .account-panel { width: 100%; }
  .case-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-header { min-height: 64px; padding: 14px 18px; }
  .product-label { display: none; }
  .hero { gap: 44px; padding: 56px 18px 64px; }
  h1 { font-size: clamp(38px, 11vw, 52px); }
  h1 br { display: none; }
  .hero-lead { margin-top: 24px; font-size: 16px; }
  .google-button { width: 100%; }
  .evidence-card { padding: 28px 24px; }
  .card-code { margin-top: 42px; }
  .principles article { padding: 34px 22px 38px; }
  .workspace { padding: 52px 18px 64px; }
  .workspace-actions, .form-submit { align-items: stretch; flex-direction: column; }
  .workspace-actions .primary-action, .form-submit .primary-action { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .boundary-card { grid-column: auto; }
  .account-panel { min-width: 0; }
  footer { flex-direction: column; padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
