:root {
    --bg: #f6f5f2;
    --surface: #ffffff;
    --ink: #23261f;
    --ink-soft: #6b6f63;
    --accent: #4c6b4f;
    --accent-soft: #dbe6db;
    --border: #e2e0d8;
    --danger: #b5473c;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(35,38,31,.06), 0 8px 24px rgba(35,38,31,.06);
    font-family: 'Georgia', 'Iowan Old Style', 'Palatino Linotype', serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

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

.app-header {
    position: sticky;
    top: 0;
    background: var(--bg);
    padding: 8px 0 16px;
    z-index: 10;
}

.app-header h1 {
    display: flex;
    gap: 10px;
    font-size: 1.4rem;
    margin: 0 0 12px;
}

.app-header h1::before {
    content: "";
    width: 36px;
    height: 36px;
    background: url("/assets/images/android-chrome-192x192.png") center / contain no-repeat;
    flex-shrink: 0;
}

.progress-track {
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width .3s ease;
}

.progress-label {
    font-size: .8rem;
    color: var(--ink-soft);
    margin-top: 6px;
}

.step {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 20px;
    margin-bottom: 16px;
}

.step-title {
    font-size: 1.15rem;
    margin: 0 0 4px;
}

.step-intro {
    color: var(--ink-soft);
    font-size: .92rem;
    margin: 0 0 18px;
}

.field {
    margin-bottom: 20px;
}

.field-label {
    display: block;
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: 6px;
}

.field-sublabel {
    display: block;
    font-size: .85rem;
    color: var(--ink-soft);
    margin-bottom: 4px;
}

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

.field-note {
    font-size: .78rem;
    color: var(--accent);
    font-weight: 500;
}

.req { color: var(--danger); }

input[type="text"], textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
    resize: vertical;
}

input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.field.field-invalid input[type="text"],
.field.field-invalid textarea,
.field-yesno.field-invalid .yesno-toggle {
    border-color: var(--danger);
}

.field.field-invalid .field-label { color: var(--danger); }

.yesno-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: .9rem;
    cursor: pointer;
    background: var(--surface);
    transition: all .15s ease;
    user-select: none;
}

.pill input { position: absolute; opacity: 0; pointer-events: none; }

.pill:has(input:checked) {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pill-scale { min-width: 42px; text-align: center; padding: 8px 0; }

.reveal-comment {
    margin-top: 10px;
    padding-left: 2px;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cb-subheader {
    font-weight: 700;
    color: var(--accent);
    margin-top: 12px;
    font-size: .95rem;
    border-bottom: 1px solid var(--accent-soft);
    padding-bottom: 4px;
}

.cb-subheader:first-child { margin-top: 0; }

.cb-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .9rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
}

.cb-item:hover { background: var(--accent-soft); }

.cb-item input {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.cb-comment {
    margin: -2px 0 8px 28px;
}

.diary-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.diary-tab {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 10px;
    cursor: pointer;
    font-size: .9rem;
}

.diary-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.step-nav {
    display: flex;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding: 12px 0 4px;
}

.btn {
    flex: 1;
    padding: 13px 18px;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.btn-secondary:disabled { opacity: .4; cursor: not-allowed; }

.review-summary {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
    font-size: .88rem;
    color: var(--ink-soft);
    margin-bottom: 18px;
    max-height: 260px;
    overflow-y: auto;
}

.review-summary .rs-row { margin-bottom: 6px; }
.review-summary .rs-row b { color: var(--ink); }

.submit-status {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: .9rem;
}

.submit-status.ok { background: #e4efe4; color: #2f5231; }
.submit-status.err { background: #fbe7e4; color: var(--danger); }

.success-screen {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px; height: 1px;
    opacity: 0;
}

@media (min-width: 640px) {
    .app { padding-top: 40px; }
}
