/*
 * Shared CSS for the plain pages (web-api §17; PRD §5.10 visual system, §5.12 accessibility).
 * White ground and ink, flat colour and square corners (the transit-line restyle the product owner approved
 * on 2026-10-25, web-api §17: no paper grain, hairline frames instead of card shadows), Noto Sans KR 400/600
 * (subset, system fallback), a 4 px grid, 44 px controls, a 2 px ink focus ring on a 2 px white offset,
 * forced colours and reduced motion. No dark mode in the MVP (PRD §5.10). Loaded under CSP style-src
 * 'self': no inline styles. Icons are Lucide (lucide-static 1.49.0, ISC licence, © 2026 Lucide Icons and
 * Contributors); plus, chevron-left and ellipsis derive from Feather (MIT licence, © 2013-present Cole Bemis).
 */

@font-face {
  font-family: "Noto Sans KR";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/NotoSansKR-400-subset.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans KR";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/NotoSansKR-600-subset.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* Colour, radius and elevation tokens (PRD §5.10, D v2 of 2026-11-03). A kind's fill is its chip, its
     -line a line or frame (>= 3:1), its -text words on white (>= 4.5:1), its -stone areas and imagery
     only. Words on warm paper are ink or ink-muted. */
  /* BEGIN tokens (written by tools/tokens/generate.mjs from shared/tokens.json; do not edit) */
  --paper: #ffffff;
  --warm-paper: #f3eee4; /* ink 17.12, ink-muted 5.61; kind text tones fall under 4.5 here */
  --ink: #0a0a0a; /* 19.80 */
  --ink-muted: #5e5e5e; /* 6.48 */
  --pencil: #8c8c8c; /* 3.36 */
  --edge: #d4d4d4; /* a rounded control's edge */
  --hairline: #e6e6e6; /* frames and dividers (decoration) */
  --track: #f2f2f2; /* behind a segmented control */
  --alert: #b3261e; /* 6.54; always with its icon */
  --moss: #11622c; /* anchor: paper on it 7.48 */
  --moss-line: #11622c; /* 7.48 */
  --moss-text: #11622c; /* 7.48 */
  --moss-stone: #7e9b86; /* areas and imagery only */
  --clay: #ca4a24; /* stop: paper on it 4.65 */
  --clay-line: #ca4a24; /* 4.65 */
  --clay-text: #c14722; /* 5.01 */
  --clay-stone: #c9876a; /* areas and imagery only */
  --dusk: #2365b0; /* stay: paper on it 5.90 */
  --dusk-line: #2365b0; /* 5.90 */
  --dusk-text: #2365b0; /* 5.90 */
  --dusk-stone: #6f8faf; /* areas and imagery only */
  --ochre: #f4be4c; /* neighbourhood: ink on it 11.61 */
  --ochre-line: #b57f0c; /* 3.50 */
  --ochre-text: #91670c; /* 5.06 */
  --ochre-stone: #d9b15f; /* areas and imagery only */
  --mist: #b9c4c9; /* unknown_time: ink on it 11.13 */
  --mist-line: #7c8c94; /* 3.48 */
  --mist-text: #637179; /* 5.04 */
  --mist-stone: #b9c4c9; /* areas and imagery only */
  --blush: #ea88a6; /* maybe: ink on it 8.08 */
  --blush-line: #e25b84; /* 3.46 */
  --blush-text: #cd305f; /* 5.02 */
  --blush-stone: #d49aa8; /* areas and imagery only */
  --presence-1: #6b4fbb; /* paper initial 6.07 */
  --presence-2: #0e7c86; /* paper initial 4.95 */
  --presence-3: #8a5a2b; /* paper initial 5.87 */
  --presence-4: #8e3b8e; /* paper initial 6.63 */
  --presence-5: #4a5a6a; /* paper initial 7.09 */
  --presence-6: #5e5e5e; /* paper initial 6.48 */
  --radius-map: 0px;
  --radius-docked: 0px;
  --radius-field: 12px;
  --radius-brand: 12px;
  --radius-menu-row: 10px;
  --radius-card: 14px;
  --radius-menu: 14px;
  --radius-sheet: 20px;
  --radius-pill: 999px;
  --shadow-e1: 0 2px 8px rgb(10 10 10 / 0.12);
  /* END tokens */

  /* Sign-in brand colours, fixed by each provider's button guide (decisions §4.7; not PRD §5.10 tokens).
     Kakao: container #FEE500, symbol #000000, label #000000 at 85 % (12.5:1). Naver, its white variant:
     background #FFFFFF, N logo #03A94D, label #000000 (21:1); Naver's green variant puts white on #03A94D,
     3.09:1, under WCAG 1.4.3's 4.5:1 for this 15 px label. */
  --kakao-container: #fee500;
  --kakao-symbol: #000000;
  --kakao-label: rgb(0 0 0 / 0.85);
  --naver-background: #ffffff;
  --naver-logo: #03a94d;
  --naver-label: #000000;
  /* Google's button guide for a custom button, light theme (https://developers.google.com/identity/branding-guidelines,
     read 2026-10-26; the iPhone app's Google sign-in): fill #FFFFFF, a 1 px #747775 stroke, label #1F1F1F
     (16.5:1; the stroke is 4.5:1 on white), beside the standard four-colour "G". */
  --google-fill: #ffffff;
  --google-stroke: #747775;
  --google-label: #1f1f1f;
  /* Sign in with Apple's button guide (Human Interface Guidelines, Sign in with Apple; the iPhone app's native button is
     this one): a black fill with white text (21:1). */
  --apple-fill: #000000;
  --apple-label: #ffffff;

  /* Type (PRD §5.10): its six styles (Strong, 2026-10-25, is plan titles on cards and 새 계획), Noto Sans
     KR 400 and 600 only, nothing below 13 px. Every font in this file is one of these tokens (buttons,
     tabs and the skip link read as Body, as the trip screen's Godot buttons do). */
  --font-sans: "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --type-title: 600 17px/24px var(--font-sans);
  --type-body: 400 15px/22px var(--font-sans);
  --type-anchor-label: 600 14px/18px var(--font-sans);
  --type-label: 400 14px/18px var(--font-sans);
  --type-caption: 400 13px/18px var(--font-sans);
  --type-strong: 600 15px/22px var(--font-sans);

  /* Spacing and shape: 4 px grid. Marks are square (tags, chips); anything pressed is a pill; cards and
     menus take --radius-card, sheets --radius-sheet (the token block above); the sign-in buttons keep their
     providers' 12 px (--radius-brand, decisions §4.7); controls 44 px */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --radius-small: 0;
  --target: 44px;

  /* Motion (PRD §5.10) */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --duration-sheet: 240ms;
  --duration-fade: 200ms;

  /* Floating sheets (dialogs, the card menu) take the one elevation; cards rest on a hairline */
  --shadow-sheet: var(--shadow-e1);
}

/* ---------------------------------------------------------------------------------------------- */
/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--paper);
  color: var(--ink);
  font: var(--type-body);
  word-break: keep-all; /* Korean wraps between words */
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

/* A word holding a bracket or a quotation mark (Daily(미국)를, ‘잠깐, 멈춤’을): keep-all still lets
   browsers break after "(" or "‘" and before a particle after ")" or "’" (copy.js appendWords). */
.keep-word {
  white-space: nowrap;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
  color: inherit;
}

/* Focus: a 2 px ink ring with a 2 px paper offset (PRD §5.12), on any surface */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--paper);
}

/* Containers that only receive the focus from the page itself (the skip link's target, the list
   panel while a retry loads); they are not controls and cannot be reached with Tab */
main:focus-visible,
.panel:focus-visible {
  outline: none;
  box-shadow: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--space-4);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  font: var(--type-body);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip:focus,
.skip:focus-visible {
  transform: none;
}

/* ---------------------------------------------------------------------------------------------- */
/* Layout */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  max-width: 560px;
  min-height: 56px;
  margin: 0 auto;
  padding: var(--space-1) var(--space-4);
}

/* The header follows its page's column: 480 px (notices, settings), 560 px (landing), 1040 px (list) */
.site-header-narrow {
  max-width: 480px;
}

.site-header-wide {
  max-width: 1040px;
}

.site-header-app {
  padding-right: var(--space-2);
  padding-left: var(--space-2);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font: var(--type-title);
  letter-spacing: 0.02em;
}

/* The logo beside the landing page's wordmark: web/icon.svg */
.wordmark-mark {
  display: block;
  flex: none;
}

.site-header-app .wordmark {
  padding-left: var(--space-2);
}

.main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-12);
}

.main-narrow {
  max-width: 480px;
}

.main-wide {
  max-width: 1040px;
}

.title {
  font: var(--type-title);
}

.lede,
.settings-text,
.notice-body {
  font: var(--type-body);
}

.caption {
  font: var(--type-caption);
  color: var(--ink-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.actions-end {
  justify-content: flex-end;
}

/* SC11, in-app browsers (inapp.js, web-api §21.9): before the page, until the person stays */
.inapp {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
}

.inapp__title {
  font: var(--type-title);
}

.inapp__body,
.inapp__howto,
.inapp__hint {
  font: var(--type-body);
}

.inapp__address {
  font: var(--type-caption);
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}

/* Status and error lines (live regions stay in the page even when empty) */
.status-line {
  font: var(--type-body);
  color: var(--ink);
}

.status-line:not(:empty) {
  margin-top: var(--space-3);
}

/* An alert leads with the alert icon (PRD §5.10, D v2): the alert colour never stands alone, and no place
   kind's colour signals status. Lucide circle-alert (ISC), inline so it needs no request. */
.status-line[role="alert"]:not(:empty) {
  padding-left: calc(20px + var(--space-2));
  background: no-repeat left 1px / 20px 20px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3261e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' x2='12' y1='8' y2='12'/%3E%3Cline x1='12' x2='12.01' y1='16' y2='16'/%3E%3C/svg%3E");
}

/* The page-level error sits in <main> after #content, which it replaces (page.js showPageError) */
.page-error .button {
  margin-top: var(--space-4);
}

.noscript {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-4);
  font: var(--type-body);
}

/* ---------------------------------------------------------------------------------------------- */
/* Controls (44 px targets; ink on paper) */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: var(--target);
  min-height: var(--target);
  padding: 0 var(--space-5);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font: var(--type-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--duration-fade) linear, color var(--duration-fade) linear;
}

.button:hover {
  background-color: rgb(10 10 10 / 0.06);
}

.button-primary {
  background-color: var(--ink);
  color: var(--paper);
}

.button-primary:hover {
  background-color: var(--ink-muted);
  border-color: var(--ink-muted);
}

.button-danger {
  border-color: var(--alert);
  color: var(--alert);
}

/* alert on paper tinted 5 % with alert: 6.02:1 */
.button-danger:hover {
  background-color: rgb(179 38 30 / 0.05);
}

.button[aria-disabled="true"],
.icon-button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: progress;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--target);
  height: var(--target);
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}

.icon-button:hover {
  background-color: rgb(10 10 10 / 0.06);
}

.icon {
  flex: none;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button .icon {
  width: 20px;
  height: 20px;
  margin-left: calc(-1 * var(--space-1));
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--target);
  padding: 0 var(--space-3) 0 var(--space-2);
  border-radius: var(--radius-pill);
  font: var(--type-body);
  text-decoration: none;
}

.back-link:hover {
  background-color: rgb(10 10 10 / 0.06);
}

/* ---------------------------------------------------------------------------------------------- */
/* SC1 landing */

.main-landing {
  padding-top: var(--space-4);
}

/*
 * The hero (D v2): the 돌탑, the headline and the sign-in on warm paper. The paper runs edge to edge and up
 * through the header to the top of the page as a shadow of the hero's own box, so it adds no scrolling and
 * stays under the header's words; below the hero the page is white.
 */
.landing-hero {
  padding-bottom: var(--space-8);
  background-color: var(--warm-paper);
  box-shadow: 0 -100vmax 0 100vmax var(--warm-paper);
}

/* The body is a flex column, whose items paint whole and in order: the header comes forward, so its
   words stay over the hero's paper. */
body[data-page="landing"] .site-header {
  position: relative;
  z-index: 1;
}

/*
 * The 돌탑 (brand/doltap.mjs landingMark, inline). On each load its five stones fall down the screen
 * one after another, bottom (moss) first, and land on the stack with a small bounce; then the rest of
 * the page fades in. landing.js LAND_MS is when the last stone has landed: the last delay plus the fall.
 * The translation is in the mark's own units (1024 across 200 px), so -3200 starts above the screen.
 * With reduced motion, the finished stack shows at once.
 */
.doltap {
  display: block;
  width: 200px;
  height: 200px;
  margin: 0 auto var(--space-6);
  overflow: visible;
}

.doltap-stone {
  animation: doltap-fall 560ms both;
}

.doltap-stone:nth-of-type(1) { animation-delay: 100ms; }
.doltap-stone:nth-of-type(2) { animation-delay: 340ms; }
.doltap-stone:nth-of-type(3) { animation-delay: 580ms; }
.doltap-stone:nth-of-type(4) { animation-delay: 820ms; }
.doltap-stone:nth-of-type(5) { animation-delay: 1060ms; }

@keyframes doltap-fall {
  0% {
    opacity: 0;
    transform: translateY(-3200px);
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  12% {
    opacity: 1;
  }
  70% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1);
  }
  84% {
    transform: translateY(-110px);
    animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.landing-hero > :not(.doltap),
.main-landing > :not(.landing-hero) {
  animation: doltap-after 400ms ease-out 1500ms both;
}

@keyframes doltap-after {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .doltap-stone,
  .landing-hero > :not(.doltap),
  .main-landing > :not(.landing-hero) {
    animation: none;
  }
}

/* On a phone the 돌탑 gives way to the screen's height, so the whole sign-in shows without a scroll. */
@media (max-width: 599px) {
  .doltap {
    width: min(200px, 22vh);
    width: min(200px, 22dvh);
    height: min(200px, 22vh);
    height: min(200px, 22dvh);
    margin-bottom: var(--space-4);
  }
}

/*
 * Inside the iPhone app (landing.js markAppScreen) the landing is the app's sign-in screen: one screen,
 * no scroll and no bounce. The launch sections stay on the web; the sign-in sits low, near the thumb,
 * as in KakaoTalk's and Toss's; the footer is one line under it.
 */
html[data-shell="ios"] {
  overscroll-behavior-y: none;
}

/* The app's sign-in screen is the hero, whole: warm paper from edge to edge, as the launch screen before
   it; the hero's box gives way, so its parts lay out in the column below. */
html[data-shell="ios"] body {
  background-color: var(--warm-paper);
}

html[data-shell="ios"] .landing-hero {
  display: contents;
}

/* The page grows past the screen only if a status line needs the room; then it scrolls, never overlaps. The
   mark and the words sit centred in the room above the sign-in. */
html[data-shell="ios"] .main-landing {
  display: flex;
  flex-direction: column;
  padding-bottom: var(--space-2);
}

html[data-shell="ios"] .main-landing .launch {
  display: none;
}

html[data-shell="ios"] .main-landing .doltap,
html[data-shell="ios"] .main-landing #content {
  margin-top: auto;
}

html[data-shell="ios"] .main-landing .signin {
  margin-top: var(--space-6);
}

html[data-shell="ios"] .site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-4);
  padding-top: 0;
  padding-bottom: var(--space-2);
}

html[data-shell="ios"] .site-footer .legal-list {
  margin-top: 0;
}

.headline {
  font: var(--type-title);
}

.main-landing .lede {
  margin-top: var(--space-2);
  color: var(--ink-muted);
}

.signin {
  margin-top: var(--space-8);
  padding: var(--space-4);
  border: 1px solid var(--mist-line);
  border-radius: var(--radius-card);
}

.signin-label {
  font: var(--type-anchor-label);
  color: var(--ink-muted);
}

/* Google Identity Services draws its "large" button 40 px high inside its own iframe, and no size
   is larger; the row keeps the 44 px rhythm of the other controls around it (PRD §5.12 exception,
   see landing.js). */
.google-button:not(:empty) {
  display: flex;
  align-items: center;
  min-height: var(--target);
  margin-top: var(--space-3);
}

/* Kakao and Naver sign-in (decisions §4.7), built to each provider's button guide: the provider's symbol
   (Kakao's speech bubble, Naver's N, never altered) and label, centred 8 px apart, on the provider's colours;
   44 px high like every control, and at most 400 px wide, Google's widest button. */
.signin-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  max-width: 400px;
  min-height: var(--target);
  margin-top: var(--space-3);
  padding: 0 var(--space-5);
  border-radius: var(--radius-brand);
  font: var(--type-body);
  text-decoration: none;
  touch-action: manipulation;
}

.signin-symbol {
  flex: none;
  width: 18px;
  height: 18px;
}

.signin-kakao {
  border: 1px solid var(--kakao-container);
  background-color: var(--kakao-container);
  color: var(--kakao-label);
}

.signin-kakao .signin-symbol {
  fill: var(--kakao-symbol);
}

.signin-naver {
  border: 1px solid rgb(0 0 0 / 0.15);
  background-color: var(--naver-background);
  color: var(--naver-label);
}

.signin-naver .signin-symbol {
  width: 16px;
  height: 16px;
  fill: var(--naver-logo);
}

/* Google's sign-in inside the iPhone app, where Google's own button cannot run (landing.js mountAppSignIn), built
   to Google's button guide for the light theme as Kakao's and Naver's are to theirs: the standard four-colour "G"
   (its paths carry Google's colours, never recoloured) and the label on white, in a 1 px #747775 stroke, the label
   #1F1F1F; our 44 px, width, gap, radius and font from .signin-button. */
.signin-google {
  border: 1px solid var(--google-stroke);
  background-color: var(--google-fill);
  color: var(--google-label);
  cursor: pointer;
}

/* Sign in with Apple, in Apple's black style (Human Interface Guidelines, "Creating a custom Sign in with Apple button"):
   the fill and the white label through the tokens; our 44 px, width, radius and rectangle from .signin-button. Apple's logo
   (its own artwork, "Left-aligned, White", under Apple's Developer Artwork License Agreement for Sign in with Apple, accepted
   2026-11-01; tools/licences.json) sits at the full button height, uncropped, with no vertical padding: the file is 44 px
   high with its margin built in, so the 1 px border is cancelled by margin-block and the 8 px gap by gap: 0 (the file's
   own right margin, 7.8 px, is that gap). Medium of Apple's three sizes: they exist to match the logo to the other buttons'
   symbols, and Medium's apple is 19 px high by 15.5 wide, beside Kakao's 18 px bubble, Google's 18 px G and Naver's 16 px N
   (Small's is 14.5 px high, Large's 24 px, which would tower over them). The file's 7.75 px left margin is pulled out
   (margin-inline-start) so the apple starts where the other symbols start in a centred group.
   Documented exception to the Noto-only rule: Apple's guide sets the title in the system font, and its size is 43% of the
   button's height (44 px x 0.43 = 18.92 px); pages_static.test.js allows these two declarations in this rule alone.
   At least 8% of the button's width stays between the title and the right edge (the group is centred and the title is
   about 100 px in a button at least 270 px wide). */
.signin-apple {
  gap: 0;
  border: 1px solid var(--apple-fill);
  background-color: var(--apple-fill);
  color: var(--apple-label);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: calc(var(--target) * 0.43);
  cursor: pointer;
}

.signin-apple .signin-symbol {
  width: 31px;
  height: var(--target);
  margin-block: -1px;
  margin-inline-start: -7.75px;
}

/* A sheet is open (the buttons are marked busy, not disabled, so they keep the focus). */
.signin-button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: progress;
}

.dev-signin-slot:not(:empty) {
  margin-top: var(--space-3);
}

.signin .button {
  margin-top: var(--space-3);
}

.site-footer {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-8);
  color: var(--ink-muted);
  font: var(--type-caption);
}

.legal-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin-top: var(--space-2);
}

.soon {
  display: inline-block;
  padding: 0 var(--space-2);
  border: 1px solid var(--mist-line);
  border-radius: var(--radius-small);
  color: var(--ink-muted);
  font: var(--type-caption);
  white-space: nowrap;
}

.legal-list a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: inherit;
}

/* ---------------------------------------------------------------------------------------------- */
/* SC22 legal pages (web-api §22.7) */

.legal-draft {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--ochre-line);
  border-radius: var(--radius-card);
  font: var(--type-body);
}

.legal-version {
  margin-top: var(--space-1);
}

.legal-contents {
  margin-top: var(--space-6);
}

.legal-contents ol {
  margin-top: var(--space-2);
  padding-left: var(--space-5);
  font: var(--type-body);
}

.legal-contents a {
  display: inline-block;
  padding: var(--space-1) 0;
}

.legal-section {
  margin-top: var(--space-8);
  scroll-margin-top: var(--space-4);
}

.legal-text {
  margin-top: var(--space-3);
  font: var(--type-body);
}

/* The recipients table scrolls sideways on its own on a phone; the page never does (WCAG 1.4.10). */
.legal-table {
  margin-top: var(--space-4);
  overflow-x: auto;
  border: 1px solid var(--mist-line);
  border-radius: var(--radius-card);
}

.legal-table table {
  min-width: 720px;
  border-collapse: collapse;
  font: var(--type-caption);
}

.legal-table th,
.legal-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--mist-line);
  text-align: left;
  vertical-align: top;
}

.legal-table tbody tr:last-child th,
.legal-table tbody tr:last-child td {
  border-bottom: 0;
}

.legal-overseas {
  display: inline-block;
  padding: 0 var(--space-2);
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius-small);
  color: var(--ink);
  white-space: nowrap;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin-top: var(--space-3);
  font: var(--type-body);
}

.legal-links a,
.notice-more a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
}

/* ---------------------------------------------------------------------------------------------- */
/* SC3, SC4 notices */

.notice-updated {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--ochre-line);
  border-radius: var(--radius-card);
  font: var(--type-body);
}

.notice .notice-body,
.notice .notice-items {
  margin-top: var(--space-3);
}

/* SC4's listening notice under the AI notice, on the same screen (ai_notice.js). */
.notice-follow {
  margin-top: var(--space-6);
}

/* ---------------------------------------------------------------------------------------------- */
/* SC5 trip list: the lobby (web-api §17, the restyle of 2026-10-25). On a phone the drawing of the
   person's plans runs edge to edge under the header, then the tabs with 새 계획, then the cards two by
   two; from 960 px the drawing stands at 1:√2 in a left column (about 520 px) beside the list, whose cards
   become rows. */

/* Doubled, so it holds over .main's top padding at every width: the drawing meets the header. */
.main.main-lobby {
  padding-top: 0;
}

.main-lobby .plan-line {
  margin-top: var(--space-3);
}

.lobby-list {
  min-width: 0;
}

/* The drawing (poster.js): SVG lines and stations under HTML chips, decoration with an accessible name
   (role img, list.poster). Forced colours leave it as drawn, as they leave an image. */
.poster {
  position: relative;
  width: calc(100% + 2 * var(--space-4));
  max-height: 320px;
  aspect-ratio: 100 / 68;
  margin: 0 calc(-1 * var(--space-4));
  overflow: hidden;
  background-color: var(--paper);
  forced-color-adjust: none;
}

.poster-lines {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  overflow: visible;
  pointer-events: none;
}

/* The line: each kind in its -line colour (at least 3:1 on white), the span between two plans in ink. */
.poster-run {
  fill: none;
}

.poster-run-anchor {
  stroke: var(--moss-line);
}

.poster-run-stop {
  stroke: var(--clay-line);
}

.poster-run-stay {
  stroke: var(--dusk-line);
}

.poster-run-neighbourhood {
  stroke: var(--ochre-line);
}

.poster-run-maybe {
  stroke: var(--blush-line);
}

.poster-run-join {
  stroke: var(--ink);
}

/* Stations: white, a pencil hairline; a meeting place (anchor) larger, ringed in ink. */
.poster-station {
  fill: var(--paper);
  stroke: var(--pencil);
}

.poster-station-anchor {
  stroke: var(--ink);
}

/* Chips: square, flat. A plan's date (or title) on ink, the newest plan's title on moss (paper text 19.80
   and 6.29:1); poster.js sets their place and size, the hero's from the drawing's height. */
.poster-chip {
  position: absolute;
  z-index: 1; /* above the bars, so a date or a title stays whole */
  max-width: calc(100% - 4px);
  overflow: hidden;
  background-color: var(--ink);
  color: var(--paper);
  font: var(--type-caption);
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}

.poster-chip-hero {
  background-color: var(--moss);
  font: var(--type-anchor-label);
}

/* Pixel bars (and the still drawing's): a station's kind in its fill colour, no text. */
.poster-pixel {
  position: absolute;
  pointer-events: none;
}

.poster-fill-anchor {
  background-color: var(--moss);
  fill: var(--moss);
}

.poster-fill-stop {
  background-color: var(--clay);
  fill: var(--clay);
}

.poster-fill-stay {
  background-color: var(--dusk);
  fill: var(--dusk);
}

.poster-fill-neighbourhood {
  background-color: var(--ochre);
  fill: var(--ochre);
}

.poster-fill-maybe {
  background-color: var(--blush);
  fill: var(--blush);
}

.poster-still {
  display: block;
  width: 100%;
  height: 100%;
}

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0 calc(-1 * var(--space-4));
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--hairline);
}

/* The tabs (D v2): a segmented row like the side panel's. The row sits on the track with the cards' corners;
   the chosen tab is a paper chip inset 3 px with 11 px corners and a 1 px shadow, its word strong ink; the
   others body ink-muted (state by look, no words). Each tab stays a 44 px target: the chip is drawn inside it.
   A grid with 1fr columns makes every tab as wide as the widest label (a flex row would split the labels'
   summed width equally and wrap the longer one); a tab's word never wraps. */
.tabs {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border-radius: var(--radius-card);
  background-color: var(--track);
}

.tab {
  position: relative;
  isolation: isolate;
  min-height: var(--target);
  white-space: nowrap;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-card);
  background-color: transparent;
  color: var(--ink-muted);
  font: var(--type-body);
  cursor: pointer;
}

.tab:hover {
  color: var(--ink);
}

.tab[aria-selected="true"] {
  color: var(--ink);
  font: var(--type-strong);
  cursor: default;
}

.tab[aria-selected="true"]::before {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: -1;
  border-radius: 11px;
  background-color: var(--paper);
  box-shadow: 0 1px 2px rgb(10 10 10 / 0.12);
}

/* 새 계획: the lobby's one coloured button, square, moss with paper text (6.29:1); ink on hover. */
.button-create {
  padding: 0 var(--space-4) 0 var(--space-3);
  border-color: var(--moss);
  background-color: var(--moss);
  color: var(--paper);
  font: var(--type-strong);
}

.button-create:hover {
  border-color: var(--ink);
  background-color: var(--ink);
}

.panel {
  margin-top: var(--space-2);
}

.list-note {
  padding: var(--space-8) 0;
  color: var(--ink-muted);
  font: var(--type-body);
  text-align: center;
}

/* 내 계획 with no plan yet: the line, and 새 계획 under it in the middle of the page (trips.js placeCreate). */
.list-empty-first {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-8) 0;
}

.list-empty-first .list-note {
  padding: 0;
}

/* Empty states (D v2): warm paper, words only, in ink (the kinds' text tones fall under 4.5:1 there). */
.list-empty {
  padding-right: var(--space-4);
  padding-left: var(--space-4);
  border-radius: var(--radius-card);
  background-color: var(--warm-paper);
  color: var(--ink);
}

.list-empty .list-note {
  color: var(--ink);
}

.list-error {
  margin-top: var(--space-3);
}

/* Cards: no frame of their own; the thumbnail is framed by a hairline, the title and date under it, the
   ⋯ button beside the date. */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6) var(--space-3);
}

.card {
  position: relative;
}

.card-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: var(--target);
  color: inherit;
  text-decoration: none;
}

.card-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  margin-bottom: var(--space-1);
  border: 1px solid var(--hairline);
  object-fit: cover;
  background-color: var(--paper);
}

.card-thumb-empty {
  overflow: hidden;
}

.card-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font: var(--type-strong);
  overflow-wrap: anywhere;
}

.card-meta {
  padding-right: var(--space-8);
  color: var(--ink-muted);
  font: var(--type-caption);
}

.card-menu-button {
  position: absolute;
  right: calc(-1 * var(--space-2));
  bottom: calc(-1 * var(--space-5));
}

.menu {
  position: absolute;
  right: var(--space-1);
  bottom: calc(var(--target) + var(--space-2));
  z-index: 5;
  min-width: 160px;
  padding: var(--space-1);
  border: 1px solid var(--mist-line);
  border-radius: var(--radius-card);
  background-color: var(--paper);
  box-shadow: var(--shadow-sheet);
  animation: fade-in var(--duration-fade) var(--ease);
}

.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--target);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-menu-row);
  background: transparent;
  color: var(--ink);
  font: var(--type-body);
  text-align: left;
  cursor: pointer;
}

.menu-item:hover,
.menu-item:focus-visible {
  background-color: rgb(10 10 10 / 0.06);
}

@media (min-width: 600px) {
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Wide: the drawing in its column at 1:√2, framed by a hairline and kept in view while the list scrolls;
   the list's cards are rows (thumbnail, then title and date, ⋯ at the end). */
@media (min-width: 960px) {
  .site-header-lobby,
  .main-lobby {
    max-width: 1280px;
  }

  .site-header-lobby {
    padding-right: var(--space-6);
    padding-left: var(--space-6);
  }

  .main.main-lobby {
    padding: var(--space-2) var(--space-8) var(--space-12);
  }

  .lobby-poster {
    display: grid;
    grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
    gap: var(--space-12);
    align-items: start;
  }

  .poster {
    position: sticky;
    top: var(--space-4);
    width: 100%;
    max-height: none;
    aspect-ratio: 1 / 1.4142;
    margin: 0;
    border: 1px solid var(--hairline);
  }

  .list-head {
    margin: 0;
    padding: 0 0 var(--space-3);
    border-top: 0;
    border-bottom: 1px solid var(--hairline);
  }

  .panel {
    margin-top: 0;
  }

  .cards {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .card {
    border-bottom: 1px solid var(--hairline);
  }

  /* The thumbnail on the left; the title, the date and the people beside it, centred on it. */
  .card-link {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    grid-template-rows: 1fr auto auto auto 1fr;
    column-gap: var(--space-4);
    padding: var(--space-3) var(--space-12) var(--space-3) 0;
  }

  .card-thumb {
    grid-row: 1 / -1;
    margin-bottom: 0;
  }

  .card-title,
  .card-meta {
    grid-column: 2;
    padding-right: 0;
  }

  .card-title {
    grid-row: 2;
    margin-bottom: var(--space-1);
  }

  .card-meta {
    grid-row: 3;
  }

  .card-people {
    grid-row: 4;
  }

  .card-menu-button {
    top: 50%;
    right: 0;
    bottom: auto;
    transform: translateY(-50%);
  }

  .card .menu {
    top: calc(50% + var(--target) / 2);
    right: 0;
    bottom: auto;
  }
}

/* ---------------------------------------------------------------------------------------------- */
/* Dialogs (SC5 delete, SC15 listening notice) and the toast */

.dialog {
  width: calc(100% - var(--space-8));
  max-width: 420px;
  padding: var(--space-6) var(--space-4) var(--space-4);
  border: 0;
  border-radius: var(--radius-sheet);
  background-color: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-sheet);
}

.dialog[open] {
  animation: sheet-in var(--duration-sheet) var(--ease);
}

.dialog::backdrop {
  background-color: rgb(10 10 10 / 0.4);
}

.dialog-text {
  font: var(--type-body);
}

.dialog-notice .notice-items {
  margin-top: var(--space-3);
}

.notice-items li {
  position: relative;
  padding-left: var(--space-4);
  font: var(--type-body);
}

.notice-items li + li {
  margin-top: var(--space-2);
}

.notice-items li::before {
  content: "";
  position: absolute;
  top: 9px;
  left: var(--space-1);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--ink);
}

.toast {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  z-index: 30;
  width: fit-content;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-pill);
  background-color: var(--ink);
  color: var(--paper);
  font: var(--type-body);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-fade) linear, visibility 0s linear var(--duration-fade);
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--duration-fade) linear, visibility 0s;
}

/* ---------------------------------------------------------------------------------------------- */
/* SC15 settings */

.settings-section {
  margin-top: var(--space-8);
}

.section-title {
  margin-bottom: var(--space-2);
  color: var(--ink-muted);
  font: var(--type-anchor-label);
}

.settings-section .button {
  margin-top: var(--space-3);
}

.settings-list {
  border-top: 1px solid var(--mist-line);
}

.settings-list > li {
  border-bottom: 1px solid var(--mist-line);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--target);
  padding: var(--space-2) var(--space-1);
  border: 0;
  background: transparent;
  color: var(--ink);
  font: var(--type-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

a.settings-row:hover,
button.settings-row:hover {
  background-color: rgb(10 10 10 / 0.06);
}

.settings-row-static {
  cursor: default;
}

/* A row with a button at its end (the sign-in methods): the section's button gap does not apply inside a row */
.settings-row .button {
  flex: none;
  margin-top: 0;
}

.settings-section .caption {
  margin-top: var(--space-6);
}

/* ---------------------------------------------------------------------------------------------- */
/* SC16 Plus (web-api §22.4): the consent box is a plain, unticked checkbox with its label beside it */

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: var(--target);
  padding-top: var(--space-3);
  font: var(--type-body);
  cursor: pointer;
}

.check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--ink);
}

.plan-line {
  margin-bottom: var(--space-4);
  font: var(--type-body);
}

.plan-line a {
  color: var(--ink);
}

/* ---------------------------------------------------------------------------------------------- */
/* Dev sign-in (local only) */

.form .field + .field {
  margin-top: var(--space-4);
}

.form .field:first-child {
  margin-top: var(--space-6);
}

.field label {
  display: block;
  margin-bottom: var(--space-1);
  font: var(--type-anchor-label);
}

.field input {
  width: 100%;
  min-height: var(--target);
  padding: 0 var(--space-3);
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius-field);
  background-color: var(--paper);
  font: var(--type-body);
}

/* ---------------------------------------------------------------------------------------------- */
/* Breakpoints (PRD §5.4) */

@media (min-width: 600px) {
  .main {
    padding-top: var(--space-10);
  }

  .main-landing {
    padding-top: var(--space-6);
  }
}

/* ---------------------------------------------------------------------------------------------- */
/* Motion (PRD §5.10): sheets slide 240 ms; reduced motion keeps 120 ms fades only */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 120ms !important;
    transition-delay: 0s !important;
    animation-duration: 120ms !important;
    animation-iteration-count: 1 !important;
  }

  .dialog[open],
  .menu {
    animation-name: fade-in;
  }

  .skip {
    transition: none !important;
  }
}

/* ---------------------------------------------------------------------------------------------- */
/* Forced colours (PRD §5.10: HTML pages respect forced-colours mode for interface chrome) */

@media (forced-colors: active) {
  :focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
    box-shadow: none;
  }

  .button,
  .icon-button,
  .settings-row,
  .menu-item,
  .tab {
    border: 1px solid ButtonText;
  }

  .button-primary {
    border-color: ButtonText;
  }

  .tab[aria-selected="true"] {
    border-bottom: 3px solid Highlight;
  }

  .button[aria-disabled="true"],
  .icon-button[aria-disabled="true"] {
    opacity: 1;
    border-color: GrayText;
    color: GrayText;
  }

  /* A button the page serves disabled until its module wires it (web-api §17) shows GrayText, the
     browser's own disabled colour, through a colour of its own: forced colours revert the author's other
     colours, so without it enabling changes no colour the browser keeps, and Chromium went on painting
     the label GrayText after `disabled` was gone (the button looked unavailable for good). */
  .button:disabled,
  .icon-button:disabled,
  .settings-row:disabled,
  .menu-item:disabled,
  .tab:disabled {
    color: GrayText;
  }

  .signin-button {
    border: 1px solid ButtonText;
  }

  .signin-button .signin-symbol {
    fill: currentColor;
  }

  /* Apple's logo keeps to the label's colour: the apple in ButtonText, its black padding rectangle transparent. */
  .signin-apple .signin-symbol path {
    fill: currentColor;
  }

  .signin-apple .signin-symbol rect {
    fill: transparent;
  }

  .card,
  .menu,
  .dialog,
  .toast,
  .signin,
  .notice-updated {
    border: 1px solid CanvasText;
  }

  .card-thumb-empty {
    border: 1px dashed GrayText;
  }

  .soon {
    border-color: CanvasText;
  }

  .status-line:not(:empty) {
    border-left-color: CanvasText;
  }

  .notice-items li::before {
    background-color: CanvasText;
  }

  .icon {
    stroke: currentColor;
  }
}

/* ---------------------------------------------------------------------------------------------- */
/* M6 (web-api §23): the landing page's launch sections, the known-issues page and 문의하기 */

.launch {
  margin-top: var(--space-10);
}

.launch-steps {
  display: grid;
  gap: var(--space-4);
}

.launch-step {
  padding: var(--space-4);
  border: 1px solid var(--mist-line);
  border-radius: var(--radius-card);
}

.launch-step-title {
  font: var(--type-anchor-label);
}

.launch-text {
  margin-top: var(--space-2);
  font: var(--type-body);
}

.launch-step .launch-text {
  margin-top: var(--space-1);
  color: var(--ink-muted);
}

.known-list {
  margin-top: var(--space-4);
}

.known-item {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--mist-line);
}

.known-title {
  font: var(--type-anchor-label);
}

.known-state {
  margin-top: var(--space-1);
  color: var(--mist-text);
  font: var(--type-caption);
}

.known-body {
  margin-top: var(--space-2);
  font: var(--type-body);
}

.support-known {
  margin-top: var(--space-6);
}

.choices {
  margin: var(--space-6) 0 0;
  padding: 0;
  border: 0;
}

.choices-legend {
  margin-bottom: var(--space-1);
  font: var(--type-anchor-label);
}

.support-deletion .settings-list {
  margin-top: var(--space-2);
}

.support-form .field {
  margin-top: var(--space-6);
}

.field textarea {
  width: 100%;
  min-height: 132px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--ink-muted);
  border-radius: var(--radius-field);
  background-color: var(--paper);
  color: var(--ink);
  font: var(--type-body);
  resize: vertical;
}

@media (forced-colors: active) {
  .launch-step {
    border: 1px solid CanvasText;
  }
}
