/* Hallmark · macrostructure: Workbench · color: custom/preserved · typography: custom/preserved · density: comfortable */
/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V4 · contrast: pass (40–41) · nav: N3 · footer: none · slop: pass (42–45) · honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · icons: pass (30) · mobile: pass (34, 49, 50–57) */
:root {
  --font-display: "Avenir Next", "Hiragino Sans", sans-serif;
  --font-body: "Hiragino Sans", "Yu Gothic", sans-serif;
  --bg: oklch(0.145 0.018 270);
  --surface: oklch(0.19 0.025 270);
  --surface-2: oklch(0.225 0.028 270);
  --surface-3: oklch(0.255 0.03 270);
  --line: oklch(0.34 0.035 270);
  --line-strong: oklch(0.47 0.05 270);
  --text: oklch(0.96 0.008 270);
  --muted: oklch(0.72 0.025 270);
  --faint: oklch(0.58 0.025 270);
  --mint: oklch(0.79 0.14 165);
  --mint-deep: oklch(0.32 0.08 165);
  --violet: oklch(0.68 0.19 290);
  --violet-deep: oklch(0.29 0.09 290);
  --amber: oklch(0.82 0.15 80);
  --amber-deep: oklch(0.31 0.07 80);
  --red: oklch(0.72 0.18 25);
  --red-deep: oklch(0.29 0.08 25);
  --blue: oklch(0.72 0.13 235);
  --blue-deep: oklch(0.28 0.08 235);
  --shadow: 0 18px 55px oklch(0.05 0.02 270 / 0.42);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --focus: 0 0 0 3px oklch(0.79 0.14 165 / 0.3);
  --speed: 160ms;
}

* { box-sizing: border-box; }
html { color-scheme: dark; overflow-x: clip; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: clip; background: var(--bg); color: var(--text); font-family: var(--font-body); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; box-shadow: var(--focus); }
[hidden] { display: none !important; }

.btn { min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 var(--s4); background: var(--surface-2); color: var(--text); font-weight: 750; white-space: nowrap; transition: background var(--speed), border-color var(--speed), transform var(--speed); }
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; background: var(--surface); color: var(--faint); }
.btn.primary { background: var(--mint); color: var(--bg); border-color: var(--mint); }
.btn.primary:hover { background: var(--text); border-color: var(--text); }
.btn.violet { background: var(--violet); color: var(--bg); border-color: var(--violet); }
.btn.danger { color: var(--red); border-color: var(--red); background: var(--red-deep); }
.btn.small { min-height: 36px; padding: 0 var(--s3); font-size: .86rem; }
.icon-btn { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; }

.field { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); color: var(--text); padding: 0 var(--s4); }
textarea.field { min-height: 150px; padding-block: var(--s3); resize: vertical; line-height: 1.65; }
.field:hover { border-color: var(--line-strong); }
.field[aria-invalid="true"] { border-color: var(--red); }
.field-label { display: grid; gap: var(--s2); color: var(--muted); font-size: .88rem; font-weight: 700; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); }
.login-intro { padding: clamp(32px, 7vw, 100px); display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(135deg, var(--bg), var(--surface)); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: var(--s3); font: 800 1.15rem/1 var(--font-display); letter-spacing: .08em; }
.brand-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--violet); color: var(--text); font: 900 1.55rem/1 var(--font-display); }
.login-copy { max-width: 680px; }
.eyebrow { margin: 0 0 var(--s3); color: var(--mint); font-size: .78rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.login-copy h1 { min-width: 0; margin: 0; overflow-wrap: anywhere; font: 800 clamp(2.4rem, 5vw, 5.4rem)/1.02 var(--font-display); letter-spacing: -.045em; }
.login-copy p { margin: var(--s5) 0 0; max-width: 580px; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.18rem); line-height: 1.8; }
.trust-row { display: flex; flex-wrap: wrap; gap: var(--s3); color: var(--muted); font-size: .86rem; }
.trust-row span { padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: 999px; }
.login-panel { padding: clamp(28px, 6vw, 84px); display: grid; place-items: center; }
.login-card { width: min(100%, 510px); }
.login-card h2 { margin: 0; font: 800 clamp(1.8rem, 3vw, 2.6rem)/1.1 var(--font-display); }
.login-card > p { color: var(--muted); line-height: 1.7; }
.login-form { margin-top: var(--s8); display: grid; gap: var(--s5); }
.login-error { min-height: 24px; margin: 0; color: var(--red); font-size: .9rem; font-weight: 700; }
.password-row { position: relative; }
.password-row .field { padding-right: 76px; }
.show-pw { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--mint); font-weight: 750; padding: 8px; }
.demo-note { margin-top: var(--s8); padding: var(--s4); border-left: 3px solid var(--amber); background: var(--amber-deep); color: var(--muted); line-height: 1.65; }

.app { min-height: 100vh; display: grid; grid-template-columns: 318px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: var(--s5); border-right: 1px solid var(--line); background: var(--surface); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s5); }
.demo-chip { padding: 7px 10px; border-radius: 999px; background: var(--amber-deep); color: var(--amber); font-size: .74rem; font-weight: 850; }
.search { margin-bottom: var(--s4); }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); }
.quick { min-height: 72px; padding: var(--s3); text-align: left; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); font-weight: 750; }
.quick span { display: block; margin-bottom: var(--s1); color: var(--mint); font-size: .76rem; }
.side-title { margin: var(--s6) 0 var(--s3); display: flex; justify-content: space-between; align-items: center; font-size: .86rem; color: var(--muted); }
.account-list { display: grid; gap: var(--s2); }
.account { width: 100%; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: var(--s3); padding: var(--s3); border: 1px solid transparent; border-radius: var(--r-md); background: transparent; color: var(--text); text-align: left; }
.account:hover { background: var(--surface-2); }
.account.active { background: var(--violet-deep); border-color: var(--violet); }
.avatar { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-deep); color: var(--blue); font-weight: 900; }
.account strong, .account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account small { margin-top: 3px; color: var(--muted); font-size: .75rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 8; min-height: 72px; display: flex; align-items: center; gap: var(--s3); padding: 0 clamp(16px, 3vw, 40px); border-bottom: 1px solid var(--line); background: oklch(0.145 0.018 270 / .94); backdrop-filter: blur(14px); }
.mobile-menu { display: none; }
.tabs { min-width: 0; display: flex; align-items: center; gap: var(--s1); overflow-x: auto; scrollbar-width: none; }
.tab { flex: 0 0 auto; min-height: 42px; border: 0; border-bottom: 2px solid transparent; padding: 0 var(--s3); background: transparent; color: var(--muted); font-weight: 750; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--mint); border-color: var(--mint); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.page { display: none; padding: clamp(20px, 3.5vw, 48px); animation: enter var(--speed) ease-out; }
.page.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s6); }
.page-head h1 { min-width: 0; margin: 0; overflow-wrap: anywhere; font: 800 clamp(1.65rem, 3vw, 2.65rem)/1.08 var(--font-display); letter-spacing: -.03em; }
.page-head p { margin: var(--s2) 0 0; color: var(--muted); line-height: 1.6; }
.notice { margin-bottom: var(--s5); padding: var(--s3) var(--s4); border: 1px solid var(--mint); border-radius: var(--r-md); background: var(--mint-deep); color: var(--text); font-size: .9rem; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.metric { min-height: 120px; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.metric span { color: var(--muted); font-size: .83rem; }
.metric strong { display: block; margin-top: var(--s3); font: 800 1.9rem/1 var(--font-display); }
.metric small { display: block; margin-top: var(--s2); color: var(--faint); }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: var(--s4); }
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.panel-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 0 var(--s5); border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font: 800 1.05rem/1.2 var(--font-display); }
.panel-body { padding: var(--s5); }
.feed { display: grid; }
.post { padding: var(--s5); border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post-meta { display: flex; align-items: center; gap: var(--s2); color: var(--muted); font-size: .82rem; }
.post p { margin: var(--s3) 0; line-height: 1.75; }
.post-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tag { display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: .75rem; font-weight: 800; }
.tag.mint { background: var(--mint-deep); color: var(--mint); }
.tag.amber { background: var(--amber-deep); color: var(--amber); }
.activity-list, .task-list, .people-list { display: grid; gap: var(--s2); }
.activity { display: grid; grid-template-columns: 10px 1fr; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.activity:last-child { border-bottom: 0; }
.activity p { margin: 0; line-height: 1.5; }
.activity small { color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s3); margin-bottom: var(--s4); }
.toolbar .field-label { min-width: 180px; flex: 1 1 180px; }
.task { display: grid; grid-template-columns: minmax(200px, 1.4fr) minmax(120px, .6fr) minmax(130px, .55fr) auto; align-items: center; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.task strong { display: block; }
.task small { color: var(--muted); }
.person { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.person .avatar { width: 52px; height: 52px; }
.person h3 { margin: 0 0 var(--s1); }
.person p { margin: 0; color: var(--muted); }
.progress { margin-top: var(--s3); height: 7px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.progress i { display: block; height: 100%; width: var(--progress); background: var(--mint); }
.compose-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .55fr); gap: var(--s4); }
.form-stack { display: grid; gap: var(--s4); }
.counter { text-align: right; color: var(--muted); font-size: .84rem; }
.counter.over { color: var(--red); }
.approval-item { padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.approval-item p { margin: var(--s2) 0; line-height: 1.6; }
.empty { padding: var(--s8); text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-md); }
.assignment { display: grid; grid-template-columns: minmax(0,1fr) repeat(3, minmax(90px, .35fr)); gap: var(--s3); align-items: center; padding: var(--s4); border-bottom: 1px solid var(--line); }
.assignment:last-child { border-bottom: 0; }
.check { display: inline-flex; align-items: center; gap: var(--s2); color: var(--muted); }
.check input { width: 19px; height: 19px; accent-color: var(--mint); }
.toast { position: fixed; z-index: 30; right: var(--s5); bottom: var(--s5); width: min(420px, calc(100vw - 40px)); padding: var(--s4); border: 1px solid var(--mint); border-radius: var(--r-md); background: var(--surface-2); box-shadow: var(--shadow); transform: translateY(20px); opacity: 0; pointer-events: none; transition: opacity var(--speed), transform var(--speed); }
.toast.show { opacity: 1; transform: none; }
.toast strong { display: block; margin-bottom: var(--s1); color: var(--mint); }
.modal { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: var(--s5); background: oklch(0.05 0.02 270 / .74); }
.modal-card { width: min(100%, 520px); padding: var(--s6); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.modal-card h2 { margin-top: 0; }
.modal-card p { color: var(--muted); line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s5); }

@media (max-width: 1050px) {
  .app { grid-template-columns: 260px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-grid, .compose-grid { grid-template-columns: 1fr; }
  .task { grid-template-columns: minmax(180px, 1fr) 120px auto; }
  .task > :nth-child(3) { display: none; }
}
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: 40vh; padding: var(--s8) var(--s5); border-right: 0; border-bottom: 1px solid var(--line); }
  .login-copy h1 { font-size: clamp(2.15rem, 11vw, 3.5rem); }
  .trust-row { margin-top: var(--s8); }
  .login-panel { padding: var(--s8) var(--s5); }
  .app { display: block; }
  .sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: min(88vw, 330px); transform: translateX(-102%); transition: transform var(--speed); box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .topbar { padding-inline: var(--s3); }
  .mobile-menu { display: grid; flex: 0 0 44px; }
  .top-actions .demo-chip { display: none; }
  .page { padding: var(--s5) var(--s4) 96px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 105px; }
  .task { grid-template-columns: 1fr; align-items: start; }
  .task > :nth-child(3) { display: block; }
  .person { grid-template-columns: 48px 1fr; }
  .person > .btn { grid-column: 1 / -1; }
  .assignment { grid-template-columns: 1fr; }
  .assignment strong { margin-bottom: var(--s2); }
}
@media (max-width: 430px) {
  .login-intro { min-height: 0; padding-block: var(--s6); }
  .login-copy { margin-top: var(--s8); }
  .login-copy h1 { font-size: 2.15rem; }
  .login-copy p { font-size: .9rem; line-height: 1.65; }
  .trust-row { display: none; }
  .login-panel { padding: var(--s6) var(--s5); }
  .login-form { margin-top: var(--s5); gap: var(--s4); }
  .demo-note { margin-top: var(--s5); }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 96px; }
  .top-actions .btn { display: none; }
  .panel-head, .panel-body, .post { padding-inline: var(--s4); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
