/* Layout: one-column work app — header, segmented tabs, cards sized for gloved thumbs (48px+ targets) */
:root {
  --bg: #eef0f2; --surface: #ffffff; --ink: #1d2328; --muted: #5d6a74; --line: #d3d9de;
  --steel: #33414c; --amber: #e8a200; --amber-ink: #5b3f00; --amber-weak: #fff3cf;
  --ok: #1f8a4c; --ok-weak: #e1f3e8; --danger: #c2372b; --danger-weak: #fde6e3;
  --font-display: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-body: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14191d; --surface: #1d242a; --ink: #e7ecef; --muted: #9aa7b0; --line: #2f3a42;
    --steel: #c9d3da; --amber: #f2b416; --amber-ink: #ffe3a0; --amber-weak: #3a2f12;
    --ok: #46c27b; --ok-weak: #163323; --danger: #f06a5d; --danger-weak: #3d1d1a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.65; -webkit-text-size-adjust: 100%; }
.wrap { max-width: 760px; margin: 0 auto; padding-inline: 16px; padding-block: calc(16px + env(safe-area-inset-top, 0px)) 48px; display: grid; gap: 16px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 34px; height: 34px; border-radius: 6px; background: repeating-linear-gradient(-45deg, var(--amber) 0 7px, var(--steel) 7px 14px); flex: none; }
.brand h1 { font-size: 20px; font-weight: 900; letter-spacing: .02em; }
.sub { font-size: 12px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 14px; font-size: 14px; }
.linkbtn { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 6px 8px; font-size: 13px; }

.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; gap: 4px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.tab { border: none; background: none; border-radius: 7px; padding: 10px 2px; font-weight: 700; color: var(--muted); min-height: 48px; font-size: 14px; }
.tab[aria-selected="true"] { background: var(--steel); color: var(--bg); }

.panel { display: grid; gap: 14px; }
.lead { color: var(--muted); margin: 0; font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mach { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-height: 96px; display: grid; gap: 6px; align-content: start; }
.mach .id { font-family: var(--font-mono); font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.mach .area { font-size: 12px; color: var(--muted); }
.mach.pending { border-color: var(--amber); box-shadow: inset 0 0 0 2px var(--amber); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; width: fit-content; }
.pill.warn { background: var(--amber); color: #2a1d00; }
.pill.ok { background: var(--ok-weak); color: var(--ok); }
.pill.none { background: var(--bg); color: var(--muted); }
.pill.high { background: var(--danger-weak); color: var(--danger); }
.pill.role { background: var(--bg); color: var(--muted); }

.back { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; min-height: 44px; font-weight: 700; }
.mtitle { font-family: var(--font-mono); font-size: 24px; font-weight: 700; overflow-wrap: anywhere; }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 10px; border-left: 6px solid var(--amber); }
.notice.high { border-left-color: var(--danger); }
.notice.done { border-left-color: var(--ok); }
.notice h3 { font-size: 17px; text-wrap: pretty; }
.notice p { margin: 0; white-space: pre-wrap; }
.caution { background: var(--amber-weak); color: var(--amber-ink); border-radius: 8px; padding: 10px 12px; font-weight: 700; white-space: pre-wrap; }
.meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ack { border: none; border-radius: 10px; min-height: 60px; font-size: 18px; font-weight: 700; background: var(--ok); color: #fff; width: 100%; }
.acked { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 10px; background: var(--ok-weak); color: var(--ok); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], select, textarea { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 10px 12px; min-height: 46px; }
textarea { resize: vertical; min-height: 120px; }
.btn { border: none; border-radius: 8px; padding: 12px 18px; min-height: 48px; font-weight: 700; }
.btn.primary { background: var(--steel); color: var(--bg); }
.btn.amber { background: var(--amber); color: #2a1d00; }
.btn.ghost { background: var(--bg); border: 1px solid var(--line); }
.btn.small { min-height: 40px; padding: 8px 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.seg { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: var(--surface); padding: 10px 16px; min-height: 44px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--steel); color: var(--bg); }
.seg button.hi[aria-pressed="true"] { background: var(--danger); color: #fff; }
.status { font-size: 13px; color: var(--muted); }
.status.err { color: var(--danger); }
.status.good { color: var(--ok); }

.names { display: flex; flex-wrap: wrap; gap: 6px; }
.names span { font-size: 12px; background: var(--ok-weak); color: var(--ok); border-radius: 999px; padding: 2px 10px; }
.count { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; }
hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.code { font-family: var(--font-mono); font-size: 28px; font-weight: 700; letter-spacing: .12em; }
.list { display: grid; gap: 0; }
.list > div { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list > div:last-child { border-bottom: none; }
.list .name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.muted { color: var(--muted); }

.auth { max-width: 440px; margin: 0 auto; width: 100%; }
.center { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }

.langpick { display: inline-flex; align-items: center; margin: 0; font-weight: 400; }
.langpick select { width: auto; min-height: 40px; padding: 6px 10px; font-size: 13px; background: var(--surface); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.orig { border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.orig b { color: var(--ink); }
.toggle { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 4px 0; font-size: 13px; justify-self: start; }

.names-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.pickname { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-height: 72px; padding: 12px; font-size: 18px; font-weight: 700; text-align: left; display: grid; gap: 2px; }
.pickname .meta { font-weight: 400; }
#linkText { font-family: var(--font-mono); font-size: 13px; }

.urgent-title { font-size: 16px; color: var(--danger); }
.joininfo { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.qr { background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); line-height: 0; flex: none; }
.qr svg { width: 180px; height: 180px; display: block; }
.names .notyet { background: var(--bg); color: var(--muted); }

.loginbox { display: flex; flex-wrap: wrap; gap: 12px 28px; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 12px 16px; }
.scrolllist { max-height: 320px; overflow: auto; }
input[type=search] { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 12px; min-height: 46px; font-size: 16px; }
