/* フラットデザイン・白黒基調（north.rip に合わせる）: 影・枠線・角丸・グラデーションを使わず、
   ベタ塗りの面と濃淡だけで区切る。色を使うのは危険操作（赤）・成功（緑）・検索語の強調（黄）だけ。 */
:root {
  --bg: #f0f0f0;
  --surface: #ffffff;
  --field: #ebebeb;
  --field-hover: #dcdcdc;
  --line: #b5b5b5;
  --fg: #111111;
  --muted: #4f4f4f;
  --accent: #111111;
  --accent-fg: #ffffff;
  --header-bg: #111111;
  --header-fg: #ffffff;
  --danger: #d33a2c;
  --ok: #1f7a4d;
  --mark: #ffe066;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #161616;
    --field: #2a2a2a;
    --field-hover: #383838;
    --line: #5a5a5a;
    --fg: #f0f0f0;
    --muted: #b8b8b8;
    --accent: #f0f0f0;
    --accent-fg: #111111;
    --header-bg: #262626;
    --header-fg: #f0f0f0;
    --danger: #ef5b4a;
    --ok: #5cc98a;
    --mark: #7a6200;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.75 "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 0 16px 80px; }
a { color: inherit; }

/* ヘッダーはアクセント色のベタ面 */
header {
  padding: 28px 24px 22px;
  background: var(--header-bg); color: var(--header-fg);
}
header h1 { margin: 0 0 4px; font-size: 26px; font-weight: 800; letter-spacing: .01em; line-height: 1.3; }
header .sub { color: inherit; opacity: .9; }
header code { background: rgba(128, 128, 128, .3); color: inherit; }
.back {
  display: inline-block; margin-bottom: 10px;
  color: inherit; opacity: .85; font-size: 13px; font-weight: 700; text-decoration: none;
}
.back:hover { opacity: 1; }

/* ツール一覧: 白いタイル。ホバーでアクセント色に塗り替わる */
.tools { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 4px; }
.tool {
  display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: center;
  padding: 18px 20px; background: var(--surface); color: inherit; text-decoration: none;
}
.tool::after { content: "→"; grid-column: 2; grid-row: 1 / span 2; font-size: 20px; font-weight: 700; color: var(--accent); }
.tool:hover { background: var(--accent); color: var(--accent-fg); }
.tool:hover::after, .tool:hover .tool-desc { color: inherit; }
.tool-name { font-weight: 800; font-size: 16px; }
.tool-desc { grid-column: 1; margin-top: 2px; color: var(--muted); font-size: 13.5px; }

.disclaimer { margin-top: 24px; color: var(--muted); font-size: 13px; }
.disclaimer p { margin: 0; }

.sub, .hint { color: var(--muted); font-size: 13.5px; margin: 6px 0; }
code { font-family: var(--mono); font-size: 13px; background: var(--field); padding: 1px 5px; }

/* 手順: 白い面を詰めて並べる。番号はアクセント色の正方形 */
section { background: var(--surface); padding: 20px 24px 22px; margin-top: 4px; }
header + section { margin-top: 16px; }
section.locked { opacity: .6; pointer-events: none; }
h2 { margin: 0 0 14px; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.num {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  background: var(--accent); color: var(--accent-fg); font-size: 14px; font-weight: 800;
}

.row { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.row.wrap { flex-wrap: wrap; gap: 6px 16px; }
.row.end { justify-content: flex-end; }
.label { color: var(--muted); font-size: 13px; font-weight: 700; min-width: 3em; }
.check, .radio, .inline { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.modes { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 6px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); margin: 0; width: 16px; height: 16px; }

/* 入力欄は枠なしの塗り面。フォーカスで下辺にアクセント色 */
input[type=text], input[type=password], input[type=number], input[type=datetime-local], textarea {
  font: inherit; color: var(--fg); background: var(--field);
  border: 0; border-bottom: 2px solid var(--line); border-radius: 0; padding: 8px 10px 6px;
}
input[type=text]:focus, input[type=password]:focus, input[type=number]:focus,
input[type=datetime-local]:focus, textarea:focus { outline: none; border-bottom-color: var(--accent); }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#token { flex: 1; min-width: 0; font-family: var(--mono); }
#token.masked { -webkit-text-security: disc; }
textarea { width: 100%; resize: vertical; margin-top: 6px; }
.num-input { width: 6em; }

button {
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 0; background: var(--accent); color: var(--accent-fg);
  border-radius: 0; padding: 8px 18px; white-space: nowrap;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:active:not(:disabled) { filter: brightness(.92); }
button.ghost { background: var(--field); color: var(--fg); }
button.ghost:hover:not(:disabled) { filter: none; background: var(--field-hover); }
button.danger { background: var(--danger); color: #fff; }
button.small, .small { font-size: 13px; padding: 5px 12px; }
button:disabled { opacity: .35; cursor: not-allowed; }

.shots { margin: 8px 0; }
.shots summary { cursor: pointer; color: var(--accent); font-size: 13.5px; font-weight: 700; }
.shots img { display: block; max-width: 100%; height: auto; margin-top: 10px; }

.me { margin-top: 12px; padding: 10px 14px; background: var(--field); }
.status { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.error { color: var(--danger); font-size: 14px; font-weight: 700; }

.summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 16px -24px 0; padding: 10px 24px; background: var(--field);
}
#count { font-weight: 800; font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.summary button.ghost { background: var(--surface); }
.summary button.ghost:hover:not(:disabled) { background: var(--field-hover); }

/* 一覧: 行ごとに塗り面、行間の隙間で区切る */
.list { list-style: none; margin: 4px 0 0; padding: 0; max-height: 520px; overflow-y: auto; display: grid; gap: 2px; }
.list:empty { display: none; }
.list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px 12px; background: var(--field); }
.list li.off { opacity: .55; }
.list li.done .text { text-decoration: line-through; color: var(--muted); }
.meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.text { white-space: pre-wrap; word-break: break-word; }
.text mark { background: var(--mark); color: inherit; }
.badge { font-size: 12px; font-weight: 700; padding: 1px 7px; background: var(--field-hover); color: var(--fg); }
.badge.reply { background: var(--fg); color: var(--surface); }
.badge.quote { background: var(--muted); color: var(--surface); }
.badge.repost { background: var(--surface); color: var(--fg); }
.st-ok { color: var(--ok); font-weight: 700; }
.st-ng { color: var(--danger); font-weight: 700; }

.progress { height: 10px; background: var(--field); margin-top: 14px; }
#bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
details summary { cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 700; margin-top: 10px; }
#log {
  margin: 6px 0 0; max-height: 240px; overflow: auto;
  background: var(--field); padding: 10px 12px;
  font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-all;
}
#log:empty { display: none; }

dialog {
  border: 0; border-top: 6px solid var(--danger); border-radius: 0; padding: 22px 24px;
  background: var(--surface); color: var(--fg); max-width: 420px; width: calc(100% - 32px);
}
dialog::backdrop { background: rgba(15, 17, 18, .6); }
dialog h3 { margin: 0 0 10px; font-size: 18px; font-weight: 800; }
#confirm-input { width: 100%; font-family: var(--mono); }
