/* 間取り提案システム — UI */
:root {
  --bg: #f3f2ee;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --line: #e3e0d9;
  --line-strong: #cfcbc2;
  --ink: #1c1f26;
  --ink-2: #4b5060;
  --muted: #7c8191;
  --brand: #1f3a5f;
  --brand-2: #2b5182;
  --brand-soft: #e8eef6;
  --accent: #9a7b4f;
  --ok: #2f7d4f;
  --ok-soft: #e8f3ec;
  --warn: #a4661a;
  --warn-soft: #fbf1e3;
  --danger: #b3261e;
  --danger-soft: #fbeae8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 31, 38, .05), 0 6px 20px -12px rgba(28, 31, 38, .12);
  --sidebar: 232px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Noto Sans JP", -apple-system, sans-serif;
  font-size: 15px; line-height: 1.6; font-feature-settings: "palt";
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: .01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
p { margin: 0; }
.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.big { width: 32px; height: 32px; stroke-width: 1.5; }
.hidden { display: none !important; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex: none; background: var(--brand); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.brand-mark .ic { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .04em; }
.brand-sub { font-size: 11px; color: rgba(255,255,255,.6); letter-spacing: .12em; text-transform: uppercase; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 8px; background: transparent; color: rgba(255,255,255,.78); font: inherit; font-size: 14.5px; cursor: pointer; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 16px 20px 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: rgba(255,255,255,.75); display: flex; flex-direction: column; gap: 8px; }
.stat { display: flex; align-items: center; gap: 8px; }
.stat .ic { width: 15px; height: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa3b2; flex: none; }
.dot.on { background: #6fcf97; } .dot.off { background: #f0a35e; }
.content { flex: 1; min-width: 0; padding: 28px 36px 60px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.lead { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.head-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* stepper */
.stepper { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--muted); }
.stepper li b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink-2); font-size: 12px; }
.stepper li.on { color: var(--brand); border-color: var(--brand); }
.stepper li.on b { background: var(--brand); color: #fff; }
.stepper li.done { color: var(--ok); border-color: var(--ok-soft); background: var(--ok-soft); }
.stepper li.done b { background: var(--ok); color: #fff; }

/* ---------- cards ---------- */
.panel { display: none; }
.panel.active { display: block; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px 26px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head .card-desc { color: var(--muted); font-size: 13px; width: 100%; margin-top: -4px; }
.card-head .head-actions { margin-left: auto; align-self: center; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: 5px; }
label > span { font-size: 12.5px; color: var(--ink-2); }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; width: 100%; transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(43,81,130,.15); }
input::placeholder, textarea::placeholder { color: #a6aab6; }
textarea { resize: vertical; line-height: 1.6; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c8191' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end; }
.form-row label { flex: 1 1 200px; }
.form-row .grow { flex: 3 1 280px; }
.form-row.two label { flex: 1 1 260px; }
.form-row.analyze { margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 16px; margin-bottom: 8px; }
.form-grid .span2 { grid-column: span 2; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
label.block { margin-top: 6px; }

/* input tiles */
.input-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 4px 0 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; text-align: left; transition: background .12s, border-color .12s; }
.tile:hover { background: var(--brand-soft); border-color: #c9d6e6; }
.tile .ic { width: 22px; height: 22px; color: var(--brand); margin-bottom: 4px; }
.tile-label { font-weight: 700; font-size: 14.5px; }
.tile-desc { font-size: 12px; color: var(--muted); }
.tile.recording { background: var(--danger-soft); border-color: #e7b3ae; }
.tile.recording .ic { color: var(--danger); animation: blink 1.1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--surface-2); border-color: #b9b4a9; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.lg { padding: 12px 22px; min-height: 48px; font-size: 15px; }
.btn.sm { padding: 6px 12px; min-height: 32px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); border-color: #e4b6b2; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.icon { padding: 6px; min-height: 32px; width: 32px; justify-content: center; }
.btn .ic { width: 16px; height: 16px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.actions.between { justify-content: space-between; }
.actions.center { justify-content: center; }

/* notes */
.note { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; min-height: 0; }
.note.warn { color: var(--warn); }
.callout { background: var(--brand-soft); border-left: 3px solid var(--brand); padding: 12px 16px; border-radius: 0 8px 8px 0; margin-bottom: 18px; white-space: pre-wrap; font-size: 14.5px; }
.callout:empty { display: none; }
.closing { color: var(--ink-2); margin-top: 16px; }
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #e6dcc6; background: var(--warn-soft); border-radius: 10px; margin: 8px 0 16px; font-size: 13.5px; }
.notice .ic { color: var(--warn); }
.notice .btn { margin-left: auto; }
.questions { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.questions h4 { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.questions ul { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.questions li { margin: 2px 0; }

/* chips */
.chips-block { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 10px; }
.chips-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chips-row .lbl { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 6px; min-width: 6.5em; text-align: center; letter-spacing: .04em; }
.lbl.must { background: var(--danger-soft); color: var(--danger); }
.lbl.nice { background: var(--brand-soft); color: var(--brand); }
.lbl.avoid { background: #ecebe7; color: var(--ink-2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13.5px; }
.chip button { border: 0; background: transparent; padding: 2px; margin: 0; display: grid; place-items: center; color: var(--muted); cursor: pointer; border-radius: 50%; }
.chip button:hover { background: var(--surface-2); color: var(--ink); }
.chip button .ic { width: 14px; height: 14px; }
.chip-add { width: 10em; padding: 6px 10px; font-size: 13.5px; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0; }
.suggest .cap { font-size: 12px; color: var(--muted); margin-right: 4px; }
.suggest button { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 8px; border: 1px dashed var(--line-strong); border-radius: 999px; background: transparent; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.suggest button:hover { border-color: var(--brand); color: var(--brand); border-style: solid; }
.suggest button .ic { width: 13px; height: 13px; }

/* ---------- results ---------- */
.result { display: grid; grid-template-columns: 320px 1fr; gap: 22px; padding: 22px 0; border-top: 1px solid var(--line); }
.result:first-child { border-top: 0; padding-top: 6px; }
.result .imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.result .imgs figure { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: zoom-in; }
.result .imgs img { width: 100%; height: 150px; object-fit: contain; display: block; padding: 6px; }
.result .imgs figcaption { font-size: 11.5px; color: var(--muted); text-align: center; padding: 3px 0 5px; border-top: 1px solid var(--line); background: var(--surface-2); }
.result .imgs figure:first-child { grid-column: span 2; }
.result .imgs figure:first-child img { height: 220px; }
.res-top { display: flex; align-items: flex-start; gap: 14px; }
.rank-num { font-size: 30px; font-weight: 700; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; letter-spacing: -.02em; min-width: 40px; }
.res-title h3 { font-size: 17px; line-height: 1.4; }
.res-title .no { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.headline { color: var(--brand); font-weight: 700; margin: 6px 0 2px; }
.story { background: #fbf8f2; border: 1px solid #ece4d3; border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 12px 14px; margin: 8px 0 10px; font-size: 14.5px; line-height: 1.75; color: var(--ink); }
.spec { color: var(--ink-2); font-size: 13.5px; margin: 6px 0 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.spec span { display: inline-flex; align-items: center; gap: 5px; }
.spec .ic { width: 14px; height: 14px; color: var(--muted); }
.fitbar { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; font-size: 12.5px; color: var(--ink-2); }
.fitbar .bar { flex: 1; max-width: 220px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.fitbar .bar i { display: block; height: 100%; background: var(--brand); }
.fitbar b { font-variant-numeric: tabular-nums; color: var(--ink); }
.tagline { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.tag { font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; color: var(--ink-2); }
.pts { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.pts li { display: flex; gap: 8px; align-items: flex-start; }
.pts li .ic { width: 15px; height: 15px; margin-top: 4px; }
.pts.fit li .ic { color: var(--ok); }
.pts.caveat li .ic { color: var(--warn); }
.pts.ideas li .ic { color: var(--accent); }
details { margin-top: 8px; }
details summary { cursor: pointer; font-size: 13.5px; color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary .ic { width: 14px; height: 14px; transition: transform .15s; }
details[open] summary .ic.chev { transform: rotate(180deg); }
.talk { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-top: 8px; line-height: 1.7; }
.detail-body { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.detail-body b { color: var(--ink); }

/* ---------- register ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 34px 20px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); color: var(--ink-2); text-align: center; cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .ic { color: var(--brand); margin-bottom: 6px; }
.dz-title { font-weight: 700; color: var(--ink); }
.dz-desc { font-size: 12.5px; color: var(--muted); }
.thumbs { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0 4px; }
.thumb { width: 168px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.thumb img { width: 100%; height: 140px; object-fit: contain; cursor: zoom-in; border-radius: 4px; }
.thumb .thumb-foot { display: flex; gap: 6px; }
.thumb select { padding: 6px 28px 6px 8px; font-size: 13px; }
.thumb .btn.icon { flex: none; width: 34px; min-height: 34px; color: var(--muted); }
.tagpicker { display: flex; gap: 8px; flex-wrap: wrap; }
.tagpicker label { flex-direction: row; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13.5px; user-select: none; }
.tagpicker label:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.tagpicker input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
table.rooms { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rooms th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.rooms td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.rooms input { padding: 6px 8px; font-size: 14px; }
table.rooms td:nth-child(1) { width: 120px; } table.rooms td:nth-child(3) { width: 96px; } table.rooms td:nth-child(4) { width: 44px; }
table.rooms .btn.icon { width: 30px; min-height: 30px; color: var(--muted); border-color: transparent; }

/* ---------- library ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { width: auto; }
.filters input[type=number] { width: 7em; }
.filters .search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--surface); }
.filters .search .ic { color: var(--muted); }
.filters .search input { border: 0; box-shadow: none; padding-left: 0; }
.count { font-size: 13px; color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.plan-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; overflow: hidden; transition: box-shadow .12s, border-color .12s; }
.plan-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.plan-card .pc-img { height: 168px; background: #fff; border-bottom: 1px solid var(--line); display: grid; place-items: center; }
.plan-card img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.plan-card .pc-body { padding: 10px 12px 12px; }
.plan-card .no { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.plan-card .t { font-weight: 700; font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0 6px; min-height: 2.9em; }
.plan-card .s { color: var(--ink-2); font-size: 12.5px; }

/* ---------- history ---------- */
.hist { display: grid; grid-template-columns: 150px 140px 1fr; gap: 16px; align-items: center; padding: 12px 8px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.hist:hover { background: var(--surface-2); }
.hist .d { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hist .n { font-weight: 700; }
.hist .s { color: var(--ink-2); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; font-size: 14px; }

/* ---------- overlays ---------- */
.modal { position: fixed; inset: 0; background: rgba(20, 24, 32, .62); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-body { background: #fff; border-radius: 12px; padding: 18px; max-width: 95vw; max-height: 92vh; overflow: auto; position: relative; }
.modal-body img { max-width: 90vw; max-height: 80vh; object-fit: contain; display: block; }
.modal-body .cap { text-align: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.modal .close { position: absolute; top: 10px; right: 10px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1c1f26; color: #fff; padding: 11px 18px; border-radius: 8px; z-index: 60; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 90vw; }
.toast.err { background: var(--danger); }
.busy { position: fixed; inset: 0; background: rgba(243, 242, 238, .75); backdrop-filter: blur(2px); z-index: 55; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-weight: 600; color: var(--ink-2); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: sticky; flex-direction: row; align-items: center; padding: 0 8px; }
  .brand { padding: 12px 10px; }
  .brand-sub { display: none; }
  .nav { flex-direction: row; padding: 0; gap: 0; flex: 1; overflow-x: auto; }
  .nav-item { flex-direction: column; gap: 3px; padding: 10px 12px; font-size: 11.5px; }
  .sidebar-foot { display: none; }
  .content { padding: 18px 16px 48px; }
  .result { grid-template-columns: 1fr; }
  .result .imgs figure:first-child img { height: 200px; }
  .hist { grid-template-columns: 1fr; gap: 2px; }
  .stepper { display: none; }
}
@media print {
  .sidebar, .actions, .head-actions, .stepper, #step1, #step2, .note, .talk, details, .btn, .toast, .busy { display: none !important; }
  .shell, .content { display: block; padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .result { break-inside: avoid; grid-template-columns: 260px 1fr; }
  .callout { background: none; border-left-color: #000; }
}

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--brand); padding: 20px; }
.login-card { background: var(--surface); border-radius: 16px; padding: 34px 36px 30px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card .brand { color: var(--ink); }
.login-card .brand-mark { background: var(--brand-soft); color: var(--brand); }
.login-card .brand-sub { color: var(--muted); }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .btn { justify-content: center; margin-top: 6px; }
.sidebar-user { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 12.5px; color: rgba(255,255,255,.85); display: flex; flex-direction: column; gap: 2px; }
.sidebar-user b { font-size: 13.5px; color: #fff; }
.sidebar-user .org { color: rgba(255,255,255,.65); }
.sidebar-user .btn { margin-top: 8px; align-self: flex-start; min-height: 30px; padding: 4px 10px; font-size: 12.5px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.sidebar-user .btn:hover { background: rgba(255,255,255,.2); }

/* ---------- admin ---------- */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.subtab { border: 0; background: transparent; padding: 10px 16px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab.active { color: var(--brand); border-bottom-color: var(--brand); }
.subpanel { display: none; }
.subpanel.active { display: block; }
table.admin { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.admin td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.admin td.mono { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
table.admin .detail { color: var(--muted); font-size: 12px; max-width: 420px; word-break: break-all; }
.badge { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.badge.on { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cd; }
.badge.off { background: var(--danger-soft); color: var(--danger); border-color: #e9c2be; }
.org { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.org .org-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.org .org-head .count { margin-left: 4px; }
.org ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.org li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); font-size: 13.5px; }
.org li .btn, .org .org-head .btn { min-height: 28px; padding: 2px 8px; font-size: 12px; margin-left: auto; }
.modal-body.dialog { width: 480px; max-width: 95vw; padding: 24px; }
.modal-body.dialog h2 { margin-bottom: 14px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; }
label.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- admin tables: 横スクロール ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.admin th, table.admin td { white-space: nowrap; }
table.admin td.detail { white-space: normal; min-width: 260px; }
@media (max-width: 900px) {
  .sidebar-user { border-top: 0; padding: 6px 8px; flex-direction: row; align-items: center; gap: 8px; margin-left: auto; }
  .sidebar-user span:not(.org) { display: none; }
  .sidebar-user .org { display: none; }
  .sidebar-user b { font-size: 12px; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar-user .btn { margin-top: 0; }
  .nav { flex: 0 1 auto; }
}

/* ---------- error dialog ---------- */
.modal-body.error { width: 560px; }
.modal-body.error h2 { display: flex; align-items: center; gap: 10px; color: var(--danger); font-size: 18px; margin-bottom: 8px; }
.modal-body.error h2 .ic { width: 22px; height: 22px; }
.err-msg { color: var(--ink-2); font-size: 14px; margin-bottom: 12px; }
.err-sec { border-top: 1px solid var(--line); padding: 12px 0; }
.err-sec p { font-size: 14.5px; line-height: 1.75; }
.err-lbl { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; margin-bottom: 4px; }
.err-tech { border-top: 1px solid var(--line); padding-top: 10px; }
.err-tech summary { color: var(--muted); font-weight: 500; font-size: 13px; }
.err-tech pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: 6px; color: var(--ink-2); }
