* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "Noto Sans JP", sans-serif;
    background: #f5f5f3;
    color: #181818;
}

main {
    width: min(760px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0 80px;
}

header {
    margin-bottom: 48px;
}

.brand {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -1px;
}

.subtitle {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 700;
}

header p {
    color: #666;
    line-height: 1.7;
}

h2 {
    font-size: 20px;
    margin-bottom: 18px;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,.05);
}

.meta {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.meta span {
    font-size: 12px;
    background: #eee;
    padding: 5px 9px;
    border-radius: 999px;
}

.label {
    color: #888;
    font-size: 13px;
    margin-bottom: 5px;
}

.standard {
    font-size: 23px;
}

.arrow {
    color: #aaa;
    margin: 12px 0;
}

.kansai {
    font-size: 32px;
    font-weight: 800;
}

.meaning {
    margin-top: 8px;
    color: #555;
}

.explanation {
    margin-top: 22px;
    padding: 16px;
    background: #f7f7f5;
    border-radius: 12px;
    line-height: 1.7;
}

button {
    width: 100%;
    margin-top: 18px;
    padding: 13px;
    border: 0;
    border-radius: 10px;
    background: #eee;
    color: #888;
}

.module-grid {
    display: grid;
    gap: 16px;
}

.module-card {
    display: block;
    background: white;
    border-radius: 18px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 20px rgba(0,0,0,.05);
    transition: transform .15s ease, box-shadow .15s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,.08);
}

.module-count {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.module-title {
    font-size: 24px;
    font-weight: 800;
}

.module-description {
    margin-top: 8px;
    color: #666;
    line-height: 1.6;
}

.module-link {
    margin-top: 20px;
    font-weight: 700;
}

.pattern {
    margin-top: 14px;
    font-size: 14px;
    font-weight: 700;
}

.back-link {
    display: inline-block;
    margin-bottom: 28px;
    color: #555;
    text-decoration: none;
}

.lesson-list {
    display: grid;
    gap: 12px;
}

.lesson-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    padding: 18px 20px;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 3px 16px rgba(0,0,0,.04);
}

.lesson-number {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #f0f0ee;
    font-weight: 700;
}

.lesson-row-content {
    flex: 1;
}

.lesson-row-main {
    font-size: 20px;
    font-weight: 750;
}

.lesson-row-sub {
    margin-top: 3px;
    font-size: 13px;
    color: #888;
}

.lesson-arrow {
    color: #999;
}

.lesson-progress {
    color: #888;
    font-size: 13px;
    margin-bottom: 16px;
}

.lesson-card {
    background: white;
    padding: 30px;
    border-radius: 22px;
    box-shadow: 0 4px 20px rgba(0,0,0,.05);
}

.kansai.big {
    font-size: 40px;
}

.pattern-box {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid #e5e5e2;
    border-radius: 12px;
    font-weight: 700;
}

.pattern-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.audio-placeholder {
    margin-top: 20px;
}

.learned-button {
    width: 100%;
    margin-top: 14px;
    padding: 14px;
    border: 0;
    border-radius: 12px;
    background: #181818;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.learned-button.is-learned {
    background: #e9e9e5;
    color: #222;
}

.lesson-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

.nav-button {
    display: inline-block;
    padding: 13px 18px;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: #222;
    font-weight: 700;
}

.nav-button.primary {
    background: #181818;
    color: white;
}

.auth-wrap {
    min-height: 80vh;
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(420px, 100%);
    background: white;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 6px 30px rgba(0,0,0,.06);
}

.auth-subtitle {
    color: #777;
    margin-bottom: 24px;
}

.auth-card form {
    display: grid;
    gap: 10px;
}

.auth-card label {
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
}

.auth-card input {
    padding: 13px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
}

.auth-button {
    margin-top: 12px;
    padding: 13px;
    border: 0;
    border-radius: 10px;
    background: #181818;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.auth-error {
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: #f7e7e7;
    color: #8d2424;
}

.admin-section {
    margin-top: 28px;
}

.admin-create-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-create-form input,
.admin-create-form select,
.user-actions input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 9px;
}

.admin-create-form button,
.user-actions button {
    padding: 10px 14px;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
}

.user-list {
    display: grid;
    gap: 12px;
}

.user-card {
    background: white;
    padding: 18px;
    border-radius: 14px;
    box-shadow: 0 3px 16px rgba(0,0,0,.04);
}

.user-main {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.user-main span {
    font-size: 12px;
    background: #eee;
    padding: 4px 8px;
    border-radius: 20px;
}

.user-meta {
    margin-top: 8px;
    font-size: 12px;
    color: #888;
}

.user-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.user-actions form {
    display: flex;
    gap: 8px;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 16px;
}

.top-nav a {
    text-decoration: none;
    color: #444;
    font-size: 14px;
    font-weight: 700;
}

.top-nav-right {
    display: flex;
    gap: 16px;
}

.admin-shortcut {
    margin: 18px 0 26px;
}

.admin-shortcut a {
    display: inline-block;
    padding: 10px 14px;
    background: #181818;
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.password-generator {
    display: flex;
    gap: 8px;
}

.password-generator input {
    min-width: 220px;
}

.progress-track {
    width: 100%;
    height: 7px;
    background: #e9e9e6;
    border-radius: 999px;
    overflow: hidden;
    margin: 10px 0 16px;
}

.progress-fill {
    height: 100%;
    background: #181818;
    border-radius: 999px;
}

.module-progress-summary {
    font-size: 13px;
    font-weight: 700;
    margin-top: 14px;
}

.lesson-number.done {
    background: #181818;
    color: white;
}

.module-title-link {
    text-decoration: none;
    color: inherit;
}

.module-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.module-list-link {
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 700;
}

.module-continue-link {
    text-decoration: none;
    background: #181818;
    color: white;
    padding: 9px 14px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
}

.module-quiz-link {
    margin: 14px 0 24px;
}

.module-quiz-link a {
    font-weight: 700;
    text-decoration: none;
    color: #222;
}

.quiz-card {
    background: white;
    padding: 24px;
    border-radius: 18px;
    margin-bottom: 18px;
    box-shadow: 0 3px 16px rgba(0,0,0,.04);
}

.quiz-number {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.quiz-question {
    font-size: 26px;
    font-weight: 800;
}

.quiz-options {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.quiz-option {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 13px;
    border: 1px solid #ddd;
    border-radius: 11px;
    cursor: pointer;
}

.quiz-submit {
    width: 100%;
    padding: 15px;
    border: 0;
    border-radius: 12px;
    background: #181818;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.quiz-score {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 22px;
}

.quiz-score-number {
    font-size: 46px;
    font-weight: 800;
}

.quiz-result-row {
    background: white;
    padding: 18px;
    border-radius: 14px;
    margin-bottom: 10px;
}

.quiz-result-row.correct {
    border-left: 5px solid #333;
}

.quiz-result-row.wrong {
    border-left: 5px solid #aaa;
}

.quiz-result-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.module-quiz-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.quiz-best,
.module-quiz-score {
    font-size: 12px;
    color: #777;
    font-weight: 700;
}

.lesson-section {
    margin-top: 22px;
    padding: 16px;
    border-radius: 12px;
    background: #f7f7f4;
}

.lesson-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
}

.example-context {
    font-size: 16px;
    line-height: 1.7;
}

.caution-box {
    border-left: 4px solid #999;
}

.lesson-section {
    margin-top: 22px;
    padding: 16px;
    border-radius: 12px;
    background: #f7f7f4;
}

.lesson-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
}

.example-context {
    font-size: 16px;
    line-height: 1.7;
}

.caution-box {
    border-left: 4px solid #999;
}

.verification-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.verification-badge.reviewed {
    background: #ecece8;
    color: #333;
}

.verification-badge.native-check {
    background: #f3eee2;
    color: #66562f;
}

.verification-badge.native-verified {
    background: #e7efe8;
    color: #36563c;
}

.native-example-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #e6e6e2;
}

.native-source-note {
    font-size: 12px;
    color: #888;
    margin-bottom: 14px;
}

.native-example-card {
    padding: 16px;
    margin-bottom: 12px;
    background: #f7f7f4;
    border-radius: 14px;
}

.native-example-card audio {
    width: 100%;
    margin-bottom: 12px;
}

.native-dialect {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.6;
}

.native-standard {
    margin-top: 6px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.native-meta {
    margin-top: 8px;
    font-size: 11px;
    color: #999;
}
