/* =====================================================================
 * 保育動画配信サービス「ひとこま」 — アプリUI（LP以外）
 * hallmark-jp v2.1.0 · JP gates: pass (J1–J17) · 行長: 34–38em · 縦書き: 0
 * 書体（LP流の使い分け・すべて自前ホスト）: 見出し=Zen Kaku Gothic New(通常ゴシック・太) /
 *       本文=Zen Kaku Gothic New(角ゴ) / 数字・EN=Quicksand。J10回避。
 * 色: 白基調 #f7f9fb（温かみを抜いた爽やかな白）/ 墨 #2b2b30 /
 *     テラコッタ #b85539（唯一のアクセント・暖色を1点に集約） / 中立グレーの罫
 *     状態色は信号色をやめセージ・オーカー・煉瓦のアース系で低彩度に統一。
 * 面は箱でなくヘアラインと余白で区切る（脱Bootstrap）。角丸2値、影は
 *     浮く要素(下部タブ)のみ、ピルは「あと◯日」と進捗トラックの2署名だけ。
 * 文字色は常にAA以上（本文4.5:1・大文字3:1）を確保する。
 * ===================================================================== */

:root {
    --paper: #f7f9fb;         /* 背景（白基調・爽やか。温かみを抜いたごく淡い寒色） */
    --paper-raised: #ffffff;  /* カード面（白は背景よりわずかに前へ出る） */
    --paper-dim: #eef1f5;     /* hover・淡い面（中立グレー） */
    --paper-dim2: #e5e9ef;    /* 区切り面 */
    --ink: #2b2b30;           /* 墨（本文・ほぼ黒） */
    --ink-soft: #66666e;      /* 補助文字（中立グレー・AA） */
    --ink-faint: #9fa0a8;     /* 装飾専用。本文には使わない */
    --rule: #e6e9ef;          /* ヘアライン（中立グレー） */
    --rule-strong: #d2d7df;
    --accent: #b85539;        /* テラコッタ（CTAのベタ面・白文字4.8:1） */
    --accent-text: #a84f37;   /* テラコッタ文字（紙5.1:1 / 白5.5:1） */
    --accent-soft: #f7ece5;   /* 極淡テラコッタ面 */
    --accent-border: #e6bcac; /* 淡テラコッタのヘアライン */
    --link: #a84f37;
    /* 状態色（低彩度・アース系。信号色にしない） */
    --ok-bg: #eef1e8;  --ok-ink: #5c7050;   /* セージ */
    --warn-bg: #f4edde; --warn-ink: #8a6a33; /* オーカー */
    --err-bg: #f6e7e1;  --err-ink: #a8493a;  /* 煉瓦 */

    /* 書体の使い分けはLPに合わせる（自前ホスト・CSPでGoogle Fonts不可）:
       見出し＝Zen Kaku Gothic New(通常ゴシック・太)、本文＝Zen Kaku Gothic New(角ゴ)、
       欧文/数字＝Quicksand。--font-latin はJPをZen Kakuに落とすので混植可（J10回避）。 */
    --font-display: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN",
        "Yu Gothic", YuGothic, Meiryo, sans-serif;
    --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN",
        "Yu Gothic", YuGothic, Meiryo, sans-serif;
    --font-latin: "Quicksand", var(--font-body);

    /* 角丸は2値に集約（J15）。面・入力・カード・サムネは --radius、
       小さなチップ・押印・チェックは --radius-sm。円は 50%、
       ピルは「あと◯日」表示と進捗トラックの2箇所だけの意図的な署名に限定。 */
    --radius: 10px;
    --radius-sm: 7px;
    --radius-pill: 999px;
    --tap: 44px;
}

* { box-sizing: border-box; }

html {
    max-width: 100%;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

body {
    max-width: 100%;
    overflow-x: clip;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    /* Quicksandに無い和文はZen Kakuへ落とす。本文中のメール、ID、数字も
       従属欧文にせず、和欧混植の役割分担を保つ。 */
    font-family: var(--font-latin);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.85;
}

/* 書体の割り当て（LP流）: 見出し＝Zen Kaku Gothic New(太) / 本文＝角ゴ Zen Kaku(body既定)
   / 数字・日付・EN＝Quicksand（JPはZen Kakuへ落ちる） */
.site-header__brand, .auth-brand,
.page-title, .section-title, .subhead { font-family: var(--font-display); }

.stat-figure, .num, .days-left, .days-pill,
.entry__meta, .feed-card__meta, .feed-card__foot { font-family: var(--font-latin); }

/* ---- 骨格 ---------------------------------------------------------- */

.site-header {
    background: var(--paper-raised);
    border-bottom: 1px solid var(--rule);
    padding: 0 16px;
}

.site-header__inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    min-height: 58px;
}

.site-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--ink);
    text-decoration: none;
    padding: 8px 0;
}

.site-header__brand svg { flex: 0 0 auto; }

.site-header__facility {
    font-size: 0.85rem;
    color: var(--ink-soft);
    letter-spacing: 0.05em;
}

/* デスクトップではdetailsを透過させ、従来どおり横並びのナビを見せる。 */
.site-menu { display: contents; }
.site-menu__toggle { display: none; }

@media (min-width: 841px) {
    .site-menu > .site-nav { display: flex !important; }
}

@media (min-width: 601px) {
    .site-menu--guardian > .site-nav { display: flex !important; }
}

.site-nav {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    margin-left: auto;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 4px 14px;
    color: var(--link);
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
}

.site-nav a:hover { background: var(--paper-dim); }
.site-nav a[aria-current="page"] {
    color: var(--accent-text);
    background: var(--accent-soft);
    font-weight: 700;
}

.site-nav--admin a { padding-inline: 10px; }

.site-header__logout {
    flex: 0 0 auto;
    margin: 0;
}

.site-header__logout-button {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 4px 8px;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: 0.82rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
    cursor: pointer;
}

.site-header__logout-button:hover {
    background: var(--paper-dim);
    color: var(--link);
}

.site-header__logout-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* 運営が園の画面へ入っている間は、対象と期限を常に画面上部へ残す。 */
.support-bar {
    background: var(--warn-bg);
    border-bottom: 1px solid var(--warn-ink);
    color: var(--ink);
}

.support-bar__inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

.support-bar__inner strong { display: block; }
.support-bar__inner span { color: var(--ink-soft); font-size: 0.82rem; }

.support-bar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 14px;
    flex-wrap: wrap;
}

.support-bar__actions form { margin: 0; }
.support-bar__actions summary { cursor: pointer; color: var(--link); font-weight: 700; }

.support-bar__form {
    width: min(32em, calc(100vw - 32px));
    margin-top: 8px !important;
    padding: 12px;
    background: var(--paper-raised);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
}

.support-bar__form label { display: block; font-weight: 700; }
.support-bar__form textarea { margin: 6px 0 8px; }
.is-support-readonly { opacity: 0.55; }
.is-support-readonly::after {
    content: "閲覧のみの接続では変更できません";
    display: block;
    margin-top: 8px;
    color: var(--warn-ink);
    font-size: 0.82rem;
    font-weight: 700;
}

main.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

main.page,
.sheet,
.field,
.entry__body,
.feed-card__head > div { min-width: 0; }

img, video, canvas, iframe { max-width: 100%; }

main.page--narrow { max-width: 560px; }

.prose { max-width: 38em; }

/* ---- 見出し -------------------------------------------------------- */

/* H1は文の長さになることがある（例「現在、利用申し込みを…」）。文への広トラッキングを
   避け、字送りは最小に（J3）。品位の字送りは短い見出し語＝section-title側で作る。 */
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.45;
    margin: 8px 0 4px;
}

.page-title__note {
    max-width: 38em;
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-weight: 400;
    letter-spacing: 0;
    margin: 0 0 24px;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.45;
    margin: 44px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rule-strong);
}

.stat-figure {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.stat-figure small {
    font-size: 0.58em;
    font-weight: 500;
    color: var(--ink-soft);
    margin-inline-start: 0.15em;
}

/* 3階層目の小見出し（帳票・フォーム内） */
.subhead {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.5;
    margin: 24px 0 8px;
}

/* 擬似ラベル（fieldsetを使わない項目見出し。.field>labelと同格） */
.field-legend {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

/* ページ先頭のタイトルは上マージンを詰める（各ビューのstyle="margin-top:0"を代替） */
main.page > .page-title:first-child,
.auth-card > .page-title:first-child { margin-top: 0; }

/* ---- 帳票・表 ------------------------------------------------------ */

.sheet {
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 22px 20px;
}

.sheet + .sheet { margin-top: 16px; }

table.ledger {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--paper-raised);
    font-size: 0.9rem;
}

/* classを付け忘れた帳票でも、文字を1文字幅まで潰さない。
   列数に応じて読みやすい最小幅を確保し、外側のtable-scrollで送る。 */
table.ledger:has(tr > :nth-child(3)) { min-width: 560px; }
table.ledger:has(tr > :nth-child(4)) { min-width: 700px; }
table.ledger:has(tr > :nth-child(5)) { min-width: 820px; }
table.ledger:has(tr > :nth-child(6)) { min-width: 920px; }
table.ledger:has(tr > :nth-child(7)) { min-width: 980px; }
table.ledger:has(tr > :nth-child(8)) { min-width: 1080px; }

table.ledger th, table.ledger td {
    border-bottom: 1px solid var(--rule);
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
}

table.ledger tr:last-child th, table.ledger tr:last-child td { border-bottom: none; }

table.ledger th {
    background: transparent;
    font-weight: 700;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-bottom: 1.5px solid var(--rule-strong);
}

table.ledger td.num, table.ledger th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background:
        linear-gradient(to right, var(--paper-raised), transparent 20px) local,
        linear-gradient(to left, var(--paper-raised), transparent 20px) local right,
        linear-gradient(to right, rgba(54, 44, 44, 0.12), transparent 14px) scroll,
        linear-gradient(to left, rgba(54, 44, 44, 0.12), transparent 14px) scroll right;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-color: var(--paper-raised);
}

.table-scroll.is-scrollable::before {
    content: "表は横にスクロールできます";
    position: sticky;
    left: 0;
    z-index: 1;
    display: block;
    width: max-content;
    max-width: 100%;
    padding: 5px 12px;
    color: var(--ink-soft);
    background: var(--paper-dim);
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    font-size: 0.74rem;
    line-height: 1.5;
}

/* 多列の運営帳票は文字を潰して収めず、列幅を保って横へ送る。
   .table-scrollの両端の陰影が、続きがあることを示す。 */
table.ledger--facilities { min-width: 780px; }
table.ledger--billing { min-width: 760px; }
table.ledger--usage { min-width: 860px; }
table.ledger--inquiries { min-width: 840px; }
table.ledger--owners { min-width: 720px; }
table.ledger--monthly { min-width: 480px; }
table.ledger--four-column { min-width: 520px; }

table.ledger--billing td:first-child,
table.ledger--billing td:last-child,
table.ledger--usage td:last-child,
table.ledger--inquiries td:last-child,
table.ledger--owners td:nth-child(4) {
    white-space: nowrap;
}

dl.spec {
    display: grid;
    grid-template-columns: minmax(8em, max-content) 1fr;
    gap: 0;
    margin: 0;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-raised);
    font-size: 0.9rem;
}

dl.spec dt {
    background: var(--paper-dim);
    padding: 10px 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--rule);
}

dl.spec dd {
    margin: 0;
    padding: 10px 14px;
    border-bottom: 1px solid var(--rule);
    overflow-wrap: anywhere;
}

dl.spec dt:last-of-type, dl.spec dd:last-of-type { border-bottom: none; }

/* ---- 押印風ステータス（パステル・文字ラベル併記） ------------------ */

.stamp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 9px;
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.5;
    white-space: nowrap;
}

.stamp--published { color: var(--ok-ink);  background: var(--ok-bg); }
.stamp--ok        { color: var(--ok-ink);  background: var(--ok-bg); }
.stamp--warn      { color: var(--warn-ink); background: var(--warn-bg); }
.stamp--err       { color: var(--err-ink);  background: var(--err-bg); }
.stamp--muted     { color: var(--ink-soft); background: var(--paper-dim2); }

/* ---- フォーム ------------------------------------------------------ */

.field { margin: 0 0 20px; max-width: 38em; }

.field > label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.field .hint {
    font-size: 0.8rem;
    color: var(--ink-soft);
    margin: 2px 0 4px;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="datetime-local"], input[type="number"],
input[type="file"], select, textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--rule-strong);
    border-radius: var(--radius);
    padding: 10px 14px;
    min-height: var(--tap);
    min-width: 0;
}

textarea { min-height: 120px; resize: vertical; }

input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible {
    outline: 2.5px solid var(--accent);
    outline-offset: 2px;
}

.field .error {
    color: var(--err-ink);
    font-size: 0.85rem;
    margin: 4px 0 0;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9rem;
}

.checkbox-row input[type="checkbox"], .checkbox-row input[type="radio"] {
    width: 22px; height: 22px;
    margin-top: 4px;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.checkbox-row input[type="checkbox"] {
    appearance: none;
    border: 1.5px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--paper-raised);
    cursor: pointer;
    display: inline-grid;
    place-content: center;
}

.checkbox-row input[type="checkbox"]::before {
    content: "";
    width: 12px; height: 12px;
    transform: scale(0);
    clip-path: polygon(14% 44%, 0 65%, 40% 100%, 100% 16%, 84% 0%, 38% 66%);
    background: #fff;
}

.checkbox-row input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-row input[type="checkbox"]:checked::before { transform: scale(1); }

.checkbox-row { min-height: var(--tap); align-items: center; }

/* file inputのボタン（文言はブラウザ言語に従う） */
input[type="file"]::file-selector-button {
    font: inherit;
    font-weight: 700;
    color: var(--accent-text);
    background: var(--accent-soft);
    border: 1.5px solid var(--accent-border);
    border-radius: var(--radius);
    padding: 8px 18px;
    margin-right: 12px;
    cursor: pointer;
}

/* ---- ボタン（角丸は控えめ・pillにしない §33） --------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap);
    padding: 8px 24px;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: var(--radius);
    border: 1.5px solid var(--rule-strong);
    background: var(--paper-raised);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    max-width: 100%;
    text-align: center;
    white-space: normal;
}

.btn:hover { background: var(--paper-dim); }

.btn--primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.btn--primary:hover { background: var(--accent-text); border-color: var(--accent-text); }

.btn--quiet {
    border-color: transparent;
    color: var(--link);
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn--quiet:hover { background: var(--paper-dim); }

.btn--danger {
    border-color: var(--err-ink);
    background: var(--paper-raised);
    color: var(--err-ink);
}

.btn--danger:hover { background: var(--err-bg); }

.btn--block { width: 100%; }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---- 告知・エラー -------------------------------------------------- */

.notice {
    border: 1.5px solid var(--rule-strong);
    border-radius: var(--radius);
    background: var(--paper-raised);
    padding: 12px 18px;
    margin: 0 0 20px;
    font-size: 0.9rem;
    max-width: 38em;
}

.notice--ok   { border-color: #cdd8bd; background: var(--ok-bg); color: var(--ok-ink); }
.notice--warn { border-color: #e3d3a8; background: var(--warn-bg); color: var(--warn-ink); }
.notice--err  { border-color: #e6c3b6; background: var(--err-bg); color: var(--err-ink); }

/* ---- 動画一覧（帳面） ---------------------------------------------- */

.entry-list { list-style: none; margin: 0; padding: 0; }

.entry {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--rule);
}

.entry__thumbbox {
    flex: 0 0 128px;
    align-self: flex-start;
}

.entry__thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--paper-dim);
    border: 1.5px solid var(--rule-strong);
    border-radius: var(--radius);
    object-fit: cover;
}

.entry__body { min-width: 0; flex: 1; }

.entry__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 2px;
    line-height: 1.5;
}

.entry__title a { color: var(--ink); text-decoration: none; }
.entry__title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.entry__meta {
    font-size: 0.82rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

.days-left {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent-text);
    white-space: nowrap;
}

/* ---- 進捗バー（動くのはここだけ） ---------------------------------- */

[hidden] { display: none !important; }

.progress {
    height: 14px;
    background: var(--paper-dim);
    border: 1.5px solid var(--rule-strong);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress > div {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-pill);
    width: 0;
}

/* ---- 動画アップロード ---------------------------------------------- */

.upload-guide,
.upload-sheet { max-width: 38em; }

.upload-guide { margin: 0 0 24px; }
.upload-guide .subhead { margin-top: 0; }

.upload-flow {
    list-style: none;
    counter-reset: upload-step;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rule-strong);
}

.upload-flow li {
    counter-increment: upload-step;
    display: grid;
    grid-template-columns: 2.5rem 8.5em 1fr;
    gap: 12px;
    padding: 13px 2px;
    border-bottom: 1px solid var(--rule);
    align-items: baseline;
}

.upload-flow li::before {
    content: counter(upload-step, decimal-leading-zero);
    color: var(--accent-text);
    font-family: var(--font-latin);
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.upload-flow strong { font-size: 0.9rem; }
.upload-flow span { color: var(--ink-soft); font-size: 0.86rem; line-height: 1.75; }

.upload-sheet__note { margin: 8px 0 0; }

.upload-dialog {
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    background: var(--paper-raised);
    color: var(--ink);
    box-shadow: 0 18px 54px rgba(43, 43, 48, 0.2);
    overflow: auto;
}

.upload-dialog::backdrop { background: rgba(43, 43, 48, 0.58); }

.upload-dialog__body { padding: 28px 30px 24px; text-align: center; }

.upload-dialog__label {
    margin: 0 0 4px;
    color: var(--accent-text);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.upload-dialog__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.45;
}

.upload-progress-visual {
    position: relative;
    width: 164px;
    height: 164px;
    margin: 16px auto 12px;
}

.upload-progress-visual svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }

.upload-progress-visual circle {
    fill: none;
    stroke-width: 9;
}

.upload-progress-visual__track { stroke: var(--paper-dim2); }

.upload-progress-visual__value {
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-dasharray: 339.3;
    stroke-dashoffset: 339.3;
    transition: stroke-dashoffset 0.25s ease;
}

.upload-progress-visual__text {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    line-height: 1.35;
}

.upload-progress-visual__text strong {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.upload-progress-visual__text span { display: block; color: var(--ink-soft); font-size: 0.78rem; }

.upload-dialog__bar { height: 10px; }
.upload-dialog__bytes { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.78rem; font-variant-numeric: tabular-nums; }

.upload-dialog__status {
    max-width: 34em;
    margin: 16px auto 0;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.7;
}

.upload-dialog__note {
    max-width: 34em;
    margin: 5px auto 0;
    color: var(--ink-soft);
    font-size: 0.8rem;
    line-height: 1.7;
}

.upload-dialog__actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.upload-dialog[data-state="checking"] .upload-progress-visual__value,
.upload-dialog[data-state="complete"] .upload-progress-visual__value { stroke: var(--ok-ink); }

.upload-dialog[data-state="error"] .upload-progress-visual__value { stroke: var(--err-ink); }

/* ---- 認証画面 ------------------------------------------------------ */

.auth-wrap {
    max-width: 400px;
    margin: 48px auto;
    padding: 0 16px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    margin: 0 0 24px;
}

.auth-card {
    background: var(--paper-raised);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    padding: 28px 24px;
}

.auth-links {
    margin-top: 16px;
    font-size: 0.85rem;
    text-align: center;
}

/* ---- 汎用 ---------------------------------------------------------- */

a { color: var(--link); text-underline-offset: 3px; }

.muted { color: var(--ink-soft); font-size: 0.88rem; }
.num { font-variant-numeric: tabular-nums; }

/* 使い方ガイドの索引（カードでなく罫で区切る行リスト） */
.guide-index {
    list-style: none;
    max-width: 34em;
    margin: 24px 0 0;
    padding: 0;
    border-top: 1px solid var(--rule-strong);
}

.guide-index li {
    padding: 18px 2px;
    border-bottom: 1px solid var(--rule);
}

.guide-index a {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ink);
    text-decoration: none;
}

.guide-index a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 4px; }

.guide-index p { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.7; }

.toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 0 20px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 20px;
}

.filter-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 2px 16px;
    text-decoration: none;
    color: var(--link);
    font-size: 0.9rem;
    border: 1.5px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--paper-raised);
}

.filter-tabs a:hover { background: var(--paper-dim); }

.filter-tabs a[aria-current="true"] {
    color: var(--accent-text);
    background: var(--accent-soft);
    border-color: var(--accent-border);
    font-weight: 700;
}

.pagination { margin-top: 24px; font-variant-numeric: tabular-nums; }

/* 数字は「箱」に入れず、天の区切り罫＋大きな数字の組版で見せる（脱Bootstrap KPI） */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0 28px;
    margin: 0 0 8px;
    border-top: 1px solid var(--rule-strong);
}

.stat-cell {
    padding: 15px 2px 13px;
    border-bottom: 1px solid var(--rule);
}

.stat-cell .label {
    font-size: 0.82rem;
    color: var(--ink-soft);
    letter-spacing: 0.08em;
    margin-bottom: 2px;
}

/* ダッシュボードの要対応項目。表とは異なる行リストで、件数への導線を前に出す。 */
.operation-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rule-strong);
}

.operation-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 12px 2px;
    border-bottom: 1px solid var(--rule);
}

.operation-list__value {
    font-family: var(--font-latin);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dashboard-next {
    margin-top: 64px;
    padding: 24px 0 32px;
    border-top: 1px solid var(--rule-strong);
}

.dashboard-next p { margin: 0; }

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px 18px;
}

.filter-grid .field { margin: 0; }

.filter-actions {
    display: flex;
    align-items: center;
    gap: 8px 14px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.filter-actions a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
}

/* ---- 法務ページ（利用規約・プライバシーポリシー） ---------------- */

.legal-doc { max-width: 38em; }

.legal-doc h2 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    margin: 34px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rule);
}

.legal-doc h3 { font-size: 0.95rem; font-weight: 700; margin: 20px 0 6px; }
.legal-doc p, .legal-doc li { font-size: 0.92rem; line-height: 1.9; }
.legal-doc ol, .legal-doc ul { padding-left: 1.5em; margin: 8px 0; }
.legal-doc li { margin-bottom: 5px; }
.legal-doc__meta { color: var(--ink-soft); font-size: 0.85rem; margin-top: 36px; }

/* ---- 料金・使用量（課金画面／ダッシュボード） -------------------- */

.usage-bar {
    height: 12px;
    background: var(--paper-dim);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin: 6px 0 4px;
    max-width: 38em;
}

.usage-bar > div {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-pill);
}

.usage-bar--warn > div { background: var(--warn-ink); }
.usage-bar--full > div { background: var(--err-ink); }

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin: 8px 0;
    align-items: stretch;
}

.plan-card {
    position: relative;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    padding: 22px 18px 18px;
    background: var(--paper-raised);
    display: flex;
    flex-direction: column;
}

.plan-card--reco { border-color: var(--accent); background: var(--accent-soft); }

.plan-card__badge {
    position: absolute;
    top: -10px;
    left: 16px;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
}

.plan-card__name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin: 0 0 6px;
}

.plan-card__price {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-latin);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    margin: 0 0 4px;
}

.plan-card__price small { font-size: 0.7rem; font-weight: 500; color: var(--ink-soft); }
.plan-card__cap { font-size: 0.92rem; font-weight: 700; margin: 0 0 2px; }
.plan-card__note { font-size: 0.82rem; margin: 0 0 16px; }
.plan-card__action { margin-top: auto; }

footer.site-footer {
    border-top: 1px solid var(--rule);
    margin-top: 48px;
    padding: 16px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--ink-soft);
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px 10px;
}

footer.site-footer a,
.site-footer__company {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    white-space: nowrap;
}

/* ---- video player -------------------------------------------------- */

.player {
    width: 100%;
    max-height: 70vh;
    background: #2b2723;
    border: 1.5px solid var(--rule-strong);
    border-radius: var(--radius);
    -webkit-touch-callout: none;
    user-select: none;
}

.video-preview { max-width: 720px; }

.staff-video-summary {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 288px;
}

.staff-video-summary__body { min-width: 0; flex: 1; }
.staff-video-summary__body a { overflow-wrap: anywhere; text-wrap: pretty; }

.staff-video-preview {
    flex: 0 0 112px;
    width: 112px;
}

.staff-video-preview__thumb {
    display: block;
    width: 112px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--paper-dim);
}

.staff-video-preview__button {
    width: 100%;
    min-height: var(--tap);
    padding: 4px 8px;
    font-size: 0.82rem;
}

.staff-video-preview__unavailable {
    display: block;
    color: var(--ink-soft);
    font-size: 0.74rem;
    text-align: center;
}

.video-preview-dialog {
    width: min(760px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    margin: auto;
    padding: 0;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    background: var(--paper-raised);
    color: var(--ink);
    box-shadow: 0 18px 54px rgba(43, 43, 48, 0.2);
}

.video-preview-dialog::backdrop { background: rgba(43, 43, 48, 0.72); }
.video-preview-dialog__body { padding: 16px; }
.video-preview-dialog__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.video-preview-dialog__title { margin: 0; font-size: 1.1rem; line-height: 1.45; }

.video-preview-dialog__close {
    display: inline-grid;
    place-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 1.5rem;
    cursor: pointer;
}

.video-preview-dialog__body > .muted { margin: 6px 0 0; min-height: 1.85em; }

.video-duration { white-space: nowrap; }

.video-favorite {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.video-availability-note {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
}

/* ---- responsive ---------------------------------------------------- */

/* 管理画面の項目数は多いため、タブレット幅から明示的なメニューへ切り替える。 */
@media (max-width: 840px) {
    .site-header__inner { gap: 8px; }
    .site-header__brand { flex: 0 0 auto; }
    .site-header__facility {
        flex: 1 1 0;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .site-header__logout { margin-left: auto; }

    .site-menu:not(.site-menu--guardian) {
        display: block;
        order: 2;
        flex: 1 0 100%;
        width: calc(100% + 32px);
        margin-inline: -16px;
        border-top: 1px solid var(--rule);
    }

    .site-menu:not(.site-menu--guardian) > .site-menu__toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: var(--tap);
        padding: 6px 16px;
        color: var(--link);
        font-size: 0.88rem;
        font-weight: 700;
        cursor: pointer;
        list-style: none;
    }

    .site-menu:not(.site-menu--guardian) > .site-menu__toggle::-webkit-details-marker { display: none; }

    .site-menu:not(.site-menu--guardian) > .site-menu__toggle::after {
        content: "＋";
        margin-left: auto;
        color: var(--ink-soft);
        font-size: 1rem;
        font-weight: 400;
    }

    .site-menu:not(.site-menu--guardian)[open] > .site-menu__toggle::after { content: "−"; }

    .site-menu__current {
        min-width: 0;
        overflow: hidden;
        color: var(--ink-soft);
        font-weight: 400;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-menu:not(.site-menu--guardian):not([open]) > .site-nav { display: none; }

    .site-menu:not(.site-menu--guardian)[open] > .site-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1px;
        width: 100%;
        margin: 0;
        padding: 0 16px 12px;
        background: var(--paper-raised);
    }

    .site-menu:not(.site-menu--guardian) .site-nav a {
        justify-content: flex-start;
        min-width: 0;
        padding-inline: 12px;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 600px) {
    main.page { padding: 20px 12px 56px; }
    .sheet { padding: 18px 14px; }
    .notice { padding: 11px 14px; }
    .page-title { font-size: 1.3rem; }
    .section-title { margin-top: 38px; }
    .entry { gap: 12px; }
    .entry__thumbbox { flex-basis: 104px; }
    .entry > form { margin-left: auto; }
    .video-availability-note {
        align-items: flex-start;
        flex-direction: column;
    }
    .site-header { padding-inline: 12px; }
    .site-menu:not(.site-menu--guardian) {
        width: calc(100% + 24px);
        margin-inline: -12px;
    }
    .site-header__logout {
        order: 1;
        margin-left: auto;
    }
    .support-bar__inner { align-items: flex-start; flex-direction: column; }
    .support-bar__actions { width: 100%; justify-content: flex-start; }
    .filter-grid { grid-template-columns: 1fr; }
    dl.spec { grid-template-columns: 1fr; }
    dl.spec dt { border-bottom: none; padding-bottom: 2px; }
    .upload-flow li { grid-template-columns: 2.2rem 1fr; gap: 7px 10px; }
    .upload-flow li::before { grid-row: 1 / span 2; }
    .upload-flow span { grid-column: 2; }
    .upload-dialog__body { padding: 24px 20px 20px; }
    .upload-progress-visual { width: 150px; height: 150px; }
}

@media (max-width: 400px) {
    .site-header__brand { font-size: 1rem; letter-spacing: 0.07em; }
    .site-header__brand svg { width: 26px; height: 26px; }
    .site-header__facility { font-size: 0.78rem; }
    .site-header__logout-button { padding-inline: 4px; }
    .site-menu:not(.site-menu--guardian)[open] > .site-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-inline: 12px;
    }
    .feed-card__head {
        align-items: flex-start;
        flex-wrap: wrap;
        padding-inline: 14px;
    }
    .feed-card__head > div { flex: 1 1 calc(100% - 50px); }
    .feed-card__head > .days-pill { margin-left: 50px; }
    .feed-card__body { padding-inline: 14px; }
    .feed-card__foot { padding-inline: 14px; }
    .operation-list li { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* =====================================================================
 * フィード型UI（保護者側・てのりの参照 2026-08-07）
 * 写真が主役のカード + 「あと◯日」ピル + 下部タブバー
 * ===================================================================== */

main.page--feed {
    max-width: 560px;
    padding-top: 16px;
}

.feed { list-style: none; margin: 0; padding: 0; }

.feed-card {
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0 0 20px;
}

.feed-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}

.feed-card__head > .days-pill { margin-left: auto; }

.feed-card__avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-soft);
    display: grid;
    place-content: center;
}

.feed-card__facility {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.feed-card__meta {
    margin: 0;
    font-size: 0.8rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.days-pill {
    display: inline-block;
    flex: 0 0 auto;
    padding: 2px 12px;
    border: 1.5px solid var(--accent-border);
    border-radius: var(--radius-pill);
    background: var(--paper-raised);
    color: var(--accent-text);
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.feed-card__thumblink { display: block; }

.feed-card__thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--paper-dim);
    border-block: 1px solid var(--rule);
}

.feed-card__body { padding: 12px 16px 14px; }

.feed-card__title {
    margin: 0 0 2px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
}

.feed-card__title a { color: var(--ink); text-decoration: none; }
.feed-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.feed-card__desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ink-soft);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px 12px;
    font-size: 0.82rem;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

.favorite-form {
    flex: 0 0 auto;
    margin: 0;
    line-height: 1;
}

.favorite-button {
    width: var(--tap);
    height: var(--tap);
    display: inline-grid;
    place-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
}

.favorite-button:hover { background: var(--accent-soft); color: var(--accent-text); }
.favorite-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.favorite-button:disabled { cursor: wait; opacity: 0.55; }
.favorite-button--on { color: var(--accent); }
.favorite-button--on svg path { fill: currentColor; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- 下部タブバー（保護者・スマホ） -------------------------------- */

.tabbar {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    background: var(--paper-raised);
    border-top: 1px solid var(--rule);
    box-shadow: 0 -2px 10px rgba(54, 44, 44, 0.05);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.tabbar ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tabbar li { flex: 1; }

.tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    padding: 6px 4px;
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.tabbar a svg { display: block; }

.tabbar a[aria-current="page"] {
    color: var(--accent-text);
    font-weight: 700;
}

@media (max-width: 600px) {
    body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0)); }
    body.has-tabbar .tabbar { display: block; }
    body.has-tabbar .site-nav { display: none; }
}
