/* Jakobsweg 2027 – MVP 3.1 dark visual language */
:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #080808;
  --line: #303030;
  --line-soft: #252525;
  --text: #f4f4f4;
  --muted: #a7a7a7;
  --green: #00c853;
  --green-dim: #063b20;
  --blue: #1688ff;
  --orange: #ff7900;
  --ink: #101510;
  --paper: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 14px; line-height: 1.35; }
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }

.app-shell { width: min(100%, 620px); min-height: 100vh; margin: 0 auto; padding: 8px; border: 1px solid #282828; border-radius: 12px; background: var(--bg); }
.app-header { padding: 0 4px 10px; border-bottom: 1px solid var(--line); }
.brand h1 { margin: 0; font-size: 17px; line-height: 1.2; font-weight: 700; letter-spacing: -.35px; }
.brand p { margin: 3px 0 9px; color: var(--muted); font-size: 10px; }
.main-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.nav-link { display: flex; min-width: 0; min-height: 38px; align-items: center; justify-content: center; padding: 5px 4px; border: 1px solid #343434; border-radius: 999px; color: #e5e5e5; text-align: center; text-decoration: none; font-size: 11px; font-weight: 600; }
.nav-link.active { border-color: var(--green); background: var(--green); color: #03150a; }

.training-section { padding: 12px 4px 4px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.month-title { margin: 7px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(23px, 6vw, 29px); line-height: 1.1; font-weight: 400; }
.week-subtitle { margin: 3px 0 12px; color: var(--green); font-size: 10px; }
.week-list { display: grid; min-width: 0; gap: 8px; }

.week-card { min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
.current-week { border: 2px solid var(--green); background: #080808; color: var(--text); }
.week-heading { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.week-heading h3 { margin: 0; font-size: 12px; font-weight: 700; }
.week-heading .week-subtitle { margin: 2px 0 0; color: var(--green); font-size: 9px; }
.completion-pill, .done-pill, .exam-pill { display: inline-block; max-width: 100%; padding: 3px 6px; border-radius: 999px; font-size: 8px; line-height: 1.25; }
.completion-pill, .done-pill { color: var(--green); background: var(--green-dim); white-space: nowrap; }
.session-list { display: grid; min-width: 0; }
.session { min-width: 0; padding: 9px 0 8px; border-bottom: 1px solid var(--line-soft); }
.session-topline { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 6px; }
.session-kind { display: inline-block; min-width: 0; padding: 2px 5px; border-radius: 4px; background: #242424; color: #ddd; font-size: 8px; font-weight: 600; }
.session-kind.focus { color: var(--blue); background: #06182b; }
.done-pill { flex: 0 0 auto; }
.distance { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 23px; line-height: 1.05; font-weight: 700; }
.session h4 { margin: 3px 0 1px; font-size: 11px; font-weight: 700; }
.session-date, .session-note { margin: 1px 0 0; color: var(--muted); font-size: 9px; }
.complaint-note { margin: 5px 0 0; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.weekly-summary { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 9px 0 1px; }
.weekly-summary h4 { margin: 0; font-size: 10px; }
.weekly-summary p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.weekly-summary > strong { flex: 0 0 auto; color: var(--text); white-space: nowrap; font-size: 12px; }

.training-units { display: grid; min-width: 0; gap: 10px; padding-top: 9px; }
.training-unit { display: grid; min-width: 0; gap: 3px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.unit-heading { display: flex; min-width: 0; align-items: baseline; gap: 7px; }
.unit-title { margin: 0; color: var(--text); font-size: 10px; font-weight: 700; }
.unit-target { margin: 0; color: var(--text); font-size: 10px; font-weight: 650; }
.unit-guidance { margin: 0; color: var(--muted); font-size: 9px; }
.entry-button { display: flex; width: 100%; min-width: 0; min-height: 42px; align-items: center; justify-content: flex-start; gap: 6px; margin-top: 5px; padding: 8px; border: 1px solid #777; border-radius: 9px; color: var(--text); background: #080808; text-align: left; font-size: 10px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.entry-button.is-active { border-color: #fff; color: #111711; background: #fff; }
.entry-button.is-active:hover { background: #e8f5ec; }
.entry-button.is-inactive:hover { background: #151515; }
.entry-symbol { flex: 0 0 auto; color: #087c38; font-size: 15px; }
.entry-button.is-inactive .entry-symbol { color: #c8c8c8; }
.week-plan-note { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }

.hike-form { display: grid; min-width: 0; gap: 8px; margin-top: 10px; padding: 10px; border: 1px solid #d7ded8; border-radius: 10px; background: #f7f8f6; color: var(--ink); }
.form-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.form-heading .eyebrow { color: #626962; }
.form-heading h3 { margin: 3px 0; font-size: 14px; }
.icon-button { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border: 1px solid #ccd3cc; border-radius: 50%; color: var(--ink); background: #fff; font-size: 20px; cursor: pointer; }
.field-label, .complaints-fieldset legend { color: #26352b; font-size: 10px; font-weight: 700; }
.field-input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #ccd3cc; border-radius: 8px; color: var(--ink); background: #fff; font-size: 14px; }
.distance-input { position: relative; }
.distance-input .field-input { padding-right: 40px; }
.distance-input > span { position: absolute; top: 50%; right: 12px; color: #626962; font-size: 11px; transform: translateY(-50%); pointer-events: none; }
.complaints-fieldset { min-width: 0; margin: 2px 0 0; padding: 0; border: 0; }
.complaints-fieldset legend { margin-bottom: 6px; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice span { display: grid; min-height: 38px; place-items: center; border: 1px solid #ccd3cc; border-radius: 8px; color: #27382d; background: #fff; font-size: 11px; font-weight: 650; }
.choice input:checked + span { border-color: #168344; color: #fff; background: #168344; }
.choice input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.description-field { display: grid; gap: 6px; }
.description-field textarea { min-height: 66px; resize: vertical; }
.save-button { display: flex; min-height: 42px; align-items: center; justify-content: space-between; margin-top: 2px; padding: 0 12px; border: 1px solid #303830; border-radius: 8px; color: #111711; background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }

.future-weeks { margin-top: 10px; }
.section-heading { margin: 0 0 6px; color: var(--text); font-size: 10px; font-weight: 700; }
.future-week-card { min-width: 0; margin: 0 0 6px; overflow: hidden; border: 1px solid #454545; border-radius: 10px; background: #080808; color: var(--text); }
.week-accordion { min-width: 0; overflow: hidden; background: transparent; color: var(--text); }
.week-accordion[open] { border-bottom: 1px solid var(--line-soft); }
.week-accordion summary { display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 8px 9px; cursor: pointer; list-style: none; }
.week-accordion summary::-webkit-details-marker { display: none; }
.week-accordion summary > span:first-child { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
.week-accordion strong { font-size: 10px; font-weight: 700; }
.week-accordion small { color: var(--muted); font-size: 9px; }
.chevron { width: 7px; height: 7px; flex: 0 0 7px; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd; transform: rotate(45deg) translateY(-2px); }
.week-accordion[open] .chevron { transform: rotate(225deg) translate(-1px, -1px); }
.exam-pill { flex: 0 0 auto; color: var(--orange); background: #2b1605; }
.week-hint { margin: 0; padding: 0 9px 9px; color: var(--muted); font-size: 9px; }
.week-accordion > .week-plan-note { padding: 0 9px; }
.future-training-units { gap: 7px; padding: 0 9px 9px; }
.future-training-units .training-unit { padding-top: 7px; }

.monthly-goal { margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #171717; }
.monthly-goal h3 { margin: 0; color: var(--text); font-size: 11px; }
.monthly-goal-purpose { margin: 5px 0 0; color: var(--text); font-size: 10px; font-weight: 700; }
.monthly-goal-detail { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.history-section { margin: 22px 4px 4px; scroll-margin-top: 12px; }
.history-card { padding: 12px 10px 10px; border: 1px solid #303030; border-radius: 11px; background: #050505; }
.history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 17px; }
.history-heading-copy { min-width: 0; }
.history-heading h2 { margin: 0; color: #ededed; font-size: 14px; line-height: 1.25; font-weight: 700; }
.history-heading p { margin: 3px 0 0; color: #c0c0c0; font-size: 9px; line-height: 1.35; }
.history-count { flex: 0 0 auto; padding: 3px 8px; border-radius: 999px; color: #00c853; background: #003b1b; font-size: 8px; line-height: 1.3; white-space: nowrap; }
.history-list { display: grid; min-width: 0; gap: 29px; }
.hike-entry { display: grid; min-width: 0; gap: 3px; padding: 0 9px; }
.hike-entry-date { color: #ededed; font-size: 13px; line-height: 1.25; font-weight: 700; }
.hike-entry-distance { margin-top: 1px; color: #ededed; font-size: 13px; line-height: 1.25; font-weight: 700; }
.hike-entry-detail { margin: 0; color: #c0c0c0; font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.edit-button { display: flex; width: 100%; min-height: 27px; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; padding: 5px 9px; border: 1px solid #383838; border-radius: 999px; color: #e8e8e8; background: #050505; font-size: 8px; line-height: 1.3; cursor: pointer; }
.edit-button span { font-size: 10px; }
.edit-button:hover { border-color: #555; background: #111; }
.edit-form-slot { min-width: 0; }
.empty-history { margin: 0; padding: 12px 9px; color: #c0c0c0; font-size: 10px; }
.exam-section { padding-top: 18px; scroll-margin-top: 12px; }
.exam-section h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.25; font-weight: 700; letter-spacing: -.25px; }
.exam-card { margin: 0 0 9px; padding: 11px 10px 10px; border: 1px solid #383838; border-radius: 11px; background: #050505; }
.exam-card h3 { margin: 0 0 5px; color: #e5e5e5; font-size: 13px; line-height: 1.2; font-weight: 700; }
.exam-card .distance { margin: 0; color: var(--text); font-family: Arial, Helvetica, sans-serif; font-size: 19px; line-height: 1.2; font-weight: 700; letter-spacing: -.2px; }
.exam-card .date { margin: 3px 0 4px; color: #a8a8a8; font-size: 11px; }
.exam-card .exam-period { margin: 3px 0 4px; color: #a8a8a8; font-size: 11px; }
.exam-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; padding: 6px 8px; border: 1px solid #292929; border-radius: 7px; background: #111; }
.exam-total span { color: #a8a8a8; font-size: 9px; }
.exam-total strong { color: var(--text); font-size: 12px; font-weight: 700; }
.exam-days { display: grid; margin: 4px 0 6px; }
.exam-day { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line-soft); font-size: 11px; line-height: 1.3; }
.exam-day time { color: #c0c0c0; }
.exam-day strong { flex: 0 0 auto; color: var(--text); font-size: 11px; font-weight: 700; text-align: right; }
.exam-card .status { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 9px; line-height: 1.2; font-weight: 600; }
.exam-card .status.planned { color: #ff7900; background: #2b1605; }
.notice { position: fixed; z-index: 5; right: 50%; bottom: max(16px, env(safe-area-inset-bottom)); width: min(calc(100% - 24px), 440px); padding: 12px 14px; border: 1px solid #444; border-radius: 10px; color: var(--text); background: #171717; box-shadow: 0 8px 24px rgb(0 0 0 / 35%); font-size: 12px; line-height: 1.4; opacity: 0; pointer-events: none; transform: translate(50%, 10px); transition: opacity .18s ease, transform .18s ease; }
.notice.is-visible { opacity: 1; transform: translate(50%, 0); }

.access-gate { display: grid; min-height: 100dvh; place-items: center; padding: 18px; background: #050505; }
.access-card { display: grid; width: min(100%, 380px); gap: 10px; padding: 22px; border: 1px solid #303030; border-radius: 16px; color: var(--text); background: #101010; }
.access-card h1 { margin: 0; font-size: 23px; }
.access-card > p:not(.eyebrow):not(.access-error) { margin: -3px 0 4px; color: var(--muted); font-size: 13px; }
.access-card .field-label { color: var(--text); }
.access-card .field-input { border-color: #414141; color: var(--text); background: #080808; }
.access-card .save-button { min-height: 46px; margin-top: 8px; }
.access-error { min-height: 1em; margin: 0; color: #ff9b84; font-size: 12px; }
.logout-button { min-height: 34px; padding: 0 10px; border: 1px solid #383838; border-radius: 999px; color: var(--text); background: #080808; font-size: 10px; cursor: pointer; }
.device-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 9px; }
.device-management { position: relative; min-width: 0; }
.device-management summary { min-height: 34px; padding: 8px 10px; border: 1px solid #383838; border-radius: 999px; color: var(--text); background: #080808; font-size: 10px; cursor: pointer; list-style-position: inside; }
.device-panel { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid #303030; border-radius: 10px; background: #101010; }
.device-panel > p { margin: 0; color: var(--muted); font-size: 10px; }
.device-session-list { display: grid; gap: 6px; }
.device-session-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.device-session-copy { min-width: 0; }
.device-session-copy strong, .device-session-copy span { display: block; overflow-wrap: anywhere; }
.device-session-copy strong { font-size: 11px; }
.device-session-copy span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.device-revoke-button { flex: 0 0 auto; min-height: 32px; padding: 5px 9px; border: 1px solid #56332a; border-radius: 8px; color: #ffb49f; background: #1c100d; font-size: 9px; cursor: pointer; }
.device-revoke-button:disabled { opacity: .55; cursor: default; }
.import-button { margin: 0 0 14px; }
[hidden] { display: none !important; }

@media (min-width: 520px) {
  .app-shell { padding: 14px; }
  .training-section { padding: 18px 6px 6px; }
  .week-card { padding: 13px; }
  .session { padding: 12px 0 10px; }
  .distance { font-size: 26px; }
  .entry-button { min-height: 48px; padding: 9px 10px; font-size: 11px; }
  .exam-section { padding-top: 22px; }
  .exam-card { padding: 13px; margin-bottom: 11px; }
  .history-card { padding: 14px 12px 12px; }
  .history-list { gap: 31px; }
}

@media (max-width: 380px) {
  .week-heading { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
