:root {
  color-scheme: dark;
  --bg: #171012;
  --rail: #1c1417;
  --panel: #241b1e;
  --panel-up: #2b2024;
  --line: #49353c;
  --ink: #f1e5d4;
  --dim: #c3afb0;
  --quiet: #a99498;
  --rose: #e2aca0;
  --red: #934950;
  --green: #96cfb4;
  --blue: #b8c5f3;
  --gold: #e0bd8f;
  --radius: 13px;
  font: 16px/1.55 "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--rose); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; white-space: nowrap; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--panel-up); padding: 8px 13px; }
button:hover { border-color: var(--rose); background: #38272d; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
.primary { background: var(--red); border-color: #b26569; color: #fff7f2; font-weight: 700; }
.primary:hover { background: #a65a61; }
.ghost { background: transparent; border-color: transparent; }
.small { font-size: .875rem; padding: 5px 10px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; padding: 10px; top: 8px; left: 8px; background: var(--panel); }
.layout { display: grid; grid-template-columns: 234px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: auto; border-right: 1px solid #39282e; background: var(--rail); padding: 31px 16px 18px; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 6px 31px; color: var(--ink); text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; }
.brand small { margin-top: 1px; letter-spacing: .19em; color: var(--rose); font: 600 .68rem/1.5 system-ui, sans-serif; }
.emblem { flex: 0 0 42px; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #76454d; border-radius: 10px; background: #48272e; color: var(--rose); }
.emblem span { position: relative; width: 17px; height: 17px; border-inline: 2px solid; border-top: 2px solid; transform: translateY(2px); }
.emblem span::before { position: absolute; content: ""; width: 25px; left: -6px; top: -6px; border-top: 3px solid; border-radius: 50%; }
.emblem span::after { position: absolute; content: ""; width: 21px; left: -4px; top: 4px; border-top: 2px solid; }
.nav-title { margin: 19px 10px 5px; color: var(--quiet); font-size: .8rem; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; margin-block: 3px; border: 1px solid transparent; border-radius: 7px; color: var(--dim); text-decoration: none; white-space: nowrap; font-size: .925rem; }
.nav-link:hover { background: #2a1d22; color: var(--ink); }
.nav-link[aria-current="page"] { background: #40272e; border-color: #603741; color: #ffded4; font-weight: 700; }
.nav-icon { width: 19px; text-align: center; font-size: 1rem; line-height: 1; color: var(--rose); }
.privacy { margin: auto 4px 0; padding: 16px 7px 2px; color: var(--quiet); font-size: .8rem; white-space: nowrap; }
.privacy span { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); }
main { width: min(100%, 1510px); padding: 25px clamp(18px, 3vw, 49px) 52px; margin-inline: auto; }
.top, .actions, .row, .section-title, .toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.top, .section-title { justify-content: space-between; }
.top { margin-bottom: 22px; min-height: 43px; gap: 13px; }
.crumb { display: flex; align-items: center; gap: 10px; color: var(--quiet); font-size: .875rem; }
.crumb span { color: #83606a; }
.crumb strong { color: var(--ink); }
.weekpicker { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; background: #21181b; }
.weekpicker :is(input,button) { border: 0; background: transparent; padding: 7px 9px; }
.weekpicker input { width: 139px; font-size: .875rem; }
.weekpicker button { padding-inline: 10px; color: var(--rose); font-size: 1.15rem; line-height: 1; }
.weekpicker button:hover { background: var(--panel-up); }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: 174px; display: flex; flex-direction: column; justify-content: center; margin-bottom: 20px; padding: 26px clamp(18px, 3vw, 38px); background: radial-gradient(ellipse at 90% 35%, #613037 0, transparent 66%), linear-gradient(112deg,#2b1b20,#392228); border: 1px solid #684047; border-radius: 15px; }
.hero.large { min-height: 202px; }
.hero::after { position: absolute; z-index: -1; content: ""; width: 255px; height: 255px; right: -8px; top: -66px; opacity: .37; border: 1px solid #b4676a; border-radius: 50%; box-shadow: 0 0 0 20px #8d474d33, 0 0 0 21px #a65a5f66, 0 0 0 51px #8d474d22, 0 0 0 52px #a65a5f55, 0 0 0 86px #8d474d22, 0 0 0 87px #a65a5f55; }
.hero h1 { margin: 1px 0 5px; max-width: 25ch; font-family: "Noto Serif KR", "Batang", Georgia, serif; font-size: clamp(1.85rem, 3.6vw, 2.85rem); letter-spacing: -.035em; line-height: 1.3; }
.kicker { margin: 0 0 8px; font-size: .875rem; letter-spacing: .06em; color: var(--rose); }
.hero p:last-child { margin: 6px 0 0; color: #dac2be; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 21px; }
.stat { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 16px 18px 14px; background: var(--panel); border-radius: var(--radius); text-align: left; white-space: normal; }
.stat-label { color: var(--dim); font-size: .875rem; }
.stat strong { font-size: 1.8rem; line-height: 1.25; }
.stat small { grid-column: 1 / -1; font-size: .8rem; color: var(--quiet); }
.stat-icon { grid-column: 2; grid-row: 1 / 3; align-self: center; border-radius: 9px; padding: 5px 9px; background: #3b2b31; color: var(--dim); }
.good { color: var(--green); }
.active { color: var(--blue); }
.late { color: #ffb4aa; }
.wait { color: var(--gold); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.panel + .panel { margin-top: 14px; }
.grid > .panel { margin-top: 0; }
.panel h2 { margin: 0; font-size: 1.05rem; }
.section-title { margin-bottom: 11px; }
.empty { color: var(--quiet); padding: 14px 0; margin: 0; font-size: .875rem; }
.loading { padding: 25px; color: var(--dim); }
.toolbar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 17px; }
.toolbar input { flex: 1 1 145px; }
.item { min-width: 0; padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.item:last-child { padding-bottom: 3px; }
.item strong { font-size: 1rem; }
.item p { margin: 7px 0 0; color: var(--dim); white-space: pre-wrap; }
.item .meta { margin-top: 4px; }
.chip { font-size: .875rem; font-weight: 600; white-space: nowrap; padding: 2px 8px; border-radius: 6px; background: #392d32; color: var(--dim); }
.chip.good,.stat-icon.good { color: var(--green); background: #233a30; }
.chip.active,.stat-icon.active { color: var(--blue); background: #303349; }
.chip.late,.stat-icon.late { color: #ffb4aa; background: #4b292d; }
.chip.wait,.stat-icon.wait { color: var(--gold); background: #433427; }
.meta { color: var(--quiet); font-size: .875rem; }
.flex { flex: 1; }
.part-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 15px; }
.part-list button { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); white-space: normal; text-align: left; }
.part-list span { color: var(--quiet); font-size: .85rem; white-space: nowrap; }
.counts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
input, select, textarea { min-width: 0; border: 1px solid #604853; border-radius: 7px; color: var(--ink); background: #1c1417; padding: 7px 9px; }
select { appearance: none; padding-right: 29px; background-image: linear-gradient(45deg,transparent 50%,#c7a2a7 50%),linear-gradient(135deg,#c7a2a7 50%,transparent 50%); background-size: 5px 5px; background-position: right 13px center,right 8px center; background-repeat: no-repeat; }
dialog { width: min(650px,94vw); max-height: 88dvh; padding: 0; color: var(--ink); background: var(--panel); border: 1px solid #71454e; border-radius: 15px; }
dialog::backdrop { background: #10090cbb; }
.dialog-heading,.dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 20px; background: var(--panel); position: sticky; z-index: 1; }
.dialog-heading { top: 0; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin: 0; font-size: 1.25rem; }
.dialog-heading button { font-size: 1.35rem; line-height: 1; }
.dialog-actions { bottom: 0; justify-content: flex-end; border-top: 1px solid var(--line); }
.fields { padding: 16px 20px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.fields label { display: grid; align-content: start; gap: 5px; color: var(--dim); font-size: .875rem; }
.fields :is(input,textarea,select) { width: 100%; font-size: 1rem; }
.wide { grid-column: 1 / -1; }
textarea { resize: vertical; min-height: 85px; }
.error { margin: 0 20px 16px; color: #ffb4a8; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th, td { border-top: 1px solid var(--line); vertical-align: top; padding: 9px 8px; }
th { color: var(--dim); }
th:first-child, td:first-child { padding-left: 0; }
td:first-child { min-width: 98px; }
@media (max-width: 950px) {
  .layout { grid-template-columns: 193px minmax(0, 1fr); }
  .rail { padding-inline: 11px; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .layout { display: block; }
  .rail { position: static; height: auto; overflow: visible; padding: 12px 14px 4px; border: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 0 7px; }
  .rail nav { display: flex; gap: 5px; overflow-x: auto; padding: 0 3px 3px; }
  .nav-title, .nav-icon, .privacy { display: none; }
  .nav-link { flex-shrink: 0; }
  main { padding: 14px 14px 35px; }
  .top { margin-bottom: 14px; }
  .hero,.hero.large { min-height: 147px; }
  .hero::after { right: -132px; opacity: .27; }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .weekpicker input { width: 125px; }
  .top .primary { padding-inline: 7px; }
  .fields { grid-template-columns: 1fr; }
  .stat { padding: 11px; }
}
.compare-grid { margin-top: 14px; }
.dialog-actions[hidden] { display: none; }
[hidden] { display: none !important; }
#authView { min-height:100vh; display:grid; place-items:center; padding:18px; }
.auth-card { width:min(100%,420px); padding:26px; }
.auth-card h1 { margin:0; font-family:"Noto Serif KR","Batang",Georgia,serif; }
.auth-card form, .auth-card label { display:grid; gap:8px; }
.auth-card form { margin-block:16px; gap:12px; }
.auth-card input { width:100%; }
.auth-card .row { margin-top:12px; }
.viewer { margin:6px 10px; font-size:.875rem; color:var(--dim); overflow-wrap:anywhere; }
#signOut { align-self:flex-start; margin-left:1px; }
.board-group h3 { font-size:.9rem; color:var(--dim); margin:10px 0 4px; }
.board-group + .board-group { border-top:1px solid var(--line); margin-top:10px; }
.record-actions { margin:8px 20px; }
.record-actions select[multiple], .fields select[multiple] { min-height:86px; background-image:none; }
.fields input[type="checkbox"] { width:auto; justify-self:start; }
.scrum-entry { margin:6px 0 0; }
.scrum-entry dt { color:var(--dim); font-size:.875rem; font-weight:700; }
.scrum-entry dd { margin:0 0 5px; white-space:pre-wrap; }
.history-content { max-height:280px; overflow:auto; }
.history-content pre { white-space:pre-wrap; overflow-wrap:anywhere; }
.auth-links { margin-left:-8px; }
@media(max-width:720px) { #signOut,.viewer { display:inline-flex; margin-block:4px 7px; } }
