:root {
    --brand-green: #91c530;
    --brand-green-dark: #6fa019;
    --text-main: #333;
    --bg: #f7f8f6;
    --card-bg: #ffffff;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-main);
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

.app-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-header img {
    height: 32px;
    display: block;
}

.app-header form button {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
}

.app-main {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card h2 {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px;
    font-weight: 600;
}

.card .empty {
    color: #999;
    font-size: 14px;
}

.greeting {
    font-size: 18px;
    font-weight: 700;
    margin: 4px 0 16px;
}

.measured-date {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-green-dark);
    margin-bottom: 12px;
}

.comment-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}

.comment-text {
    white-space: pre-wrap;
    line-height: 1.6;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.score-item {
    text-align: center;
    background: var(--bg);
    border-radius: 8px;
    padding: 8px 4px;
}

.score-item .label {
    font-size: 11px;
    color: #888;
}

.score-item .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-green-dark);
}

.task-text {
    white-space: pre-wrap;
    line-height: 1.6;
}

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

.menu-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.menu-list li:last-child {
    border-bottom: none;
}

.menu-list .menu-name {
    font-weight: 600;
}

.menu-list .menu-desc {
    font-size: 13px;
    color: #777;
    margin-top: 2px;
}

/* Login page */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.login-card img {
    display: block;
    height: 40px;
    margin: 0 auto 24px;
}

.login-card label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.login-card input[type="email"],
.login-card input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 16px;
}

.login-card button {
    width: 100%;
    background: var(--brand-green);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.login-card button:hover {
    background: var(--brand-green-dark);
}

.error-text {
    color: #dc2626;
    font-size: 13px;
    margin: -8px 0 16px;
}

/* Links */
.link-arrow {
    color: var(--brand-green-dark);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

.link-arrow:hover {
    text-decoration: underline;
}

/* History list */
.history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.history-list li {
    border-bottom: 1px solid var(--border);
}

.history-list li:last-child {
    border-bottom: none;
}

.history-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 4px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

.history-list .chevron {
    color: #ccc;
    font-size: 18px;
}

/* Chart */
.chart-card {
    text-align: center;
}

.radar-chart {
    width: 100%;
    max-width: 420px;
    height: auto;
}

/* Nav tabs */
.app-nav {
    display: flex;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 65px;
    z-index: 9;
}

.nav-toggle {
    display: none;
}

.nav-links {
    display: flex;
    width: 100%;
}

.nav-links a {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.nav-links a.active {
    color: var(--brand-green-dark);
    border-bottom-color: var(--brand-green);
}

@media (max-width: 600px) {
    .app-nav {
        justify-content: flex-start;
        padding: 4px 0;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        height: 40px;
        margin: 0 0 0 12px;
        padding: 0;
        background: none;
        border: none;
        cursor: pointer;
    }

    .nav-toggle-icon {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 22px;
    }

    .nav-toggle-icon span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--text-main);
    }

    .nav-toggle-label {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-main);
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: #fff;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 14px 16px;
        text-align: left;
        border-bottom: 1px solid var(--border);
        border-left: 3px solid transparent;
    }

    .nav-links a.active {
        border-bottom-color: var(--border);
        border-left-color: var(--brand-green);
        background: var(--bg);
    }
}

/* Video upload form */
.card form label {
    display: block;
    font-size: 13px;
    color: #666;
    margin: 12px 0 4px;
}

.card form input[type="file"],
.card form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.card form button {
    margin-top: 16px;
    width: 100%;
    background: var(--brand-green);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.card form button:hover {
    background: var(--brand-green-dark);
}

.upload-success {
    background: #ecfdf3;
    color: var(--brand-green-dark);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.video-player {
    width: 100%;
    border-radius: 8px;
    background: #000;
    max-height: 50vh;
    display: block;
    margin: 0 auto;
}

.uploader-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.uploader-badge--staff {
    background: #eff6ff;
    color: #2563eb;
}

.uploader-badge--member {
    background: #ecfdf3;
    color: var(--brand-green-dark);
}

/* Trend chart */
.trend-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    margin-bottom: 12px;
}

.trend-chart-img {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
}

.trend-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 13px;
}

.trend-nav a {
    color: var(--brand-green-dark);
    font-weight: 600;
    text-decoration: none;
}

.trend-nav a:hover {
    text-decoration: underline;
}

.trend-nav-disabled {
    color: #ccc;
    font-weight: 600;
}

.trend-range {
    color: #888;
    font-size: 12px;
}

/* Journal */
.journal-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

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

.journal-thumb {
    width: 100%;
    display: block;
    max-height: 200px;
    object-fit: cover;
}

.journal-thumb--detail {
    max-height: 260px;
    border-radius: 8px;
}

.journal-card-body {
    padding: 16px;
}

.journal-title {
    font-size: 17px;
    font-weight: 700;
    margin: 4px 0 0;
    color: var(--text-main);
}

.journal-title--detail {
    font-size: 22px;
    margin-top: 8px;
}

.journal-body {
    margin-top: 16px;
    line-height: 1.8;
    font-size: 15px;
}

.journal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

.journal-body p {
    margin: 0 0 1em;
}

/* Question board */
.board-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin: -16px -16px 16px;
}

.board-tabs a {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.board-tabs a.active {
    color: var(--brand-green-dark);
    border-bottom-color: var(--brand-green);
}

.question-status-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.question-status-badge--answered {
    background: #ecfdf3;
    color: var(--brand-green-dark);
}

.question-status-badge--unanswered {
    background: #fef2f2;
    color: #ef4444;
}

.question-category-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg);
    color: #666;
}

.question-answer {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
}

.question-answer-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-green-dark);
    margin: 0 0 6px;
}

/* Swing length table */
.swing-lead {
    font-size: 13px;
    color: #777;
    margin: 0 0 14px;
}

.swing-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.swing-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.swing-field label {
    font-size: 12px;
    color: #888;
    font-weight: 600;
}

.swing-select {
    font-size: 16px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-main);
    min-width: 110px;
}

.swing-slope-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.swing-hint {
    font-size: 12px;
    color: #888;
}

.swing-condition {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--brand-green-dark);
    margin: 0 0 12px;
}

.swing-tablewrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.swing-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 520px;
    font-variant-numeric: tabular-nums;
}

.swing-table th,
.swing-table td {
    padding: 8px 6px;
    text-align: center;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.swing-table thead th {
    background: #fafafa;
    color: #888;
    font-size: 11px;
    font-weight: 700;
}

.swing-table tbody th {
    background: #fafafa;
    color: var(--text-main);
    font-weight: 700;
}

.swing-table th.corner {
    background: #fff;
    color: #888;
    font-size: 10px;
    font-weight: 600;
    text-align: left;
    padding-left: 10px;
}

.swing-table td.val {
    font-weight: 600;
}

.swing-table td.na {
    color: #9a3412;
    font-weight: 700;
}

.swing-note {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
}
