:root {
  --bg: #f4f5f8; --panel: #ffffff; --line: #d9dce3; --text: #1d2230; --muted: #5d6475; --input: #ffffff; --inputLine: #b9bfcc;
  --accent: #F35362; --accentText: #fff; --ok: #1f8a4c; --warn: #b26a00; --bad: #c62828; --soft: #fff1f2; --chip: #eef0f5;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #14161c; --panel: #1d2029; --line: #333846; --text: #e9ebf1; --muted: #a3a9b8; --input: #262a35; --inputLine: #4a5163;
  --soft: #3a2228; --chip: #2a2e3a; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #14161c; --panel: #1d2029; --line: #333846; --text: #e9ebf1; --muted: #a3a9b8; --input: #262a35; --inputLine: #4a5163;
  --soft: #3a2228; --chip: #2a2e3a; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif; }
a { color: var(--accent); }
.loading { padding: 40px; color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; background: var(--input); border: 1.5px solid var(--inputLine); border-radius: 8px; padding: 9px 11px; font-size: 15px;
}
textarea { min-height: 84px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--panel); border-radius: 9px; padding: 9px 16px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accentText); border-color: var(--accent); }
.btn.big { padding: 12px 22px; font-size: 16px; }
.btn.small { padding: 5px 10px; font-size: 14px; }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }

/* 1画面：左フォーム・右結果 */
.split { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(380px, 520px); gap: 18px; padding: 18px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.card h2 { margin: 0 0 10px; font-size: 18px; }
.card h3 { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { margin: 0 0 12px; }
.field > label, .lab { display: block; font-weight: 700; margin-bottom: 4px; font-size: 15px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 3px; }
.sticky { position: sticky; top: 76px; }

/* ステップ編集 */
.step { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.step > summary { list-style: none; cursor: pointer; padding: 13px 16px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.step > summary::-webkit-details-marker { display: none; }
.step > summary .num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; }
.step > summary .sub { color: var(--muted); font-weight: 400; font-size: 14px; }
.step[open] > summary { border-bottom: 1px solid var(--line); }
.stepbody { padding: 14px 16px; }
.item { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; background: var(--bg); }
.item .head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 700; font-size: 14px; color: var(--muted); }
.item .head .spacer { flex: 1; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.chk input { width: 18px; height: 18px; }

/* 状態 */
.status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--chip); }
.pill.ok { background: #dff3e6; color: var(--ok); }
.pill.warn { background: #fff0d6; color: var(--warn); }
.pill.bad { background: #fde2e2; color: var(--bad); }
:root[data-theme="dark"] .pill.ok { background: #183526; } :root[data-theme="dark"] .pill.warn { background: #3a2c12; } :root[data-theme="dark"] .pill.bad { background: #3b1c1c; }
.problems { margin: 8px 0 0; padding-left: 20px; color: var(--bad); font-size: 14px; }
.saved { color: var(--muted); font-size: 13px; }

/* プレビュー */
.phone { width: 390px; max-width: 100%; height: 760px; margin: 0 auto; border: 10px solid #1d1f26; border-radius: 36px; overflow: hidden; background: #fff; }
.phone iframe { width: 100%; height: 100%; border: 0; display: block; }

/* レポート */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); }
.kpi.a { border-top: 5px solid var(--accent); } .kpi.b { border-top: 5px solid #7a8399; }
.kpi .big { font-size: 30px; font-weight: 800; line-height: 1.2; }
.kpi table { width: 100%; font-size: 14px; margin-top: 8px; }
.kpi td:last-child { text-align: right; font-weight: 700; }
.verdict { font-size: 18px; font-weight: 800; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: left; }
table.t td.n, table.t th.n { text-align: right; white-space: nowrap; }
.bar { height: 10px; background: var(--chip); border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.drop { color: var(--bad); font-weight: 700; }

/* 設置 */
pre.code { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; font-size: 13px; margin: 6px 0; }
input[type=range] { width: 100%; }

/* ログイン */
.login { max-width: 420px; margin: 9vh auto; }
.auth-logo { text-align: center; margin-bottom: 18px; } .auth-logo img { height: 34px; width: auto; }
.err { color: var(--bad); font-weight: 600; margin: 8px 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 15px; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }

/* ── 枠：POP STAR と同じサイドパネル ── */
:root { --side-bg: #eef3fa; --side-line: #dfe7f3; --side-ink: #45506a; --side-ink-hi: #141b2d; --side-ink-lo: #8a95ab; --side-hover: rgba(43, 86, 160, .07); --side-on-bg: #ffffff; --side-on-ink: var(--accent); --side-on-shadow: 0 1px 2px rgba(20, 40, 90, .08), 0 2px 8px -2px rgba(20, 40, 90, .10); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --side-bg: #11151f; --side-line: rgba(255,255,255,.06); --side-ink: #b9bfcd; --side-ink-hi: #ffffff; --side-ink-lo: #7c8396; --side-hover: rgba(255,255,255,.06); --side-on-bg: rgba(243,83,98,.14); --side-on-ink: #ff7a86; --side-on-shadow: none; } }
:root[data-theme="dark"] { --side-bg: #11151f; --side-line: rgba(255,255,255,.06); --side-ink: #b9bfcd; --side-ink-hi: #ffffff; --side-ink-lo: #7c8396; --side-hover: rgba(255,255,255,.06); --side-on-bg: rgba(243,83,98,.14); --side-on-ink: #ff7a86; --side-on-shadow: none; }
.ld { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ll { display: none; } :root:not([data-theme="light"]) .ld { display: inline-block; } }
:root[data-theme="dark"] .ll { display: none; } :root[data-theme="dark"] .ld { display: inline-block; }
.shell { --side-w: 236px; min-height: 100vh; padding-left: 76px; }
.shell.pinned { padding-left: var(--side-w); }
.pinned .side, .pinned .side:hover, .resizing .side, .resizing .side:hover { box-shadow: none; transition: none; }
.side { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 76px; background: var(--side-bg); border-right: 1px solid var(--side-line); color: var(--side-ink); padding: 14px 8px 12px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; transition: width .18s ease .15s, box-shadow .18s ease .15s; }
.side:hover, .side:focus-within, .pinned .side, .resizing .side { width: var(--side-w); box-shadow: 12px 0 32px -12px rgba(15, 18, 30, .28); transition-delay: .06s; }
.logo-row { display: flex; align-items: center; justify-content: center; flex: none; }
.logo-row .logo { flex: 1; }
.logo { display: flex; align-items: center; justify-content: center; height: 40px; padding: 0 6px; text-decoration: none; flex: none; }
.logo .mark { display: block; width: 30px; height: 30px; }
.logo .full { display: none; }
.logo .full img { height: 22px; width: auto; }
.side:hover .logo, .side:focus-within .logo, .pinned .side .logo, .resizing .side .logo { justify-content: flex-start; padding-left: 12px; }
.side:hover .logo .mark, .side:focus-within .logo .mark, .pinned .side .logo .mark, .resizing .side .logo .mark { display: none; }
.side:hover .logo .full, .side:focus-within .logo .full, .pinned .side .logo .full, .resizing .side .logo .full { display: block; }
.pin { display: none; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--side-ink-lo); cursor: pointer; place-items: center; }
.pin:hover { background: var(--side-hover); color: var(--side-ink-hi); }
.pin.on { color: var(--side-on-ink); }
.side:hover .pin, .side:focus-within .pin, .pinned .pin { display: grid; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; scrollbar-width: none; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; border-radius: 10px; text-decoration: none; color: var(--side-ink); font-weight: 500; white-space: nowrap; }
.nav a .tl { display: none; }
.nav a .ts { font-size: 10.5px; line-height: 1.2; }
.nav a:hover { background: var(--side-hover); color: var(--side-ink-hi); }
.nav a.on { background: var(--side-on-bg); color: var(--side-on-ink); box-shadow: var(--side-on-shadow); font-weight: 700; }
.nav a svg { flex: none; opacity: .9; width: 20px; height: 20px; }
.nav .grp { height: 1px; background: var(--side-line); margin: 6px 10px; font-size: 0; overflow: hidden; }
.side:hover .nav a, .side:focus-within .nav a, .pinned .side .nav a, .resizing .side .nav a { flex-direction: row; gap: 12px; padding: 10px 12px; }
.side:hover .nav a .tl, .side:focus-within .nav a .tl, .pinned .side .nav a .tl, .resizing .side .nav a .tl { display: inline; font-size: 15px; }
.side:hover .nav a .ts, .side:focus-within .nav a .ts, .pinned .side .nav a .ts, .resizing .side .nav a .ts { display: none; }
.side:hover .nav .grp, .side:focus-within .nav .grp, .pinned .side .nav .grp, .resizing .side .nav .grp { height: auto; background: none; margin: 10px 12px 2px; font-size: 12px; color: var(--side-ink-lo); }
.side .me { flex: none; border-top: 1px solid var(--side-line); padding-top: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 12px; color: var(--side-ink); }
.side .me b { color: var(--side-ink-hi); } .side .me .faint { color: var(--side-ink-lo); }
.side .me .av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
.side .me .mi, .side .me .out { display: none; }
.side .me .out { background: transparent; border-color: transparent; color: var(--side-ink); }
.side:hover .me, .side:focus-within .me, .pinned .side .me, .resizing .side .me { justify-content: flex-start; padding-left: 6px; }
.side:hover .me .mi, .side:focus-within .me .mi, .pinned .side .me .mi, .resizing .side .me .mi { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
.side:hover .me .out, .side:focus-within .me .out, .pinned .side .me .out, .resizing .side .me .out { display: inline-flex; }
.side-resize { position: absolute; top: 0; right: -3px; width: 8px; height: 100%; cursor: col-resize; z-index: 2; display: none; }
.side-resize::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s; }
.side-resize:hover::after, .resizing .side-resize::after { background: var(--accent); }
.side:hover .side-resize, .pinned .side-resize, .resizing .side-resize { display: block; }
.resizing .side, .resizing.shell { transition: none !important; }
.topbar { position: sticky; top: 0; z-index: 40; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .lbl { color: var(--muted); font-weight: 700; }
.topbar select { width: auto; min-width: 260px; }
.sticky { top: 72px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 16px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
.kpis4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 1300px) { .kpis4 { grid-template-columns: repeat(2, 1fr); } }
.kpi .small { font-size: 13px; }
.onoff { display: flex; gap: 10px; margin: 6px 0 10px; }
.onoff .btn { flex: 1; justify-content: center; }
@media (max-width: 640px) { .shell, .shell.pinned { padding-left: 76px; } .topbar { padding: 0 12px; } .topbar select { min-width: 0; flex: 1; } }
