/* 単位チェッカー Web 版。スマートフォンを基準に、広い画面では中央に寄せる */

:root {
    --green: #035830;
    --green-strong: #02472a;
    --red: #ac1e3e;
    --orange: #b45309;
    --bg: #f2f3f1;
    --card: #ffffff;
    --text: #1c1f1d;
    --muted: #646b67;
    --line: #e2e5e2;
    --track: #e7eae7;
    --soft-green: #e6f0ea;
    --soft-red: #f8e8ec;
    --soft-orange: #fdf1e3;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --green: #3fae78;
        --green-strong: #5cc492;
        --red: #ff6b8a;
        --orange: #f5a74a;
        --bg: #101211;
        --card: #1b1e1c;
        --text: #eceeed;
        --muted: #9aa29e;
        --line: #2c312e;
        --track: #2c312e;
        --soft-green: #17301f;
        --soft-red: #3a1a22;
        --soft-orange: #3a2a17;
        --shadow: none;
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--green); }
button { font: inherit; color: inherit; }

svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ヘッダー */

.topbar {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--line);
    padding-top: env(safe-area-inset-top);
}
.topbar-inner {
    max-width: 680px; margin: 0 auto; padding: 8px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); line-height: 1.25; }
.brand-text { display: flex; flex-direction: column; }
.brand-logo { width: 36px; height: 36px; flex: none; stroke: none; }
.brand-logo .logo-g { fill: #035830; }
.brand-logo .logo-r { fill: #ad1d3d; }
@media (prefers-color-scheme: dark) {
    /* 暗い背景でも見えるよう、少し明るい色にする */
    .brand-logo .logo-g { fill: #3fae78; }
    .brand-logo .logo-r { fill: #e0536f; }
}
@media (min-width: 960px) { .brand-logo { width: 40px; height: 40px; } }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.brand-title { font-size: 17px; font-weight: 700; }
.badge {
    display: inline-block; vertical-align: 2px; margin-left: 4px; padding: 1px 7px;
    border-radius: 999px; background: var(--soft-green); color: var(--green);
    font-size: 11px; font-weight: 700;
}

.icon-button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent;
    color: var(--muted); cursor: pointer;
}
.icon-button:hover { background: var(--track); color: var(--text); }

/* レイアウト */

main {
    max-width: 680px; margin: 0 auto;
    padding: 20px 16px calc(32px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 16px;
}
#start-view, #result-view, .start-intro, .start-action { display: flex; flex-direction: column; gap: 16px; }

.card {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 16px;
}
.section-title {
    font-size: 13px; font-weight: 600; color: var(--muted);
    margin: 8px 4px -8px; letter-spacing: .02em;
}

/* ボタン */

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 12px; padding: 10px 16px; cursor: pointer;
    background: var(--track); color: var(--text); font-weight: 600; text-decoration: none;
    transition: transform .1s ease, background .15s ease;
}
.button:active { transform: scale(.98); }
.button-primary { background: var(--green); color: #fff; }
.button-primary:hover { background: var(--green-strong); }
.button-large { width: 100%; padding: 16px; font-size: 17px; border-radius: 14px; }
.button-small { padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.button-danger { background: var(--soft-red); color: var(--red); width: 100%; }
.text-button {
    border: 0; background: none; padding: 0; color: var(--green); font-weight: 600; cursor: pointer;
    font-size: 14px;
}
@media (prefers-color-scheme: dark) {
    .button-primary { color: #06120c; }
}
:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 50%, transparent); outline-offset: 2px; }

/* 読み込み前 */

.hero { padding: 12px 4px 0; }
.hero h1 { font-size: 26px; line-height: 1.35; letter-spacing: .01em; }
.lead { margin-top: 10px; color: var(--muted); font-size: 15px; }

.privacy-box {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--soft-green); border-radius: var(--radius); padding: 14px 16px;
}
.privacy-icon { color: var(--green); margin-top: 2px; }
.privacy-title { font-weight: 700; font-size: 15px; color: var(--green); }
.privacy-text { font-size: 13px; color: var(--muted); margin-top: 2px; }

.drop-zone {
    border: 2px dashed transparent; border-radius: 18px; padding: 4px;
    display: flex; flex-direction: column; gap: 8px; align-items: stretch;
}
.drop-zone.is-dragging { border-color: var(--green); background: var(--soft-green); }
.drop-hint { text-align: center; font-size: 12px; color: var(--muted); }
@media (hover: none), (max-width: 959px) { .drop-hint { display: none; } }

.error-text {
    background: var(--soft-red); color: var(--red); border-radius: 12px; padding: 12px 14px; font-size: 14px;
}

.disclosure { padding: 0; }
.disclosure > summary {
    list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 600;
    display: flex; justify-content: space-between; align-items: center;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after {
    content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(45deg); margin: -4px 4px 0 12px; transition: transform .2s ease;
}
.disclosure[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.disclosure > :not(summary) { margin: 0 16px 16px; }
.steps { padding-left: 1.4em; font-size: 15px; }
.steps li + li { margin-top: 6px; }
.coverage-list { list-style: none; padding: 0; font-size: 14px; }
.coverage-list li { padding: 6px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.coverage-list li:first-child { border-top: 0; }
.coverage-list li > span:last-child { white-space: nowrap; flex: none; }

.caution-text { font-size: 12px; color: var(--muted); padding: 0 4px; }

/* iOS アプリへの誘導 */

.app-card { display: flex; gap: 12px; align-items: flex-start; position: relative; padding-right: 44px; }
.app-icon { border-radius: 13px; flex: none; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.app-card-title { font-weight: 700; font-size: 15px; }
.app-card-text { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.app-card-close { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; }
.app-card-close svg { width: 18px; height: 18px; }

/* 判定結果 */

.caution-banner {
    text-align: center; padding: 4px 8px 0;
}
.caution-banner strong { color: var(--red); font-size: 14px; display: block; }
.caution-banner span { font-size: 12px; color: var(--muted); }

.summary { display: flex; flex-direction: column; gap: 16px; }
.summary-main { display: flex; gap: 18px; align-items: center; }
.gauge { width: 104px; height: 104px; flex: none; position: relative; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 10; }
.gauge .gauge-track { stroke: var(--track); }
.gauge .gauge-value { stroke: var(--red); transition: stroke-dashoffset .6s ease; }
.gauge.is-ok .gauge-value { stroke: var(--green); }
.gauge-label {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    line-height: 1.1;
}
.gauge-number { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gauge-unit { font-size: 11px; color: var(--muted); }
.summary-kind { font-size: 12px; color: var(--muted); }
.summary-total { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-status { font-size: 14px; font-weight: 600; color: var(--red); }
.summary-status.is-ok { color: var(--green); }
.summary-row {
    display: flex; justify-content: space-between; align-items: baseline;
    border-top: 1px solid var(--line); padding-top: 12px;
}
.summary-row .value { font-weight: 700; font-variant-numeric: tabular-nums; }
.profile-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
    border: 0; border-top: 1px solid var(--line); background: none; padding: 12px 0 0; text-align: left; cursor: pointer;
}
.profile-meta { font-size: 12px; color: var(--muted); }
.profile-name { font-weight: 600; }
.profile-track { font-size: 14px; color: var(--muted); }
.profile-change { color: var(--green); font-weight: 600; font-size: 14px; flex: none; }
.summary-link {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer;
    border: 0; border-top: 1px solid var(--line); background: none; padding: 12px 0 0; font-size: 15px;
}
.summary-link > span:first-child { flex: 1; }

.notice {
    display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
    border: 0; background: var(--soft-orange); border-radius: 12px; padding: 12px 14px; cursor: pointer;
    font-size: 14px;
}
.notice + .notice { margin-top: 8px; }
.notice svg { color: var(--orange); width: 20px; height: 20px; margin-top: 1px; }
/* フィードバックの送信ボタンの上: 成績データが添付されることを強調 */
.attach-notice { cursor: default; margin: 16px 0 12px; border: 1.5px solid var(--orange); }
.attach-notice strong { display: block; font-size: 15px; margin-bottom: 4px; }
.attach-notice-body { display: block; font-size: 13px; line-height: 1.55; }
.notice-hint { display: block; font-size: 12px; color: var(--orange); font-weight: 600; margin-top: 2px; }

/* 進捗の行 */

.row-list { padding: 4px 0; }
.req-row {
    display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
    padding: 12px 16px; border-top: 1px solid var(--line);
}
.req-row:first-child { border-top: 0; }
.req-row:hover { background: color-mix(in srgb, var(--track) 50%, transparent); }
.req-row.is-indented { padding-left: 40px; }
.req-row.is-static { cursor: default; }
.req-row.is-static:hover { background: none; }
/* プログラム・コース等の比較（トラック専用の要件の進み具合）と選択の行 */
.track-req { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.track-req.is-ok span:first-child::before { content: "✓ "; color: var(--green); }
.track-req:not(.is-ok) span:first-child::before { content: "○ "; }
.choice-row { color: var(--green); font-size: 15px; }
.req-head { display: flex; align-items: flex-start; gap: 8px; }
.req-icon { width: 20px; height: 20px; margin-top: 2px; color: var(--muted); }
.req-icon.is-ok { color: var(--green); }
.req-label { flex: 1; font-size: 15px; }
.req-row.is-heading .req-label { font-weight: 700; font-size: 16px; }
.req-value { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 15px; white-space: nowrap; }
.req-value.is-ok { color: var(--text); }
.req-row.is-heading .req-value { font-weight: 700; }
.req-chevron { width: 16px; height: 16px; color: var(--muted); margin-top: 4px; }
.bar { display: block; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; margin: 8px 0 0 28px; }
.req-row.is-heading .bar { height: 8px; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--red); }
.bar.is-ok > span { background: var(--green); }
.req-note.is-red { color: var(--red); }
.category-checklist { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 8px 0 0 28px; font-size: 12px; }
.category-item { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; color: var(--red); }
.category-item.is-ok { color: var(--muted); }
.category-item svg { width: 14px; height: 14px; }
.category-item.is-ok svg { color: var(--green); }
.req-note { display: block; font-size: 12px; color: var(--muted); margin: 6px 0 0 28px; }
/* 要件データの未確認の点（caveats） */
.req-caveat { display: flex; gap: 4px; align-items: flex-start; font-size: 12px; color: var(--muted); margin: 6px 0 0 28px; }
.req-caveat svg { flex: none; width: 14px; height: 14px; margin-top: 1px; color: var(--orange); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.caveat-card .req-caveat { margin: 0; padding: 10px 16px; }
.caveat-card .req-caveat + .req-caveat { border-top: 1px solid var(--line); }

.group-card { padding: 0; overflow: hidden; }

/* 不足要件 */

.shortfall { padding: 12px 16px; border-top: 1px solid var(--line); display: block; width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer; }
.shortfall:first-child { border-top: 0; }
.shortfall-path { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shortfall-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.shortfall-label { font-weight: 700; font-size: 15px; }
.shortfall-need { color: var(--red); font-weight: 700; font-size: 14px; white-space: nowrap; }
.shortfall-line { font-size: 13px; color: var(--muted); margin-top: 2px; }
.shortfall-line.is-red { color: var(--red); }
.shortfall-line.is-orange { color: var(--orange); }

.list-footer { font-size: 12px; color: var(--muted); padding: 0 4px; margin-top: -8px; }

/* 科目の行 */

.course {
    display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line);
    width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0;
}
.course:first-child { border-top: 0; }
button.course { cursor: pointer; }
button.course:hover { background: color-mix(in srgb, var(--track) 50%, transparent); }
.course-main { min-width: 0; flex: 1 1 55%; }
.course-name { font-size: 15px; }
.course-sub { font-size: 12px; color: var(--muted); }
.course-side { text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; max-width: 45%; flex: none; }
.course-side strong { display: block; color: var(--text); font-size: 15px; font-weight: 600; }
.course.is-ahead { opacity: .55; }
/* タップして開く欄（他学部・他学科向けの開講授業・この区分のほかの未修得の授業）。開閉の矢印は .disclosure の共通の見た目。
   中の授業の一覧は、ほかの授業の一覧のカードと同じ幅で並べる */
.disclosure > .disclosure-body { margin: 0; border-top: 1px solid var(--line); }
.course.is-failed .course-name, .course.is-failed .course-side strong { color: var(--red); }
.course-note { font-size: 12px; color: var(--orange); margin-top: 2px; }
.required {
    display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; vertical-align: 1px;
    background: var(--soft-red); color: var(--red); font-size: 11px; font-weight: 700;
}
.course-link { color: var(--green); font-size: 12px; font-weight: 600; }

/* GPA の推移 */

.chart svg { width: 100%; height: auto; stroke: none; fill: none; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .bar-rect { fill: color-mix(in srgb, var(--green) 35%, transparent); }
.chart .line { stroke: var(--green); stroke-width: 2.5; fill: none; }
.chart .dot { fill: var(--green); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .legend-bar::before { background: color-mix(in srgb, var(--green) 35%, transparent); }
.legend .legend-line::before { background: var(--green); height: 3px; vertical-align: 3px; }

/* 出典 */

.source-link { display: block; padding: 10px 16px; border-top: 1px solid var(--line); text-decoration: none; }
.source-link:first-child { border-top: 0; }
.source-pages { display: block; font-size: 12px; color: var(--muted); }
.source-note { font-size: 12px; color: var(--muted); padding: 10px 16px; border-top: 1px solid var(--line); }

/* シート（要件の詳細・設定） */

.sheet {
    border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 680px;
    max-height: 92dvh; height: 92dvh; border-radius: 20px 20px 0 0;
    background: var(--bg); color: var(--text);
    display: flex; flex-direction: column;
}
.sheet:not([open]) { display: none; }
.sheet::backdrop { background: rgba(0, 0, 0, .35); }
.sheet[open] { animation: sheet-in .25s ease-out; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 720px) and (max-width: 959px) {
    .sheet { margin: auto; border-radius: 20px; height: min(86vh, 900px); }
}
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
.sheet-header {
    display: flex; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line);
    background: var(--card); border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.sheet-title { flex: 1; font-size: 16px; font-weight: 700; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sheet-back[hidden] + .sheet-title { padding-left: 44px; }
.sheet-body {
    overflow-y: auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 16px; flex: 1; overscroll-behavior: contain;
}
.sheet-body > * { flex-shrink: 0; }

.search {
    width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--card); color: var(--text); font: inherit; font-size: 16px;
}

/* 設定 */

.field { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); }
.field:first-child { border-top: 0; }
.field-label { font-size: 13px; color: var(--muted); }
.select {
    width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
}
.select:disabled { opacity: .6; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; }
.switch { appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--track); position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }
.field-hint { font-size: 12px; color: var(--muted); padding: 0 4px; margin-top: -8px; }

/* フッター */

.footer {
    max-width: 680px; margin: 0 auto; padding: 8px 20px calc(32px + env(safe-area-inset-bottom));
    font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 8px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* プライバシーポリシー・同意 */

.consent { display: flex; flex-direction: column; gap: 16px; }
/* 同意画面の上に出すツールの説明（main.js が .start-intro を移動する）。画面に張り付く指定は読み込み前の画面だけ */
.consent .start-intro { position: static !important; padding-top: 0 !important; margin-bottom: 8px; }
.consent-head h2 { font-size: 26px; line-height: 1.35; }
.policy { font-size: 14px; line-height: 1.7; }
.policy-summary { display: flex; flex-direction: column; gap: 10px; border: 2px solid var(--soft-green); }
.policy-summary-title { font-size: 16px; line-height: 1.5; color: var(--green); }
.policy-summary ul { margin: 0; padding-left: 1.3em; font-size: 16px; line-height: 1.7; }
.policy-summary li + li { margin-top: 8px; }
.policy-full > summary { font-size: 14px; color: var(--muted); }
#consent-policy { max-height: 52dvh; overflow-y: auto; overscroll-behavior: contain; }
.policy-title { font-size: 17px; }
.policy h3 { font-size: 15px; margin: 18px 0 4px; }
.policy p + p { margin-top: 6px; }
.policy ul, .policy ol { padding-left: 1.4em; margin: 4px 0; }
.policy li + li { margin-top: 4px; }
.policy table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.policy th, .policy td { text-align: left; vertical-align: top; padding: 8px 6px; border-top: 1px solid var(--line); }
.policy th { width: 28%; color: var(--muted); font-weight: 600; }
.policy td ul { padding-left: 1.1em; margin: 0; }
.consent-actions { display: flex; flex-direction: column; gap: 12px; }
.declined { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 24px 20px; }
.declined-title { font-size: 18px; font-weight: 700; }
.link-button { border: 0; background: none; padding: 0; color: var(--green); text-decoration: underline; cursor: pointer; font-size: inherit; }

/* フィードバック */

.feedback-wrap { display: flex; flex-direction: column; gap: 16px; }
.feedback-card { display: flex; flex-direction: column; gap: 12px; background: var(--soft-green); box-shadow: none; }
.feedback-card.is-answered { flex-direction: row; justify-content: space-between; align-items: center; background: var(--card); box-shadow: var(--shadow); }
.feedback-question { font-weight: 700; font-size: 15px; }
.feedback-thanks { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.feedback-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feedback-buttons .button { background: var(--card); }
.button:disabled { opacity: .5; cursor: default; }
.option-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.option-row:first-child { border-top: 0; }
.option-caption { display: block; font-size: 12px; color: var(--muted); }
.option-label { display: block; font-size: 15px; }
.check { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green); flex: none; }
.textarea {
    width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); resize: vertical;
    background: var(--card); color: var(--text); font: inherit; font-size: 16px; line-height: 1.5;
}
.preview { display: flex; flex-direction: column; gap: 4px; }
.preview-list { list-style: none; padding: 0; margin: 4px 0 0; font-size: 13px; max-height: 320px; overflow-y: auto; }
.preview-list li { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--line); }
.preview-list li span:last-child { font-size: 12px; }

.toast {
    position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    z-index: 30; max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 14px;
    background: var(--text); color: var(--bg); font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

/* 判定結果のレイアウト（スマートフォン: 1列。各セクションの order の順に並ぶ） */

.result-side, .result-main { display: contents; }
.result-section { display: flex; flex-direction: column; gap: 16px; }
.data-card { display: flex; flex-direction: column; gap: 10px; }
.notice-list { display: flex; flex-direction: column; }

/* PC（広い画面） */

@media (min-width: 960px) {
    .topbar-inner, main, .footer { max-width: 1160px; }
    main { padding: 32px 32px 48px; }
    .footer { padding-left: 36px; padding-right: 36px; }

    /* 読み込み前: 左に説明、右に読み込み */
    .start { display: grid !important; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
    .start[hidden] { display: none !important; }
    .start-intro, .start-action { display: flex; flex-direction: column; gap: 16px; }
    .start-intro { position: sticky; top: 96px; padding-top: 24px; }
    .hero h1 { font-size: 38px; }
    .lead { font-size: 16px; }
    .drop-zone { border-color: var(--line); padding: 28px; background: var(--card); }
    .drop-zone.is-dragging { border-color: var(--green); }

    .consent { max-width: 820px; margin: 0 auto; width: 100%; }
    #consent-policy { max-height: 56vh; }
    .policy-summary ul { font-size: 17px; }
    .consent-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .consent-actions .button { width: auto; flex: 1; }

    /* 判定結果: 左に概要・不足要件、右に修得状況 */
    .result { display: grid !important; grid-template-columns: minmax(340px, 400px) 1fr; gap: 28px; align-items: start; }
    .result[hidden] { display: none !important; }
    .result.is-single { grid-template-columns: minmax(0, 640px); justify-content: center; }
    .result-side, .result-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
    .result-side .result-section:first-child .caution-banner { text-align: left; padding: 0 4px; }

    /* シートは右側のパネル */
    .sheet {
        margin: 0 0 0 auto; width: min(600px, 92vw); max-width: none;
        height: 100dvh; max-height: 100dvh; border-radius: 20px 0 0 20px;
    }
    .sheet[open] { animation: panel-in .25s ease-out; }
    .sheet-header { border-top-right-radius: 0; }
    .sheet-body { padding: 20px 24px 32px; }
}
@keyframes panel-in { from { transform: translateX(32px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
@media (hover: hover) and (min-width: 960px) { .drop-hint { display: block; } }

/* 解析中のアニメーション（約1秒） */

.analyzing {
    position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    animation: fade-in .15s ease-out;
}
.analyzing.is-leaving { opacity: 0; transition: opacity .15s ease; }
.analyzing-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: var(--card); border-radius: 24px; padding: 28px 36px 24px; min-width: 240px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .12);
    animation: pop-in .25s cubic-bezier(.2, .9, .3, 1.2);
}
.analyzing-ring { position: relative; width: 84px; height: 84px; margin-bottom: 10px; }
.analyzing-ring > svg:first-child { width: 100%; height: 100%; transform: rotate(-90deg); }
.analyzing-ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.ring-track { stroke: var(--track); }
.ring-value {
    stroke: var(--green); stroke-dasharray: 264; stroke-dashoffset: 264;
    animation: ring-fill .75s cubic-bezier(.45, 0, .2, 1) forwards;
}
.analyzing.is-waiting .ring-value { stroke-dashoffset: 200; animation: none; }
.analyzing.is-waiting .analyzing-ring > svg:first-child { animation: spin .9s linear infinite; }
.analyzing.is-done .ring-value { animation: none; stroke-dashoffset: 0; transition: stroke-dashoffset .15s ease; }
.analyzing-doc {
    position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; color: var(--green);
    animation: doc-bob .5s ease-in-out infinite alternate;
}
.analyzing-title { font-weight: 700; font-size: 17px; }
.analyzing-title::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1s steps(4) infinite; }
.analyzing-step { font-size: 13px; color: var(--muted); min-height: 1.6em; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { transform: scale(.92); opacity: 0; } }
@keyframes ring-fill { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(270deg); } }
@keyframes doc-bob { from { transform: translateY(1px); } to { transform: translateY(-2px); } }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

@media (prefers-reduced-motion: reduce) {
    .analyzing, .analyzing-card, .analyzing-doc, .analyzing-title::after { animation: none; }
    .ring-value { animation: none; stroke-dashoffset: 0; }
}

/* フィードバックのお願い（小さなダイアログ） */

.prompt {
    border: 0; padding: 22px 20px 16px; border-radius: 20px; width: min(340px, 90vw);
    background: var(--card); color: var(--text); text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .2);
}
.prompt::backdrop { background: rgba(0, 0, 0, .35); }
.prompt[open] { animation: pop-in .2s ease-out; }
.prompt-title { font-weight: 700; font-size: 17px; }
.prompt-text { font-size: 14px; color: var(--muted); margin: 6px 0 16px; }
.prompt-buttons { display: flex; flex-direction: column; gap: 8px; }
.prompt-buttons .button { width: 100%; color: var(--green); }
.prompt-buttons .prompt-later { background: none; color: var(--muted); font-weight: 500; }
