/* field-english-ops 練習アプリ。外部の CSS・フォントは使わない (規則 #21) */
:root {
  --bg: #f6f5f2; --card: #fff; --fg: #1a1a1a; --muted: #6b6b6b; --line: #e2e0db;
  --accent: #e1231a; --accent-fg: #fff; --ok: #2e7d32; --warn: #b26a00; --chip: #ecebe7;
  --tabs-h: 58px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121212; --card: #1e1e1e; --fg: #ececec; --muted: #9a9a9a; --line: #333;
          --chip: #2a2a2a; --ok: #66bb6a; --warn: #ffb74d; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: 16px; line-height: 1.55;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.top { background: #1a1a1a; color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
       border-bottom: 3px solid var(--accent); }
.top h1 { margin: 0; font-size: 17px; font-weight: 700; }
main { max-width: 720px; margin: 0 auto; padding: 12px 16px 24px; }
.pad { padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h2 { font-size: 19px; margin: 20px 0 8px; }
h3 { font-size: 16px; margin: 16px 0 6px; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card);
        border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tabs button { flex: 1; height: var(--tabs-h); border: 0; background: none; font-size: 14px; color: var(--muted); }
.tabs button[aria-selected="true"] { color: var(--accent); font-weight: 700; box-shadow: inset 0 3px 0 var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
       padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 700; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stats { display: flex; gap: 8px; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 26px; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--chip); border-radius: 999px; padding: 6px 12px; min-height: 36px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.tag { display: inline-block; font-size: 12px; padding: 0 6px; border-radius: 6px; background: var(--chip); color: var(--muted); }
.tag.core { background: #fff1d6; color: #8a5a00; }
.tag.safety { background: #ffe0dd; color: #a3150e; }
@media (prefers-color-scheme: dark) { .tag.core { background: #4a3a10; color: #ffd27a; } .tag.safety { background: #4a1714; color: #ff9b93; } }

.filters { display: grid; gap: 8px; }
.filters select, .filters input[type=search] { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 6px 10px; }
.filters .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.list { list-style: none; margin: 0; padding: 0; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.item.hidden-row { opacity: .55; }
.item .head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.item .head .id { font-variant-numeric: tabular-nums; }
.item .ja { margin: 4px 0 0; }
.item .en { margin: 2px 0 0; font-weight: 600; }
.hide-en .item .en { filter: blur(6px); }
.hide-en .item .en.peek { filter: none; }
.item .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--muted); }
.iconbtn { border: 0; background: none; min-width: 36px; min-height: 36px; font-size: 20px; line-height: 1; padding: 0; }
.star[aria-pressed="true"] { color: #e0a400; }
.known { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 13px; color: var(--fg); }
.known input { width: 20px; height: 20px; }

.flash { text-align: center; padding: 22px 16px; }
.flash .who { font-size: 13px; color: var(--muted); }
.flash .prompt { font-size: 22px; margin: 10px 0; font-weight: 600; }
.flash .answer { font-size: 22px; margin: 10px 0 4px; font-weight: 700; }
.flash .sub { color: var(--muted); }
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.grades .btn { min-height: 56px; flex-direction: column; gap: 0; font-weight: 700; }
.grades .btn small { font-weight: 400; font-size: 11px; color: var(--muted); }
.g-forgot { border-color: var(--accent) !important; }
.g-easy { border-color: var(--ok) !important; }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); }

.banner { position: sticky; top: 0; z-index: 9; background: #fff6d6; color: #5a4300; padding: 10px 16px; font-size: 14px; }
.banner .btn { min-height: 34px; padding: 4px 12px; margin-left: 8px; }
@media (prefers-color-scheme: dark) { .banner { background: #3d3410; color: #ffe08a; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom));
         background: #1a1a1a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: 90vw; }

.doc table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; }
.doc blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid var(--line); color: var(--muted); }
.doc code { font-size: 90%; background: var(--chip); padding: 0 4px; border-radius: 4px; }
details.card > summary { font-weight: 700; cursor: pointer; }
textarea { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 8px; font-size: 13px; }

/* 歩く (歩き用トラック) */
.walk .item .head { color: var(--fg); font-size: 15px; }
.walkctl { justify-content: center; gap: 6px; flex-wrap: nowrap; }
.walkctl .btn { padding: 8px 10px; min-width: 44px; }
