:root {
  --atd-ink: #122033;
  --atd-muted: #5d6b7c;
  --atd-line: #e6ebf2;
  --atd-canvas: #f4f6f8;
  --atd-surface: #ffffff;
  --atd-board: #0e2744;
  --atd-chalk: #f4f0e6;
  --atd-chalk-dim: #c5d0dc;
  --atd-primary: #2f6bff;
  --atd-accent: #e07a2f;
  --atd-rail: 240px;
  --atd-font: "Jost", ui-sans-serif, system-ui, sans-serif;
}

body.atd-theme {
  margin: 0;
  background: var(--atd-canvas);
  color: var(--atd-ink);
  font-family: var(--atd-font);
  font-size: 16px;
  line-height: 1.5;
}

.atd-app { min-height: 100vh; }
.atd-rail {
  display: none;
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--atd-rail);
  background: var(--atd-board);
  color: var(--atd-chalk);
  padding: 20px 12px 28px;
  overflow: auto;
  z-index: 30;
}
.atd-brand { display: flex; flex-direction: column; padding: 4px 12px 18px; text-decoration: none; color: inherit; }
.atd-brand strong { font-size: 18px; letter-spacing: 0.08em; }
.atd-brand span { color: var(--atd-chalk-dim); font-size: 12px; }
.atd-rail a, .atd-rail button {
  display: flex;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--atd-chalk);
  text-decoration: none;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.atd-rail a:hover, .atd-rail a.is-on { background: rgba(255,255,255,0.1); }
.atd-rail p {
  margin: 16px 12px 4px;
  color: var(--atd-chalk-dim);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.atd-main { min-width: 0; }
.atd-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.94);
  border-bottom: 1px solid var(--atd-line);
}
.atd-top-brand { font-weight: 650; color: var(--atd-ink); text-decoration: none; }
.atd-content { width: min(1120px, calc(100% - 24px)); margin: 0 auto; padding: 18px 0 96px; }
.atd-tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--atd-surface);
  border-top: 1px solid var(--atd-line);
}
.atd-tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 10px;
  color: var(--atd-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}
.atd-kicker { margin: 0; color: var(--atd-primary); font-size: 14px; font-weight: 600; }
h1, h2, h3 { line-height: 1.2; font-weight: 650; }
.atd-hero h1, .atd-home h1 { margin: 4px 0 14px; font-size: clamp(28px, 5vw, 40px); max-width: 16ch; }
.atd-muted { color: var(--atd-muted); }
.atd-section { margin-top: 28px; }
.atd-section-head, .atd-card-title-row, .atd-stats article, .atd-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
}
.atd-section h2, .atd-archive h1, .atd-single h1, .atd-desk h1 { margin: 0 0 4px; }
.atd-text-link { color: var(--atd-primary); font-weight: 650; text-decoration: none; font-size: 14px; }
.atd-grid { display: grid; gap: 12px; }
.atd-grid-4, .atd-grid-5, .atd-grid-3, .atd-grid-2 { grid-template-columns: 1fr 1fr; }
.atd-card { min-width: 0; }
.atd-card-media { position: relative; border-radius: 14px; overflow: hidden; background: var(--atd-line); aspect-ratio: 5/4; }
.atd-card-media img, .atd-destination img, .atd-hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.atd-card-media a { position: absolute; inset: 0; }
.atd-card-fallback { display: grid; place-items: center; height: 100%; color: var(--atd-muted); }
.atd-heart {
  position: absolute; right: 8px; top: 8px; z-index: 1;
  width: 40px; height: 40px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,0.95); cursor: pointer;
}
.atd-heart svg { width: 18px; height: 18px; fill: none; stroke: var(--atd-ink); stroke-width: 1.8; }
.atd-heart.is-on svg { fill: var(--atd-accent); stroke: var(--atd-accent); }
.atd-badge { position: absolute; left: 8px; border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.atd-badge-sale { top: 8px; background: var(--atd-accent); color: white; }
.atd-badge-instant { bottom: 8px; background: rgba(18,32,51,0.82); color: var(--atd-chalk); }
.atd-card-body { padding-top: 8px; }
.atd-card-body a { color: var(--atd-ink); font-weight: 650; text-decoration: none; font-size: 14px; }
.atd-card-body p { margin: 2px 0; font-size: 14px; }
.atd-rating::before { content: "★ "; color: var(--atd-accent); }
.atd-verified { color: var(--atd-primary); font-weight: 650; }
.atd-price s { color: var(--atd-muted); margin-right: 4px; }
.atd-meta, .atd-fine { font-size: 12px; color: var(--atd-muted); }
.atd-shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.atd-shortcut {
  background: var(--atd-surface);
  border-radius: 14px;
  text-align: center;
  text-decoration: none;
  color: var(--atd-ink);
  font-size: 12px;
  font-weight: 650;
  padding: 14px 6px;
  box-shadow: 0 1px 0 rgba(18,32,51,0.04);
}
.atd-destination { display: block; background: var(--atd-surface); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; }
.atd-destination img { aspect-ratio: 4/3; }
.atd-destination span { display: block; padding: 8px 10px 10px; }
.atd-destination strong, .atd-destination em { display: block; font-style: normal; }
.atd-destination em { color: var(--atd-muted); font-size: 12px; }
.atd-panel, .atd-book-card, .atd-note, .atd-search, .atd-faq details {
  background: var(--atd-surface);
  border: 1px solid var(--atd-line);
  border-radius: 16px;
  padding: 14px;
}
.atd-note { background: var(--atd-board); color: var(--atd-chalk); border: 0; }
.atd-note h2 { color: inherit; }
.atd-search, .atd-panel form, .atd-sort { display: grid; gap: 10px; }
.atd-search label, .atd-panel label, .atd-sort label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.atd-panel input, .atd-panel textarea, .atd-panel select, .atd-sort input, .atd-sort select,
.login-username input, .login-password input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--atd-line);
  background: #fff;
  border-radius: 12px;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  color: var(--atd-ink);
}
.atd-btn, .atd-app .button, .atd-app button.button, .atd-app a.button, .login-submit input {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: var(--atd-board);
  color: var(--atd-chalk);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.atd-btn-block { width: 100%; }
.atd-btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.atd-search-flags, .atd-views, .atd-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.atd-check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.atd-check input { width: auto; min-height: 0; }
.atd-pills { list-style: none; padding: 0; }
.atd-pills li { border: 1px solid var(--atd-line); background: #fff; border-radius: 999px; padding: 6px 10px; font-size: 14px; }
.atd-single { display: grid; gap: 18px; }
.atd-hero-img { border-radius: 18px; aspect-ratio: 16/10; }
.atd-lines { list-style: none; padding: 0; margin: 0; }
.atd-lines li { padding: 8px 0; border-bottom: 1px solid var(--atd-line); }
.atd-reviews blockquote { margin: 0 0 12px; padding: 12px; background: #fff; border-radius: 14px; }
.atd-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.atd-stats article { background: #fff; border: 1px solid var(--atd-line); border-radius: 14px; padding: 12px; display: block; }
.atd-stats p { margin: 0; color: var(--atd-muted); font-size: 13px; }
.atd-stats strong { font-size: 20px; }
.atd-table-wrap { overflow-x: auto; }
.atd-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; font-size: 14px; }
.atd-table th, .atd-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--atd-line); vertical-align: top; }
.atd-map { position: relative; height: 320px; border-radius: 16px; background: #d7e4ea; margin: 12px 0; overflow: hidden; }
.atd-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  background: var(--atd-board);
  color: var(--atd-chalk);
  text-decoration: none;
  font-size: 11px;
  border-radius: 999px;
  padding: 4px 8px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atd-search { display: block; }
.atd-type-row { display: flex; gap: 6px; overflow: auto; margin: 0 0 10px; padding-bottom: 2px; }
.atd-type-row label {
  position: relative;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 650;
  color: var(--atd-muted);
  cursor: pointer;
}
.atd-type-row input { position: absolute; opacity: 0; pointer-events: none; }
.atd-type-row label:has(input:checked) { background: var(--atd-board); color: var(--atd-chalk); }
.atd-search-row { display: grid; gap: 10px; }
.atd-search-flags { margin-top: 10px; }
.atd-card { min-width: 0; }
.atd-card-title-row { align-items: flex-start; min-width: 0; }
.atd-card-title-row a { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.atd-card-body { min-width: 0; }
.atd-card-body .atd-rating { flex: none; white-space: nowrap; }
.atd-shortcut { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.atd-shortcut svg { width: 22px; height: 22px; stroke: var(--atd-primary); fill: none; stroke-width: 1.8; }
.atd-top { justify-content: flex-start; gap: 12px; }
.atd-top-search {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 420px;
  min-height: 40px;
  margin-right: auto;
  padding: 0 14px;
  border: 1px solid var(--atd-line);
  border-radius: 999px;
  color: var(--atd-muted);
  text-decoration: none;
  font-size: 14px;
}
.atd-top-link { color: var(--atd-ink); text-decoration: none; font-size: 14px; font-weight: 650; white-space: nowrap; }
.atd-tabs { display: flex; gap: 8px; overflow: auto; margin: 12px 0 16px; padding-bottom: 2px; }
.atd-tabs a {
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--atd-ink);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 650;
}
.atd-tabs a.is-on { background: var(--atd-board); color: var(--atd-chalk); }
.atd-pending { color: var(--atd-accent); font-weight: 650; }
body.admin-bar .atd-rail { top: 32px; }
body.admin-bar .atd-top { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .atd-rail, body.admin-bar .atd-top { top: 46px; }
  .atd-top-link { display: none; }
}
@media (min-width: 900px) {
  .atd-search-row { grid-template-columns: 1.4fr 0.9fr 0.9fr 0.7fr auto; align-items: end; }
}

.atd-faq details { margin-top: 8px; }
.atd-faq summary { cursor: pointer; font-weight: 650; }
.atd-error { color: #9a3412; background: #fff4ed; border-radius: 12px; padding: 8px 10px; }
.atd-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.atd-sort { margin: 12px 0; grid-template-columns: 1fr; align-items: end; }
.atd-views a { text-decoration: none; color: var(--atd-ink); background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 650; }
.atd-views a.is-on { background: var(--atd-board); color: var(--atd-chalk); }
.nav-links { display: flex; gap: 8px; list-style: none; padding: 12px 0; }
.nav-links a { color: var(--atd-primary); }
.atd-menu {
  position: fixed; inset: 0; z-index: 40; background: var(--atd-surface);
  padding: 16px; overflow: auto;
}
.atd-menu[hidden] { display: none; }
.atd-prose p { margin-top: 0; }

@media (min-width: 900px) {
  .atd-rail { display: block; }
  .atd-main { margin-left: var(--atd-rail); }
  .atd-tabbar, .atd-top-brand, .atd-mobile-only { display: none; }
  .atd-content { padding-bottom: 48px; }
  .atd-grid-4 { grid-template-columns: repeat(4, 1fr); }
  .atd-grid-5 { grid-template-columns: repeat(5, 1fr); }
  .atd-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .atd-grid-2 { grid-template-columns: 1fr 1fr; }
  .atd-shortcuts { grid-template-columns: repeat(8, 1fr); }
  .atd-single { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .atd-book { position: sticky; top: 76px; }
  .atd-sort { grid-template-columns: 180px 140px 1fr; }
  .atd-grid-list { grid-template-columns: 1fr; }
  .atd-grid-list .atd-card { display: grid; grid-template-columns: 220px 1fr; gap: 14px; }
}

@media (max-width: 899px) {
  .atd-search-row { grid-template-columns: 1fr 1fr; }
  .atd-search-row label:first-child, .atd-search-row .atd-btn { grid-column: 1 / -1; }
}

.atd-rail a, .atd-tabbar a, .atd-tabbar button {
  display: flex;
  align-items: center;
  gap: 10px;
}
.atd-tabbar a, .atd-tabbar button {
  flex-direction: column;
  gap: 2px;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: var(--atd-muted);
  padding: 8px 4px 10px;
}
.atd-ico { width: 16px; height: 16px; flex: 0 0 16px; color: var(--atd-chalk-dim); }
.atd-tabbar .atd-ico { width: 20px; height: 20px; flex-basis: 20px; color: currentColor; }
.atd-top-search { display: none; align-items: center; gap: 8px; }
.atd-top-search .atd-ico { color: var(--atd-primary); }
.atd-signin {
  background: transparent;
  border: 1px solid var(--atd-line);
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}
.atd-single-main h1 { font-size: clamp(28px, 4vw, 36px); margin: 2px 0 6px; }
.atd-meta-row { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 14px; color: var(--atd-muted); font-size: 14px; }
.atd-host { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.atd-host h2 { margin: 0; font-size: 22px; }
.atd-host-meta { margin: 4px 0 0; color: var(--atd-muted); font-size: 14px; }
.atd-host-meta span { display: block; }
.atd-host-about { margin: 12px 0 0; color: var(--atd-muted); line-height: 1.55; }
.atd-status-pill { flex: 0 0 auto; border-radius: 999px; background: #fff4ed; color: #9a3412; font-size: 12px; font-weight: 700; padding: 6px 10px; }
.atd-verified { flex: 0 0 auto; }
.atd-map-kicker { margin: 0 0 6px; letter-spacing: 0.16em; text-transform: uppercase; font-size: 11px; color: var(--atd-chalk-dim); }
.atd-map-note p { margin: 0 0 6px; }
.atd-review-name { margin: 0 0 6px; font-weight: 650; color: var(--atd-ink); }
.atd-cancel { margin-top: 8px; }
.atd-related { grid-template-columns: 1fr 1fr; }
.atd-book { display: grid; gap: 8px; }
.atd-cart-row { margin: 0; }
.atd-btn-ghost {
  width: 100%;
  background: #fff !important;
  color: var(--atd-ink) !important;
  border: 1px solid var(--atd-line) !important;
  border-radius: 999px !important;
}
.atd-book-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: 0 8px 24px rgba(18, 32, 51, 0.06);
}
.atd-book-price { margin: 4px 0 0; font-size: 28px; font-weight: 650; line-height: 1.1; }
.atd-book-price span { font-size: 16px; font-weight: 500; color: var(--atd-muted); }
.atd-book-vendor { margin: 2px 0 0; color: var(--atd-muted); font-size: 14px; }
.atd-book-note { margin: 10px 0 0; color: var(--atd-muted); font-size: 14px; line-height: 1.45; }
.atd-datebox {
  margin-top: 12px;
  border: 1px solid var(--atd-line);
  border-radius: 12px;
  padding: 8px 12px;
}
.atd-datebox > span { display: block; color: var(--atd-muted); font-size: 12px; }
.atd-date-inputs { display: flex; gap: 8px; }
.atd-datebox input[type="date"] {
  width: 100%;
  border: 0;
  background: transparent;
  min-height: 36px;
  padding: 0;
  font: inherit;
  color: var(--atd-ink);
}
.atd-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.atd-step p { margin: 0; }
.atd-step p:first-child { font-size: 14px; font-weight: 600; }
.atd-step p:last-child { font-size: 12px; color: var(--atd-muted); font-weight: 400; }
.atd-step-ctl { display: flex; align-items: center; gap: 8px; }
.atd-step-ctl span { width: 20px; text-align: center; font-size: 14px; }
.atd-book-card button.atd-step-btn {
  width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid var(--atd-line) !important;
  background: #fff !important;
  color: var(--atd-ink) !important;
  font-size: 18px !important;
  line-height: 1 !important;
  box-shadow: none !important;
}
.atd-addons { margin-top: 8px; }
.atd-addons > p { margin: 0 0 6px; font-size: 12px; color: var(--atd-muted); }
.atd-addon { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 500; margin: 6px 0; }
.atd-quote { list-style: none; margin: 8px 0 0; padding: 10px 0 0; border-top: 1px solid var(--atd-line); }
.atd-quote li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin: 4px 0; }
.atd-quote li span { color: var(--atd-muted); }
.atd-quote li.is-total { font-weight: 700; padding-top: 4px; }
.atd-quote li.is-total span { color: var(--atd-ink); }
.atd-pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.atd-pay-opt { position: relative; display: block; margin: 0; font-weight: 500; }
.atd-pay-opt input { position: absolute; opacity: 0; pointer-events: none; }
.atd-pay-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--atd-line);
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
  padding: 6px;
}
.atd-pay-opt input:checked + span { border-color: var(--atd-primary); background: rgba(47, 107, 255, 0.1); color: var(--atd-primary); font-weight: 650; }
.atd-book-card .atd-input, .atd-auth-form .atd-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
  border: 1px solid var(--atd-line);
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  color: var(--atd-ink);
  background: #fff;
}
.atd-book-card textarea.atd-input { min-height: 80px; resize: vertical; }
.atd-due { margin: 10px 0 0; font-size: 14px; }
.atd-book-card .atd-btn-book, .atd-auth-form .atd-btn-book {
  width: 100%;
  margin-top: 14px;
  min-height: 48px;
  border-radius: 12px !important;
  background: var(--atd-primary) !important;
  color: #fff !important;
}
.atd-auth {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 39, 68, 0.55);
}
.atd-auth[hidden] { display: none; }
.atd-auth-card {
  position: relative;
  width: min(440px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 22px 20px 18px;
  box-shadow: 0 24px 60px rgba(8, 20, 40, 0.28);
}
.atd-auth-inline { margin-top: 12px; }
.atd-auth-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--atd-line);
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.atd-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 4px; }
.atd-auth-tabs button {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--atd-line);
  background: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.atd-auth-tabs button.is-on { background: var(--atd-board); color: var(--atd-chalk); border-color: var(--atd-board); }
.atd-check { display: flex !important; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; font-weight: 500; }
.atd-check input { width: auto; min-height: 0; }
.atd-menu { background: var(--atd-board); color: var(--atd-chalk); }
.atd-menu a { display: flex; align-items: center; gap: 10px; color: var(--atd-chalk); text-decoration: none; padding: 10px 12px; border-radius: 10px; }
.atd-menu p { margin: 16px 12px 4px; color: var(--atd-chalk-dim); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.atd-menu .atd-brand, .atd-menu .atd-brand strong { color: var(--atd-chalk); }

@media (min-width: 900px) {
  .atd-top-search { display: flex; }
  .atd-related { grid-template-columns: 1fr 1fr; }
}
