:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d1f23; --muted: #646b75; --line: #e1e4e9;
  --accent: #2f6fed; --accent-text: #fff; --ok: #1b7f37; --error: #c4262e;
  --warn-bg: #fff6e6; --warn-line: #f0a020;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416; --card: #1d1f23; --text: #e8eaed; --muted: #9aa0a8; --line: #33363c;
    --accent: #5b8ff9; --accent-text: #0b1020; --ok: #4cc26b; --error: #ff6b6b;
    --warn-bg: #2e2510; --warn-line: #c88a1c;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 2.5rem 1rem; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
}
main { max-width: 44rem; margin: 0 auto; }
.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: .25rem; }
.header-row h1 { font-size: 1.6rem; margin: 0; }
.lang-btn { font-size: .85rem; padding: .35rem .75rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.lede { color: var(--muted); margin: 0 0 1.5rem; }
a { color: var(--accent); }
code { font: .9em ui-monospace, Menlo, monospace; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.1rem 1.25rem; margin-bottom: 1rem;
}
details.card summary { cursor: pointer; font-weight: 600; }
details.card[open] summary { margin-bottom: .75rem; }

.steps { margin: 0 0 .5rem; padding-left: 1.25rem; }
.steps li { margin-bottom: .35rem; }
.note { color: var(--muted); font-size: .875rem; margin: .5rem 0; }
.meta { font-size: .875rem; color: var(--muted); margin: .25rem 0 .75rem; }
.warn {
  background: var(--warn-bg); border-left: 3px solid var(--warn-line); border-radius: 6px;
  padding: .6rem .8rem; font-size: .875rem; margin: .75rem 0 0;
}

.field { margin-bottom: .5rem; }
.label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; }
.radio { display: block; font-size: .9rem; margin: .25rem 0; }

input[type="password"], input[type="text"], table.aps input {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem;
}
input[type="password"] { font-family: ui-monospace, Menlo, monospace; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.checkbox-label {
  display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem;
  color: var(--muted); margin-top: .5rem; cursor: pointer; user-select: none;
}
.checkbox-label input[type="checkbox"] { width: auto; cursor: pointer; }

table.aps { width: 100%; border-collapse: collapse; margin: .25rem 0 .75rem; }
table.aps th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 0 .25rem .25rem; }
table.aps td { padding: .15rem .25rem; }
table.versions { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.versions th { text-align: left; color: var(--muted); font-weight: 600; padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
table.versions td { padding: .45rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.versions tr:last-child td { border-bottom: 0; }
table.versions td:first-child { white-space: nowrap; font-weight: 600; }
table.versions td:nth-child(2) { white-space: nowrap; color: var(--muted); }
table.aps tr.from-device input[type="text"] { box-shadow: inset 3px 0 0 var(--accent); }

.row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.install-row { margin: .75rem 0 .5rem; }
.button {
  font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: .6rem 1.1rem; cursor: pointer;
  background: var(--accent); color: var(--accent-text); transition: opacity .15s;
}
.button.secondary { background: var(--line); color: var(--text); }
.button.danger { background: var(--error); color: #fff; }
.button.small { padding: .3rem .6rem; font-size: .85rem; }
.button:disabled, input:disabled { opacity: .5; cursor: not-allowed; }

.scan ul { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.scan li button { text-align: left; }

.status { font-size: .9rem; margin: .5rem 0 0; }
.status.ok { color: var(--ok); }
.status.error { color: var(--error); }
.status:empty { display: none; }

footer { margin-top: 1.5rem; text-align: center; }
[hidden] { display: none !important; }
