* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
    background-color: #f4f6f8;
    color: #222222;
    line-height: 1.7;
}

.app-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 16px 48px;
}

.app-header {
    text-align: center;
    padding: 20px 0;
}

.app-header h1 {
    font-size: 22px;
    margin: 0;
    color: #2c3e50;
}

.app-main {
    background: #ffffff;
    border-radius: 10px;
    padding: 28px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e6ea;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: #3b7dd8;
    transition: width 0.3s ease;
}

.step-indicator {
    text-align: right;
    font-size: 14px;
    color: #777777;
    margin: 0 0 16px;
}

.tag-label {
    display: inline-block;
    font-size: 13px;
    background: #eef3fb;
    color: #3b7dd8;
    padding: 4px 10px;
    border-radius: 14px;
    margin-bottom: 12px;
}

.q-title, .q-prompt {
    font-size: 20px;
    color: #222222;
    margin: 8px 0 16px;
}

.info-body p {
    font-size: 17px;
    margin: 0 0 12px;
}

.passage-box {
    background: #f9fafb;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 16px 18px;
    margin-top: 8px;
}

.passage-box p {
    font-size: 17px;
    margin: 0 0 10px;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 16px;
}

.word-tile {
    background: #eef3fb;
    border: 1px solid #cfe0f5;
    border-radius: 8px;
    padding: 18px 8px;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    color: #2c3e50;
}

.prompt-image {
    text-align: center;
    margin: 12px 0 20px;
}

.prompt-image img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #e2e6ea;
}

.choice-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0 24px;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.choice-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid #e2e6ea;
    border-radius: 8px;
    padding: 14px 16px;
    cursor: pointer;
    font-size: 18px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice-grid .choice-item {
    flex-direction: column;
    padding: 10px;
}

.choice-item:hover {
    border-color: #3b7dd8;
    background-color: #f5f9ff;
}

.choice-item input[type="radio"],
.choice-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.choice-text {
    font-size: 18px;
}

.choice-img {
    max-width: 100%;
    max-height: 130px;
    border-radius: 6px;
}

.sort-list {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 16px 0 24px;
}

.sort-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 2px solid #e2e6ea;
    border-radius: 8px;
    padding: 14px 16px;
}

.sort-letter {
    font-size: 26px;
    font-weight: bold;
    color: #2c3e50;
}

.sort-tile select {
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #cccccc;
}

.btn-next {
    display: inline-block;
    background: #3b7dd8;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 14px 32px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn-next:hover {
    background: #2f68b8;
}

.result-title {
    font-size: 22px;
    text-align: center;
    margin-bottom: 8px;
}

.result-score {
    text-align: center;
    margin-bottom: 20px;
}

.score-number {
    font-size: 34px;
    font-weight: bold;
    color: #2c3e50;
    margin: 6px 0;
}

.score-percent {
    font-size: 16px;
    color: #666666;
    margin: 0;
}

.result-level {
    text-align: center;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.level-label {
    font-size: 14px;
    margin: 0 0 6px;
    opacity: 0.8;
}

.level-value {
    font-size: 22px;
    font-weight: bold;
    margin: 0 0 10px;
}

.level-comment {
    font-size: 15px;
    margin: 0;
}

.level-normal { background: #e7f6ec; color: #1e7a3c; }
.level-mild { background: #fef6e0; color: #9a7100; }
.level-moderate { background: #fdece3; color: #b3521a; }
.level-advanced { background: #fbe4e4; color: #b32020; }

.result-breakdown h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.breakdown-table th, .breakdown-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #eeeeee;
    font-size: 15px;
}

.mini-bar {
    width: 100%;
    height: 6px;
    background: #eeeeee;
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}

.mini-bar-fill {
    height: 100%;
    background: #3b7dd8;
}

.disclaimer {
    background: #f9fafb;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.disclaimer p {
    font-size: 13px;
    color: #666666;
    margin: 0;
}

.result-page {
    text-align: left;
}

.result-page > .btn-next {
    display: block;
    width: 100%;
    margin-top: 8px;
}

/* ============================================================
   以下、SSO連携・管理者（教職員）向け結果閲覧画面のために追加したスタイル
   （既存の受験画面のトーン・配色に合わせている）
   ============================================================ */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e6ea;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.site-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

.site-header .brand img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

.site-header .user-info {
    font-size: 13px;
    color: #555555;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-header .user-info a {
    color: #3b7dd8;
    text-decoration: none;
}

.container-wide {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.panel {
    background: #ffffff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.panel h2 {
    margin-top: 0;
    font-size: 18px;
    color: #2c3e50;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th, .data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #eaeef1;
}

.data-table th {
    color: #6a7078;
    font-weight: bold;
    background: #f7f9fb;
}

.data-table tr:hover td {
    background: #fafcfe;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    color: #ffffff;
}

.badge.level-normal { background: #2e9e5b; }
.badge.level-mild { background: #d0a02c; }
.badge.level-moderate { background: #d97a2e; }
.badge.level-advanced { background: #d1473f; }

.empty-note {
    color: #8a8f9c;
    padding: 20px 0;
    text-align: center;
}

.login-wrap {
    max-width: 380px;
    margin: 60px auto;
    padding: 0 16px;
}

.login-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 32px 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.login-card img.logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    margin-bottom: 12px;
}

.login-card h1 {
    font-size: 19px;
    color: #2c3e50;
    margin: 0 0 22px;
}

.login-card label {
    display: block;
    text-align: left;
    font-size: 13px;
    color: #555555;
    margin: 14px 0 4px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid #d5dbe1;
    border-radius: 8px;
}

.login-error {
    background: #fdecea;
    color: #c0392b;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 14px;
}

.sso-note {
    margin-top: 22px;
    font-size: 12.5px;
    color: #8a8f9c;
    line-height: 1.6;
}

.link-back {
    display: inline-block;
    margin-top: 16px;
    color: #3b7dd8;
    text-decoration: none;
    font-size: 14px;
}

.breakdown-mini {
    font-size: 13px;
    color: #555555;
}


/* ============================================================
   配信管理（第1回、第2回…）・生徒用テスト一覧
   ============================================================ */
.admin-nav { display: flex; gap: 4px; padding: 0 24px; background: #fff; border-bottom: 1px solid #e3e6ec; }
.admin-nav a { padding: 12px 18px; color: #5a6270; text-decoration: none; font-size: 14px; border-bottom: 3px solid transparent; }
.admin-nav a.active { color: #d9822b; border-bottom-color: #d9822b; font-weight: bold; }
.admin-nav a:hover { color: #d9822b; }

.note { color: #8a8f9c; font-size: 13px; margin: 8px 0; }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash-ok { background: #e7f6ec; color: #1e7a3c; }
.flash-err { background: #fbe4e4; color: #b32020; }

.status-badge { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 12px; font-weight: bold; color: #fff; vertical-align: middle; }
.st-open { background: #2e9e5b; }
.st-draft { background: #9aa3b0; }
.st-closed { background: #c0504d; }

.btn { display: inline-block; border: 1px solid transparent; border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; text-decoration: none; line-height: 1.4; font-family: inherit; }
.btn-primary { background: #e8912d; color: #fff; }
.btn-primary:hover { background: #d9822b; }
.btn-warn { background: #fff; color: #b3521a; border-color: #d97a2e; }
.btn-danger { background: #fff; color: #b32020; border-color: #d1473f; }
.btn-light { background: #fff; color: #4a5260; border-color: #cfd4dc; }
.btn-light:hover { background: #f4f6f9; }
.btn-lg { padding: 10px 28px; font-size: 15px; }
td.actions { white-space: nowrap; }
td.actions .btn { margin: 2px 2px; }

.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label, .form-grid label { display: block; font-size: 13px; color: #5a6270; }
.inline-form input[type="text"], .inline-form select, .form-grid input[type="text"], .form-grid input[type="datetime-local"], .form-grid textarea {
    display: block; margin-top: 4px; padding: 8px 10px; border: 1px solid #cfd4dc; border-radius: 6px; font-size: 14px; font-family: inherit; min-width: 220px;
}
.form-grid { display: grid; gap: 14px; max-width: 560px; }
.form-grid textarea { width: 100%; box-sizing: border-box; }
.check-line { display: block; margin: 8px 0; font-size: 14px; color: #3a4250; cursor: pointer; }

.target-picker { margin-top: 12px; padding: 12px 14px; border: 1px solid #e3e6ec; border-radius: 8px; background: #fafbfc; }
.picker-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.picker-tools input[type="search"] { padding: 7px 10px; border: 1px solid #cfd4dc; border-radius: 6px; font-size: 13px; }
.class-group { border: 1px solid #e3e6ec; border-radius: 8px; margin: 10px 0; padding: 6px 12px 10px; background: #fff; }
.class-group legend { padding: 0 6px; font-weight: bold; }
.student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; }
.student-item { font-size: 14px; padding: 4px 0; cursor: pointer; }

.round-tag { display: inline-block; margin-left: 10px; padding: 2px 12px; border-radius: 12px; background: #fdf0df; color: #b3651a; font-size: 14px; vertical-align: middle; }
.round-list { display: grid; gap: 12px; }
.round-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid #e3e6ec; border-radius: 10px; background: #fff; }
.round-card-title { font-size: 18px; font-weight: bold; color: #2c3e50; }
.round-card-desc { margin-top: 4px; color: #5a6270; font-size: 14px; }
.round-card-meta { margin-top: 4px; color: #8a8f9c; font-size: 13px; }
.round-card .btn-next { white-space: nowrap; text-decoration: none; display: inline-block; }
.badge-done { display: inline-block; padding: 6px 16px; border-radius: 16px; background: #e7f6ec; color: #1e7a3c; font-size: 13px; font-weight: bold; }

/* フォントをボタン・入力欄にも適用（Noto Sans JP） */
button, input, select, textarea { font-family: inherit; }


/* ============================================================
   前回との比較
   ============================================================ */
.cmp-table th { white-space: nowrap; }
.cmp-sub { font-weight: normal; font-size: 11px; color: #8a8f9c; }
.cmp-h { font-size: 15px; margin: 20px 0 8px; color: #2c3e50; }
.delta { font-weight: bold; white-space: nowrap; }
.delta-up { color: #1e7a3c; }
.delta-down { color: #b32020; }
.delta-same { color: #6a7078; font-weight: normal; }
.trend-wrap { overflow-x: auto; margin: 4px 0 16px; }
.trend-svg { width: 100%; max-width: 680px; height: auto; display: block; }
.result-page .note { text-align: left; }
