@charset "UTF-8";
/*
 * 日程調整 — 画面のデザイン
 * 色・角丸・影は他サービスと同じ値（CLAUDE.md 7.1節）。スマホの指で操作することを前提に、
 * 押せるもの（日付・○△×・マス目）は指先でも外しにくい大きさにしてある。
 * 「なぞって選ぶ」部分だけ touch-action: none にして、指で塗っている間に画面が動かないようにしている。
 * それ以外（項目名・見出し）は、ふつうにスクロールできる。
 */
:root {
    --accent: #403999;
    --accent-dark: #322c7a;
    --accent-soft: #ece9fb;
    --accent-line: #d9d4f3;
    --ink: #1c1b26;
    --ink-2: #4a4857;
    --muted: #8a8796;
    --line: #e8e6ef;
    --line-2: #f2f1f7;
    --bg: #f7f6fb;
    --ok: #1f9d63;
    --ok-soft: #e3f5ec;
    --maybe: #c98a12;
    --maybe-soft: #fdf3dc;
    --ng: #c0392b;
    --ng-soft: #fbe9e7;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(28, 27, 38, .05), 0 8px 24px rgba(64, 57, 153, .06);
    --shadow-lg: 0 12px 40px rgba(64, 57, 153, .16);
    --topbar-h: 61px;
}

/* hidden 属性は、後から読み込む自作クラスの詳細度に負けて無効化されることがあるため、最優先で効かせる（CLAUDE.md 8.1節） */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
    font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.35; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(64, 57, 153, .45); outline-offset: 2px; }

/* ---------- 上部バー・サイドバー（他サービスと同じクラス名・同じ数値。CLAUDE.md 5.7節） ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .93); backdrop-filter: saturate(1.6) blur(10px);
    border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top);
}
.topbar-in { display: flex; align-items: center; gap: 12px 20px; min-height: 60px; padding: 8px 20px 8px 76px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; display: block; object-fit: contain; }
.brand-text strong { font-weight: 800; font-family: Outfit, "Noto Sans JP", sans-serif; font-size: 1.2rem; line-height: 1; letter-spacing: -.02em; color: var(--ink); }

.drawer-toggle-slot {
    position: fixed; top: env(safe-area-inset-top); left: 0; right: 0;
    height: 60px; z-index: 1400; padding-left: 8px;
    display: flex; align-items: center; pointer-events: none;
}
.drawer-toggle-slot .drawer-toggle { pointer-events: auto; }
.side-drawer-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    z-index: 1100; opacity: 0; pointer-events: none; transition: opacity 400ms ease;
}
.side-drawer-overlay.active { opacity: 1; pointer-events: auto; }
.side-drawer {
    position: fixed; top: 0; left: 0; width: 300px; max-width: 85vw; height: 100vh;
    background: var(--accent); z-index: 1200; transform: translateX(-100%); box-shadow: none;
    transition: transform .45s cubic-bezier(.22, 1, .36, 1), box-shadow .45s ease;
    display: flex; flex-direction: column; overflow-y: auto; will-change: transform;
}
.side-drawer.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0, 0, 0, .28); }
.side-drawer-header { height: calc(60px + env(safe-area-inset-top)); border-bottom: 1px solid rgba(255, 255, 255, .1); }
.side-drawer-list { list-style: none; margin: 0; padding: 24px 0; flex: 1; }
/* 順番にふわっと出す。項目の数を決め打ちせず、PHP が振った --i（0始まりの順番）から計算する（CLAUDE.md 8.3節） */
.side-drawer-list > li { opacity: 0; transform: translateX(-14px); transition: opacity .4s ease, transform .4s ease; }
.side-drawer.open .side-drawer-list > li { opacity: 1; transform: translateX(0); transition-delay: calc(var(--i, 0) * .06s + .10s); }
.side-drawer-link {
    display: flex; align-items: center; gap: 12px; padding: 16px 32px;
    color: rgba(255, 255, 255, .85) !important; font-size: 1rem; font-weight: 500; letter-spacing: .05em;
    transition: all 150ms ease; border-left: 3px solid transparent; text-decoration: none !important;
}
.side-drawer-link:hover { background: rgba(255, 255, 255, .06); color: #fff !important; border-left-color: #ffcd38; padding-left: 36px; }
.side-drawer-link.active { color: #ffcd38 !important; border-left-color: #ffcd38; font-weight: 700; }
.side-drawer-icon { flex-shrink: 0; display: inline-flex; }
.drawer-toggle {
    display: flex; align-items: center; justify-content: center; width: 48px; height: 48px;
    border: none; background: transparent; cursor: pointer; padding: 4px; border-radius: 10px;
    transition: background 150ms ease; position: relative; z-index: 1201;
}
.drawer-toggle:hover { background: var(--line-2); }
.drawer-toggle-bars { position: relative; display: block; width: 24px; height: 16px; }
.drawer-toggle-bars span {
    position: absolute; left: 0; width: 100%; height: 2.5px; border-radius: 2px; background: var(--accent);
    transition: transform .4s cubic-bezier(.4, 0, .2, 1), opacity .25s ease, background .25s ease;
}
.drawer-toggle-bars span:nth-child(1) { top: 0; }
.drawer-toggle-bars span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.drawer-toggle-bars span:nth-child(3) { top: calc(100% - 2.5px); }
.drawer-toggle.active .drawer-toggle-bars span { background: #fff; }
.drawer-toggle.active .drawer-toggle-bars span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.drawer-toggle.active .drawer-toggle-bars span:nth-child(2) { opacity: 0; transform: translateY(-50%) scaleX(.4); }
.drawer-toggle.active .drawer-toggle-bars span:nth-child(3) { top: 50%; transform: translateY(-50%) rotate(-45deg); }
.drawer-toggle.active:hover { background: rgba(255, 255, 255, .12); }
@media (prefers-reduced-motion: reduce) {
    .side-drawer, .side-drawer-list > li, .side-drawer.open .side-drawer-list > li, .drawer-toggle-bars span {
        transition-duration: .01ms !important; transition-delay: 0ms !important;
    }
}

/* ---------- ページの土台 ---------- */
.page { padding: 20px 0 120px; }
.wrap { width: calc(100% - 32px); max-width: 720px; margin-inline: auto; display: grid; gap: 16px; }
.wrap-wide { max-width: 960px; }
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; min-width: 0;
}
.page-title { font-family: Outfit, "Noto Sans JP", sans-serif; font-size: 1.5rem; font-weight: 800; }
.page-lead { color: var(--ink-2); font-size: .92rem; margin-top: 4px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin-bottom: 12px; }
.step-no {
    width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
    display: inline-grid; place-items: center; font-size: .82rem; font-weight: 700; flex-shrink: 0;
}
.hint { color: var(--muted); font-size: .82rem; }
.muted { color: var(--muted); }
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.field label, .label { font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.opt { font-weight: 400; color: var(--muted); font-size: .78rem; margin-left: 4px; }
.input, select.input, textarea.input {
    width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: #fff; font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(64, 57, 153, .12); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- ボタン ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
    padding: 10px 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
    font-weight: 700; font-size: .92rem; text-decoration: none !important; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, transform .08s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover:not(:disabled) { background: var(--accent-line); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--line-2); }
.btn-danger { background: #fff; color: var(--ng); border-color: #f0c4bf; }
.btn-danger:hover:not(:disabled) { background: var(--ng-soft); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .84rem; }
.btn-lg { min-height: 54px; font-size: 1.02rem; padding: 12px 28px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 6px 4px; color: var(--accent); font-weight: 700; font-size: .84rem; cursor: pointer; }
.link-btn.danger { color: var(--ng); }

/* 画面の下に固定する「保存」の帯（スマホで親指が届く位置に置く）。
   システム管理者だけに出る「メンテナンス中」の帯（accounts/sdk.php）の上に出す（CLAUDE.md 5.8節） */
.action-bar {
    position: sticky; bottom: 0; z-index: 40; margin: 0 -20px -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 10px; align-items: center;
    bottom: var(--nkmry-maint-bar, 0px);
}
.action-bar .btn-primary { flex: 1; }
/* 作成画面の「作成」ボタン。フォーム全体の中で画面の下に貼り付き、入力の途中でもすぐ押せる */
.submit-bar { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom) + var(--nkmry-maint-bar, 0px)); z-index: 40; }
.submit-bar .btn { box-shadow: var(--shadow-lg); }

/* ---------- 作り方の選択 ---------- */
.kind-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind-opt { position: relative; display: grid; gap: 4px; padding: 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: #fff; }
.kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.kind-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.kind-opt:has(input:focus-visible) { outline: 3px solid rgba(64, 57, 153, .45); outline-offset: 2px; }
.kind-ico { color: var(--accent); }
.kind-title { font-weight: 700; font-size: .95rem; }
.kind-desc { font-size: .78rem; color: var(--ink-2); line-height: 1.5; }

/* ---------- カレンダー（なぞって複数選択） ---------- */
/* 日付は正方形にしているので、広い画面で横いっぱいに広げると1マスが大きくなりすぎる。幅に上限を付ける */
.cal-head, .cal-week, .cal-grid { max-width: 440px; margin-inline: auto; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-month { font-weight: 800; font-size: 1.05rem; font-family: Outfit, "Noto Sans JP", sans-serif; }
.cal-nav { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1.1rem; color: var(--ink-2); }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week span { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-week span:first-child, .cal-day.sun { color: #c0392b; }
.cal-week span:last-child, .cal-day.sat { color: #2b62c0; }
.cal-grid { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cal-day {
    aspect-ratio: 1 / 1; min-height: 44px; border-radius: 12px; border: 1px solid transparent; background: var(--line-2);
    display: grid; place-items: center; font-weight: 700; font-size: .98rem; cursor: pointer; color: var(--ink);
    transition: background .12s, color .12s, transform .12s;
}
.cal-day.blank { background: transparent; cursor: default; }
.cal-day.past { background: transparent; color: #c9c6d3; cursor: default; }
.cal-day.today { border-color: var(--accent-line); }
.cal-day.on { background: var(--accent); color: #fff; transform: scale(.94); }
.cal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: .85rem; color: var(--ink-2); }

/* ---------- 時間帯の部品 ---------- */
.seg { display: inline-flex; background: var(--line-2); border-radius: 999px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 8px 14px; min-height: 38px; cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--accent); box-shadow: 0 1px 4px rgba(28, 27, 38, .12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 8px 6px 14px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: .85rem; border: 1px solid var(--accent-line);
}
.chip-x { width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(64, 57, 153, .12); color: var(--accent-dark); cursor: pointer; font-size: .95rem; line-height: 1; }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.slot-add { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; margin-top: 12px; }
.slot-add .tilde { color: var(--muted); }
.cand-days { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.cand-day { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: start; padding: 10px 12px; background: var(--line-2); border-radius: var(--radius-sm); }
.cand-day-label { font-weight: 800; font-size: .92rem; padding-top: 6px; }
.cand-day-label.sun { color: #c0392b; }
.cand-day-label.sat { color: #2b62c0; }
.cand-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.cand-slot {
    min-height: 34px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--accent-line); background: #fff;
    color: var(--accent-dark); font-weight: 700; font-size: .82rem; cursor: pointer;
}
.cand-slot.off { background: transparent; color: var(--muted); border-style: dashed; text-decoration: line-through; }
/*
 * 大学時間割の時限（なぞって複数選択。カレンダーと同じく、なぞる部分だけ画面のスクロールを止める）。
 * 時間割と同じく縦1列に並べる（横に折り返すと、「1限から3限まで」となぞったときに間の時限を通らないため）
 */
.period-pick {
    display: grid; gap: 6px; max-width: 440px; margin: 10px 0 4px;
    touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.period-btn {
    display: grid; grid-template-columns: 4.5em 1fr; align-items: center; justify-items: start; min-height: 46px; padding: 6px 14px;
    border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--line-2); color: var(--ink); cursor: pointer; text-align: left;
}
.period-btn b { font-size: .95rem; }
.period-btn small { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.period-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.period-btn[aria-pressed="true"] small { color: rgba(255, 255, 255, .82); }
.grid-preview { margin-top: 10px; padding: 10px 12px; background: var(--accent-soft); border-radius: var(--radius-sm); color: var(--accent-dark); font-weight: 700; font-size: .88rem; }
.time-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }

/* ---------- 作成後 ---------- */
.created-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.created-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; flex-shrink: 0; }
.url-block + .url-block { margin-top: 16px; }
.url-box { display: flex; gap: 8px; margin-top: 6px; }
.url-box .input { font-size: .85rem; min-width: 0; background: var(--line-2); }
.url-note { margin-top: 6px; font-size: .78rem; color: var(--ink-2); }
.url-note.warn { color: #8a5a00; background: var(--maybe-soft); border-radius: 8px; padding: 8px 10px; }

/* ---------- イベントの見出し ---------- */
.ev-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--line-2); color: var(--ink-2); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.closed { background: var(--ng-soft); color: var(--ng); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.ev-title { font-size: 1.35rem; font-weight: 800; word-break: break-word; }
.ev-desc { margin-top: 6px; color: var(--ink-2); font-size: .92rem; white-space: pre-wrap; word-break: break-word; }
.decided {
    margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--ok-soft); color: #14603d;
    font-weight: 700; display: flex; gap: 8px; align-items: center;
}
.ev-head-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- タブ ---------- */
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px; position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top) + 6px); z-index: 30; box-shadow: var(--shadow); }
.tab { flex: 1 1 auto; border: 0; background: transparent; min-height: 42px; padding: 0 10px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--accent); color: #fff; }
.tab .count { font-size: .78rem; opacity: .85; margin-left: 2px; }

/* ---------- 候補リスト型の回答（○△× をなぞってまとめて付ける） ---------- */
.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 6px; }
.vote-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.vote-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-top: 1px solid var(--line-2); background: #fff; }
.vote-row:first-child { border-top: 0; }
.vote-row.decided-row { background: var(--ok-soft); }
.vote-label { font-weight: 700; font-size: .92rem; word-break: break-word; }
.vote-sub { display: block; font-weight: 400; font-size: .74rem; color: var(--muted); }
/* なぞって付ける部分だけ、画面のスクロールを止める（左の候補名の部分を触ればスクロールできる） */
.vote-btns { display: flex; gap: 6px; touch-action: none; user-select: none; -webkit-user-select: none; }
.vote-btn {
    width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--line); background: #fff; cursor: pointer;
    font-size: 1.25rem; font-weight: 800; color: #c4c1cf; transition: background .1s, border-color .1s, color .1s, transform .1s;
}
.vote-btn[data-status="2"].on { background: var(--ok); border-color: var(--ok); color: #fff; }
.vote-btn[data-status="1"].on { background: var(--maybe); border-color: var(--maybe); color: #fff; }
.vote-btn[data-status="0"].on { background: var(--ng); border-color: var(--ng); color: #fff; }
.vote-btn.on { transform: scale(1.04); }

/* ---------- マス目（なぞって塗る） ---------- */
.grid-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin: 10px 0; }
.grid-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.tgrid { display: grid; position: relative; min-width: 100%; width: max-content; }
.tg-corner, .tg-day, .tg-time { background: #fff; z-index: 2; }
.tg-corner { position: sticky; top: 0; left: 0; z-index: 4; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.tg-day { position: sticky; top: 0; padding: 6px 2px; text-align: center; font-size: .74rem; font-weight: 800; border-bottom: 1px solid var(--line); line-height: 1.25; }
.tg-day .dow { display: block; font-weight: 700; color: var(--muted); font-size: .68rem; }
.tg-day.sun .dow { color: #c0392b; } .tg-day.sat .dow { color: #2b62c0; }
.tg-time { position: sticky; left: 0; font-size: .7rem; color: var(--muted); padding: 0 6px; text-align: right; border-right: 1px solid var(--line); transform: translateY(-.6em); background: transparent; }
.tg-time.hour { color: var(--ink-2); font-weight: 700; }
/* 時刻は線の位置に合わせて少し上にずらすが、いちばん上だけはずらすと見出しの下に隠れるので、ずらさない */
.tg-time.first { transform: none; }
.tg-cell { height: 28px; border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.tg-cell.hour { border-top-color: var(--line); }
.tgrid.paint .tg-cell { touch-action: none; }
.tgrid.paint { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tg-cell.on { background: #6fcf9f; }
.tg-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.tg-cell.decided { box-shadow: inset 0 0 0 3px var(--ok); }
/* 大学時間割のマス目：行ごとに時限の名前と時刻を出すので、行を高くし、見出しも線にずらさず行の中に置く */
.tgrid.tt .tg-cell { height: 44px; }
.tgrid.tt .tg-time { transform: none; display: grid; align-content: center; gap: 1px; line-height: 1.2; border-top: 1px solid var(--line); background: #fff; }
.tgrid.tt .tg-time b { font-size: .74rem; color: var(--ink-2); }
.tgrid.tt .tg-time small { font-size: .62rem; font-variant-numeric: tabular-nums; }
.legend { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }

/* ---------- 回答後 ---------- */
.saved-box { margin-top: 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--ok-soft); }
.saved-box h3 { color: #14603d; font-size: 1rem; }

/* ---------- 集計（候補リスト型） ---------- */
.sum-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sum-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.sum-item.best { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.sum-item.decided-row { background: var(--ok-soft); border-color: #9bd8b8; }
.sum-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sum-label { font-weight: 800; font-size: .95rem; word-break: break-word; }
.sum-star { color: var(--accent); font-size: .78rem; font-weight: 800; white-space: nowrap; }
.sum-counts { display: flex; gap: 12px; font-size: .84rem; font-weight: 700; margin-top: 6px; }
.c-ok { color: var(--ok); } .c-maybe { color: var(--maybe); } .c-ng { color: var(--ng); }
.bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line-2); margin-top: 8px; }
.bar i { display: block; height: 100%; }
.bar .b-ok { background: var(--ok); } .bar .b-maybe { background: var(--maybe); } .bar .b-ng { background: var(--ng); }
.sum-names { margin-top: 6px; font-size: .78rem; color: var(--ink-2); }
.admin-row-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.matrix-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
.matrix { border-collapse: separate; border-spacing: 0; font-size: .82rem; min-width: 100%; }
.matrix th, .matrix td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: center; white-space: nowrap; background: #fff; }
.matrix thead th { position: sticky; top: 0; background: var(--line-2); font-weight: 700; z-index: 1; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; text-align: left; z-index: 2; font-weight: 700; max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.matrix thead th:first-child { z-index: 3; }
.mk-2 { color: var(--ok); font-weight: 800; } .mk-1 { color: var(--maybe); font-weight: 800; } .mk-0 { color: var(--ng); font-weight: 800; } .mk-n { color: #c4c1cf; }

/* ---------- 回答者の一覧 ---------- */
.people { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--line-2); border-radius: var(--radius-sm); }
.person-name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-comment { display: block; font-weight: 400; font-size: .78rem; color: var(--ink-2); white-space: normal; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: .82rem; flex-shrink: 0; }

/* ---------- マス目の集計 ---------- */
/* ---------- 最終結果（順位） ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--line-2); }
.rank-item.top { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(64, 57, 153, .25); }
.rank-no { font-family: Outfit, "Noto Sans JP", sans-serif; font-weight: 800; font-size: 1.3rem; min-width: 2.6em; text-align: center; line-height: 1; color: var(--accent); }
.rank-no small { font-size: .62em; margin-left: 1px; }
.rank-item.top .rank-no { color: #fff; }
.rank-main { display: grid; gap: 2px; min-width: 0; }
.rank-label { font-weight: 800; font-size: .98rem; word-break: break-word; }
.rank-item.top .rank-label { font-size: 1.08rem; }
.rank-sub { font-size: .8rem; color: var(--ink-2); font-weight: 700; }
.rank-item.top .rank-sub { color: rgba(255, 255, 255, .85); }
.cell-info { margin-top: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--line-2); font-size: .85rem; }
.cell-info b { display: block; margin-bottom: 4px; }

/* ---------- 幹事 ---------- */
.admin-sec + .admin-sec { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin-sec h3 { font-size: .98rem; margin-bottom: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .9rem; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* ---------- 自分のイベント ---------- */
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ev-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.ev-item-main { flex: 1; min-width: 0; }
.ev-item-title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-item-sub { font-size: .78rem; color: var(--muted); }
.empty { text-align: center; padding: 24px 12px; color: var(--muted); font-size: .9rem; }

/* ---------- お知らせ ---------- */
.toast {
    position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom) + var(--nkmry-maint-bar, 0px)); transform: translateX(-50%);
    z-index: 2000; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: .9rem; font-weight: 700;
    box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); pointer-events: none; animation: toastIn .25s ease;
}
.toast.error { background: var(--ng); }
.toast.fade-out { opacity: 0; transition: opacity .35s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.loading { text-align: center; padding: 40px 0; color: var(--muted); }
.contact-box { text-align: center; padding: 36px 20px; }

@media (max-width: 560px) {
    .page { padding-top: 12px; }
    .wrap { width: calc(100% - 24px); gap: 12px; }
    .card { padding: 16px; }
    .action-bar { margin: 0 -16px -16px; padding-left: 16px; padding-right: 16px; }
    .topbar-in { padding: 8px 12px 8px 64px; }
    .kind-switch { grid-template-columns: 1fr; }
    .cand-day { grid-template-columns: 1fr; gap: 4px; }
    .cand-day-label { padding-top: 0; }
    .slot-add { grid-template-columns: 1fr auto 1fr; }
    .slot-add .btn { grid-column: 1 / -1; }
    .vote-btn { width: 46px; height: 46px; }
    .tab { font-size: .82rem; padding: 0 6px; }
    .ev-title { font-size: 1.2rem; }
}
