/* 色の違いだけに頼らない：明るさの差・太い枠・文字で区別する（計測アプリの app.css と同じ考え） */
:root { --ink: #111; --paper: #fff; --soft: #f1f1ee; --line: #b9b9b2; --mid: #55554f; --dark: #111; --on-dark: #fff; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 17px; line-height: 1.6; -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.top { display: flex; align-items: center; gap: 8px 12px; background: var(--dark); color: var(--on-dark); padding: 10px 16px; position: relative; z-index: 10; }
.brand { font-weight: 800; min-width: 0; }
.brand small { display: block; font-weight: 400; font-size: 13px; opacity: .9; }

/* 左上の大会選び（37章）。押すと下に一覧が出る */
.switch { position: relative; flex: 1 1 auto; min-width: 0; }
.switch-btn { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; max-width: 100%; text-align: left;
  background: transparent; color: var(--on-dark); border: 2px solid var(--on-dark); border-radius: 10px; padding: 4px 12px 6px; }
.switch-btn small { flex-basis: 100%; font-size: 12px; opacity: .9; }
.switch-btn .cur { font-weight: 800; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.switch-btn[aria-expanded="true"] { background: var(--on-dark); color: var(--ink); }
.switch-btn .caret { font-size: 14px; }
.switch-panel { position: absolute; top: calc(100% + 8px); left: 0; width: min(340px, calc(100vw - 32px)); max-height: 70vh; overflow: auto;
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; padding: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.switch-panel .head { font-size: 13px; font-weight: 700; color: var(--mid); padding: 6px 8px 2px; }
.switch-panel .item { display: block; width: 100%; text-align: left; background: var(--paper); border: 0; border-radius: 8px; padding: 10px 10px; font-weight: 700; }
.switch-panel .item:hover, .switch-panel .item:focus-visible { background: var(--soft); }
.switch-panel .item[aria-current="true"] { background: var(--dark); color: var(--on-dark); }
.switch-panel hr { border: 0; border-top: 2px solid var(--line); margin: 6px 0; }

.menu-btn { background: transparent; color: var(--on-dark); border: 2px solid var(--on-dark); border-radius: 8px; padding: 8px 12px; font-weight: 800; white-space: nowrap; }

/* 大会ごとのメニュー：パソコンでは左の列、スマホでは「≡ メニュー」で開く */
.layout { display: block; }
.side { padding: 12px 16px; border-bottom: 3px solid var(--ink); background: var(--soft); }
.side-name { font-size: 13px; font-weight: 700; color: var(--mid); margin: 0 0 6px; overflow-wrap: anywhere; }
.side .nav { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-left: 4px solid transparent; border-radius: 0 8px 8px 0;
  padding: 10px 10px; font-weight: 700; color: var(--ink); }
.side .nav.sub { padding-left: 28px; font-weight: 400; }
.side .nav:hover { background: var(--paper); }
.side .nav[aria-current="page"] { background: var(--dark); color: var(--on-dark); border-left-color: var(--ink); font-weight: 800; }
.side .nav[aria-current="page"]::before { content: "● "; }
@media (max-width: 799px) {
  .side:not(.open) { display: none; }
  .side.open { position: absolute; left: 0; right: 0; z-index: 9; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
}
@media (min-width: 800px) {
  .menu-btn { display: none; }
  .layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .layout:has(> .side[hidden]) { display: block; }
  .side { position: sticky; top: 0; min-height: calc(100vh - 64px); border-bottom: 0; border-right: 3px solid var(--ink); }
}

.wrap { max-width: 920px; margin: 0 auto; padding: 16px 16px 48px; min-width: 0; }
.boot { text-align: center; padding: 40px 0; }
h1 { font-size: 24px; margin: 8px 0 12px; }
h2 { font-size: 19px; margin: 28px 0 8px; border-bottom: 3px solid var(--ink); padding-bottom: 4px; }
p.note { color: var(--mid); font-size: 15px; margin: 4px 0 12px; }

.card { border: 3px solid var(--ink); border-radius: 12px; padding: 16px; margin: 12px 0; background: var(--paper); }
label { display: block; font-weight: 700; margin: 12px 0 4px; }
textarea { width: 100%; border: 2px solid var(--ink); border-radius: 8px; padding: 10px 12px; font: inherit; line-height: 1.7; }
.preview { white-space: pre-wrap; overflow-wrap: anywhere; border: 2px dashed var(--ink); border-radius: 8px; padding: 12px; background: var(--soft); font: inherit; font-size: 15px; }
input[type=email], input[type=text], input[inputmode=numeric], select {
  width: 100%; max-width: 420px; border: 2px solid var(--ink); border-radius: 8px; padding: 10px 12px; background: var(--paper); }
input.code { font-size: 28px; letter-spacing: .3em; max-width: 240px; text-align: center; }
.btn { display: inline-block; border: 3px solid var(--ink); background: var(--dark); color: var(--on-dark); border-radius: 10px;
  padding: 10px 18px; font-weight: 800; min-height: 48px; margin: 12px 8px 0 0; }
.btn.sub { background: var(--paper); color: var(--ink); }
.btn.small { min-height: 0; padding: 4px 10px; margin: 0; font-size: 15px; border-width: 2px; }
.btn:disabled { opacity: .5; cursor: default; }

.msg { border: 3px solid var(--ink); border-radius: 10px; padding: 10px 14px; margin: 12px 0; background: var(--soft); }
.msg.bad { background: var(--dark); color: var(--on-dark); }
.msg.bad::before { content: "⚠ "; }
.msg.good::before { content: "✓ "; font-weight: 800; }

table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 15px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 8px 6px; vertical-align: top; }
th { border-bottom: 2px solid var(--ink); font-size: 14px; }
td.act { text-align: right; white-space: nowrap; }
.tag { display: inline-block; border: 2px solid var(--ink); border-radius: 6px; padding: 0 6px; font-size: 13px; font-weight: 700; }
.tag.solid { background: var(--dark); color: var(--on-dark); }
.muted { color: var(--mid); }
.big { font-size: 20px; }
.big b { font-size: 30px; }
.ver { text-align: center; font-size: 12px; color: var(--mid); padding: 16px; }

@media (max-width: 640px) {
  table.users thead { display: none; }
  table.users tr { display: block; border-bottom: 2px solid var(--line); padding: 6px 0; }
  table.users td { display: block; border: 0; padding: 2px 0; }
  table.users td.act { text-align: left; padding-top: 6px; }
}

/* メールの設定・差出人のドメイン（0.4.0） */
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 14px; word-break: break-all; }
.note.small { font-size: 14px; margin: 2px 0 6px; }
table.users tbody th { text-align: left; white-space: nowrap; padding-right: 12px; }

/* 運営メンバーの役割と権限のチェック（37章）。色に頼らず、太い枠とチェックの形で分かるように */
fieldset.perms { border: 2px solid var(--ink); border-radius: 10px; padding: 8px 14px 4px; margin: 14px 0 6px; }
fieldset.perms legend { font-weight: 700; padding: 0 6px; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 6px 18px 6px 0; }
label.check input { width: 22px; height: 22px; accent-color: var(--ink); }

/* 設定：運営メンバーのカード（0.6.1） */
.member { border: 2px solid var(--ink); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.member .who { font-size: 18px; margin-bottom: 4px; }
.member .row { display: flex; gap: 12px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 15px; }
.member .row .k { flex: 0 0 3.5em; font-weight: 700; color: var(--mid); }
.member .row .v { min-width: 0; overflow-wrap: anywhere; }
.member .row label.check { margin: 0; }
.member .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.member .acts:empty { display: none; }
