:root {
  color-scheme: light;
  --paper: #f6f5f1;
  --surface: #fffefa;
  --ink: #192925;
  --muted: #53645e;
  --line: #dedfd5;
  --green: #20483e;
  --green-dark: #15352d;
  --soft: #e8efe8;
  --warm: #c24130;
  --accent: #ffbd91;
  --shadow: 0 7px 28px rgb(26 47 40 / 7%);
  --radius: 19px;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}
:root[data-accent="indigo"] {
  --ink: #242b46;
  --muted: #505a75;
  --green: #3b4d81;
  --green-dark: #2b3a66;
  --soft: #e7ebf7;
}
:root[data-accent="plum"] {
  --ink: #39293b;
  --muted: #655369;
  --green: #704266;
  --green-dark: #572c50;
  --soft: #f1e6ee;
}
*, *::before, *::after { box-sizing: border-box; }
body { min-width: 280px; margin: 0; line-height: 1.56; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
a { color: var(--green-dark); }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #b84c39; outline-offset: 3px; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3, summary, strong { line-height: 1.32; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.85rem, 4.3vw, 2.9rem); letter-spacing: -.055em; }
h2 { font-size: clamp(1.25rem, 2.1vw, 1.58rem); letter-spacing: -.04em; }
h3 { font-size: 1.1rem; letter-spacing: -.03em; }
p, dd { overflow-wrap: anywhere; }
p + p { margin-top: .38rem; }
ul, ol, dl { margin-block: .6rem 0; }
dd { margin-inline-start: 0; }
dt { color: var(--muted); font-weight: 650; }
small { font-size: .83rem; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus { position: fixed; z-index: 20; left: 1rem; top: 1rem; padding: .8rem; background: white; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgb(246 245 241 / 96%);
  border-bottom: 1px solid var(--line);
}
.header-inner, .app-main, .nav-inner {
  width: min(1080px, 100% - 48px);
  margin-inline: auto;
}
.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: max(.5rem, env(safe-area-inset-top)) .5rem;
}
.brand, .profile-button, .sync-button, .icon-button {
  border: 0;
  background: transparent;
  min-width: 44px;
  min-height: 44px;
}
.brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  gap: .66rem;
  padding: 0;
  white-space: nowrap;
  font-size: 1.24rem;
  font-weight: 830;
  letter-spacing: -.06em;
}
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-block;
  flex: none;
  background: #c64835;
  border-radius: 50%;
}
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  background: #fff7e8;
  border-radius: 3px;
  transform: rotate(-34deg);
}
.brand-mark::before { width: 3px; height: 21px; left: 14px; top: 5px; }
.brand-mark::after { width: 19px; height: 3px; left: 6px; top: 15px; }
.app-tools { display: flex; flex: none; align-items: center; gap: .48rem; min-width: 0; }
.trip-select { min-width: 0; }
.trip-select select {
  width: min(240px, 28vw);
  padding-block: .48rem;
  background-color: var(--surface);
  font-size: .9rem;
  font-weight: 650;
  text-overflow: ellipsis;
}
.sync-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .44rem;
  padding: .4rem .53rem;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 650;
  font-size: .8rem;
  white-space: nowrap;
}
.sync-button:hover, .icon-button:hover { background: var(--soft); }
.sync-button i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #39815b; }
.sync-button.waiting i { background: #b94e38; }
.profile-button {
  border-radius: 50%;
  background: var(--soft);
  color: var(--green-dark);
  font-weight: 800;
}

.app-main { padding-block: 28px max(120px, calc(95px + env(safe-area-inset-bottom))); }
.app-main:has(.auth-layout) { padding-block: clamp(36px, 8vw, 100px) 40px; }
.starting { padding-block: 3rem; text-align: center; color: var(--muted); }

.app-nav {
  position: fixed;
  z-index: 3;
  inset: auto 0 max(16px, env(safe-area-inset-bottom)) 0;
  pointer-events: none;
}
.nav-inner {
  width: min(482px, 100% - 32px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  background: rgb(255 254 250 / 98%);
  border: 1px solid var(--line);
  border-radius: 23px;
  box-shadow: 0 9px 24px rgb(36 48 44 / 12%);
  pointer-events: auto;
}
.nav-inner button {
  border: 0;
  background: transparent;
  padding: .35rem .3rem;
  color: var(--muted);
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 53px;
  gap: 4px;
  font-size: .83rem;
  font-weight: 750;
  border-radius: 17px;
}
.nav-inner button:hover, .nav-inner button[aria-current="page"] { color: var(--green-dark); background: var(--soft); }
.nav-icon { position: relative; display: block; width: 16px; height: 16px; border: 1.7px solid currentColor; }
.nav-today { border-radius: 3px; height: 13px; margin-top: 3px; }
.nav-today::after { position: absolute; content: ""; bottom: 0; left: 5px; height: 5px; border-left: 2px solid currentColor; }
.nav-places { width: 14px; height: 14px; border-radius: 50% 50% 50% 8%; transform: translateY(-1px) rotate(-45deg); }
.nav-places::after { position: absolute; content: ""; width: 4px; height: 4px; left: 3px; top: 3px; border-radius: 50%; background: currentColor; }
.nav-schedule { border-radius: 3px; height: 14px; }
.nav-schedule::after { position: absolute; content: ""; left: 0; right: 0; top: 3px; border-top: 1.7px solid currentColor; }
.nav-info { border-radius: 3px; width: 13px; }
.nav-info::after { position: absolute; content: ""; left: 2px; right: 2px; top: 4px; height: 5px; border-block: 1.5px solid currentColor; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 238px;
  color: #fffef8;
  border-radius: 23px;
  background-color: #25443c;
  background-image: linear-gradient(95deg, rgb(12 30 28 / 96%) 0%, rgb(12 30 28 / 78%) 42%, rgb(12 30 28 / 16%) 100%), url("/tokyo-hero.webp");
  background-size: cover;
  background-position: center 50%;
  box-shadow: var(--shadow);
}
.hero-content { display: grid; justify-items: start; align-content: center; gap: .64rem; min-height: inherit; padding: clamp(23px, 5vw, 52px); }
.hero-content p:not(.eyebrow) { max-width: 49ch; color: #f3f6ec; font-weight: 500; }
.hero-content .eyebrow { color: var(--accent); }
.hero .button.primary { background: #fff4df; border-color: #fff4df; color: #263e32; margin-top: .42rem; }
.hero .button.primary:hover { background: #ffe4c9; }
.eyebrow { font-weight: 800; color: var(--muted); letter-spacing: .06em; font-size: .82rem; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .85fr); gap: 19px; }
.auth-hero { min-height: 440px; background-position: 56% 48%; }
.auth-hero h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); line-height: 1.1; }
.auth-panel { display: grid; align-content: center; gap: 1.1rem; padding: clamp(25px, 4vw, 45px) !important; }
.auth-panel > .quiet { justify-self: center; }
.empty-home { display: grid; gap: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.6vw, 26px);
  min-width: 0;
  box-shadow: 0 2px 10px rgb(32 54 42 / 3%);
}
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stack { display: grid; gap: .85rem; min-width: 0; }
.stack > * { min-width: 0; }
.section-head, .row, .form-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}
.section-head { justify-content: space-between; }
.section-head > div { min-width: 0; }
.form-actions { justify-content: flex-start; }
.muted { color: var(--muted); }
.empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: .65rem;
  padding-block: clamp(25px, 4vw, 42px);
  color: var(--muted);
}
.empty h2, .empty h3 { color: var(--ink); }
.notice, .form-error {
  border-radius: 10px;
  padding: .64rem .77rem;
  background: #fff0e4;
  color: #703628;
}
.form-error { background: #fff0ef; color: #8a281f; }
.pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: .24rem .58rem;
  border-radius: 100px;
  background: var(--soft);
  color: var(--green-dark);
  font-weight: 730;
  font-size: .81rem;
}
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .54rem .88rem;
  background: var(--surface);
  color: var(--green-dark);
  font-size: .92rem;
  font-weight: 750;
  text-decoration: none;
  text-align: center;
}
.button:hover { background: #edf0e9; }
.button.primary, .button[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: white; }
.button.primary:hover, .button[aria-pressed="true"]:hover { background: var(--green-dark); }
.button.secondary { background: var(--soft); border-color: #d6e1d4; }
.button.secondary:hover { background: #dbe8db; }
.button.quiet { background: transparent; border-color: transparent; }
.button.quiet:hover { background: var(--soft); }
.button.danger { color: #942a24; border-color: #e9c7bf; }
.button.danger:hover { background: #ffede8; }

form { min-width: 0; }
label {
  display: grid;
  align-content: start;
  gap: .33rem;
  letter-spacing: -.018em;
  font-weight: 700;
  font-size: .9rem;
}
input:not([type=checkbox],[type=radio],[type=range],[type=color]), textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #c9d0c5;
  border-radius: 10px;
  background-color: var(--surface);
  padding: .56rem .63rem;
  font-size: 1rem;
  font-weight: 500;
}
input[type=date], input[type=time] { min-width: 0; max-width: 100%; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: .2rem; accent-color: var(--green); }
label:has(> input:is([type=checkbox],[type=radio])) {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 40px;
}
input[type=file] { padding-inline: .45rem; }
textarea { min-height: 88px; resize: vertical; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #456052 50%), linear-gradient(135deg, #456052 50%, transparent 50%);
  background-position: right 13px center, right 9px center;
  background-repeat: no-repeat;
  background-size: 4px 4px;
  padding-right: 25px;
}
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }

dialog {
  width: min(620px, 100% - 32px);
  max-height: min(780px, calc(100% - 40px));
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 19px;
  box-shadow: 0 14px 50px rgb(14 28 24 / 22%);
}
dialog::backdrop { background: rgb(12 26 24 / 49%); }
.dialog-frame, .dialog-form { padding: clamp(16px, 4vw, 28px); }
.dialog-frame > .section-head { margin-bottom: .85rem; }
.icon-button { line-height: 1; font-size: 1.6rem; border-radius: 50%; }
.legal-links { display: flex; flex-wrap: wrap; gap: .6rem; color: var(--muted); font-size: .85rem; }
.toast {
  position: fixed;
  z-index: 8;
  bottom: max(94px, calc(env(safe-area-inset-bottom) + 78px));
  inset-inline: 16px;
  width: fit-content;
  max-width: min(480px, 100% - 32px);
  margin-inline: auto;
  border-radius: 12px;
  padding: .7rem 1.05rem;
  background: #243f35;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 650;
}
.conflict-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.conflict-compare details { display: block; min-width: 0; padding: .5rem; background: var(--paper); border-radius: 9px; }
.conflict-compare pre { margin-block: .45rem 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .9rem; }
.google-attribution { font-weight: 400; font-size: .82rem; line-height: 1.2; color: #5e5e5e; white-space: nowrap; }
.google-map-canvas { min-height: clamp(270px, 50vw, 470px); border-radius: 13px; width: 100%; }
.map-status:not(:empty) { padding-top: .55rem; }

@media (max-width: 730px) {
  .header-inner, .app-main { width: calc(100% - 28px); }
  .header-inner { min-height: 60px; gap: .3rem; }
  .brand { font-size: 1.07rem; gap: .36rem; }
  .brand-mark { transform: scale(.86); margin-left: -2px; }
  .app-main { padding-top: 17px; }
  .app-tools { gap: .15rem; }
  .trip-select select { width: min(210px, 34vw); }
  .sync-button { min-width: 32px; padding-inline: .3rem; }
  .sync-button span { display: none; }
  .profile-button { min-width: 36px; min-height: 36px; }
  .auth-layout { grid-template-columns: 1fr; gap: 12px; }
  .app-main:has(.auth-layout) { padding-block: 16px 32px; }
  .auth-hero { min-height: 240px; }
  .auth-hero .hero-content { padding-block: 24px; }
  .hero { background-image: linear-gradient(95deg, rgb(12 30 28 / 92%) 0%, rgb(12 30 28 / 70%) 53%, rgb(12 30 28 / 20%) 100%), url("/tokyo-hero.webp"); }
  .app-nav { inset-block-end: 0; background: var(--surface); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); }
  .nav-inner { border: 0; box-shadow: none; width: min(480px, 100% - 14px); border-radius: 0; }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
  .hero { min-height: 206px; }
  .auth-hero { min-height: 230px; }
  .hero-content p:not(.eyebrow) { max-width: 29ch; }
}
@media (max-width: 345px) {
  .header-inner, .app-main { width: calc(100% - 16px); }
  .field-grid { grid-template-columns: 1fr; }
}
.auth-legal { text-align: center; font-size: .83rem; color: var(--muted); }
.auth-legal a { color: inherit; }
