:root {
  color-scheme: light;
  --ink: #171922;
  --muted: #596071;
  --line: #e4e5eb;
  --canvas: #fafafc;
  --blue: #384bba;
  --dark: #242735;
  --accent: #434eb0;
  --tint: #e1e4ff;
  font: 16px Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button { background: transparent; border: 0; }
button:focus-visible, summary:focus-visible, a:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible { outline: 3px solid #4158d4; outline-offset: 3px; }
button:disabled { opacity: .55; cursor: not-allowed; }
h1, h2, h3, p, td, .summary, .readtext { overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; font-weight: 550; }
h1 { font-size: clamp(2.5625rem, 4.25vw, 4.0625rem); letter-spacing: -.048em; line-height: 1.04; }
h2 { font-size: 1.6rem; letter-spacing: -.04em; line-height: 1.17; }
h3 { font-size: 1.13rem; letter-spacing: -.025em; margin: 18px 0 7px; }
p { line-height: 1.55; }
small, .sub, .muted { color: var(--muted); }
.icon svg { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: fixed; top: -6rem; z-index: 20; background: white; color: var(--blue); padding: 12px; }
.skip:focus { top: 0; }
.shell > header { background: white; border-bottom: 1px solid var(--line); }
.bar, .content { width: min(calc(100% - 80px), 1200px); margin-inline: auto; }
.bar { display: flex; align-items: center; gap: 24px; min-height: 82px; }
.brand { display: inline-flex; align-items: center; gap: 17px; white-space: nowrap; }
.brand img { width: 102px; height: auto; display: block; }
.brand span { border-left: 1px solid var(--line); padding-left: 17px; font-size: 20px; font-weight: 570; letter-spacing: -.85px; }
.bar nav { display: flex; align-self: stretch; align-items: stretch; margin: 0 auto; gap: 22px; }
.nav-btn, .dropdown > summary { display: flex; align-items: center; min-height: 44px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: .88rem; padding: 1px 2px 0; }
.nav-btn:hover, .dropdown > summary:hover { color: var(--ink); }
nav > .nav-btn[aria-current=page], nav > .dropdown:has(.nav-btn[aria-current=page]) > summary { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.dropdown { position: relative; }
.dropdown > summary { height: 100%; list-style: none; user-select: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
nav .dropdown > summary::after { content: "⌄"; margin-left: 5px; }
.account > summary { gap: 13px; }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: #e3dcf5; color: #473c66; font-size: .76rem; font-weight: 650; }
.env { color: var(--muted); font-size: .75rem; }
.menu-panel { position: absolute; top: calc(100% + 2px); right: 0; width: 220px; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 7px; z-index: 4; box-shadow: 0 16px 40px #191e3624; }
.menu-panel .nav-btn { width: 100%; text-align: left; border: 0; border-radius: 7px; padding: 9px 12px; }
.menu-panel .nav-btn:hover, .menu-panel .nav-btn[aria-current=page] { background: #f1f2fb; color: var(--blue); }
.identity { display: grid; padding: 10px 12px; gap: 4px; border-bottom: 1px solid var(--line); }
.identity strong, .identity small { overflow-wrap: anywhere; }
.content { padding: 45px 0 64px; }
.titleline { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.titleline p { margin: 10px 0 0; color: var(--muted); font-size: .94rem; }
.search { width: min(340px,100%); flex-shrink: 0; display: flex; align-items: center; gap: 11px; padding: 0 12px; height: 44px; background: white; border: 1px solid #d6d9e2; border-radius: 12px; }
.search:focus-within { outline: 2px solid var(--blue); outline-offset: 1px; }
.search input { width: 100%; min-width: 0; border: 0; background: transparent; outline: 0; font-size: .9rem; }
kbd { padding: 1px 6px; border-radius: 4px; background: #f6f6f8; border: 1px solid var(--line); color: var(--muted); font: 12px ui-monospace, monospace; }
.live { --tint: #e1e4ff; --accent: #434eb0; }
.billing { --tint: #caf4ea; --accent: #116a64; }
.technical { --tint: #ffdfb7; --accent: #984817; }
.relations { --tint: #ffdce9; --accent: #a83168; }
.cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; }
.deptcard { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; text-align: left; background: var(--tint); border-radius: 18px; min-height: 214px; padding: 0; transition: transform .17s ease; }
.deptcard:hover { transform: translateY(-3px); }
.deptcard[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--ink); }
.deptcard::before { content: ""; position: absolute; left: 31%; right: 31%; top: 56%; height: 7%; z-index: -2; border-radius: 50%; background: var(--accent); opacity: .16; filter: blur(7px); }
.department-art { position: absolute; top: 0; left: 0; width: 100%; height: 142px; object-fit: contain; z-index: -1; }
.arr { position: absolute; top: 13px; right: 13px; width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; background: #ffffffa8; font-size: 1rem; }
.card-label { display: grid; gap: 4px; padding: 15px 18px 17px; }
.card-label strong { letter-spacing: -.05em; font-weight: 550; font-size: clamp(1.15rem,1.75vw,1.5rem); line-height: 1.12; }
.card-label small { color: #404657; font-size: .75rem; }
.badge-icon { width: 34px; height: 38px; flex: 0 0 auto; display: inline-grid; place-items: center; border-radius: 8px; background: var(--tint); color: var(--accent); }
.deptcard > .badge-icon { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); }
.board { display: grid; grid-template-columns: minmax(0,1fr) minmax(235px,285px); align-items: start; gap: 34px; margin-top: 35px; }
.section-head, .spread, .actions, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section-head { margin: 24px 0 13px; }
.section-head:first-child { margin-top: 0; }
.column-labels, .publication { display: grid; align-items: center; gap: 12px; }
.column-labels { grid-template-columns: minmax(0,1fr) 180px; padding: 10px 14px; background: #f0f1f5; border-radius: 7px; color: var(--muted); font-size: .73rem; }
.publication { grid-template-columns: 34px minmax(0,1fr) 144px 24px; padding: 10px 14px; min-height: 62px; width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
.template-title { font-size: .95rem; letter-spacing: -.016em; overflow-wrap: anywhere; }
.publication-dept { color: var(--muted); font-size: .77rem; display: flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; flex-shrink: 0; }
.publication > :last-child { text-align: right; }
.publication:hover, .item:hover { background: #f0f1fa; }
.work-panel { background: var(--dark); color: white; padding: 22px; border-radius: 18px; }
.work-panel h2 { margin-bottom: 16px; }
.stat { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; min-height: 46px; padding: 10px 0; border-top: 1px solid #454854; color: #f5f4f8; font-size: .85rem; }
.stat:hover span { text-decoration: underline; }
.stat strong { color: #c3cdff; font-size: 1.15rem; }
.queue-link { margin: 6px 0; }
.work-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.work-tile { padding: 20px; display: grid; text-align: left; gap: 12px; }
.work-tile, .panel, .card, .login-card { background: white; border: 1px solid var(--line); border-radius: 16px; }
.work-tile:hover { border-color: #a4aaca; }
.panel, .card { padding: 19px; }
.toolbar, .tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 22px; }
.tabs button { border: 1px solid var(--line); border-radius: 24px; min-height: 42px; padding: 7px 15px; background: white; font-size: .86rem; }
.tabs .selected { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.list { border-top: 1px solid var(--line); }
.item { display: flex; width: 100%; align-items: center; gap: 12px; text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); }
.summary { flex: 1; min-width: 0; }
.summary strong, .summary small { display: block; }
.summary strong { font-size: .96rem; font-weight: 550; }
.summary small, .template-meta { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.pill { display: inline-flex; border-radius: 16px; padding: 4px 9px; font-size: .75rem; font-weight: 550; background: #e0f5e9; color: #185539; }
.pill.wait { background: #fff0d7; color: #704711; }
.pill.dim { background: #eef0f4; color: #4e596b; }
.pill.bad { background: #ffe8e8; color: #882539; }
.empty, .notice, .error, .readtext { border-radius: 10px; padding: 13px 15px; line-height: 1.5; }
.empty { color: var(--muted); border: 1px dashed #cbd0da; padding: 22px; }
.notice { color: #354467; background: #eef2ff; font-size: .91rem; }
.error { background: #fff0ed; color: #862e23; }
.error:empty, #toast:empty, .hidden { display: none !important; }
.primary, .secondary, .ghost, .iconbtn, .textbtn { font-size: .9rem; }
.primary, .secondary, .ghost { padding: 10px 15px; border-radius: 9px; min-height: 42px; }
.primary { color: white; background: #262934; }
.primary:hover { background: #414665; }
.secondary { background: white; border: 1px solid #c9ced8; }
.textbtn { color: var(--blue); padding: 8px 0; }
.textbtn:hover { text-decoration: underline; }
.iconbtn { min-width: 40px; min-height: 40px; border-radius: 50%; }
.iconbtn:hover { background: #f2f2f8; }
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--canvas); }
.login-intro, .login-side { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: clamp(22px,6vw,86px); }
.login-intro { background: #e1e4ff; }
.login-intro h1 { margin: 32px 0 0; }
.login-intro p { max-width: 32ch; color: #41485d; }
.login-intro .brand img { width: 160px; }
.login-side { align-items: center; }
.login-card { padding: 32px; width: min(100%,410px); }
.login-card h2 { margin-top: 15px; }
.login-card .primary { width: 100%; }
.grid2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 16px; }
.span2 { grid-column: 1/-1; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 550; margin: 12px 0; }
.field small { font-weight: 400; }
.field input, .field textarea, .field select, .toolbar select, .inline-input { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #bfc4d0; border-radius: 8px; padding: 10px 12px; background: #fdfdfe; font-weight: 400; }
.field textarea { resize: vertical; min-height: 74px; }
.check { display: flex; gap: 9px; align-items: flex-start; line-height: 1.5; margin: 12px 0; font-size: .9rem; }
.check input { min-width: 17px; min-height: 17px; accent-color: var(--blue); }
.group { min-width: 0; margin: 21px 0; border: 0; border-top: 1px solid var(--line); padding: 10px 0 0; }
.group legend { padding-right: 9px; font-weight: 600; }
.actions { justify-content: flex-end; margin-top: 18px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); background: white; border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
td, th { padding: 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: #f4f4f8; color: var(--muted); }
dialog { color: var(--ink); border: 1px solid var(--line); padding: 0; border-radius: 18px; width: min(780px,95vw); max-height: 91vh; box-shadow: 0 25px 80px #18213b38; }
dialog::backdrop { background: #191e30a8; }
#dialog-content { padding: 24px; }
.dialog-head { border-bottom: 1px solid var(--line); padding-bottom: 13px; flex-wrap: nowrap; }
.dialog-head h2 { font-size: clamp(1.45rem,3vw,2rem); }
.dialog-head .iconbtn { font-size: 1.45rem; }
dialog details { padding: 12px; border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }
dialog summary { font-size: .92rem; font-weight: 550; }
.readtext, pre { white-space: pre-wrap; font: inherit; line-height: 1.5; }
.readtext { background: #f4f5f9; }
.notesbox { min-height: 225px !important; }
.info-list, .stack { display: grid; gap: 10px; }
.num { font-variant-numeric: tabular-nums; }
.editorline { border: 1px solid var(--line); padding: 12px; border-radius: 8px; margin: 8px 0; }
#toast { position: fixed; right: 18px; bottom: 18px; background: var(--dark); color: white; padding: 12px 16px; border-radius: 10px; z-index: 20; max-width: 90vw; }
body:has(dialog[open]) { overflow: hidden; }
dialog:has(.case-layout) { width: min(1120px,96vw); background: var(--canvas); }
.department-tag { display: inline-flex; margin: 14px 0; border-radius: 16px; color: var(--accent); background: var(--tint); font-size: .78rem; padding: 5px 11px; }
.case-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(190px,25%); gap: 18px; align-items: start; }
.case-editor, .case-summary section { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 18px; min-width: 0; }
.case-steps { display: flex; gap: 10px; color: var(--muted); font-size: .85rem; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.case-steps [aria-current] { color: var(--ink); font-weight: 600; }
.case-summary { display: grid; gap: 14px; position: sticky; top: 0; }
.case-summary h3 { margin: 0 0 10px; }
.case-summary dl { margin: 0; }
.case-pair { border-top: 1px solid var(--line); padding: 10px 0; }
.case-pair dt { font-size: .76rem; color: var(--muted); }
.case-pair dd { font-size: .93rem; margin: 5px 0 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .case-layout { grid-template-columns: minmax(0,1fr); }
  .case-summary { position: static; }
  .case-editor, .case-summary section { padding: 14px; }
}
@media (max-width: 960px) {
  .bar, .content { width: calc(100% - 42px); }
  .bar { gap: 14px; }
  .bar nav { gap: 13px; }
  .cards { gap: 10px; }
  .card-label { padding: 12px; }
  .board { gap: 20px; grid-template-columns: minmax(0,1fr) 230px; }
}
@media (max-width: 760px) {
  .bar, .content { width: calc(100% - 32px); }
  .bar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0; min-height: 0; padding-top: 7px; }
  .brand { gap: 10px; }
  .brand img { width: 79px; }
  .brand span { font-size: 17px; padding-left: 10px; }
  .bar nav { grid-row: 2; grid-column: 1/-1; margin: 0; gap: 16px; }
  .bar nav > button, .bar nav > details > summary { font-size: .82rem; min-height: 42px; }
  .account { grid-column: 2; grid-row: 1; }
  .account .env { display: none; }
  .avatar { width: 29px; height: 29px; }
  .content { padding: 27px 0 40px; }
  .titleline { display: grid; gap: 16px; margin-bottom: 18px; }
  .titleline p { font-size: .87rem; }
  .search { width: 100%; }
  .search kbd { display: none; }
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .deptcard { min-height: 147px; border-radius: 14px; }
  .department-art { height: 91px; top: 1px; }
  .card-label { gap: 4px; padding: 8px 12px 11px; }
  .card-label strong { font-size: 1.03rem; letter-spacing: -.035em; }
  .card-label small { font-size: .7rem; }
  .arr { width: 23px; height: 23px; right: 8px; top: 8px; font-size: .86rem; }
  .board, .work-grid, .grid2 { grid-template-columns: minmax(0,1fr); }
  .board { margin-top: 24px; gap: 22px; }
  .column-labels, .publication-dept { display: none; }
  .publication { grid-template-columns: 33px minmax(0,1fr) 16px; gap: 9px; padding: 9px 2px; min-height: 55px; }
  h2 { font-size: 1.42rem; }
  .grid2 { gap: 0; }
  .span2 { grid-column: auto; }
  .item { gap: 8px; padding: 11px 2px; flex-wrap: wrap; }
  .item .summary { min-width: 45%; }
  #dialog-content, .panel { padding: 16px; }
  .login { display: block; }
  .login-intro, .login-side { padding: 24px; }
  .login-intro h1 { margin-top: 15px; }
  .login-intro .brand img { width: 100px; }
  .login-card { padding: 22px; }
}
@media (max-width: 365px) {
  .bar nav { gap: 10px; }
  .bar nav > button, .bar nav > details > summary { font-size: .76rem; }
  .deptcard { min-height: 157px; }
  .card-label strong { font-size: .96rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .deptcard:hover { transform: none; }
}
