/* Trip — layout on top of the Montage tokens (ds/colors_and_type.css). Mobile first; borders are inset shadows. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--semantic-background-normal-alternative); } /* ds base paints html white; short pages showed it under body */
body {
  margin: 0;
  background: var(--semantic-background-normal-alternative);
  color: var(--semantic-label-normal);
  word-break: keep-all;          /* Korean wraps between words, not inside them */
  overflow-wrap: break-word;
}
#app { max-width: 720px; margin: 0 auto; padding: var(--space-16) var(--space-16) var(--space-32); }
h1, h2, h3, p { margin: 0; }
a { color: var(--semantic-primary-normal); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--semantic-label-neutral); }  /* label-alternative is 3.7:1 on white, below AA for body text */
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.grow { flex: 1; min-width: 0; }

.icon { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.icon-sm { width: 16px; height: 16px; vertical-align: -3px; }
.icon-xs { width: 12px; height: 12px; vertical-align: -1px; margin-left: 2px; }
.icon-lg { width: 28px; height: 28px; }

.card {
  background: var(--semantic-background-normal-normal);
  border-radius: var(--radius-16);
  box-shadow: inset 0 0 0 1px var(--semantic-line-normal-alternative);
  padding: var(--space-20);
  display: flex; flex-direction: column; gap: var(--space-12);
}

/* buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-6);
  min-height: 44px; padding: 0 var(--space-16); border: 0; border-radius: var(--radius-10);
  font-size: var(--type-body2-size); font-weight: 600;
}
.btn-primary { background: var(--semantic-primary-normal); color: var(--semantic-static-white); }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-outline { background: var(--semantic-background-normal-normal); box-shadow: inset 0 0 0 1px var(--semantic-line-normal-normal); }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: var(--radius-full); background: transparent;
  color: var(--semantic-label-alternative);
}
.btn-icon:hover { background: var(--semantic-fill-normal); }
.btn-xs { width: 44px; height: 44px; margin: -10px -10px -10px var(--space-4); vertical-align: middle; }  /* 44px target, compact row */
.btn-text {
  display: inline-flex; align-items: center; gap: var(--space-4);
  min-height: 44px; border: 0; background: transparent; padding: var(--space-8) 0; color: var(--semantic-primary-normal);
}
.field {
  width: 100%; min-height: 44px; padding: var(--space-10) var(--space-12);
  border: 0; border-radius: var(--radius-10); background: var(--semantic-background-normal-normal);
  box-shadow: inset 0 0 0 1px var(--semantic-line-normal-normal);
  font: inherit; font-size: 16px; color: inherit; resize: vertical;
}
.field:focus { outline: none; box-shadow: inset 0 0 0 2px var(--semantic-primary-normal); }
:focus-visible { outline: 2px solid var(--semantic-primary-normal); outline-offset: 2px; }

/* login */
.login { max-width: 400px; margin: 12vh auto 0; text-align: center; align-items: stretch; }
.login-mark { display: flex; justify-content: center; color: var(--semantic-primary-normal); }
.login form { display: flex; flex-direction: column; gap: var(--space-8); }
.name-list { display: flex; flex-wrap: wrap; gap: var(--space-8); justify-content: center; }
.error { color: var(--atomic-red-40); min-height: 1.4em; }

/* header */
.top { display: flex; flex-direction: column; gap: var(--space-8); margin-bottom: var(--space-16); }
.top-row { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-12); }
.eyebrow { color: var(--semantic-primary-normal); }
.me { display: flex; align-items: center; gap: var(--space-4); flex: none; }
.people { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); }
.chip {
  padding: 2px var(--space-10); border-radius: var(--radius-full);
  font-size: var(--type-caption1-size); font-weight: 500;
  background: var(--semantic-fill-normal); color: var(--semantic-label-neutral);
}
.chip-on { background: var(--semantic-primary-normal); color: var(--semantic-static-white); }

/* budget */
.budget { margin-bottom: var(--space-12); }
.budget-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: var(--space-8); }
.budget h2, .card > h2, .section-head h2 { display: flex; align-items: center; gap: var(--space-4); }
.bar { height: 10px; border-radius: var(--radius-full); background: var(--semantic-fill-normal); overflow: hidden; }
.bar-fill { height: 100%; background: var(--semantic-primary-normal); border-radius: inherit; transition: width .25s ease; }
.bar-fill.over { background: var(--semantic-status-negative); }
.budget-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-8); }
.budget-rows li { display: flex; align-items: baseline; gap: var(--space-10); }
.budget-rows li > :first-child { width: 3.5em; flex: none; color: var(--semantic-label-neutral); }

.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-10); }
.facts li { display: grid; grid-template-columns: 1fr; gap: var(--space-2); }
.facts li > :first-child { color: var(--semantic-label-neutral); }

/* sections and options */
.section { margin-top: var(--space-32); display: flex; flex-direction: column; gap: var(--space-12); }
.section-head { display: flex; flex-direction: column; gap: var(--space-4); }
.decided { display: flex; align-items: center; gap: var(--space-4); color: var(--semantic-label-normal); }
.decided .icon { color: var(--semantic-accent-fg-orange); }
.options { display: flex; flex-direction: column; gap: var(--space-12); }
.option.picked { box-shadow: inset 0 0 0 2px var(--semantic-primary-normal); }
.option-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-12); }
.price { text-align: right; flex: none; }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-4); }
.tag {
  display: inline-block; padding: 1px var(--space-8); border-radius: var(--radius-6);
  font-size: var(--type-caption2-size); font-weight: 600;
  background: var(--semantic-fill-normal); color: var(--semantic-label-neutral);
}
.budget-rows .tag { margin-left: var(--space-6); }
.tag-recommended { background: var(--semantic-fill-normal); color: var(--atomic-blue-45); }  /* primary-normal is 4.4:1 on the grey tag */
.tag-pick, .tag-pick.tag { background: var(--semantic-primary-normal); color: var(--semantic-static-white); }
/* status tags keep readable text; the color rides on a dot */
.tag-votes::before, .tag-tie::before, .tag-disliked::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; vertical-align: 1px;
}
.tag-votes::before { background: var(--semantic-status-positive); }
.tag-tie::before { background: var(--semantic-status-cautionary); }
.tag-disliked::before { background: var(--semantic-status-negative); }
.warn { color: var(--semantic-label-normal); font-weight: 600; }

details > summary {
  display: inline-flex; align-items: center; gap: var(--space-4); cursor: pointer; list-style: none;
  min-height: 44px; color: var(--semantic-label-neutral); padding: var(--space-4) 0;
}
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .icon { transform: rotate(180deg); }
.detail-list { margin: var(--space-8) 0 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: var(--space-4); }
.links { display: flex; flex-wrap: wrap; column-gap: var(--space-16); margin-top: var(--space-4); }
.links a, .sources li a { display: inline-flex; align-items: center; min-height: 44px; }

.vote-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.vote {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; padding: var(--space-6) var(--space-4); border: 0; border-radius: var(--radius-10);
  background: var(--semantic-fill-alternative); color: var(--semantic-label-neutral);
  font-size: var(--type-caption1-size); font-weight: 600;
}
.vote:hover { background: var(--semantic-fill-normal); }
.vote-up.on { background: var(--semantic-primary-normal); color: var(--semantic-static-white); }
.vote-meh.on { background: var(--semantic-label-neutral); color: var(--semantic-static-white); }
.vote-down.on { background: var(--atomic-red-40); color: var(--semantic-static-white); }
.who { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.who-chip { padding: 2px var(--space-8); border-radius: var(--radius-full); background: var(--semantic-fill-alternative); }
/* vote chips: the words carry the vote, the dot carries the color (red-40 text is 4.3:1 on the chip fill) */
.who-chip { color: var(--semantic-label-neutral); }
.who-chip::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; vertical-align: 1px; }
.who-up::before { background: var(--semantic-primary-normal); }
.who-down::before { background: var(--atomic-red-40); }
.who-meh::before { background: var(--semantic-label-alternative); }
.pick-row { display: flex; justify-content: flex-end; margin-top: calc(-1 * var(--space-4)); }

/* comments */
.thread { display: flex; flex-direction: column; gap: var(--space-10); padding-top: var(--space-4); }
.comment { padding: var(--space-10) var(--space-12); border-radius: var(--radius-10); background: var(--semantic-fill-alternative); }
.comment > p:first-child { display: flex; align-items: center; justify-content: space-between; }
.comment-form { display: flex; gap: var(--space-8); align-items: flex-end; }
.comment-form .btn { flex: none; width: 48px; padding: 0; }

.sources ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 0; }
.site-footer { text-align: center; color: var(--semantic-label-neutral); padding: var(--space-24) var(--space-16) var(--space-40); }

@media (min-width: 640px) {
  #app { padding-top: var(--space-32); }
  .facts li { grid-template-columns: 5.5em 1fr; gap: var(--space-10); }
  .vote { flex-direction: row; gap: var(--space-6); min-height: 44px; font-size: var(--type-label1-size); }
}

/* itinerary */
.days { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-8); }
.day { gap: var(--space-4); padding: var(--space-16); }
.day-name { color: var(--semantic-primary-normal); }
.day-tip { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-4); color: var(--semantic-label-normal); }
.day-tip .icon { color: var(--semantic-status-cautionary); }
