:root {
  --bg: #f5f7fb;
  --bg-2: #eef2f8;
  --panel: #ffffff;
  --panel-2: #f3f6fb;
  --border: #e1e7f0;
  --text: #16202e;
  --muted: #5a6677;
  --primary: #2f6df0;
  --primary-ink: #ffffff;
  --yes: #1a8f3c;
  --no: #d23b32;
  --unsure: #b5760f;
  --ms: #2f2f2f;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 10px 28px rgba(16,24,40,.08);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1100px 520px at 78% -12%, #e9f0ff 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
::selection { background: rgba(47,109,240,.18); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: #cfd8e6; border: 3px solid var(--bg); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #b9c5d8; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.7rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.tiny { font-size: .8rem; }
.center { text-align: center; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 1.2rem;
  padding: .7rem 1.2rem; background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { margin-right: .2rem; }
.nav { display: flex; gap: 1rem; margin-left: .5rem; }
.nav a { color: var(--muted); font-weight: 600; font-size: .92rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; font-size: 1.2rem; line-height: 1; color: var(--text); cursor: pointer; padding: .35rem .55rem; }
.who { margin-left: auto; display: flex; align-items: center; gap: .8rem; font-size: .9rem; }
.who .pts { color: var(--unsure); font-weight: 700; }
.who .uname { color: var(--muted); }

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 1.5rem 1.2rem; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.2rem; }

/* Flash */
.flashes { margin-bottom: 1rem; display: grid; gap: .5rem; }
.flash { padding: .7rem 1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); font-size: .92rem; }
.flash-error { border-color: var(--no); background: rgba(229,83,75,.12); }
.flash-success { border-color: var(--yes); background: rgba(46,160,67,.12); }
.flash-info { border-color: var(--primary); background: rgba(79,140,255,.1); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  padding: .6rem 1rem; border-radius: 10px; font-weight: 600; cursor: pointer;
  font-size: .95rem; transition: transform .05s ease, filter .15s ease, background .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .35rem .6rem; font-size: .82rem; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-ghost { background: transparent; }
.btn-yes { background: rgba(26,143,60,.1); border-color: var(--yes); color: #14712f; }
.btn-no { background: rgba(210,59,50,.09); border-color: var(--no); color: #b5342c; }
.btn-unsure { background: rgba(181,118,15,.1); border-color: var(--unsure); color: #8a5a12; }
.btn-ms { background: #fff; color: #2f2f2f; border-color: var(--border); width: 100%; font-weight: 700; }
.btn kbd {
  font-size: .68rem; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  border-radius: 5px; padding: 1px 5px; margin-left: .2rem;
}
.ms-logo { width: 16px; height: 16px; display: inline-block;
  background:
    linear-gradient(#f25022,#f25022) 0 0/7px 7px no-repeat,
    linear-gradient(#7fba00,#7fba00) 9px 0/7px 7px no-repeat,
    linear-gradient(#00a4ef,#00a4ef) 0 9px/7px 7px no-repeat,
    linear-gradient(#ffb900,#ffb900) 9px 9px/7px 7px no-repeat; }

/* Auth card */
.auth-card { max-width: 380px; margin: 3rem auto; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.auth-card h1 { margin-top: 0; }
.auth-card label { display: block; margin: .9rem 0 .3rem; font-size: .9rem; font-weight: 600; }
.auth-card .check { display: flex; align-items: center; gap: .4rem; font-weight: 500; }
.input {
  width: 100%; padding: .6rem .7rem; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text); font-size: .95rem;
}
.input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.input-sm { padding: .3rem .4rem; font-size: .82rem; width: auto; }
.err { color: #ffa39e; font-size: .82rem; }
.divider { text-align: center; color: var(--muted); margin: 1rem 0; position: relative; }
.divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.divider span { background: var(--panel); padding: 0 .6rem; position: relative; }
.big-code { font-size: 4rem; margin: 0; }
.pw-toggle { display: block; width: 100%; margin-top: .9rem; background: none; border: 0; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pw-toggle:hover { color: var(--text); }

/* Hero / dashboard */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.hero h1 { margin-top: 0; }
.ring {
  --pct: 0;
  width: 120px; height: 120px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--primary) calc(var(--pct) * 1%), var(--panel-2) 0);
  display: grid; place-items: center; position: relative;
}
.ring::after { content: ""; position: absolute; inset: 12px; background: var(--panel); border-radius: 50%; }
.ring-num, .ring-label { position: relative; z-index: 1; text-align: center; }
.ring-num { font-size: 1.5rem; font-weight: 800; }
.ring-label { font-size: .72rem; color: var(--muted); }

.grid { display: grid; gap: 1rem; margin-bottom: 1.2rem; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid > * { min-width: 0; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem; text-align: center; min-width: 0; }
.stat.ok { border-color: rgba(46,160,67,.5); }
.stat.warn { border-color: rgba(216,166,52,.5); }
.stat.bad { border-color: rgba(229,83,75,.55); background: rgba(229,83,75,.07); }
.stat-num { font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.stat.bad .stat-num { color: var(--no); }
.stat-lbl { color: var(--text); font-size: .95rem; font-weight: 600; margin-top: .15rem; }
.stat-sub { margin-top: .35rem; }
.headline { margin-bottom: 1.4rem; }

/* Dashboard head */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.dash-head h1 { margin: 0 0 .2rem; }

/* Queue cards */
.queue-card { display: flex; flex-direction: column; gap: .3rem; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem; color: var(--text); transition: border-color .15s, transform .05s; }
.queue-card:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-2px); }
.queue-card.approve:hover { border-color: var(--yes); }
.queue-card.edit:hover { border-color: var(--unsure); }
.queue-card h2 { margin: .2rem 0 0; }
.queue-card p { margin: 0; }
.queue-top { display: flex; align-items: center; justify-content: space-between; }
.queue-icon { font-size: 1.6rem; }
.queue-count { font-size: 2.2rem; font-weight: 800; }
.queue-card.approve .queue-count { color: var(--yes); }
.queue-card.edit .queue-count { color: var(--unsure); }
.queue-go { margin-top: .5rem; color: var(--primary); font-weight: 700; font-size: .9rem; }
.cta-row { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.4rem; }

/* Queue banner on the play screen */
.queue-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1.1rem; margin-bottom: 1rem; }
.queue-banner strong { margin-right: .5rem; }
.queue-banner.approve strong { color: var(--yes); }
.queue-banner.edit strong { color: var(--unsure); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.you-stats { display: flex; gap: 1.5rem; }
.you-stats.wide { margin-bottom: 1.5rem; }
.you-stats .big { font-size: 1.5rem; font-weight: 800; display: block; }
.you-stats small { color: var(--muted); }
.mini-board { list-style: none; padding: 0; margin: 0; }
.mini-board li { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.mini-board .rank { width: 1.4rem; color: var(--muted); font-weight: 700; }
.mini-board .nm { flex: 1; }
.mini-board .pts { color: var(--unsure); font-weight: 700; }

/* Table */
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table tr.me { background: rgba(79,140,255,.1); }
.table tr.inactive { opacity: .5; }
.table .rank { font-weight: 700; }
.table .pts { color: var(--unsure); font-weight: 700; }
.tag { font-size: .68rem; background: var(--panel-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; color: var(--muted); }

/* Pills */
.pill { font-size: .78rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; border: 1px solid var(--border); }
.pill.yes { background: rgba(26,143,60,.12); color: #14712f; border-color: var(--yes); }
.pill.no { background: rgba(210,59,50,.1); color: #b5342c; border-color: var(--no); }
.pill.unsure { background: rgba(181,118,15,.12); color: #8a5a12; border-color: var(--unsure); }

/* Forms (admin) */
.inline-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.inline-form .input { width: auto; flex: 1; min-width: 160px; }
.row-form { display: inline; }
.row-actions { display: flex; gap: .4rem; }

/* Game */
#game { max-width: 720px; margin: 0 auto; }
.game-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.progress { flex: 1; }
.progress-bar { height: 10px; background: var(--panel-2); border-radius: 20px; overflow: hidden; border: 1px solid var(--border); }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #7ee29a); transition: width .5s ease; }
.progress-txt { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.game-stats { display: flex; gap: .5rem; }
.chip { background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: .3rem .7rem; font-size: .85rem; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); position: relative; }
.card.done { text-align: center; padding: 3rem 1.6rem; }
.card + .card { margin-top: 1rem; }
.impact-row, .impact { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; flex-wrap: wrap; }
.impact-badge { background: rgba(47,109,240,.1); border: 1px solid var(--primary); color: #1f52c0; padding: .35rem .85rem; border-radius: 20px; font-size: .9rem; font-weight: 700; }
.impact-hint { color: var(--muted); font-size: .88rem; }
.prompt { font-size: 1.05rem; margin: 0 0 1rem; color: var(--text); }
.prompt strong { color: #1f52c0; }
.prompt-help { font-size: .9rem; margin: -.3rem 0 1rem; }
.table.compact th, .table.compact td { padding: .45rem .6rem; font-size: .86rem; }
.bom-context { margin-top: 1rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .9rem; }
.bom-context summary { cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--primary); list-style: none; }
.bom-context summary::-webkit-details-marker { display: none; }
.bom-context summary::before { content: "▸ "; }
.bom-context[open] summary::before { content: "▾ "; }
.bom-context[open] summary { margin-bottom: .7rem; }
.ctx-table { min-width: 780px; }

.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: stretch; }
.versus.small .part-no { font-size: 1.1rem; }
.side { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem; min-width: 0; display: flex; flex-direction: column; }
.side .flag { font-size: .8rem; color: var(--muted); margin-bottom: .5rem; font-weight: 700; letter-spacing: .03em; }
.source-tag { font-size: .82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .7rem; }
.side.uk .source-tag { color: #1f52c0; }
.side.tw .source-tag { color: #9a6208; }
.field { margin-bottom: .7rem; }
.field-lbl { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .15rem; }
.part-no { font-size: 1.4rem; font-weight: 800; font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace; word-break: break-word; color: var(--text); font-variant-numeric: tabular-nums; }
.part-desc { color: var(--text); font-size: 1rem; line-height: 1.45; word-break: break-word; }
.vs { display: grid; place-items: center; font-size: 1.8rem; color: var(--muted); }
.translate-btn { margin-top: auto; align-self: flex-start; }
.btn-xs { padding: .3rem .6rem; font-size: .78rem; }

.bom-refs, .others, .mine { margin-top: 1rem; padding: .7rem .9rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; }
.bom-chip { display: inline-block; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; margin: 2px 3px 2px 0; font-size: .85rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
.vote-chip { display: inline-block; border-radius: 16px; padding: 2px 10px; margin: 2px 4px 2px 0; font-size: .85rem; border: 1px solid var(--border); }
.vote-chip.yes { background: rgba(26,143,60,.12); color: #14712f; border-color: var(--yes); }
.vote-chip.no { background: rgba(210,59,50,.1); color: #b5342c; border-color: var(--no); }
.vote-chip.unsure { background: rgba(181,118,15,.12); color: #8a5a12; border-color: var(--unsure); }

.reason-wrap { display: block; margin-top: 1.1rem; }
.note { width: 100%; margin-top: .3rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); padding: .7rem .8rem; resize: vertical; min-height: 52px; font-family: inherit; font-size: .95rem; }
.note:focus { outline: 2px solid var(--primary); }
.note.needs-reason { border-color: var(--no); outline: 2px solid var(--no); }
.reason-hint { display: block; color: #ffa39e; font-size: .85rem; margin-top: .3rem; }

.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; margin-top: 1.2rem; }
.actions .btn { padding: .9rem; font-size: 1.05rem; line-height: 1.25; flex-direction: column; gap: .1rem; }
.actions .btn small { font-weight: 500; opacity: .8; font-size: .72rem; }
.btn-approve { background: rgba(26,143,60,.1); border-color: var(--yes); color: #14712f; }
.btn-reject { background: rgba(210,59,50,.09); border-color: var(--no); color: #b5342c; }
.btn-unsure { background: rgba(181,118,15,.1); border-color: var(--unsure); color: #8a5a12; }
.subactions { text-align: center; margin-top: .9rem; }

.toast { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--yes); color: #04210d; font-weight: 800; padding: .4rem 1rem; border-radius: 20px; font-size: .9rem; box-shadow: var(--shadow); animation: pop .4s ease; }
.toast.warn { background: var(--unsure); color: #2a1d00; }
@keyframes pop { 0% { transform: translate(-50%, 8px) scale(.8); opacity: 0; } 100% { transform: translate(-50%, 0) scale(1); opacity: 1; } }
.card.flash-yes { animation: flashYes .5s ease; }
.card.flash-no { animation: flashNo .5s ease; }
@keyframes flashYes { 0% { box-shadow: 0 0 0 2px var(--yes); } 100% { box-shadow: var(--shadow); } }
@keyframes flashNo { 0% { box-shadow: 0 0 0 2px var(--no); } 100% { box-shadow: var(--shadow); } }

/* Disputes */
.dispute .votes { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; align-items: center; }
.note-chip { color: var(--muted); font-size: .82rem; font-style: italic; }
.resolve-form { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.resolve-form .input { flex: 1; min-width: 180px; }

/* Global parts tab */
.global-filter { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.gcard { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.gcard.multi { background: #fff8ec; border-color: #f0dcae; }
.gcard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.gcard-id .part-no { font-size: 1.25rem; }
.gcard-id .part-desc { margin-top: .2rem; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-left: .5rem; vertical-align: middle; }
.badge.warn { background: rgba(181,118,15,.12); color: #8a5a12; border: 1px solid var(--unsure); }
.gcard-metrics { display: flex; gap: .5rem; flex-wrap: wrap; }
.metric { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .7rem; font-size: .85rem; color: var(--muted); }
.metric b { color: var(--text); font-size: 1rem; }
.metric.warn { border-color: var(--unsure); color: #8a5a12; }

.candidates { display: grid; gap: .6rem; }
.candidate { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: .8rem .9rem; }
.candidate.flash-yes { animation: flashYes .5s ease; }
.candidate.flash-no { animation: flashNo .5s ease; }
.cand-main { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cand-tw { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; min-width: 0; }
.source-tag.tw { color: #9a6208; margin-bottom: 0; }
.part-no.sm { font-size: 1.05rem; }
.cand-tw .part-desc { font-size: .92rem; }
.cand-meta { display: flex; align-items: center; gap: .5rem; }
.status-pill { font-size: .82rem; font-weight: 700; padding: 3px 10px; border-radius: 16px; border: 1px solid var(--border); white-space: nowrap; }
.status-pending { color: var(--muted); }
.status-resolved { background: rgba(26,143,60,.12); color: #14712f; border-color: var(--yes); }
.status-disputed { background: rgba(181,118,15,.12); color: #8a5a12; border-color: var(--unsure); }
.cand-context { margin-top: .5rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.cand-actions { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; flex-wrap: wrap; position: relative; }
.cand-actions .cand-reason { flex: 1; min-width: 180px; }
.cand-reason.needs-reason { border-color: var(--no); outline: 1px solid var(--no); }
.cand-actions .btn { flex-direction: row; }
.gcard-foot { margin-top: .8rem; padding-top: .7rem; border-top: 1px solid var(--border); }

/* Help page */
.help { max-width: 820px; }
.help .lead { font-size: 1.1rem; line-height: 1.6; }
.help h2 { margin-top: 1.8rem; }
.help ul { line-height: 1.75; }
.help-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1rem 0; }
.help-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
.help-card h3 { margin: 0 0 .4rem; }
.help kbd { font-size: .72rem; background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.help-cta { margin-top: 1.6rem; }
.mini-toast { position: absolute; right: 0; top: -22px; background: var(--yes); color: #04210d; font-weight: 800; font-size: .78rem; padding: 2px 8px; border-radius: 12px; animation: pop .3s ease; }

/* First-boot banner */
.boot-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: rgba(47,109,240,.07); border: 1px solid var(--primary); border-radius: 12px;
  padding: .7rem 1rem; margin-bottom: 1rem; font-size: .92rem; }

/* Maker badge (bottom corner) */
.maker-badge { position: fixed; bottom: 12px; right: 14px; display: flex; align-items: center; gap: .45rem;
  background: var(--panel); border: 1px solid var(--border); border-radius: 30px; padding: .3rem .7rem .3rem .35rem;
  box-shadow: var(--shadow); font-size: .78rem; color: var(--muted); z-index: 20; opacity: .85; }
.maker-badge:hover { opacity: 1; }
.maker-badge strong { color: var(--text); }
.maker-badge svg { flex: none; }

.table .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.table tr.undone { opacity: .5; }

/* BOM detail — readable lines */
.line-progress { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.line-progress .progress-bar { flex: 1; }
.line-progress-txt { font-size: .85rem; color: var(--muted); white-space: nowrap; }
#lines { display: grid; gap: .7rem; }
.line { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1.1rem; }
.line.is-ok { border-color: rgba(26,143,60,.4); background: rgba(26,143,60,.05); }
.line.is-flag { border-color: rgba(210,59,50,.45); background: rgba(210,59,50,.05); }
.line-main { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: start; }
.line-side { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.line-side.tw { text-align: right; align-items: flex-end; }
.src-tag { font-size: .68rem; font-weight: 800; letter-spacing: .05em; color: var(--muted); }
.line-side.uk .src-tag { color: #1f52c0; }
.line-side.tw .src-tag { color: #9a6208; }
.line .part-no.sm { font-size: 1.05rem; }
.line-desc { font-size: .95rem; }
.line-meta { font-size: .78rem; color: var(--muted); }
.line-vs { align-self: center; color: var(--muted); font-size: 1.2rem; }
.line-foot { display: flex; align-items: center; gap: .7rem; margin-top: .7rem; flex-wrap: wrap; }
.line-result { font-size: .82rem; color: var(--muted); }
.line-note { font-size: .82rem; font-style: italic; }
.line-btns { margin-left: auto; display: flex; gap: .4rem; }
.line-btns .btn { flex-direction: row; }
.line-editor { margin-top: .8rem; border-top: 1px dashed var(--border); padding-top: .8rem; }
.editor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.editor-grid label { display: flex; flex-direction: column; font-size: .72rem; color: var(--muted); gap: .2rem; }
.editor-grid label.wide { grid-column: 1 / -1; }
.editor-actions { display: flex; gap: .5rem; margin-top: .7rem; align-items: center; }
.add-line summary { cursor: pointer; font-weight: 700; color: var(--primary); }

/* Export panel */
.export-panel { margin-bottom: 1.2rem; }
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.export-opt { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: .8rem .9rem; }
.export-lbl { font-size: .9rem; margin-bottom: .5rem; }
.export-lbl b { font-size: 1.2rem; display: inline-block; margin-left: .25rem; }
.export-btns { display: flex; gap: .5rem; }

/* BOM workflow status */
.wf { font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 16px; border: 1px solid var(--border); }
.wf-open { color: var(--muted); }
.wf-submitted { background: rgba(47,109,240,.1); color: #1f52c0; border-color: var(--primary); }
.wf-approved { background: rgba(26,143,60,.12); color: #14712f; border-color: var(--yes); }
.wf-banner { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1.1rem; margin-bottom: 1rem; }

/* BOM editable grid (legacy) */
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.edit-table { min-width: 1180px; }
.edit-table td { vertical-align: top; padding: .4rem .5rem; }
.edit-table .input { width: 100%; min-width: 110px; }
.edit-table .input.qty { min-width: 52px; width: 64px; }
.edit-table .input.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.edit-table .center { text-align: center; }
.table tr.edited td { background: rgba(181,118,15,.07); }

@media (max-width: 720px) {
  .maker-badge span { display: none; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { flex-direction: column; text-align: center; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .who .uname { display: none; }
  .who { margin-left: .5rem; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
         background: var(--panel); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); padding: .4rem 1.1rem; margin-left: 0; }
  .nav.open { display: flex; }
  .nav a { padding: .8rem .2rem; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .nav a:last-child { border-bottom: 0; }
  .bom-table .col-status, .bom-table .col-lines { display: none; }
  .export-grid { grid-template-columns: 1fr; }
  .actions { grid-template-columns: 1fr; }
  .versus { grid-template-columns: 1fr; }
  .vs { transform: rotate(90deg); }
}
