/* VPS サービスの画面 (v2)。
   考え方: 上のナビ + 表と項目リストで見せる、落ち着いた業務画面。色は紺 1 色 + 状態の 3 色だけ。
   光・影・動きは使わず、罫線と余白で区切る。ひとつだけ目立たせるのは「接続コマンドの帯」。 */

:root {
  --bg:          #f2f4f7;
  --surface:     #ffffff;
  --surface-2:   #f7f8fa;
  --line:        #dfe3e9;
  --line-strong: #c4cbd5;
  --text:        #172033;
  --muted:       #5a6678;
  --accent:      #2447d6;
  --accent-ink:  #ffffff;
  --accent-soft: #e8edfc;
  --ok:          #0e7a53;
  --ok-soft:     #e2f3ea;
  --warn:        #8f5a00;
  --warn-soft:   #fbf0d9;
  --bad:         #b42318;
  --bad-soft:    #fdeceb;
  --term:        #0f1722;
  --term-text:   #dbe4f0;
  --term-dim:    #7f8da3;
  --term-mark:   #7fd1a8;

  --font: 'Noto Sans JP', system-ui, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Noto Sans JP', monospace;
  --r: 6px;
}

html[data-theme="dark"] {
  --bg:          #0d1219;
  --surface:     #151c26;
  --surface-2:   #1a232f;
  --line:        #263140;
  --line-strong: #364459;
  --text:        #e6ebf2;
  --muted:       #94a1b5;
  --accent:      #86a0ff;
  --accent-ink:  #0a1022;
  --accent-soft: #1d2a52;
  --ok:          #4cc38a;
  --ok-soft:     #12281f;
  --warn:        #e2b04a;
  --warn-soft:   #2b2412;
  --bad:         #f08074;
  --bad-soft:    #2c1816;
  --term:        #080c12;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.7 var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex-shrink: 0; }
code, pre, .mono { font-family: var(--mono); }
[hidden], .none { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.4; }

/* ── 上のナビ ───────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: stretch; gap: 32px;
  padding: 0 28px;
  height: 56px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img { width: 24px; height: 24px; border-radius: 5px; display: block; }

.topnav-links { display: flex; align-items: stretch; gap: 22px; }
.topnav-links a {
  display: flex; align-items: center;
  color: var(--muted);
  font-size: 14.5px; font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.topnav-links a:hover { color: var(--text); text-decoration: none; }
.topnav-links a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }

.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r);
  color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.icon-btn.bad:hover { color: var(--bad); }

.account { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 8px 0 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r);
}
.account-btn:hover, .account.open .account-btn { background: var(--surface-2); border-color: var(--line); }
.avatar {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--surface);
  border-radius: 50%;
  font-size: 12.5px; font-weight: 700;
}
.account-name { font-size: 14px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(10, 20, 40, .16);
  padding: 6px;
  z-index: 60;
}
.menu-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-who b { display: block; font-size: 14px; }
.menu-who span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  background: none; border: none; border-radius: 4px;
  text-align: left; font-size: 14px;
}
.menu button:hover { background: var(--surface-2); }
.menu button.bad { color: var(--bad); }

/* ── ページの枠 ─────────────────────────────── */
.page { max-width: 1120px; margin: 0 auto; padding: 28px 28px 90px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.crumb:hover { color: var(--accent); text-decoration: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-desc { color: var(--muted); font-size: 14px; margin-top: 4px; max-width: 62ch; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.section-title { font-size: 15px; font-weight: 700; margin: 30px 0 10px; }

/* ── ボタン ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  font-size: 14px; font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(.92); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
html[data-theme="dark"] .btn.danger { color: #1a0b09; }
.btn.danger:hover:not(:disabled) { background: var(--bad); filter: brightness(.92); }
.btn.quiet-danger { color: var(--bad); border-color: var(--line-strong); }
.btn.quiet-danger:hover:not(:disabled) { border-color: var(--bad); background: var(--bad-soft); }
.btn.sm { min-height: 30px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }

/* ── 入力 ───────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 13.5px; font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.65; }
.input, .select, .textarea {
  width: 100%;
  min-height: 38px; padding: 7px 11px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
}
.textarea { min-height: 88px; resize: vertical; line-height: 1.55; }
.textarea.code { font-family: var(--mono); font-size: 13px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .75; }
.msg { font-size: 13.5px; min-height: 0; }
.msg.ok { color: var(--ok); }
.msg.ng { color: var(--bad); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.check input { margin-top: 5px; }

/* ── タグ・状態 ─────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 1px 8px; min-height: 22px;
  border-radius: 4px;
  font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.dot.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.cdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--line-strong)); flex-shrink: 0; }
.c-red { --c: #e5484d; } .c-orange { --c: #f76b15; } .c-yellow { --c: #e5a50a; } .c-green { --c: #30a46c; }
.c-cyan { --c: #05a2c2; } .c-blue { --c: #3e63dd; } .c-purple { --c: #8e4ec6; } .c-pink { --c: #d6409f; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--warn-soft); color: var(--warn);
  border-radius: var(--r);
  font-size: 14px; line-height: 1.65;
}
.notice.info { background: var(--accent-soft); color: var(--accent); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice svg { margin-top: 3px; }

/* ── 表 ─────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--surface-2); }
td.nowrap, .nowrap { white-space: nowrap; }
td.end, th.end { text-align: right; }
.cell-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.cell-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.state { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.state.on { color: var(--ok); }
.state.wait { color: var(--warn); }
.state.off { color: var(--muted); }
tr.vacant td { background: var(--surface-2); color: var(--muted); }
tr.vacant .cell-name { font-weight: 500; color: var(--muted); }
.empty { padding: 28px 18px; color: var(--muted); font-size: 14px; text-align: center; }

/* ── パネルと項目リスト ─────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; min-height: 49px; }
.panel-head h2 { font-size: 14.5px; font-weight: 700; }
.panel-body { padding: 16px 18px; }
.panel.danger { border-color: var(--bad); }
.panel.danger .panel-head { background: var(--bad-soft); }
.panel.danger .panel-head h2 { color: var(--bad); }

.props { display: block; }
.prop {
  display: grid; grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 4px 20px; align-items: start;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.prop:last-child { border-bottom: none; }
.prop-label { font-size: 13.5px; color: var(--muted); padding-top: 1px; }
.prop-value { min-width: 0; word-break: break-all; }
.prop-value.mono { font-family: var(--mono); font-size: 13.5px; }
.prop-note { grid-column: 2 / 3; font-size: 13px; color: var(--muted); line-height: 1.65; }
.prop-act { grid-column: 3; grid-row: 1; }
.prop-edit {
  display: none; flex-direction: column; gap: 12px;
  padding: 14px 18px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.prop-edit.open { display: flex; }
.prop-edit:last-child { border-bottom: none; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 使用量のメーター */
.meters { display: grid; gap: 16px; }
.meter-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 6px; }
.meter-top span:first-child { color: var(--muted); }
.meter-top span:last-child { font-weight: 600; text-align: right; }
.meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--accent); }
.meter-fill.warn { background: var(--warn); }
.meter-fill.high { background: var(--bad); }

/* ── タブ ───────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; overflow-y: hidden; }
.tabs button {
  background: none; border: none;
  padding: 10px 14px;
  font-size: 14.5px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }
.tabs button.bad[aria-selected="true"] { border-bottom-color: var(--bad); }
.tabs button.bad { color: var(--bad); margin-left: auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.split { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; }
.subnav button {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; border-radius: var(--r);
  padding: 8px 12px; text-align: left;
  font-size: 14.5px; color: var(--muted);
}
.subnav button:hover { background: var(--surface); color: var(--text); }
.subnav button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.subnav button.bad { color: var(--bad); margin-top: 14px; }
.tab-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.tab-desc { font-size: 14px; color: var(--muted); margin-bottom: 18px; max-width: 64ch; }

/* 切り替えボタン */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.seg button { background: var(--surface); border: none; border-right: 1px solid var(--line-strong); padding: 6px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button:last-child { border-right: none; }
.seg button:hover { color: var(--text); background: var(--surface-2); }
.seg button.active { background: var(--accent); color: var(--accent-ink); }

/* ── 接続コマンドの帯 (この画面でいちばん目立たせるところ) ── */
.term {
  display: flex; align-items: center; gap: 14px;
  background: var(--term); color: var(--term-text);
  border-radius: 8px;
  padding: 13px 14px 13px 18px;
  margin-bottom: 22px;
}
.term-prompt { color: var(--term-mark); font-family: var(--mono); font-size: 15px; user-select: none; }
.term code { flex: 1; min-width: 0; font-size: 15px; overflow-x: auto; white-space: nowrap; }
.term.off code { color: var(--term-dim); }
.term button {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--term-text);
  border: 1px solid #3a475c; border-radius: 5px;
  padding: 5px 12px; font-size: 13px; font-weight: 600;
}
.term button:hover { background: #1b2636; }
.term-label { font-size: 12.5px; color: var(--term-dim); white-space: nowrap; }

/* 手順 (番号は本当に順番があるときだけ) */
.steps { list-style: none; counter-reset: s; }
.steps > li { counter-increment: s; position: relative; padding: 14px 18px 14px 58px; border-bottom: 1px solid var(--line); }
.steps > li:last-child { border-bottom: none; }
.steps > li::before {
  content: counter(s);
  position: absolute; left: 18px; top: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.steps h3 { font-size: 15px; margin-bottom: 4px; }
.steps p { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.snip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 7px 8px 7px 12px; margin-bottom: 6px;
  font-family: var(--mono); font-size: 13px;
}
.snip code { overflow-x: auto; white-space: pre; flex: 1; min-width: 0; }
pre.block { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 13px; line-height: 1.7; overflow-x: auto; margin-bottom: 8px; }

/* 項目の一覧 (鍵・端末・ポート) */
.rows > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.rows > div:last-child { border-bottom: none; }
.rows .main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rows .ico { width: 34px; height: 34px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.rows .t { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rows .s { font-size: 12.5px; color: var(--muted); word-break: break-all; }

/* 運営: 数字 */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.figure { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; }
.figure b { display: block; font-size: 26px; line-height: 1.3; }
.figure span { font-size: 13px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.toolbar .input { max-width: 300px; }
.toolbar .grow { flex: 1; }

/* ── 選択肢 (スロット・実行環境・鍵) ─────────── */
.choices { display: flex; flex-direction: column; gap: 6px; }
.choice {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
}
.choice:hover:not(:disabled) { background: var(--surface-2); }
.choice[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.choice:disabled { opacity: .5; cursor: not-allowed; }
.choice .ico { width: 32px; height: 32px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.choice[aria-checked="true"] .ico { color: var(--accent); background: var(--surface); }
.choice .body { flex: 1; min-width: 0; }
.choice .n { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice .d { font-size: 13px; color: var(--muted); }
.choice .tick { color: var(--accent); opacity: 0; }
.choice[aria-checked="true"] .tick { opacity: 1; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: var(--c, var(--surface)); box-shadow: 0 0 0 1px var(--line-strong) inset; display: inline-flex; align-items: center; justify-content: center; color: #fff; padding: 0; }
.swatch.selected { border-color: var(--text); }
.swatch.none { color: var(--muted); }

/* ── 引き出し (VPS を作る) ──────────────────── */
.backdrop { position: fixed; inset: 0; background: rgba(8, 14, 26, .5); z-index: 200; opacity: 0; pointer-events: none; }
.backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 201;
  width: 100%; max-width: 460px;
  background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(100%); visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 17px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 20px; }
.drawer-foot { padding: 14px 22px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }

/* ── ダイアログ・通知 ───────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(8, 14, 26, .55); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px 26px; width: 100%; max-width: 420px; box-shadow: 0 18px 44px rgba(8, 14, 26, .3); }
.modal-box h2 { font-size: 17px; margin-bottom: 8px; }
.modal-box p { font-size: 14.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.7; }
.modal-box p strong { color: var(--text); font-family: var(--mono); font-size: .93em; }
.modal-box .input { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 10000; pointer-events: none; }
.toast { min-width: 220px; max-width: 360px; padding: 11px 16px; background: var(--text); color: var(--surface); border-radius: var(--r); font-size: 14px; pointer-events: auto; }
.toast.ng { background: var(--bad); color: #fff; }
html[data-theme="dark"] .toast.ng { color: #1a0b09; }

/* ── ファイル ───────────────────────────────── */
.fm-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.fm-path { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; flex: 1; min-width: 160px; font-size: 14.5px; }
.fm-path button { background: none; border: none; color: var(--muted); padding: 3px 7px; border-radius: 4px; display: inline-flex; align-items: center; gap: 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-path button:hover { color: var(--accent); background: var(--surface-2); }
.fm-path button.here { color: var(--text); font-weight: 700; cursor: default; }
.fm-path button.here:hover { background: none; color: var(--text); }
.fm-path .sep { color: var(--muted); }
.fm-info { padding: 8px 18px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.fm-grid, .fm-line { display: grid; grid-template-columns: minmax(0, 1fr) 100px 150px 108px; gap: 12px; align-items: center; padding: 8px 18px; }
.fm-grid { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.fm-line { border-bottom: 1px solid var(--line); }
.fm-line:last-child { border-bottom: none; }
.fm-line:hover { background: var(--surface-2); }
.fm-name { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.fm-name span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-line.dir .fm-name svg { color: var(--accent); }
.fm-meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.fm-ops { display: flex; justify-content: flex-end; gap: 2px; }
.panel.dropping { outline: 2px dashed var(--accent); outline-offset: -6px; }
.up { padding: 9px 18px; border-bottom: 1px solid var(--line); }
.up-top { display: flex; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.up-top .n { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-top .ng { color: var(--bad); }
.up .meter { height: 4px; }
.editor { position: fixed; inset: 0; z-index: 9000; background: var(--bg); display: flex; flex-direction: column; }
.editor-bar { display: flex; align-items: center; gap: 12px; padding: 9px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.editor-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-state { font-size: 13px; color: var(--muted); }
.editor textarea { flex: 1; width: 100%; resize: none; border: none; outline: none; padding: 16px; background: var(--bg); color: var(--text); font: 14px/1.65 var(--mono); tab-size: 4; white-space: pre; overflow: auto; }

/* ── ログイン ───────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-aside { background: #101a33; color: #e4eaf6; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-aside .brand { color: #fff; }
.auth-aside h1 { font-size: 30px; line-height: 1.5; font-weight: 700; max-width: 17em; margin-bottom: 14px; }
.auth-aside p { color: #a9b6d0; max-width: 34em; }
.auth-aside ul { list-style: none; border-top: 1px solid #26365e; }
.auth-aside li { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid #26365e; font-size: 14px; }
.auth-aside li b { color: #fff; font-weight: 600; }
.auth-aside li span { color: #a9b6d0; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-top { display: flex; justify-content: flex-end; margin-bottom: 24px; }
.auth-box h2 { font-size: 21px; margin-bottom: 4px; }
.auth-box .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-switch { margin-top: 22px; font-size: 14px; color: var(--muted); }
.auth-switch button { background: none; border: none; color: var(--accent); font-weight: 600; padding: 0; }
.auth-switch button:hover { text-decoration: underline; }
.nf { min-height: calc(100vh - 56px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; }
.nf b { font-size: 48px; line-height: 1.2; }
.nf p { color: var(--muted); margin-bottom: 14px; }

/* ── プランの比較表 ─────────────────────────── */
.plan-table th, .plan-table td { text-align: center; }
.plan-table th:first-child, .plan-table td:first-child { text-align: left; color: var(--muted); font-weight: 500; white-space: nowrap; }
.plan-table thead th { font-size: 15px; color: var(--text); padding-top: 14px; padding-bottom: 14px; }
.plan-table .price td { font-size: 18px; font-weight: 700; }
.plan-table .price td small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.plan-table td.cur, .plan-table th.cur { background: var(--accent-soft); }

/* ── 細かい調整 ─────────────────────────────── */
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.page-head h1 .state { font-size: 14px; }
.page-head h1 .cdot { width: 12px; height: 12px; }
.page > .table-wrap + * { margin-top: 14px; }
.panel .table-wrap { border: none; border-radius: 0; background: transparent; }
.panel > .props:empty, .panel > .rows:empty { display: none; }

/* ── 画面が狭いとき ─────────────────────────── */
@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { padding: 28px 24px; gap: 24px; }
  .auth-aside h1 { font-size: 22px; }
  .auth-aside li { grid-template-columns: 1fr; gap: 0; }
  .split { grid-template-columns: 1fr; gap: 16px; }
  .subnav { position: static; flex-direction: row; overflow-x: auto; border-bottom: 1px solid var(--line); }
  .subnav button { white-space: nowrap; }
  .subnav button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--accent); background: none; }
  .subnav button.bad { margin-top: 0; }
}
@media (max-width: 720px) {
  .topnav { flex-wrap: wrap; height: auto; padding: 0 16px; gap: 0 16px; }
  .brand { height: 52px; }
  .topnav-right { height: 52px; }
  .topnav-links { order: 3; width: 100%; overflow-x: auto; height: 42px; border-top: 1px solid var(--line); }
  .account-name { display: none; }
  .page { padding: 20px 16px 70px; }
  .prop { grid-template-columns: minmax(0, 1fr) auto; }
  .prop-label { grid-column: 1 / -1; }
  .prop-value { grid-column: 1; }
  .prop-note { grid-column: 1 / -1; }
  .prop-act { grid-column: 2; grid-row: 2; }
  .fm-grid, .fm-line { grid-template-columns: minmax(0, 1fr) 108px; }
  .fm-grid > :nth-child(2), .fm-grid > :nth-child(3), .fm-size, .fm-time { display: none; }
  th, td { padding: 10px 12px; }
  .col-hide { display: none; }
  .term { flex-wrap: wrap; }
  #toasts { left: 14px; right: 14px; }
  .toast { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .dot.pulse { animation: none; } }
