/* Practice workbench layout. Tokens come from common.css. */

body { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; color: var(--text); display: flex; align-items: baseline; gap: 8px; }
.brand:hover { text-decoration: none; }
.logo { font-family: var(--mono); color: var(--accent); }
.tagline { font-weight: 400; font-size: 12px; color: var(--muted); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { padding: 4px 9px; border-radius: var(--radius); color: var(--muted); font-size: 13px; }
.nav a.active, .nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-toggle { display: none; }

.main { flex: 1; padding: 16px; width: 100%; max-width: 1480px; margin: 0 auto; }
.footer { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; display: flex; flex-direction: column; gap: 3px; color: var(--text); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.form { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }
.spacer { flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head .why { color: var(--muted); font-size: 13px; margin: 0; }

.auth-box { max-width: 440px; margin: 40px auto; }
.auth-box h1 { margin-bottom: 4px; }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.plan-pick label { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; color: var(--text); cursor: pointer; margin: 0; }
.plan-pick input { width: auto; display: inline; margin-right: 6px; }
.qr { background: #fff; padding: 8px; display: inline-block; border-radius: var(--radius); }
.qr img { display: block; }

/* Board */
.board { display: grid; grid-template-columns: repeat(8, minmax(200px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--panel-2); border-radius: var(--radius); padding: 8px; min-height: 120px; }
.col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); display: flex; justify-content: space-between; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-bottom: 6px; color: var(--text); font-size: 12px; }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card .t { font-weight: 600; font-size: 13px; }
.card .meta { color: var(--muted); margin-top: 3px; }

/* Steps */
.steps { display: flex; gap: 2px; overflow-x: auto; margin: 6px 0 12px; }
.steps span { flex: 1; min-width: 70px; text-align: center; font-size: 11px; padding: 5px 4px; background: var(--panel-2); color: var(--muted); }
.steps span:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.steps span:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.steps span.done { background: var(--ok-bg); color: var(--ok); }
.steps span.cur { background: var(--accent); color: var(--accent-text); font-weight: 600; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs a { padding: 6px 12px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13px; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }

.exc { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius); padding: 10px; background: var(--panel); margin-bottom: 8px; }
.exc.high { border-left-color: var(--bad); }
.exc.low { border-left-color: var(--line); }
.exc.resolved { opacity: 0.6; border-left-color: var(--ok); }
.exc .why { color: var(--muted); font-size: 13px; margin: 4px 0; white-space: pre-wrap; }
.exc .refs { font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.kpi .v { font-size: 20px; font-weight: 600; font-family: var(--mono); }
.kpi .k { font-size: 12px; color: var(--muted); }
.bar { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar.alert > i { background: var(--warn); }

/* Document viewer */
.viewer { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.viewer .orig { min-height: 500px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); overflow: auto; }
.viewer .orig iframe { width: 100%; height: 70vh; border: 0; }
.viewer .orig img { max-width: 100%; display: block; }
.lines { font-family: var(--mono); font-size: 12px; max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.lines .pg { position: sticky; top: 0; background: var(--panel-2); padding: 3px 8px; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.lines .ln { display: grid; grid-template-columns: 40px 1fr; padding: 1px 8px; white-space: pre-wrap; word-break: break-word; }
.lines .ln .n { color: var(--muted); user-select: none; }
.lines .ln.item { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.lines .ln.flash { background: var(--hl); }
.lines .ln .tag { font-family: var(--sans); font-size: 11px; color: var(--accent); }

.thread .msg { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin-bottom: 6px; max-width: 760px; background: var(--panel); }
.thread .msg.in { border-left: 4px solid var(--accent); background: var(--panel-2); }
.thread .msg .h { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.thread .msg .b { white-space: pre-wrap; }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); }
.drop.over { border-color: var(--accent); color: var(--accent); }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); max-width: 560px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(0,0,0,0.4); }
details > summary { cursor: pointer; color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .tagline { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav { display: none; width: 100%; order: 5; flex-direction: column; }
  .nav.open { display: flex; }
  .viewer { grid-template-columns: 1fr; }
  .main { padding: 12px 16px; }
}

[hidden] { display: none !important; }

/* Original PDF drawn by pdf.js, with the cited line marked on the page. */
.pdf-box { overflow: auto; max-height: 78vh; background: #e9e9ec; padding: 4px; }
.pdf-page { margin: 0 auto 8px; box-shadow: 0 1px 3px rgba(0,0,0,.3); background: #fff; }
.pdf-mark { background: rgba(255, 196, 0, .35); outline: 2px solid #f0a500; border-radius: 2px; pointer-events: none; }
