:root {
  --paper: #F3F5F7;
  --surface: #FFFFFF;
  --ink: #14243A;
  --ink-2: #4B5969;
  --ink-3: #7A8796;
  --line: #D8DEE5;
  --line-2: #E7EBEF;
  --blue: #2C5C8F;
  --grain: #9FB8D3;
  --live: #9A5F0E;
  --live-bg: #FBF1E1;
  --review: #2C5C8F;
  --review-bg: #E6EEF7;
  --final: #2B6747;
  --final-bg: #E3F1E8;
  --danger: #A23B2A;
  --danger-bg: #F8E6E2;
  --brand: #1F4E79;
  --radius-lg: 14px;
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  /* Static (non-variable) Pretendard for the printed board: Chrome turns variable fonts into blurry Type 3 glyphs in PDFs. */
  --print-font: Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  font-feature-settings: "tnum" 1;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--grain); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shared controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4em;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  border-radius: var(--radius-sm); padding: .55em 1em; font-weight: 600; cursor: pointer;
  text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn:hover { background: #22385a; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.quiet:hover { border-color: var(--ink-3); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.small { padding: .35em .7em; font-size: 14px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { color: var(--ink-3); font-size: 13px; }
input[type=email], input[type=text], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm);
  padding: .55em .7em;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--review-bg); }
.code-input { font-size: 28px; letter-spacing: .35em; text-align: center; font-weight: 700; }

.msg { border-radius: var(--radius-sm); padding: .7em .9em; margin: 0 0 14px; font-size: 14px; }
.msg.err { background: var(--danger-bg); color: var(--danger); }
.msg.ok { background: var(--final-bg); color: var(--final); }

.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: .15em .6em; border-radius: 99px; white-space: nowrap; }
.chip.live { background: var(--live-bg); color: var(--live); }
.chip.review { background: var(--review-bg); color: var(--review); }
.chip.final { background: var(--final-bg); color: var(--final); }
.chip.muted { background: var(--line-2); color: var(--ink-2); }
.chip.warn { background: var(--danger-bg); color: var(--danger); }

/* ---------- Portal (gyeoldesk.com) ---------- */
.portal { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.portal-hero {
  position: relative; overflow: hidden; background: var(--ink); color: #fff;
  padding: clamp(56px, 10vw, 120px) clamp(20px, 6vw, 72px) clamp(48px, 8vw, 96px);
}
.portal-hero .grain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.portal-hero .grain path { fill: none; stroke: var(--grain); stroke-width: 1.2; stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 2.4s ease-out forwards; }
.portal-hero .grain path:nth-child(2n) { animation-delay: .15s; opacity: .7; }
.portal-hero .grain path:nth-child(3n) { animation-delay: .3s; opacity: .5; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.wordmark { position: relative; display: flex; align-items: baseline; gap: .25em; margin: 0; line-height: 1; }
.wordmark .ko { font-size: clamp(88px, 16vw, 168px); font-weight: 800; letter-spacing: -.04em; }
.wordmark .en { font-size: clamp(22px, 3.2vw, 34px); font-weight: 500; color: var(--grain); letter-spacing: -.01em; }
.portal-hero p { position: relative; max-width: 34em; margin: 22px 0 0; color: #C9D6E4; font-size: clamp(16px, 1.8vw, 19px); }
.portal-main { padding: 40px clamp(20px, 6vw, 72px) 56px; max-width: 1180px; width: 100%; }
.portal-main h2 { font-size: 18px; margin: 0 0 18px; font-weight: 700; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.org-card {
  display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 18px; text-decoration: none; color: var(--ink);
}
.org-card:hover { border-color: var(--ink-3); }
.org-card .name { font-weight: 700; font-size: 17px; line-height: 1.3; }
.org-card .sub { color: var(--ink-3); font-size: 14px; }
.org-logo { width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: var(--brand); color: #fff; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.org-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.portal-foot { padding: 20px clamp(20px, 6vw, 72px); color: var(--ink-3); font-size: 13px; }

/* ---------- Workspace ---------- */
.top {
  position: sticky; top: 0; z-index: 5; background: rgba(243, 245, 247, .94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px clamp(16px, 4vw, 32px); display: flex; align-items: center; gap: 14px; }
.top .org { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
.top .org .org-logo { width: 34px; height: 34px; border-radius: 8px; font-size: 12px; flex: none; }
.top .org .org-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang { flex: none; }
.lang button { white-space: nowrap; }
.who { white-space: nowrap; }
.top .crumb { color: var(--ink-3); font-weight: 500; }
.top .spacer { flex: 1; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.lang button { border: 0; background: transparent; padding: .25em .7em; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-3); }
.lang button[aria-pressed=true] { background: var(--ink); color: #fff; }
.who { font-size: 13px; color: var(--ink-3); }
.who button { border: 0; background: none; color: var(--blue); cursor: pointer; padding: 0 0 0 8px; font-size: 13px; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 32px) 64px; }
.page h1 { font-size: clamp(24px, 3vw, 30px); letter-spacing: -.02em; margin: 0 0 6px; }
.page .lede { color: var(--ink-2); margin: 0 0 24px; max-width: 46em; }

/* Sign-in */
.gate { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; }
.gate-card h1 { font-size: 22px; margin: 0 0 4px; }
.gate-card p { color: var(--ink-2); margin: 0 0 20px; font-size: 15px; }
.gate-card .btn { width: 100%; justify-content: center; padding: .75em 1em; }
.linkish { border: 0; background: none; color: var(--blue); cursor: pointer; padding: 0; font-size: 14px; }

/* Home tiles */
.tiles { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.tile {
  grid-column: span 4; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; min-height: 150px;
}
a.tile:hover { border-color: var(--ink-3); }
.tile.main { grid-column: span 8; grid-row: span 2; background: var(--ink); color: #fff; border-color: var(--ink); position: relative; overflow: hidden; min-height: 316px; }
.tile.main:hover { border-color: var(--blue); }
.tile.main .grain { position: absolute; right: -40px; bottom: -30px; width: 70%; opacity: .35; }
.tile.main .grain path { fill: none; stroke: var(--grain); stroke-width: 1.4; }
.tile h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.tile.main h2 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -.03em; }
.tile p { margin: 0; color: var(--ink-2); font-size: 15px; }
.tile.main p { color: #C9D6E4; max-width: 28em; position: relative; }
.tile .stat { margin-top: auto; padding-top: 10px; position: relative; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tile.soon { color: var(--ink-3); background: transparent; border-style: dashed; }
.tile.soon h2 { color: var(--ink-2); }

/* WAR */
.war-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.war-head .title { flex: 1; min-width: 260px; }
.war-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.weeks { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 0 0 20px; }
.weeks a {
  flex: none; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius); padding: 8px 12px; display: grid; gap: 2px; min-width: 112px;
}
.weeks a[aria-current=page] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.weeks .d { font-weight: 700; }
.weeks .chip { justify-self: start; }
.war-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.war-tools input[type=search] { max-width: 280px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); }

.items { display: grid; gap: 14px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.item-head { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: start; padding: 16px 18px 6px; }
.item-no { font-size: 26px; font-weight: 800; color: var(--grain); line-height: 1; letter-spacing: -.03em; }
.item-key { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.item-title { font-size: 18px; font-weight: 700; line-height: 1.35; margin: 2px 0 0; }
.item-body { padding: 4px 18px 16px 80px; }
.item-body ul { margin: 0; padding-left: 1.1em; }
.item-body li { margin: 4px 0; }
.item-body li.sub { list-style: none; margin-left: -.2em; color: var(--ink-2); }
.item-body .alt { color: var(--ink-3); font-size: 14px; }
.kd { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.kd th, .kd td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line-2); vertical-align: top; }
.kd th { color: var(--ink-3); font-weight: 600; font-size: 13px; }
.kd td:first-child { white-space: nowrap; font-weight: 600; width: 1%; }
.internal { margin: 0 18px 16px 80px; border-left: 3px solid var(--live); background: var(--live-bg); border-radius: 0 var(--radius) var(--radius) 0; padding: 10px 14px; font-size: 14px; }
.internal h3 { margin: 0 0 4px; font-size: 13px; color: var(--live); }
.internal ul { margin: 0 0 6px; padding-left: 1.1em; }
.internal .done { text-decoration: line-through; color: var(--ink-3); }

/* Access dashboard */
.summary { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 22px; }
.summary div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 130px; }
.summary .sumbtn { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 130px; text-align: left; cursor: pointer; }
.summary .sumbtn:hover { border-color: var(--ink-3); }
.summary b { display: block; font-size: 24px; line-height: 1.1; }
.summary span { color: var(--ink-3); font-size: 13px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 22px; overflow: hidden; }
.panel > header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel > header h2 { margin: 0; font-size: 17px; flex: 1; }
.roster { width: 100%; border-collapse: collapse; font-size: 14px; }
.roster th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 8px 12px; background: #FAFBFC; border-bottom: 1px solid var(--line); }
.roster td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.roster tr.team td { background: #F7F9FB; font-weight: 700; color: var(--ink-2); font-size: 13px; padding-top: 12px; }
.roster tr.off td:not(.keep) { color: var(--ink-3); }
.roster .nm { font-weight: 600; }
.roster .nm small { display: block; color: var(--ink-3); font-weight: 400; }
.roster .note { color: var(--ink-3); font-size: 12px; }
.roster input[type=email] { min-width: 200px; padding: .4em .6em; }
.roster select { width: auto; padding: .4em .5em; }
.roster input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); }
.roster .saved { color: var(--final); font-size: 12px; }
.roster .err { color: var(--danger); font-size: 12px; }
.addrow { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr 1fr 1.4fr auto; gap: 8px; padding: 14px 16px; align-items: end; }
.req { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); align-items: center; }
.req:last-child { border-bottom: 0; }
.req .act { display: flex; gap: 8px; align-items: center; }
.req select { width: auto; }
.empty { padding: 18px 16px; color: var(--ink-3); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .6em 1em; border-radius: var(--radius); font-size: 14px; z-index: 20; }

@media (max-width: 860px) {
  .tile, .tile.main { grid-column: span 12; }
  .tile.main { min-height: 230px; }
  .item-body, .internal { padding-left: 18px; margin-left: 18px; }
  .item-body { margin-left: 0; }
  .roster thead { display: none; }
  .roster, .roster tbody, .roster tr, .roster td { display: block; width: 100%; }
  .roster tr:not(.team) { padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
  .roster td { border: 0; padding: 3px 0; }
  .roster td.inl { display: inline-block; width: auto; margin-right: 12px; vertical-align: middle; }
  .req { grid-template-columns: 1fr; }
  .top .org .org-name { max-width: 40vw; }
  .top-in { gap: 8px; }
  .roster input[type=email] { min-width: 0; }
  .addrow { grid-template-columns: 1fr 1fr; }
  .top .crumb, .who .addr { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-hero .grain path { animation: none; stroke-dashoffset: 0; }
}
@media print {
  .top, .war-tools, .weeks, .war-head .actions, .no-print { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .page { padding: 0; max-width: none; }
  .item { break-inside: avoid; border-color: #bbb; }
  .internal { display: none; }
}

/* Company logos */
.org-img { display: block; object-fit: contain; }
.org-img.mark { height: 28px; width: auto; max-width: 90px; }
.org-img.wide { height: 56px; width: auto; max-width: 100%; }
.org-card.has-logo { grid-template-columns: 1fr; gap: 12px; padding: 22px; }
.gate-logo { margin-bottom: 18px; }
.gate-logo .org-img.wide { height: 52px; }
.gate-logo .org-logo { width: 56px; height: 56px; }

/* WAR Board */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.stage { margin: 22px 0 8px; }
.stage > h2 { font-size: 17px; margin: 0 0 10px; letter-spacing: -.01em; }
.stage > h2 span { font-weight: 400; color: var(--ink-3); font-size: 13px; margin-left: 6px; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.bcard {
  position: relative; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--stage); border-radius: 4px 4px var(--radius) var(--radius);
  padding: 12px 14px 14px; min-height: 230px;
}
.bcard:hover { border-color: var(--ink-3); border-top-color: var(--stage); }
.bcard:focus-visible { outline-offset: 3px; }
.bc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.bc-key { font-weight: 800; letter-spacing: .01em; }
.bc-stage { margin-left: auto; color: var(--stage); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.prime { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; background: var(--line-2); color: var(--ink-2); }
.prime-krima { background: #E8EEF6; color: #2A4F7F; }
.prime-livart { background: #F1E9F6; color: #6B3B86; }
.prime-gnc { background: #12165A; color: #fff; }
.bcard h3 { margin: 0; font-size: 16.5px; line-height: 1.3; letter-spacing: -.01em; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; background: #F3F5F7; border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12.5px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
.bcard ul.clamp { margin: 0; padding-left: 1em; font-size: 13.5px; line-height: 1.45; }
.bcard ul.clamp li { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0; }
.bc-dates { margin-top: auto; border-top: 1px dashed var(--line); padding-top: 8px; display: grid; gap: 3px; font-size: 12.5px; }
.bc-dates div { display: grid; grid-template-columns: minmax(52px, max-content) 1fr; gap: 8px; }
.bc-dates b { white-space: nowrap; }
.bc-dates b { color: var(--danger); }
.bc-carried { align-self: flex-start; margin-top: 8px; }

/* Project detail */
.detail { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--stage); border-radius: 6px 6px var(--radius-lg) var(--radius-lg); padding: 20px clamp(16px, 3vw, 28px) 24px; max-width: 900px; }
.detail .bc-stage { margin-left: 4px; }
.detail .spacer { flex: 1; }
.detail h1 { margin: 10px 0 2px; font-size: clamp(22px, 3vw, 28px); letter-spacing: -.02em; }
.detail .alt { color: var(--ink-3); margin: 0 0 8px; font-size: 14px; }
.detail .facts { margin: 14px 0 6px; font-size: 14px; max-width: 560px; }
.detail section { margin-top: 22px; }
.detail section h2 { font-size: 15px; margin: 0 0 8px; }
.detail ul { margin: 0; padding-left: 1.15em; }
.detail li { margin: 5px 0; }
.detail li.sub { list-style: none; color: var(--ink-2); }
.sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sec-head h2 { flex: 1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.altcol { color: var(--ink-2); border-left: 1px solid var(--line); padding-left: 18px; }
.detail .internal { margin: 22px 0 0; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } .altcol { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; } }

.bc-top { flex-wrap: nowrap; }
.bc-key, .bc-stage { white-space: nowrap; }
.bcard ul.clamp { list-style: none; padding-left: 0; }
.bcard ul.clamp li { position: relative; padding-left: .9em; }
.bcard ul.clamp li::before { content: "•"; position: absolute; left: 0; color: var(--ink-3); }
.prime { white-space: nowrap; flex: none; }
.bc-top { gap: 5px; }
.bc-key { font-size: 11.5px; }
.bc-stage { font-size: 10.5px; letter-spacing: .03em; }

/* Company desk */
.desk { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dtile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; min-height: 190px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; text-decoration: none; color: var(--ink);
}
.dtile:hover { border-color: var(--ink-3); }
.dtile.main { background: var(--ink); color: #fff; border-color: var(--ink); }
.dtile.main p { color: #C9D6E4; }
.dtile .grain { position: absolute; right: -40px; bottom: -30px; width: 70%; opacity: .3; }
.dtile .grain path { fill: none; stroke: var(--grain); stroke-width: 1.4; }
.dtile h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; position: relative; }
.dtile p { margin: 0; color: var(--ink-2); max-width: 30em; position: relative; }
.dtile .stat { margin-top: auto; display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; position: relative; }
.dtile .num { font-size: 14px; color: inherit; opacity: .85; }
.dtile .num b { font-size: 26px; margin-right: 6px; opacity: 1; }
.qstrip { display: block; margin-top: 16px; background: var(--live-bg); color: var(--live); border-radius: var(--radius); padding: 12px 16px; text-decoration: none; font-weight: 600; }
.qstrip b { font-size: 18px; margin-right: 4px; }
@media (max-width: 760px) { .desk { grid-template-columns: 1fr; } }

/* Tags */
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.inst { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-2); background: #fff; white-space: nowrap; }
.inst.muted { color: var(--ink-3); }

/* Menu */
.menu { position: relative; }
.menu > button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); width: 36px; height: 34px; font-size: 18px; cursor: pointer; }
.menu nav { position: absolute; right: 0; top: 42px; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; display: grid; box-shadow: 0 8px 24px rgba(20, 36, 58, .12); z-index: 10; }
.menu nav a, .menu nav .soon-item { padding: 9px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-size: 14px; }
.menu nav a:hover { background: var(--paper); }
.menu nav .soon-item { color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; }

/* Project page */
.records { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.rec { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 14px; }
.ask { display: grid; gap: 8px; justify-items: start; }
.ask textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6em .7em; resize: vertical; }
.q { border-top: 1px solid var(--line-2); padding: 12px 0; }
.q-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.q-meta b { color: var(--ink); }
.q p { margin: 6px 0 0; white-space: pre-wrap; }
.q-ans { background: var(--final-bg); border-radius: var(--radius-sm); padding: 8px 10px; }
.ans { display: flex; gap: 8px; margin-top: 8px; }
#qlist > .q:first-child { margin-top: 10px; }
.menu nav[hidden] { display: none; }
.bcard.pcard { min-height: 0; }

/* Detail header wraps on small screens */
.detail .bc-top { flex-wrap: wrap; row-gap: 6px; }
.detail .item-key { white-space: normal; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

/* ---------- Printed WAR Board (landscape) ---------- */
#print-root { display: none; }
#print-root.measure { display: block; position: absolute; left: -20000px; top: 0; width: 1017px; background: #fff; }
/* JPG download: the same sheet at 1017 px content width plus a white margin, drawn off screen and captured at 3x. */
#print-root.snap { display: block; position: absolute; left: -20000px; top: 0; width: 1061px; padding: 18px 22px; background: #fff; }
#print-root { font: 400 7.4pt/1.28 var(--print-font); color: #111; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#print-root .pb-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2pt solid #111; padding-bottom: 4pt; }
#print-root .pb-eyebrow { color: #B4532A; font-weight: 700; font-size: 7pt; letter-spacing: .08em; }
#print-root .pb-head h1 { margin: 1pt 0 0; font-size: 18pt; letter-spacing: -.02em; line-height: 1.1; }
#print-root .pb-date { text-align: right; }
#print-root .pb-date b { display: block; font-size: 11pt; letter-spacing: .04em; }
#print-root .pb-date span { color: #555; font-size: 7pt; }
#print-root .pb-legend { display: flex; gap: 10pt; margin: 5pt 0 6pt; font-size: 7pt; color: #333; align-items: center; }
#print-root .pb-legend i { display: inline-block; width: 7pt; height: 7pt; margin-right: 3pt; vertical-align: -1pt; }
#print-root .pb-note { color: #777; }
#print-root .pb-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); column-gap: 5pt; margin-bottom: 6pt; break-inside: avoid; page-break-inside: avoid; }
#print-root .pb-sec { display: grid; grid-template-rows: auto 1fr; min-width: 0; }
#print-root .pb-sec h2 { font-size: 8.5pt; margin: 0 0 3pt; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#print-root .pb-sec h2 span { font-weight: 400; color: #666; font-size: 6.5pt; margin-left: 3pt; }
#print-root .pb-cards { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); column-gap: 5pt; }
#print-root .pc { border: .6pt solid #c9cdd2; border-top: 2.4pt solid var(--stage); padding: 4pt 5pt; display: flex; flex-direction: column; gap: 2.5pt; min-width: 0; }
#print-root .pc-top { display: flex; justify-content: space-between; align-items: center; gap: 3pt; font-weight: 700; font-size: 6.8pt; white-space: nowrap; }
#print-root .pc-top > span:first-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#print-root .pc-top .prime { font-size: 5.6pt; padding: 0 2.5pt; flex: none; }
#print-root .pc-stage { color: var(--stage); font-weight: 700; font-size: 6pt; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#print-root .pc-pid { color: #111; letter-spacing: .02em; margin-right: 2pt; }
#print-root .pc-inst { color: #666; font-weight: 600; text-transform: none; letter-spacing: 0; margin-left: 3pt; }
#print-root .pc-title { font-weight: 700; font-size: 8.4pt; line-height: 1.18; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#print-root .pc-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 4pt; margin: 0; background: #F1F3F5; padding: 2pt 4pt; font-size: 6.2pt; }
#print-root .pc-facts dt { color: #666; }
#print-root .pc-facts dd { margin: 0; overflow-wrap: anywhere; }
#print-root .pc ul { margin: 0; padding-left: 7pt; font-size: 6.6pt; }
#print-root .pc li { margin: 0 0 1pt; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#print-root .pc-dates { margin-top: auto; border-top: .6pt dashed #c9cdd2; padding-top: 2.5pt; font-size: 6.2pt; display: grid; gap: 1pt; }
#print-root .pc-dates div { display: grid; grid-template-columns: minmax(24pt, max-content) minmax(0, 1fr); gap: 3pt; }
#print-root .pc-dates b { white-space: nowrap; }
#print-root .pc-dates span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#print-root .pc-dates b { color: #B42318; }
#print-root .pb-foot { display: flex; justify-content: space-between; border-top: .6pt solid #ccc; margin-top: 4pt; padding-top: 3pt; font-size: 6.2pt; color: #666; }
@media print {
  @page { size: A4 landscape; margin: 12mm 14mm; }
  body.printing-board #app { display: none !important; }
  body.printing-board #print-root { display: block; position: static; width: auto; }
  body.printing-board { background: #fff; }
  body:not(.printing-board) .top, body:not(.printing-board) .no-print, body:not(.printing-board) .war-tools,
  body:not(.printing-board) .weeks, body:not(.printing-board) .war-head .actions { display: none !important; }
}

/* ---------- Phones ---------- */
html, body { max-width: 100%; overflow-x: hidden; }
.top-in { min-width: 0; }
.top .org { min-width: 0; flex: 0 1 auto; }
.menu-out { border: 0; background: none; text-align: left; padding: 9px 10px; border-top: 1px solid var(--line-2); margin-top: 4px; cursor: pointer; font-size: 14px; color: var(--danger); display: grid; }
.menu-out small { color: var(--ink-3); font-size: 12px; }
.board, .records, .org-grid { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
@media (max-width: 640px) {
  .top-in { gap: 8px; padding: 8px 12px; }
  .top .who, .top .crumb { display: none; }
  .top .org .org-name { display: none; }
  .top .org .org-img.mark { height: 24px; }
  .lang button { padding: .25em .55em; }
  .page { padding: 18px 14px 48px; }
  .dtile { min-height: 0; padding: 18px; }
  .dtile h2 { font-size: 24px; }
  .dtile .num b { font-size: 22px; }
  .war-head .actions { width: 100%; }
  .war-tools input[type=search] { max-width: none; }
  .detail { padding: 16px 14px 20px; }
  .facts { font-size: 12.5px; }

  .summary div, .summary .sumbtn { min-width: calc(50% - 6px); }
  .addrow { grid-template-columns: 1fr; }
  .gate-card { padding: 22px 18px; }
  .wordmark .ko { font-size: 88px; }
}
.req > div { min-width: 0; }
.req .act { flex-wrap: wrap; }
@media (max-width: 640px) { .req .act select { max-width: 100% !important; flex: 1 1 100%; } }
.kd th:first-child, .kd td:first-child { white-space: nowrap; width: 1%; padding-right: 12px; }
@media (max-width: 640px) { .kd { font-size: 13px; } .kd th, .kd td { padding: 6px 4px; } }

/* Project records */
a.rec { text-decoration: none; color: var(--ink); background: #fff; }
a.rec:hover { border-color: var(--ink-3); }
a.rec.empty-rec { color: var(--ink-3); }
.recgroup { margin-top: 18px; }
.recgroup h2 { font-size: 15px; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.reclist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.recrow { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line-2); }
.recrow:first-child { border-top: 0; }
.rr-main { min-width: 0; display: grid; gap: 2px; }
.rr-main b { font-weight: 600; overflow-wrap: anywhere; }
.rr-meta { color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }
.rr-main details { font-size: 13px; color: var(--ink-2); }
.rr-main details p { margin: 4px 0 0; white-space: pre-wrap; }
.recrow .btn { flex: none; }

/* Question threads */
.qcard { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--live); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; display: grid; gap: 10px; }
.qcard.is-done { border-left-color: var(--final); }
.q-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.q-proj { font-weight: 700; }
.msgb { border-radius: var(--radius); padding: 10px 12px; }
.msgb.ask { background: #F3F5F7; }
.msgb.reply { background: var(--final-bg); margin-left: clamp(0px, 4vw, 32px); }
.msgb-who { font-size: 13px; color: var(--ink-3); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.msgb-who b { color: var(--ink); }
.who-role { font-weight: 700; text-transform: none; color: var(--ink-2); }
.msgb.reply .who-role { color: var(--final); }
.msgb p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.qcard .ans { display: grid; gap: 6px; justify-items: start; margin: 0; }
.qcard .ans textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5em .7em; resize: vertical; }
.q-wait { margin: 0; font-size: 13px; color: var(--ink-3); }

.rec-help { margin: -2px 0 8px; font-size: 13px; color: var(--ink-3); max-width: 60em; }
.q-del { margin-left: auto; border: 0; background: none; color: var(--danger); font-size: 13px; cursor: pointer; padding: 2px 4px; }
.q-del:hover { text-decoration: underline; }

/* Portal: features, footer, no-JS content */
.features h2 { font-size: 18px; margin: 0 0 14px; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.feat { border-top: 3px solid var(--grain); padding-top: 10px; }
.feat h3 { margin: 0 0 4px; font-size: 16px; }
.feat p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.contact { margin: 22px 0 0; color: var(--ink-2); }
.portal-foot { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.portal-foot img { display: block; }
.seo { max-width: 720px; margin: 0 auto; padding: 48px 20px; }

/* Team access: invite email state */
.roster .inv { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
.linkbtn:disabled { opacity: .5; cursor: default; }

/* Gyeoldesk footer on every page; sits at the bottom of short pages */
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
#app > .portal, #app > .page, #app > .gate { flex: 1 0 auto; width: 100%; }
.site-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 16px clamp(16px, 4vw, 32px); border-top: 1px solid var(--line); background: var(--paper); color: var(--ink-3); font-size: 12.5px; }
.site-foot .sf-brand img { display: block; }
.site-foot .sf-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.site-foot a { color: inherit; }
@media (max-width: 640px) {
  .site-foot { flex-direction: column; align-items: flex-start; }
  .site-foot .sf-right { margin-left: 0; }
}
@media print { .site-foot { border-top: 1px solid #ccc; padding: 8px 0; background: none; } }
.gate { min-height: calc(100dvh - 180px); }

/* preview.gyeoldesk.com only */
.preview-bar { position: sticky; top: 0; z-index: 50; height: 28px; line-height: 28px; background: #F0B445; color: #14243A; font: 700 12.5px var(--font); text-align: center; padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-bar ~ #app .top { top: 28px; }
@media print { .preview-bar { display: none; } }

/* WAR-first: tiles not open yet */
.dtile.soon { cursor: default; background: var(--paper, #F3F5F7); border-style: dashed; color: var(--ink-3); }
.dtile.soon:hover { border-color: var(--line); }
.dtile.soon h2 { color: var(--ink-2); }
.soon-page { max-width: 560px; margin: 40px auto; display: grid; gap: 12px; justify-items: start; }
.soon-page h1 { margin: 0; }
/* working-draft note on the WAR board */
.draft-note { margin: 4px 0 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--ink-2); font-size: 14px; }
/* print: company logo + draft mark */
.pb-brand { display: flex; align-items: center; gap: 14px; }
.pb-logo { height: 40px; width: auto; display: block; }
.pb-draft { display: block; margin-top: 3px; font-weight: 800; color: #9A5B0F; letter-spacing: .02em; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 18px; }
.photo-grid figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; break-inside: avoid; }
.photo-grid img { display: block; width: 100%; height: 210px; object-fit: contain; background: #f4f5f7; }
.photo-grid figcaption { padding: 12px; overflow-wrap: anywhere; }
.photo-grid time { font-size: 13px; color: var(--ink-2); }
.photo-grid p { margin: 8px 0; }
.photo-unavailable { padding: 20px; }
.war-photos .photo-status { max-width: 52em; }
@media print { .photo-grid { grid-template-columns: repeat(2,1fr); } .photo-grid img { height: 160px; } }

/* ---------------------------------------------------------------- Contacts */
.ct-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ct-bar input[type=search] { flex: 1 1 240px; max-width: 360px; }
.ct-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; background: var(--surface); }
.ct-tabs a { padding: .4em 1em; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.ct-tabs a[aria-current=page] { background: var(--ink); color: #fff; }
.ct-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.ct-chips a { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: .25em .75em; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.ct-chips a[aria-current=page] { border-color: var(--ink); background: var(--ink); color: #fff; }
.ct-proj h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.ct-proj p { margin: 2px 0 14px; color: var(--ink-2); }
.ct-lists { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 20px; }
.ct-lists h3 { margin: 0 0 8px; font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.ct-list { display: grid; grid-template-columns: 84px 1fr auto; gap: 8px; align-items: start; padding: 4px 0; font-size: 14px; }
.ct-list code { font-family: inherit; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; user-select: all; }
.btn.sm { padding: .2em .7em; font-size: 12px; }
.ct-group { margin: 0 0 22px; }
.ct-group > h2 { font-size: 15px; margin: 0 0 10px; color: var(--ink); }
.ct-group > h2 span { color: var(--ink-3); font-weight: 500; font-size: 13px; margin-left: 6px; }
.ct-org-mail { margin: -6px 0 10px; font-size: 13px; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.ct-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ct-head { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.ct-head h3 { margin: 0; font-size: 15px; }
.ct-head .alt { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.chip.dist { background: var(--review-bg); color: var(--review); }
.chip.auth-ko { background: var(--danger-bg); color: var(--danger); }
.chip.auth-cor { background: var(--line-2); color: var(--ink-2); }
.chip.auth-site { background: var(--final-bg); color: var(--final); }
.ct-title, .ct-role { margin: 0; font-size: 13px; color: var(--ink-2); }
.ct-role { color: var(--ink); font-weight: 600; }
.ct-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.ct-lines { font-size: 13px; display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.ct-mail a { overflow-wrap: anywhere; }
#ctStat { display: contents; }
.ct-mail.none { color: var(--live); }
.ct-ph span { display: inline-block; min-width: 74px; color: var(--ink-3); }
.ct-priv { border-left: 3px solid var(--danger-bg); padding-left: 6px; }
.ct-note, .ct-esc, .ct-ver { margin: 0; font-size: 12px; color: var(--ink-3); }
.ct-esc { color: var(--ink-2); }
.ct-ended { margin: 6px 0 20px; }
.ct-ended summary { cursor: pointer; color: var(--ink-2); font-size: 14px; margin-bottom: 10px; }
.ct-ended .ct-card { opacity: .75; }
@media (max-width: 760px) {
  .ct-list { grid-template-columns: 1fr auto; }
  .ct-list b { grid-column: 1 / -1; }
  .ct-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
}

/* Back-to-top arrow */
.to-top {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 50; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  box-shadow: 0 4px 14px rgba(20, 36, 58, .25);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: #22385a; }
.to-top:focus-visible { outline: 3px solid #8fb3e0; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
@media print { .to-top { display: none !important; } }
@media (max-width: 640px) { .site-foot { padding-bottom: 76px; } }
.war-photos .photo-status { white-space: pre-line; }

/* WAR stage stepper (filter) */
.stepper { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; flex-wrap: wrap; }
.stepper .st-all { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: .4em .9em; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); min-height: 40px; }
.stepper .st-all b { margin-left: 4px; }
.stepper .st-all[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.stepper ol { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; min-width: 0; position: relative; }
.stepper ol::before { content: ""; position: absolute; left: 10%; right: 10%; top: 12px; height: 2px; background: var(--line); }
.stepper li { flex: 1; min-width: 0; position: relative; }
.stepper li button { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; display: grid; justify-items: center; gap: 3px; padding: 2px 2px 6px; color: var(--ink-2); border-radius: var(--radius); min-height: 44px; }
.stepper li button i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--stage); background: var(--surface); position: relative; z-index: 1; margin-top: 3px; }
.stepper li button span { font-size: 13px; font-weight: 600; text-align: center; line-height: 1.2; }
.stepper li button b { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.stepper li button[aria-pressed="true"] { color: var(--ink); }
.stepper li button[aria-pressed="true"] i { background: var(--stage); box-shadow: 0 0 0 4px color-mix(in srgb, var(--stage) 20%, transparent); }
.stepper li button[disabled] { opacity: .45; cursor: default; }
.stepper li button:not([disabled]):hover span { color: var(--ink); }
.sortsel { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.sortsel select { width: auto; padding: .4em .6em; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-left: auto; }
.seg button { border: 0; background: var(--surface); font: inherit; font-size: 14px; padding: .45em .9em; cursor: pointer; color: var(--ink-2); min-height: 38px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Compact project list */
.plist { display: grid; gap: 8px; }
.prow { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--stage); border-radius: var(--radius); }
.prow > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "key prime title stage" "next next next chip"; gap: 4px 8px; align-items: center; padding: 10px 14px; }
.prow > summary::-webkit-details-marker { display: none; }
.prow > summary:hover { background: var(--line-2); }
.pr-key { grid-area: key; font-size: 12px; font-weight: 800; white-space: nowrap; }
.prow .prime { grid-area: prime; }
.pr-title { grid-area: title; font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-stage { grid-area: stage; color: var(--stage); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.pr-next { grid-area: next; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-next b { color: var(--danger); font-weight: 700; margin-right: 4px; }
.prow > summary .chip { grid-area: chip; justify-self: end; }
.prow[open] > summary { border-bottom: 1px solid var(--line-2); }
.ppanel { padding: 12px 14px 14px; display: grid; gap: 12px; }
.ppanel h4 { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); }
.pp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px; }
.prow, .ppanel, .pp-grid > div, .pp-recs, .pp-rec { min-width: 0; }
.pp-rec-t { flex: 1 1 auto; }
@media (max-width: 720px) {
  .pp-grid { grid-template-columns: minmax(0, 1fr); }
  .prow > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .pr-stage { margin-left: auto; }
  .pr-title { flex: 1 0 100%; white-space: normal; order: 1; }
  .pr-next { flex: 1 1 0; min-width: 0; order: 2; }
  .prow > summary .chip { flex: none; order: 3; }
}
@media (max-width: 560px) {
  .stepper { gap: 8px; }
  .stepper ol { flex-basis: 100%; }
  .stepper li button span { font-size: 11.5px; }
}
.stepper li button span { word-break: keep-all; overflow-wrap: normal; }
.prow .prime { justify-self: start; }
.pp-steps { list-style: none; margin: 0; padding: 0; display: flex; position: relative; }
.pp-steps::before { content: ""; position: absolute; left: 10%; right: 10%; top: 8px; height: 2px; background: var(--line); }
.pp-steps li { flex: 1; display: grid; justify-items: center; gap: 4px; position: relative; font-size: 12px; color: var(--ink-3); text-align: center; }
.pp-steps li i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); z-index: 1; margin-top: 1px; }
.pp-steps li.done i { background: var(--stage); border-color: var(--stage); }
.pp-steps li.now { color: var(--ink); font-weight: 700; }
.pp-steps li.now i { background: var(--stage); border-color: var(--stage); box-shadow: 0 0 0 4px color-mix(in srgb, var(--stage) 22%, transparent); }
.pp-events { margin: 0 0 12px; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.pp-recs { display: grid; gap: 6px; }
.pp-rec { display: flex; justify-content: space-between; gap: 10px; text-decoration: none; color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 13px; }
.pp-rec:hover { border-color: var(--ink-3); }
.pp-rec-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pp-rec-d { color: var(--ink-3); white-space: nowrap; }
.tbar { margin-top: 10px; }
.tbar-track { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.tbar-track span { display: block; height: 100%; background: var(--stage); border-radius: 99px; }
.tbar-lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); margin-top: 5px; flex-wrap: wrap; }
.tbar-lbl b { color: var(--ink); font-weight: 700; }
.tbar small { font-size: 11.5px; color: var(--ink-3); }
@media print { .stepper, .seg, .sortsel { display: none !important; } }

/* Demo company (?org=demo): banner on every page, demo card on the portal, demo prime tags */
.demo-bar { position: relative; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px;
  background: #1E5A5A; color: #fff; font: 500 13px/1.4 var(--font); padding: 7px 14px; text-align: center; }
.demo-bar b { background: #F0B445; color: #14243A; border-radius: 4px; padding: 1px 7px; font-size: 12px; letter-spacing: .04em; }
.demo-bar a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.org-card.demo-card { border-style: dashed; }
.prime-tallis { background: #FBEFE2; color: #8A4A12; }
.prime-hwc { background: #1E5A5A; color: #fff; }
@media print { .demo-bar { display: none; } }

/* Users & access: edit a person in place; field labels on phones */
.roster .redit { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 600; }
.roster .mlbl { display: none; }
.roster tr.editrow td { background: #F7F9FB; padding: 12px; }
.redit-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.redit-form .field { margin: 0; }
.redit-form .wide { grid-column: 1 / -1; }
.redit-form .chk { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.redit-form .chk input { width: 20px; height: 20px; accent-color: var(--ink); }
.redit-form .acts { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.linkbtn.danger { color: var(--danger); }
@media (max-width: 860px) {
  .roster .mlbl { display: block; font-size: 12px; color: var(--ink-3); margin: 4px 0 2px; }
  .roster td.inl .mlbl { display: inline; margin: 0 6px 0 0; vertical-align: middle; }
  .redit-form { grid-template-columns: 1fr 1fr; }
  .roster tr.editrow td { padding: 12px 0; background: transparent; }
}
.pp-steps span { word-break: keep-all; overflow-wrap: normal; }
@media (max-width: 480px) { .pp-steps span { font-size: 11px; letter-spacing: -.01em; } }
