/* 여행 추억 (/memories/) — design pass matching /lab.css tokens and typography.
 * Loaded after memories/memories.css. Selectors only; no content: text injection. */

:root {
  --ok: #166534;
  --ok-soft: #e7f4ec;
  --on-ok: #ffffff;
  --star: #b45309;
  --star-soft: #fef3c7;
  --heart: #be123c;
  --heart-soft: #ffeef1;
  --warn: var(--lab-fb-err, #b42318);
  --warn-soft: #fbe9e7;
  --on-warn: #ffffff;
  --teal: #0f766e;
  --teal-soft: #e8f3f1;
  --on-teal: #ffffff;
  --shade: rgba(10, 10, 12, .52);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ok: #4ade80;
    --ok-soft: #13261a;
    --on-ok: #121213;
    --star: #fbbf24;
    --star-soft: #2a210d;
    --heart: #fb7185;
    --heart-soft: #2c151d;
    --warn: var(--lab-fb-err, #ff8f86);
    --warn-soft: #2c1514;
    --on-warn: #121213;
    --teal: #2dd4bf;
    --teal-soft: #102624;
    --on-teal: #121213;
    --shade: rgba(10, 10, 12, .64);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ok: #4ade80;
  --ok-soft: #13261a;
  --on-ok: #121213;
  --star: #fbbf24;
  --star-soft: #2a210d;
  --heart: #fb7185;
  --heart-soft: #2c151d;
  --warn: var(--lab-fb-err, #ff8f86);
  --warn-soft: #2c1514;
  --on-warn: #121213;
  --teal: #2dd4bf;
  --teal-soft: #102624;
  --on-teal: #121213;
  --shade: rgba(10, 10, 12, .64);
  color-scheme: dark;
}

/* ---------- base & focus ---------- */
html {
  overflow-x: clip;
}

body {
  background: var(--lab-bg);
  color: var(--lab-text);
  font-family: var(--lab-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip;
}

:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--lab-accent);
  outline-offset: 2px;
}

.j-wrap {
  max-width: 860px;
  min-height: calc(100dvh - 57px);
  margin: 0 auto;
  padding: 24px 16px 84px;
}

@media (min-width: 960px) {
  .j-wrap {
    padding: 28px 20px 88px;
  }
}

/* ---------- buttons & icon buttons ---------- */
.btn {
  height: auto;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: var(--lab-radius);
  border: 1px solid var(--lab-line-strong);
  background: var(--lab-surface);
  color: var(--lab-text);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  white-space: normal;
  text-align: center;
  max-width: 100%;
  box-shadow: var(--lab-shadow-sm);
  transition: border-color .15s, background-color .15s, color .15s, opacity .15s;
}

.btn:not(.primary):not(.danger):not(.ghost):not(:disabled):hover {
  border-color: var(--lab-text);
  background: var(--lab-surface2);
}

.btn:not(:disabled):active {
  opacity: .84;
}

.btn:focus-within {
  outline: 2px solid var(--lab-accent);
  outline-offset: 2px;
}

.btn.primary {
  background: var(--lab-ink);
  border-color: var(--lab-ink);
  color: var(--lab-on-ink);
}

.btn.primary:not(:disabled):hover {
  opacity: .88;
}

.btn.sm {
  height: auto;
  min-height: 32px;
  padding: 5px 11px;
  font-size: 13px;
  border-radius: var(--lab-radius);
}

.btn.ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.btn.ghost:not(:disabled):hover {
  background: var(--lab-surface2);
  border-color: var(--lab-line);
}

.btn.danger {
  color: var(--warn);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.btn.danger:not(:disabled):hover {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

.btn.danger.armed,
.btn.danger.armed:hover {
  background: var(--warn);
  border-color: var(--warn);
  color: var(--on-warn);
  opacity: 1;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--lab-radius);
  border: 1px solid var(--lab-line);
  background: var(--lab-surface);
  color: var(--lab-text);
  box-shadow: var(--lab-shadow-sm);
  transition: border-color .15s, background-color .15s;
}

.icon-btn:hover {
  border-color: var(--lab-line-strong);
  background: var(--lab-surface2);
}

/* ---------- trip list (#/) & backup ---------- */
.j-intro h1 {
  margin: 2px 0 8px;
  font-size: clamp(1.5rem, 3.2vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.j-intro p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--lab-muted);
  max-width: 58ch;
}

.j-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 22px;
}

.j-tools a.btn[href="#/card"] svg {
  color: var(--teal);
}

.j-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@media (min-width: 720px) {
  .j-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

.j-card {
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  color: var(--lab-text);
  box-shadow: var(--lab-shadow-sm);
  min-width: 0;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}

.j-card:hover {
  border-color: var(--lab-line-strong);
  box-shadow: 0 3px 12px rgba(20, 20, 18, .06);
}

:root[data-theme="dark"] .j-card:hover {
  box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .j-card:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
  }
}

.j-cover {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  border: 1px solid var(--lab-line);
  background: var(--lab-surface2);
  color: var(--lab-muted);
}

.j-card-body {
  gap: 4px;
}

.j-card-title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}

.j-card-sub {
  font-size: 13px;
  color: var(--lab-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.j-card-stats {
  gap: 3px 10px;
  margin-top: 2px;
  font-size: 13px;
  color: var(--lab-muted);
}

.j-card-stats b {
  color: var(--lab-text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--lab-surface2);
  margin-top: 7px;
}

.bar i {
  background: var(--ok);
  border-radius: 999px;
}

.j-empty {
  border: 1px dashed var(--lab-line-strong);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  padding: 36px 20px;
  color: var(--lab-muted);
}

.j-empty h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--lab-text);
}

.j-empty p {
  margin: 0 auto 18px;
  max-width: 44ch;
  font-size: 14px;
  line-height: 1.6;
}

.j-empty .j-tools {
  justify-content: center;
  margin: 0;
}

.j-backup {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
}

.j-backup h2 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.j-backup > p {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--lab-muted);
  max-width: 64ch;
}

.j-usage {
  margin-top: 14px !important;
  padding-top: 12px;
  border-top: 1px solid var(--lab-line);
  font-size: 12.5px !important;
  font-variant-numeric: tabular-nums;
  color: var(--lab-muted);
}

.j-usage:empty {
  display: none;
}

/* ---------- trip page (#/t/<id>) ---------- */
.j-top {
  gap: 12px;
  align-items: flex-start;
}

.j-top h1 {
  font-size: clamp(1.25rem, 2.8vw, 1.5rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

.j-top .j-sub {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--lab-muted);
  font-variant-numeric: tabular-nums;
}

.j-wrap > .plan-memo {
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--lab-line);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--lab-radius) var(--lab-radius) 0;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  color: var(--lab-text);
  font-size: 13.5px;
  line-height: 1.58;
}

.j-src {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--lab-line);
  border-radius: 10px;
  background: var(--lab-surface2);
  gap: 8px 10px;
  font-size: 13px;
  color: var(--lab-muted);
}

@media (min-width: 560px) {
  .j-src > button {
    margin-left: auto;
  }
}

.tag {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--lab-line-strong);
  font-size: 12px;
  font-weight: 600;
}

.tag.plan {
  background: var(--teal-soft);
  border-color: color-mix(in srgb, var(--teal) 30%, var(--lab-line));
  color: var(--teal);
  font-weight: 700;
}

.j-progress {
  margin: 12px 0 0;
  padding: 13px 15px;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
}

.j-progress-row {
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 14px;
}

.j-progress-row b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.j-progress-row span {
  font-size: 13px;
  color: var(--lab-muted);
  font-variant-numeric: tabular-nums;
}

.j-progress .bar {
  margin-top: 9px;
}

/* view tabs (Log / Photos) */
.j-tabs {
  display: flex;
  gap: 3px;
  margin: 18px 0 0;
  padding: 3px;
  border: 1px solid var(--lab-line);
  border-radius: 10px;
  background: var(--lab-surface2);
}

.j-tabs button {
  flex: 1;
  min-width: 0;
  height: 36px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--lab-muted);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color .15s, background-color .15s, box-shadow .15s;
}

.j-tabs button:not([aria-selected="true"]):hover {
  color: var(--lab-text);
}

.j-tabs button[aria-selected="true"] {
  background: var(--lab-surface);
  color: var(--lab-text);
  font-weight: 700;
  box-shadow: var(--lab-shadow-sm);
}

.j-tabs .n {
  font-family: var(--lab-mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-left: 0;
  color: var(--lab-muted);
}

.j-tabs button[aria-selected="true"] .n {
  color: var(--teal);
  font-weight: 600;
}

/* filter + add bar */
.j-bar2 {
  margin: 14px 0 10px;
  gap: 8px 10px;
}

.seg {
  border: 1px solid var(--lab-line-strong);
  border-radius: var(--lab-radius);
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  max-width: 100%;
}

.seg button {
  height: 32px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--lab-muted);
  white-space: nowrap;
  transition: color .15s, background-color .15s;
}

.seg button:not([aria-pressed="true"]):hover {
  color: var(--lab-text);
  background: var(--lab-surface2);
}

.seg button[aria-pressed="true"] {
  background: var(--lab-ink);
  color: var(--lab-on-ink);
}

/* day headings & place rows */
.j-day {
  margin: 22px 2px 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--lab-line);
  gap: 8px;
  align-items: baseline;
}

.j-day b {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.015em;
}

.j-day span {
  font-size: 13px;
  font-weight: 500;
  color: var(--lab-muted);
  font-variant-numeric: tabular-nums;
}

.j-list {
  gap: 9px;
}

.ent {
  padding: 13px 14px 13px 12px;
  gap: 0 12px;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  transition: border-color .15s, background-color .15s;
}

.ent:hover {
  border-color: var(--lab-line-strong);
}

.ent.st-done {
  border-color: var(--lab-line);
}

.ent.st-done:hover {
  border-color: var(--lab-line-strong);
}

.ent.st-skip {
  background: var(--lab-surface2);
  box-shadow: none;
}

.chk {
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border: 1.8px solid var(--lab-line-strong);
  background: var(--lab-surface);
  color: transparent;
  transition: border-color .15s, background-color .15s, color .15s, opacity .15s;
}

.chk:hover {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}

.st-done .chk {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--on-ok);
}

.st-done .chk:hover {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--on-ok);
  opacity: .88;
}

.st-skip .chk {
  border-style: dashed;
  border-color: var(--lab-line-strong);
  background: var(--lab-surface);
  color: var(--lab-muted);
}

.st-skip .chk:hover {
  border-style: solid;
  border-color: var(--lab-text);
  background: var(--lab-surface);
  color: var(--lab-text);
}

.ent-main {
  gap: 4px;
  padding: 1px 0;
}

.ent-t {
  font-weight: 650;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.ent-m {
  font-size: 13px;
  color: var(--lab-muted);
  gap: 4px 8px;
  align-items: center;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.ent-m > span:first-child {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--lab-surface2);
  color: var(--lab-muted);
  font-size: 12px;
  font-weight: 600;
}

.ent.st-skip .ent-m > span:first-child {
  background: var(--lab-surface);
}

.ent-note {
  margin-top: 2px;
  font-size: 13.5px;
  line-height: 1.52;
  color: var(--lab-text);
}

.gone {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--warn);
  font-weight: 600;
}

.ent-extra {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--lab-line);
  gap: 8px 14px;
}

.stars {
  gap: 1px;
}

.stars button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--lab-line-strong);
  transition: color .12s, background-color .12s;
}

.stars button:hover {
  background: var(--lab-surface2);
  color: var(--star);
}

.stars button.on {
  color: var(--star);
}

.thumbs {
  gap: 6px;
  align-items: center;
}

.thumbs button {
  width: 52px;
  height: 52px;
  border: 1px solid var(--lab-line);
  border-radius: 8px;
  background: var(--lab-surface2);
  transition: border-color .15s;
}

.thumbs button:hover {
  border-color: var(--lab-line-strong);
}

.fav-dot {
  right: 4px;
  top: 4px;
  width: 18px;
  height: 18px;
  background: var(--lab-surface);
  color: var(--heart);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

/* ---------- photos tab (#/t/<id>/photos) ---------- */
.chip {
  height: auto;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--lab-line-strong);
  border-radius: 999px;
  background: var(--lab-surface);
  color: var(--lab-text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, background-color .15s, color .15s;
}

.chip svg {
  color: var(--heart);
}

.chip:not([aria-pressed="true"]):hover {
  border-color: var(--lab-text);
  background: var(--lab-surface2);
}

.chip[aria-pressed="true"] {
  border-color: var(--lab-ink);
  background: var(--lab-ink);
  color: var(--lab-on-ink);
}

.chip[aria-pressed="true"] svg {
  color: currentColor;
}

.grid {
  grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.grid button {
  border-radius: 8px;
  border: 1px solid var(--lab-line);
  background: var(--lab-surface2);
  transition: border-color .15s;
}

.grid button:hover {
  border-color: var(--lab-line-strong);
}

/* ---------- dialogs, forms, country chips & import ---------- */
dialog.j-dlg:not(.j-view) {
  width: min(540px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--lab-line-strong);
  border-radius: 14px;
  background: var(--lab-surface);
  color: var(--lab-text);
  box-shadow: var(--lab-shadow-lg);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--lab-line-strong) transparent;
}

dialog.j-dlg::backdrop {
  background: var(--shade);
}

.dlg-head {
  padding: 15px 16px 13px 20px;
  border-bottom: 1px solid var(--lab-line);
  background: var(--lab-surface);
}

.dlg-head h2 {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.015em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dlg-body {
  padding: 18px 20px;
  gap: 16px;
}

.dlg-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--lab-line);
  background: var(--lab-surface);
  gap: 8px;
}

.fld {
  gap: 6px;
  min-width: 0;
}

.fld > span,
.fld legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--lab-muted);
}

.fld input,
.fld select,
.fld textarea,
.imp-link input {
  height: auto;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--lab-line-strong);
  border-radius: var(--lab-radius);
  background: var(--lab-bg);
  color: var(--lab-text);
  font-size: 16px;
  max-width: 100%;
  min-width: 0;
  transition: border-color .15s;
}

.fld textarea {
  min-height: 96px;
  padding: 10px 12px;
  line-height: 1.55;
}

.fld input::placeholder,
.fld textarea::placeholder,
.imp-link input::placeholder {
  color: var(--lab-faint);
  opacity: 1;
}

.fld input:hover,
.fld select:hover,
.fld textarea:hover,
.imp-link input:hover {
  border-color: var(--lab-muted);
}

.fld input:focus,
.fld select:focus,
.fld textarea:focus,
.imp-link input:focus {
  outline: 2px solid var(--lab-accent);
  outline-offset: -1px;
  border-color: var(--lab-accent);
}

.row2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.chips {
  gap: 6px;
}

.chips span {
  height: auto;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--lab-line-strong);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--lab-text);
  background: var(--lab-surface);
  transition: border-color .15s, background-color .15s, color .15s;
}

.chips label:hover input:not(:checked) + span {
  border-color: var(--lab-text);
  background: var(--lab-surface2);
}

.chips input:checked + span {
  border-color: var(--lab-ink);
  background: var(--lab-ink);
  color: var(--lab-on-ink);
}

.dlg-body .stars button {
  width: 34px;
  height: 34px;
}

.dlg-body .stars button svg {
  width: 22px;
  height: 22px;
}

.dlg-body .plan-memo {
  padding: 10px 12px;
  border: 1px solid var(--lab-line);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--lab-radius) var(--lab-radius) 0;
  background: var(--lab-bg);
  color: var(--lab-text);
  font-size: 13.5px;
  line-height: 1.55;
}

.hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--lab-muted);
}

.msg {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--lab-muted);
}

.msg.err {
  color: var(--warn);
  font-weight: 600;
}

hr.sep {
  border-top: 1px solid var(--lab-line);
  margin: 2px 0;
}

/* country chips */
.cty {
  gap: 6px;
  min-height: 28px;
}

.cty-chip {
  height: auto;
  min-height: 32px;
  padding: 3px 5px 3px 12px;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--teal) 32%, var(--lab-line));
  background: var(--teal-soft);
  color: var(--lab-text);
  font-size: 13.5px;
  font-weight: 600;
}

.cty-chip button {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--teal);
  transition: background-color .15s, color .15s;
}

.cty-chip button:hover {
  background: color-mix(in srgb, var(--teal) 16%, transparent);
  color: var(--lab-text);
}

/* photo grid inside place editor */
.pgrid {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.pcell {
  border-radius: 8px;
  border: 1px solid var(--lab-line);
}

.pcell .p-fav,
.pcell .p-del {
  width: 28px;
  height: 28px;
  border: 1px solid var(--lab-line);
  background: var(--lab-surface);
  color: var(--lab-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
  transition: background-color .15s, border-color .15s;
}

.pcell .p-fav:hover,
.pcell .p-del:hover {
  background: var(--lab-surface2);
  border-color: var(--lab-line-strong);
}

.pcell .p-fav.on {
  color: var(--heart);
}

.padd {
  border: 1.5px dashed var(--lab-line-strong);
  border-radius: 8px;
  background: var(--lab-bg);
  color: var(--lab-muted);
  transition: border-color .15s, color .15s, background-color .15s;
}

.padd:hover {
  border-color: var(--lab-text);
  color: var(--lab-text);
  background: var(--lab-surface2);
}

.padd:focus-within {
  outline: 2px solid var(--lab-accent);
  outline-offset: 2px;
}

/* plan import dialog */
.imp-h {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.imp-list {
  gap: 8px;
}

.imp-list .hint a {
  color: var(--teal);
  font-weight: 600;
  text-underline-offset: 3px;
}

.imp-item {
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 14px;
  border: 1px solid var(--lab-line);
  border-radius: 10px;
  background: var(--lab-bg);
  transition: border-color .15s, background-color .15s;
}

.imp-item:hover {
  border-color: var(--lab-line-strong);
  background: var(--lab-surface2);
}

.imp-item > span:first-child {
  flex: 1 1 170px;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.imp-item b {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.imp-item small {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--lab-muted);
  font-variant-numeric: tabular-nums;
}

.imp-item .go {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.imp-link {
  gap: 8px;
  align-items: stretch;
}

/* ---------- photo viewer (dialog.j-view) ---------- */
dialog.j-dlg.j-view {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #0b0b0c;
  color: #f2f2f2;
}

dialog.j-view::backdrop {
  background: #0b0b0c;
}

dialog.j-view :focus-visible {
  outline: 2px solid #ff8a4c;
  outline-offset: 2px;
}

.v-top {
  padding: 12px 14px;
  border-bottom: 1px solid #26262a;
  background: rgba(11, 11, 12, .9);
}

.v-bot {
  padding: 12px 14px;
  border-top: 1px solid #26262a;
  background: rgba(11, 11, 12, .9);
  gap: 8px;
}

.v-nav {
  border: 1px solid #444;
  background: rgba(20, 20, 22, .78);
  transition: background-color .15s, border-color .15s;
}

.v-nav:hover {
  background: rgba(42, 42, 48, .92);
  border-color: #707078;
}

.v-btn {
  height: auto;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--lab-radius);
  border: 1px solid #4a4a4f;
  background: #1b1b1e;
  color: #f2f2f2;
  transition: background-color .15s, border-color .15s, color .15s;
}

.v-btn:hover {
  background: #28282d;
  border-color: #707078;
}

.v-btn.on {
  color: #ff9eb0;
  border-color: #ff9eb0;
  background: #29181c;
}

.v-btn.armed {
  background: #ff8f86;
  border-color: #ff8f86;
  color: #111111;
}

.v-sel {
  height: 36px;
  flex: 1 1 140px;
  min-width: 0;
  max-width: 240px;
  border-radius: var(--lab-radius);
  border: 1px solid #4a4a4f;
  background: #1b1b1e;
  color: #f2f2f2;
  padding: 0 10px;
  font-size: 13.5px;
}

/* ---------- trip card (#/card) & shared card (#/c/<id>) ---------- */
.card-layout {
  gap: 20px;
  margin-top: 18px;
}

@media (min-width: 760px) {
  .card-layout {
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  .card-fig {
    position: sticky;
    top: 16px;
  }
}

.card-fig {
  border-radius: 14px;
  border: 1px solid var(--lab-line);
  background: var(--lab-surface2);
  box-shadow: var(--lab-shadow-sm);
}

.card-side {
  gap: 14px;
}

.card-side > p:not(.hint) {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--lab-text);
}

.card-side .fld input {
  background: var(--lab-surface);
}

.opt {
  min-height: 38px;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.opt input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  flex: none;
  cursor: pointer;
}

.share-box {
  padding: 16px;
  border: 1px solid var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
  box-shadow: var(--lab-shadow-sm);
  gap: 12px;
}

.share-box h2 {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.share-box .imp-link input[readonly] {
  font-family: var(--lab-mono);
  font-size: 13px;
  min-height: 38px;
  padding: 0 11px;
  background: var(--lab-bg);
  color: var(--lab-text);
}

.share-box .btn.danger:not(.armed) {
  border-color: color-mix(in srgb, var(--warn) 34%, var(--lab-line));
  background: var(--lab-surface);
}

.share-box .btn.danger:not(.armed):not(:disabled):hover {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 55%, transparent);
}

.cty-rows {
  gap: 8px;
}

.cty-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 168px) auto;
  gap: 8px 10px;
  padding: 10px 12px;
  border: 1px solid var(--lab-line);
  border-radius: 10px;
  background: var(--lab-bg);
}

.cty-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cty-row b {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.cty-row small {
  font-size: 12.5px;
  color: var(--lab-muted);
  line-height: 1.4;
}

.cty-row select {
  height: 34px;
  min-height: 34px;
  border: 1px solid var(--lab-line-strong);
  border-radius: var(--lab-radius);
  background: var(--lab-surface);
  color: var(--lab-text);
  padding: 0 8px;
  font-size: 13.5px;
  min-width: 0;
  max-width: 100%;
}

/* ---------- toast ---------- */
.j-toast {
  bottom: calc(20px + env(safe-area-inset-bottom));
  border-radius: var(--lab-radius);
  background: var(--lab-ink);
  color: var(--lab-on-ink);
  box-shadow: var(--lab-shadow-lg);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- mobile (<= 520px & 360px) ---------- */
@media (max-width: 520px) {
  .row2 {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .j-cover {
    width: 66px;
    height: 66px;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .v-nav {
    display: none;
  }

  .v-sel {
    max-width: 100%;
  }

  .cty-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cty-row > span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .j-wrap {
    padding: 16px 12px 72px;
  }

  .seg button {
    padding: 0 9px;
    font-size: 12.5px;
  }

  .dlg-head {
    padding: 14px 14px 12px 16px;
  }

  .dlg-body {
    padding: 16px;
    gap: 14px;
  }

  .dlg-foot {
    padding: 12px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .icon-btn,
  .j-card,
  .j-tabs button,
  .seg button,
  .ent,
  .chk,
  .stars button,
  .thumbs button,
  .chip,
  .grid button,
  .fld input,
  .fld select,
  .fld textarea,
  .imp-link input,
  .chips span,
  .cty-chip button,
  .pcell .p-fav,
  .pcell .p-del,
  .padd,
  .imp-item,
  .v-nav,
  .v-btn,
  .j-toast {
    transition: none;
  }
}
