@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;700&family=Nunito:wght@500;600;700;800&display=swap");

:root {
  --basau-red: #9b1c1c;
  --basau-red-deep: #6e1212;
  --basau-red-dark: #4a0c0c;
  --basau-orange: #f0a030;
  --basau-orange-bright: #ffc04d;
  --basau-cream: #fff4e8;
  --basau-cream-muted: #f5e6d3;
  --basau-ink: #2a0a0a;

  --bg: var(--basau-red-deep);
  --surface: rgba(255, 244, 232, 0.97);
  --surface-2: rgba(245, 230, 211, 0.9);
  --text: var(--basau-ink);
  --text-on-red: var(--basau-cream);
  --muted: #6b4a3a;
  --accent: var(--basau-orange);
  --accent-hover: var(--basau-orange-bright);
  --green: #1a7a42;
  --yellow: #b8860b;
  --red: #c41e1e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(42, 10, 10, 0.28);
  --shadow-soft: 0 4px 20px rgba(42, 10, 10, 0.12);
  --font: "Nunito", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-on-red);
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(240, 160, 48, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(155, 28, 28, 0.5), transparent 50%),
    linear-gradient(165deg, var(--basau-red) 0%, var(--basau-red-deep) 45%, var(--basau-red-dark) 100%);
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: -1;
}

a {
  color: var(--basau-orange-bright);
  text-decoration: none;
  transition: color 160ms ease;
}

a:hover {
  color: var(--basau-cream);
}

/* —— Brand —— */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand:hover {
  text-decoration: none;
  color: inherit;
}

.brand__logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.brand__logo--lg {
  width: min(200px, 55vw);
  height: auto;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--basau-orange);
  text-transform: lowercase;
}

.brand__tag {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--basau-cream);
  opacity: 0.92;
}

.chopstick-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
  opacity: 0.7;
}

.chopstick-divider::before,
.chopstick-divider::after {
  content: "";
  height: 3px;
  width: 28px;
  background: var(--basau-cream);
  border-radius: 2px;
}

.chopstick-divider span {
  width: 4px;
  height: 4px;
  background: var(--basau-orange);
  border-radius: 50%;
}

/* —— Header —— */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid rgba(255, 244, 232, 0.12);
  background: rgba(74, 12, 12, 0.55);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-header__nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.app-header__back {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--basau-orange);
  opacity: 0.9;
}

.app-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--basau-cream);
}

.app-header__subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 244, 232, 0.65);
  font-weight: 600;
}

/* —— Badges —— */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--green {
  background: rgba(26, 122, 66, 0.15);
  color: var(--green);
  border: 1px solid rgba(26, 122, 66, 0.25);
}

.badge--yellow {
  background: rgba(184, 134, 11, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(184, 134, 11, 0.3);
}

.badge--red {
  background: rgba(196, 30, 30, 0.12);
  color: var(--red);
  border: 1px solid rgba(196, 30, 30, 0.35);
}

.badge--red.risk-pulse {
  box-shadow: 0 0 0 0 rgba(196, 30, 30, 0.4);
}

.badge--ops {
  background: rgba(240, 160, 48, 0.2);
  color: var(--basau-orange-bright);
  border: 1px solid rgba(240, 160, 48, 0.35);
}

/* —— Layout —— */
.layout {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem clamp(1rem, 4vw, 2rem) 2.5rem;
  max-width: 1320px;
  margin: 0 auto;
}

.layout--admin {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  align-items: start;
}

@media (max-width: 960px) {
  .layout--admin {
    grid-template-columns: 1fr;
  }
}

/* —— Cards —— */
.card {
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(240, 160, 48, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.card--sticky {
  position: sticky;
  top: 5.5rem;
}

/* —— Stats —— */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  border: 1px solid rgba(240, 160, 48, 0.15);
}

.stat__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--basau-red);
  line-height: 1.2;
}

.stat__label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat--red .stat__value {
  color: var(--red);
}

.stat--yellow .stat__value {
  color: var(--yellow);
}

.stat--green .stat__value {
  color: var(--green);
}

/* —— Order list —— */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.order-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--surface-2);
  transition:
    transform 200ms cubic-bezier(0.2, 0, 0, 1),
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.order-row:hover {
  transform: translateX(4px);
  border-color: rgba(240, 160, 48, 0.45);
  box-shadow: var(--shadow-soft);
}

.order-row.is-selected {
  border-color: var(--basau-orange);
  background: #fff9f2;
  box-shadow: 0 0 0 1px var(--basau-orange), var(--shadow-soft);
}

.order-row__title {
  font-weight: 800;
  color: var(--basau-ink);
  font-size: 0.95rem;
}

.order-row__meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 0.15rem;
}

.order-row__code {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--basau-red);
  background: rgba(155, 28, 28, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  max-width: 120px;
  text-align: right;
  word-break: break-word;
}

/* —— Detail panel —— */
.detail-hero {
  padding: 1rem;
  background: linear-gradient(135deg, var(--basau-red) 0%, var(--basau-red-deep) 100%);
  border-radius: var(--radius-sm);
  color: var(--basau-cream);
  margin-bottom: 1rem;
}

.detail-hero__id {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0.35rem 0 0;
}

.action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  border-left: 3px solid var(--basau-orange);
}

.action-list li::before {
  content: "⚡";
  font-size: 0.85rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.meta-item {
  background: var(--surface-2);
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

.meta-item strong {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

/* —— Audit —— */
.audit-line {
  font-size: 0.82rem;
  padding: 0.45rem 0 0.45rem 0.85rem;
  border-left: 3px solid var(--basau-orange);
  margin-bottom: 0.4rem;
  color: var(--text);
  font-weight: 600;
  background: linear-gradient(90deg, rgba(240, 160, 48, 0.08), transparent);
  border-radius: 0 8px 8px 0;
}

/* —— Chat —— */
.chat-thread {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
  display: flex;
  flex-direction: column;
}

.admin-chat-thread {
  max-height: 280px;
  min-height: 120px;
  background: #fffbf7;
  border-radius: 12px;
  padding: 0.65rem;
  border: 1px solid rgba(240, 160, 48, 0.2);
}

.chat-bubble {
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}

.chat-bubble small {
  display: block;
  font-size: 0.68rem;
  opacity: 0.65;
  margin-bottom: 0.25rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Khách — phải */
.chat-bubble--customer {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 14px 14px 4px 14px;
}

/* Bot / nhân viên — trái */
.chat-bubble--bot {
  align-self: flex-start;
  margin-right: auto;
  margin-left: 0;
  background: rgba(155, 28, 28, 0.08);
  color: var(--basau-red-deep);
  border-radius: 14px 14px 14px 4px;
}

.chat-bubble--admin {
  align-self: flex-start;
  margin-right: auto;
  margin-left: 0;
  background: linear-gradient(135deg, var(--basau-orange), var(--basau-orange-bright));
  color: var(--basau-ink);
  border-radius: 14px 14px 14px 4px;
  box-shadow: var(--shadow-soft);
}

/* Admin ops: khách trái, nhân viên phải */
.admin-chat-thread .chat-bubble--customer {
  align-self: flex-start;
  margin-left: 0;
  margin-right: auto;
  border-radius: 14px 14px 14px 4px;
}

.admin-chat-thread .chat-bubble--admin {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0;
  border-radius: 14px 14px 4px 14px;
}

.admin-chat-thread .chat-bubble--bot {
  align-self: flex-start;
  margin-left: 0;
  margin-right: auto;
}

.admin-end-chat-btn {
  width: 100%;
  margin-top: 0.65rem;
  font-size: 0.82rem;
}

.admin-end-chat-btn[hidden] {
  display: none !important;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 10, 10, 0.45);
}

.admin-modal__card {
  position: relative;
  z-index: 1;
  width: min(100%, 22rem);
  padding: 1.25rem 1.35rem;
  border-radius: 14px;
  background: #fffbf7;
  border: 1px solid rgba(155, 28, 28, 0.15);
  box-shadow: var(--shadow-soft);
}

.admin-modal__card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--basau-red-deep);
}

.admin-modal__text {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.admin-modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.admin-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.admin-notifications {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.admin-notif-card {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(196, 30, 30, 0.25);
  border-radius: 10px;
  background: rgba(196, 30, 30, 0.06);
  cursor: pointer;
  font-family: var(--font);
}

.admin-notif-card strong {
  display: block;
  color: var(--basau-red-deep);
}

.admin-notif-card__meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.order-row__chat-flag {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
}

.admin-chat-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.admin-chat-input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 2px solid rgba(155, 28, 28, 0.12);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-chat-send {
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
}

.audit-log-live {
  max-height: 160px;
  overflow-y: auto;
}

.admin-audit-hint {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

/* —— Delivery journey (customer) —— */
.delivery-journey {
  margin: 0.85rem 0 0.65rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 251, 247, 0.9);
  border: 1px solid rgba(240, 160, 48, 0.22);
}

.delivery-journey__bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(155, 28, 28, 0.1);
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.delivery-journey__fill {
  height: 100%;
  width: var(--progress, 20%);
  background: linear-gradient(90deg, var(--basau-red), var(--basau-orange));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.delivery-journey__steps {
  display: flex;
  justify-content: space-between;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.journey-step {
  flex: 1;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--muted);
}

.journey-step__dot {
  display: block;
  width: 8px;
  height: 8px;
  margin: 0 auto 0.2rem;
  border-radius: 50%;
  background: rgba(155, 28, 28, 0.2);
}

.journey-step--active .journey-step__dot {
  background: var(--basau-orange);
  box-shadow: 0 0 0 3px rgba(240, 160, 48, 0.35);
}

.journey-step--done .journey-step__dot {
  background: rgba(155, 28, 28, 0.35);
}

.delivery-journey--white .journey-step--done .journey-step__dot {
  background: rgba(100, 100, 100, 0.4);
}

.delivery-journey--white .journey-step--active .journey-step__dot {
  background: #c8c0b8;
  box-shadow: 0 0 0 3px rgba(200, 192, 184, 0.45);
}

.delivery-journey--orange .journey-step--done .journey-step__dot,
.delivery-journey--orange .journey-step--active .journey-step__dot {
  background: var(--basau-orange);
  box-shadow: 0 0 0 3px rgba(240, 160, 48, 0.35);
}

.delivery-journey--yellow .journey-step--done .journey-step__dot {
  background: rgba(201, 160, 32, 0.75);
}

.delivery-journey--yellow .journey-step--active .journey-step__dot {
  background: #c9a020;
  box-shadow: 0 0 0 3px rgba(201, 160, 32, 0.35);
}

.delivery-journey--green .journey-step--done .journey-step__dot,
.delivery-journey--green .journey-step--active .journey-step__dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(26, 122, 66, 0.35);
}

.delivery-journey--cancelled .journey-step--done .journey-step__dot,
.delivery-journey--cancelled .journey-step--active .journey-step__dot {
  background: #888;
}

.journey-step--active {
  color: var(--basau-red-deep);
}

.journey-step--done .journey-step__label {
  color: var(--basau-ink);
}

.journey-step__label {
  display: block;
  font-size: 0.58rem;
  line-height: 1.25;
  margin-top: 0.1rem;
}

.delivery-journey__hint {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.merchant-contact {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(155, 28, 28, 0.1);
}

.merchant-contact__title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.merchant-contact__name {
  margin: 0;
  font-weight: 800;
  color: var(--basau-red-deep);
}

.merchant-contact__link {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 700;
  color: var(--basau-red);
  text-decoration: none;
}

.merchant-contact__addr {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.order-edit-block {
  margin: 0.35rem 0 0.5rem;
}

.order-edit-block__hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.order-edit-block--locked {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  padding: 0.5rem 0;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  background: linear-gradient(180deg, var(--basau-orange-bright), var(--basau-orange));
  color: var(--basau-ink);
  box-shadow: 0 4px 0 var(--basau-red-deep), var(--shadow-soft);
  transition:
    transform 160ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 160ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--basau-red-deep), var(--shadow);
}

.btn--ghost {
  background: var(--surface);
  color: var(--basau-red);
  border: 2px solid rgba(155, 28, 28, 0.2);
  box-shadow: none;
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--basau-orange);
  background: #fff9f2;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.select-basau {
  appearance: none;
  padding: 0.55rem 2rem 0.55rem 0.85rem;
  border-radius: 999px;
  border: 2px solid rgba(240, 160, 48, 0.4);
  background: rgba(255, 244, 232, 0.12)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23fff4e8'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E")
    no-repeat right 0.75rem center;
  color: var(--basau-cream);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.select-basau option {
  color: var(--basau-ink);
  background: var(--basau-cream);
}

/* —— Landing —— */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem clamp(1rem, 5vw, 3rem);
  text-align: center;
}

.landing__hero {
  max-width: 520px;
}

.landing__product {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--basau-cream);
  margin: 0.5rem 0 0;
  font-weight: 700;
}

.landing__product em {
  font-style: normal;
  color: var(--basau-orange-bright);
}

.landing__desc {
  margin: 1rem auto 0;
  max-width: 400px;
  color: rgba(255, 244, 232, 0.78);
  font-weight: 600;
  font-size: 0.95rem;
}

.landing__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
  width: min(640px, 100%);
}

.landing__card {
  position: relative;
  padding: 1.75rem 1.5rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid rgba(240, 160, 48, 0.35);
  border-radius: var(--radius);
  text-align: left;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition:
    transform 280ms cubic-bezier(0.2, 0, 0, 1),
    border-color 200ms ease,
    box-shadow 280ms ease;
}

.landing__card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--basau-orange), var(--basau-orange-bright));
}

.landing__card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--basau-orange);
  box-shadow: 0 20px 50px rgba(42, 10, 10, 0.35);
  text-decoration: none;
  color: var(--text);
}

.landing__card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.landing__card strong {
  display: block;
  font-size: 1.15rem;
  color: var(--basau-red);
}

.landing__card p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.landing__card-arrow {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 800;
  color: var(--basau-orange);
  font-size: 0.9rem;
}

.landing__hint {
  margin-top: 2.5rem;
  font-size: 0.8rem;
  color: rgba(255, 244, 232, 0.5);
  font-weight: 600;
}

.landing__hint code {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  color: var(--basau-orange-bright);
}

/* —— Customer recovery —— */
.recovery-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: max(5.5rem, calc(4.5rem + env(safe-area-inset-bottom, 0px)));
}

.recovery-phone {
  max-width: 420px;
  margin: 0 auto;
}

.recovery-card {
  overflow: hidden;
  padding: 0;
}

.recovery-card__banner {
  padding: 1rem 1.15rem 1.1rem;
  background: linear-gradient(160deg, var(--basau-red) 0%, var(--basau-red-deep) 70%);
  color: var(--basau-cream);
  text-align: left;
}

.recovery-banner__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.65rem;
  margin-bottom: 0.85rem;
  text-align: center;
}

.recovery-banner__title {
  margin: 0;
  font-weight: 800;
  font-size: 0.95rem;
  opacity: 0.95;
  flex: 1 1 auto;
  min-width: 5rem;
}

.recovery-card__banner .brand__logo {
  width: 48px;
  height: 48px;
  margin: 0;
  flex-shrink: 0;
}

.recovery-banner__facts {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(255, 251, 247, 0.12);
}

.recovery-banner__row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 38%) 1fr;
  gap: 0.35rem 0.65rem;
  align-items: start;
  padding: 0.4rem 0;
}

.recovery-banner__row + .recovery-banner__row {
  border-top: 1px solid rgba(255, 251, 247, 0.1);
}

.recovery-banner__row dt {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.82;
}

.recovery-banner__row dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--basau-cream);
}

.recovery-banner__order-id {
  font-weight: 800;
  margin-right: 0.35rem;
}

.recovery-card__banner .badge {
  font-size: 0.62rem;
  vertical-align: middle;
  background: rgba(255, 251, 247, 0.2);
  color: var(--basau-cream);
  border-color: rgba(255, 251, 247, 0.35);
}

.recovery-card__banner .badge--green {
  background: rgba(26, 122, 66, 0.45);
  color: #e8fff0;
}

.recovery-card__banner .badge--yellow {
  background: rgba(184, 134, 11, 0.45);
  color: #fff8e6;
}

.recovery-card__banner .badge--red {
  background: rgba(255, 200, 120, 0.35);
  color: #fff5eb;
  border-color: rgba(255, 220, 160, 0.5);
}

/* Banner theo giai đoạn timeline (status) */
.recovery-card__banner--ordered {
  background: linear-gradient(165deg, #fffdfb 0%, #f7f0e8 45%, #efe4d8 100%);
  color: var(--basau-ink);
}

.recovery-card__banner--ordered .recovery-banner__facts {
  background: rgba(42, 10, 10, 0.05);
  border-color: rgba(42, 10, 10, 0.08);
}

.recovery-card__banner--ordered .recovery-banner__row dt {
  opacity: 0.62;
  color: var(--basau-ink);
}

.recovery-card__banner--ordered .recovery-banner__row dd {
  color: var(--basau-ink);
}

.recovery-card__banner--ordered .recovery-banner__row + .recovery-banner__row {
  border-top-color: rgba(42, 10, 10, 0.08);
}

.recovery-card__banner--ordered .badge--status-white {
  background: rgba(255, 255, 255, 0.85);
  color: var(--basau-ink);
  border-color: rgba(42, 10, 10, 0.12);
}

.recovery-card__banner--confirmed {
  background: linear-gradient(160deg, #ffc96a 0%, var(--basau-orange) 50%, #d97812 100%);
  color: var(--basau-ink);
}

.recovery-card__banner--confirmed .recovery-banner__facts {
  background: rgba(42, 10, 10, 0.08);
  border-color: rgba(42, 10, 10, 0.12);
}

.recovery-card__banner--confirmed .recovery-banner__row dt,
.recovery-card__banner--confirmed .recovery-banner__row dd {
  color: var(--basau-ink);
}

.recovery-card__banner--confirmed .badge--status-orange {
  background: rgba(255, 255, 255, 0.35);
  color: var(--basau-ink);
  border-color: rgba(42, 10, 10, 0.15);
}

.recovery-card__banner--active {
  background: linear-gradient(160deg, #f0d86a 0%, #d4b020 48%, #a88408 100%);
  color: var(--basau-ink);
}

.recovery-card__banner--active .recovery-banner__facts {
  background: rgba(42, 10, 10, 0.1);
  border-color: rgba(42, 10, 10, 0.14);
}

.recovery-card__banner--active .recovery-banner__row dt,
.recovery-card__banner--active .recovery-banner__row dd {
  color: var(--basau-ink);
}

.recovery-card__banner--active .badge--status-yellow {
  background: rgba(255, 255, 255, 0.32);
  color: #3d2e00;
  border-color: rgba(61, 46, 0, 0.18);
}

.recovery-card__banner--cancelled {
  background: linear-gradient(160deg, #6b6b6b 0%, #454545 55%, #2e2e2e 100%);
  color: var(--basau-cream);
}

.recovery-card__banner--cancelled .badge--status-cancelled {
  background: rgba(255, 255, 255, 0.15);
  color: var(--basau-cream);
  border-color: rgba(255, 255, 255, 0.25);
}

.badge--status-white,
.badge--status-orange,
.badge--status-yellow,
.badge--status-cancelled {
  font-size: 0.62rem;
  font-weight: 800;
}

.recovery-card__banner--success .recovery-banner__facts,
.recovery-card__banner--warning .recovery-banner__facts {
  background: rgba(0, 0, 0, 0.1);
}

.recovery-card__body {
  padding: 1.25rem;
}

.recovery-message {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
  padding: 1rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--basau-orange);
}

.recovery-merchant {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--basau-red);
  margin: 0.5rem 0 0;
  font-weight: 700;
}

.recovery__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0 1.25rem 1.25rem;
}

.recovery__actions .btn {
  width: 100%;
}

.speed-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: var(--basau-orange);
  color: var(--basau-ink);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.speed-tag::before,
.speed-tag::after {
  content: "—";
  opacity: 0.5;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-weight: 600;
}

/* —— Customer: completed (Green) —— */
.recovery-message--success {
  border-left-color: var(--green);
  background: rgba(26, 122, 66, 0.08);
}

.recovery-message--warning {
  border-left-color: var(--yellow);
  background: rgba(184, 134, 11, 0.1);
}

.recovery-message--danger {
  border-left-color: var(--red);
  background: rgba(196, 30, 30, 0.08);
}

.recovery-message--neutral {
  border-left-color: var(--basau-orange);
  background: rgba(240, 160, 48, 0.08);
}

.recovery-message--muted {
  border-left-color: #888;
  background: rgba(100, 100, 100, 0.08);
  color: var(--muted);
}

.rating-block {
  margin-top: 1.25rem;
}

.rating-block__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.65rem;
}

.rating-stars {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
}

.star-btn {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(240, 160, 48, 0.35);
  border-radius: 12px;
  background: var(--surface);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: rgba(107, 74, 58, 0.35);
  transition:
    transform 160ms cubic-bezier(0.2, 0, 0, 1),
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.star-btn:hover {
  transform: scale(1.08);
  border-color: var(--basau-orange);
}

.star-btn.is-active {
  color: var(--basau-orange);
  border-color: var(--basau-orange);
  background: #fff9f2;
  box-shadow: var(--shadow-soft);
}

.feedback-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.feedback-input {
  width: 100%;
  min-height: 72px;
  padding: 0.75rem 0.85rem;
  border: 2px solid rgba(155, 28, 28, 0.15);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  resize: vertical;
  color: var(--text);
  background: var(--surface);
  transition: border-color 160ms ease;
}

.feedback-input:focus {
  outline: none;
  border-color: var(--basau-orange);
}

.feedback-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.toast {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  background: rgba(26, 122, 66, 0.12);
  color: var(--green);
  border: 1px solid rgba(26, 122, 66, 0.25);
}

.toast[hidden] {
  display: none;
}

.recovery-card__banner--success {
  background: linear-gradient(160deg, #1a7a42 0%, #1a5c38 55%, var(--basau-red-deep) 100%);
}

.recovery-card__banner--warning {
  background: linear-gradient(160deg, #8a6a12 0%, var(--basau-red-deep) 100%);
}

/* —— Chat widget (FAB + panel) —— */
.chat-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 200;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--basau-orange-bright), var(--basau-orange));
  color: var(--basau-ink);
  box-shadow: 0 6px 24px rgba(240, 160, 48, 0.45);
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1);
}

.chat-fab:hover {
  transform: scale(1.06);
}

.chat-fab svg {
  width: 28px;
  height: 28px;
}

.chat-fab__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--red);
  border: 2px solid var(--basau-cream);
  border-radius: 50%;
}

.chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(42, 10, 10, 0.45);
  backdrop-filter: blur(4px);
}

.chat-backdrop[hidden],
.chat-panel[hidden] {
  display: none;
}

.chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  z-index: 220;
  width: min(360px, calc(100vw - 2rem));
  max-height: min(520px, calc(100vh - 7rem));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  border: 2px solid rgba(240, 160, 48, 0.35);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--basau-red), var(--basau-red-deep));
  color: var(--basau-cream);
}

.chat-panel__head strong {
  display: block;
  font-size: 0.95rem;
}

.chat-panel__head small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  opacity: 0.9;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chat-panel__close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 244, 232, 0.15);
  color: var(--basau-cream);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.chat-panel__close:hover {
  background: rgba(255, 244, 232, 0.28);
}

.chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  min-height: 220px;
  max-height: 340px;
  background: #fffbf7;
  display: flex;
  flex-direction: column;
}

.chat-widget__bubble {
  max-width: 88%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
}

.chat-widget__bubble small {
  display: block;
  font-size: 0.65rem;
  opacity: 0.65;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  font-weight: 700;
}

/* Bot / nhân viên — bên trái */
.chat-widget__bubble--bot {
  align-self: flex-start;
  margin-right: auto;
  margin-left: 0;
  background: rgba(155, 28, 28, 0.08);
  color: var(--basau-red-deep);
  border-radius: 12px 12px 12px 4px;
}

.chat-widget__bubble--admin {
  align-self: flex-start;
  margin-right: auto;
  margin-left: 0;
  background: linear-gradient(135deg, var(--basau-orange), var(--basau-orange-bright));
  color: var(--basau-ink);
  border-radius: 12px 12px 12px 4px;
}

/* Khách — bên phải */
.chat-widget__bubble--customer {
  align-self: flex-end;
  margin-left: auto;
  margin-right: 0;
  background: var(--surface-2);
  border-radius: 12px 12px 4px 12px;
}

.chat-widget__bubble--system {
  align-self: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 92%;
  text-align: center;
  background: rgba(155, 28, 28, 0.06);
  color: var(--basau-red-deep);
  border-radius: 10px;
  font-style: italic;
  font-weight: 700;
}

.chat-widget__typing {
  align-self: flex-start;
  margin-right: auto;
  margin-left: 0;
  padding: 0.5rem 0.65rem;
  background: var(--surface-2);
  border-radius: 12px;
  color: var(--basau-orange);
}

.chat-panel__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(240, 160, 48, 0.2);
  background: var(--surface);
}

.chat-panel__input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 2px solid rgba(155, 28, 28, 0.12);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
}

.chat-panel__input:focus {
  outline: none;
  border-color: var(--basau-orange);
}

.chat-panel__send {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  background: linear-gradient(180deg, var(--basau-orange-bright), var(--basau-orange));
  color: var(--basau-ink);
}

.chat-panel__send:disabled,
.chat-panel__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1rem 0.65rem;
}

.chat-quick-replies[hidden] {
  display: none !important;
}

.chat-quick-reply {
  border: 1px solid rgba(232, 93, 44, 0.35);
  background: rgba(255, 248, 240, 0.95);
  color: var(--basau-ink);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.chat-quick-reply:hover {
  background: rgba(232, 93, 44, 0.12);
}

.chat-widget__typing-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.chat-offline-hint {
  margin: 0 1rem 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(232, 93, 44, 0.08);
  border: 1px dashed rgba(232, 93, 44, 0.35);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.chat-offline-hint code {
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.05);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

@media (max-width: 480px) {
  .chat-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }
}

/* —— Customer responsive —— */
.recovery-page .layout.recovery-phone {
  width: 100%;
}

/* Tablet+ */
@media (min-width: 640px) {
  .recovery-phone {
    max-width: 440px;
  }
}

@media (min-width: 900px) {
  .recovery-page .layout.recovery-phone {
    max-width: 480px;
    padding-top: 1.75rem;
  }

  .recovery-page .recovery-card {
    box-shadow: 0 16px 48px rgba(42, 10, 10, 0.22);
  }
}

/* Mobile header + picker */
@media (max-width: 639px) {
  .recovery-page .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
  }

  .recovery-page .app-header .brand {
    min-width: 0;
  }

  .recovery-page .app-header .select-basau {
    width: 100%;
    max-width: none;
    font-size: 0.82rem;
  }
}

/* Banner facts — stack on narrow screens */
@media (max-width: 380px) {
  .recovery-page .recovery-banner__row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .recovery-page .recovery-banner__row dt {
    font-size: 0.64rem;
  }

  .recovery-page .recovery-banner__row dd {
    font-size: 0.8rem;
  }

  .recovery-page .recovery-card__banner {
    padding: 0.85rem 0.9rem 0.95rem;
  }

  .recovery-page .recovery-banner__brand {
    gap: 0.35rem 0.5rem;
  }

  .recovery-page .recovery-card__banner .brand__logo {
    width: 40px;
    height: 40px;
  }
}

/* Timeline — scroll ngang trên mobile */
@media (max-width: 520px) {
  .recovery-page .delivery-journey {
    padding: 0.65rem 0.5rem;
  }

  .recovery-page .delivery-journey__steps {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    gap: 0.35rem;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
  }

  .recovery-page .delivery-journey__steps::-webkit-scrollbar {
    display: none;
  }

  .recovery-page .journey-step {
    flex: 0 0 auto;
    min-width: 3.75rem;
    max-width: 4.5rem;
    scroll-snap-align: start;
    font-size: 0.58rem;
  }

  .recovery-page .journey-step__label {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
  }

  .recovery-page .delivery-journey__hint {
    font-size: 0.78rem;
  }
}

/* Card body + actions */
@media (max-width: 639px) {
  .recovery-page .layout {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    padding-bottom: 1.5rem;
    gap: 1rem;
  }

  .recovery-page .recovery-card__body {
    padding: 1rem;
  }

  .recovery-page .recovery__actions {
    padding: 0 1rem 1rem;
  }

  .recovery-page .recovery-message {
    font-size: 0.94rem;
    padding: 0.85rem;
  }

  .recovery-page .merchant-contact__addr {
    font-size: 0.78rem;
    word-break: break-word;
  }

  .recovery-page .star-btn {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.65rem;
  }

  .recovery-page .btn,
  .recovery-page .chat-panel__send {
    min-height: 44px;
  }
}

/* Chat — bottom sheet mobile */
@media (max-width: 639px) {
  .recovery-page .chat-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: min(92dvh, 720px);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .recovery-page .chat-panel__messages {
    min-height: 36dvh;
    max-height: none;
    flex: 1 1 auto;
  }

  .recovery-page .chat-panel__form {
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
  }

  .recovery-page .chat-panel__input {
    font-size: 16px; /* tránh zoom iOS */
  }

  .recovery-page .chat-quick-replies {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
  }

  .recovery-page .chat-quick-replies::-webkit-scrollbar {
    display: none;
  }

  .recovery-page .chat-quick-reply {
    flex: 0 0 auto;
    white-space: nowrap;
    max-width: 85vw;
  }

  .recovery-page .chat-fab {
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    width: 54px;
    height: 54px;
  }

  .recovery-page .chat-widget__bubble {
    max-width: 92%;
    font-size: 0.84rem;
  }
}

/* Landscape phone — chat không che nội dung */
@media (max-height: 520px) and (orientation: landscape) {
  .recovery-page .chat-panel {
    max-height: 88dvh;
  }

  .recovery-page .chat-panel__messages {
    min-height: 28dvh;
  }
}

/* Reduced motion — giữ cuộn mượt */
@media (prefers-reduced-motion: reduce) {
  .recovery-page .delivery-journey__steps {
    scroll-behavior: auto;
  }
}

@media (max-width: 639px) {
  .policies-page .policy-card__hero,
  .policies-page .policy-card__body,
  .policies-page .policy-card__footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .policies-page .policy-card__title {
    font-size: 1.2rem;
  }

  .policies-page .policy-section__title {
    font-size: 0.95rem;
    flex-wrap: wrap;
  }
}

.policy-link {
  font-weight: 800;
  color: var(--basau-red);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.policy-link:hover,
.policy-link:focus-visible {
  color: var(--basau-red-deep);
}

.policy-card {
  overflow: hidden;
}

.policy-card__hero {
  padding: 1.25rem 1.25rem 0.75rem;
  background: linear-gradient(160deg, var(--basau-cream) 0%, #fff9f2 100%);
  border-bottom: 1px solid rgba(155, 28, 28, 0.08);
}

.policy-card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--basau-red);
  margin: 0 0 0.5rem;
  font-weight: 800;
}

.policy-card__lead {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
  font-weight: 600;
}

.policy-card__body {
  padding: 1rem 1.25rem 0.5rem;
}

.policy-card__footer {
  padding: 0 1.25rem 1.25rem;
}

.policy-toc {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--basau-orange);
}

.policy-toc__label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--basau-red);
}

.policy-toc__list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.7;
}

.policy-toc__list a {
  color: var(--basau-ink);
  text-decoration: none;
}

.policy-toc__list a:hover {
  color: var(--basau-red);
  text-decoration: underline;
}

.policy-section {
  margin-bottom: 1.5rem;
  scroll-margin-top: 5rem;
}

.policy-section__title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--basau-red);
  margin: 0 0 0.75rem;
  font-weight: 800;
}

.policy-section__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  font-size: 0.75rem;
  background: var(--basau-red);
  color: var(--basau-cream);
  border-radius: 6px;
}

.policy-subtitle {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--basau-ink);
  margin: 0 0 0.5rem;
}

.policy-block + .policy-block {
  margin-top: 1rem;
}

.policy-list {
  margin: 0 0 0.5rem;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text);
}

.policy-table-wrap {
  overflow-x: auto;
  margin-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.policy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-weight: 600;
}

.policy-table th,
.policy-table td {
  padding: 0.5rem 0.55rem;
  text-align: left;
  border: 1px solid rgba(155, 28, 28, 0.12);
  vertical-align: top;
}

.policy-table th {
  background: rgba(155, 28, 28, 0.06);
  color: var(--basau-red);
  font-weight: 800;
}

.policy-table tbody tr:nth-child(even) {
  background: rgba(255, 249, 242, 0.6);
}
