/* ==========================================================================
   Armada Residence — اكتشف الطائف / Discover Taif
   Brand system 2026: Armada Midnight, Armada Bronze, Warm Porcelain, Pure White
   ========================================================================== */

:root {
  /* Brand core */
  --midnight: #142A3B;
  --bronze: #A97C50;
  --porcelain: #F3EFE7;
  --white: #FFFFFF;

  /* Derived working tones (blends of the core palette only) */
  --ink: #142A3B;
  --ink-muted: #4B5B69;
  --ink-soft: #6B7885;
  --line: rgba(20, 42, 59, 0.12);
  --line-strong: rgba(20, 42, 59, 0.22);
  --bronze-line: rgba(169, 124, 80, 0.55);
  --bronze-wash: rgba(169, 124, 80, 0.08);
  --midnight-wash: rgba(20, 42, 59, 0.04);
  --shadow-card: 0 1px 2px rgba(20, 42, 59, 0.05), 0 10px 24px -18px rgba(20, 42, 59, 0.45);
  --shadow-lift: 0 2px 6px rgba(20, 42, 59, 0.07), 0 22px 40px -24px rgba(20, 42, 59, 0.5);

  /* Type */
  --font-ar: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Manrope", "Segoe UI", Helvetica, Arial, sans-serif;

  /* Rhythm */
  --shell: 1240px;
  --gutter: 20px;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 20px;
  --header-h: 62px;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; --header-h: 74px; }
}

/* --------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--porcelain);
  color: var(--ink);
  font-family: var(--font-ar);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

html[lang="en"] body { font-family: var(--font-en); line-height: 1.65; }

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -100px;
  z-index: 200;
  background: var(--midnight);
  color: var(--white);
  padding: 10px 18px;
  border-radius: var(--radius-s);
  text-decoration: none;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

/* Language visibility helpers */
html[lang="ar"] .en-only,
html[lang="en"] .ar-only { display: none !important; }

/* --------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(243, 239, 231, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand img { height: 30px; width: auto; }
@media (min-width: 768px) { .brand img { height: 38px; } }

.nav { margin-inline-start: auto; }

.nav-list { display: flex; align-items: center; gap: 26px; }

.nav-list a,
.nav-list button {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-muted);
  padding: 6px 0;
  position: relative;
  transition: color .18s ease;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.nav-list a::after,
.nav-list button::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: var(--bronze);
  transform: scaleX(0);
  transform-origin: inline-start;
  transition: transform .22s ease;
}
.nav-list a:hover,
.nav-list button:hover { color: var(--ink); }
.nav-list a:hover::after,
.nav-list button:hover::after { transform: scaleX(1); }

.header-tools { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
@media (min-width: 900px) { .header-tools { margin-inline-start: 26px; } }

.lang-switch {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
}

.lang-switch button {
  border: 0;
  background: transparent;
  padding: 0 14px;
  min-height: 36px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.lang-switch button:first-child { font-family: var(--font-ar); }
.lang-switch button:last-child { font-family: var(--font-en); }
.lang-switch button[aria-pressed="true"] { background: var(--midnight); color: var(--white); }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--white);
  cursor: pointer;
}
.menu-toggle svg { width: 18px; height: 18px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }

@media (min-width: 900px) { .menu-toggle { display: none; } }

@media (max-width: 899px) {
  .nav {
    position: fixed;
    inset-inline: 12px;
    top: calc(var(--header-h) + 8px);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-lift);
    padding: 8px;
    display: none;
  }
  .nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list a,
  .nav-list button {
    padding: 13px 14px;
    border-radius: var(--radius-s);
    font-size: 1rem;
    color: var(--ink);
    text-align: start;
    width: 100%;
    min-height: 44px;
  }
  .nav-list a::after,
  .nav-list button::after { display: none; }
  .nav-list a:hover,
  .nav-list button:hover { background: var(--midnight-wash); }
}

/* --------------------------------------------------------------- hero */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--midnight);
}
@media (min-width: 900px) { .hero { min-height: 74vh; } }

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top,
      rgba(20, 42, 59, 0.94) 0%,
      rgba(20, 42, 59, 0.86) 22%,
      rgba(20, 42, 59, 0.62) 46%,
      rgba(20, 42, 59, 0.28) 74%,
      rgba(20, 42, 59, 0.34) 100%);
}
html[dir="rtl"] .hero-veil { background-image:
  linear-gradient(to top, rgba(20,42,59,.94) 0%, rgba(20,42,59,.86) 22%, rgba(20,42,59,.62) 46%, rgba(20,42,59,.28) 74%, rgba(20,42,59,.34) 100%),
  linear-gradient(to right, transparent 34%, rgba(20,42,59,.5) 100%); }
html[dir="ltr"] .hero-veil { background-image:
  linear-gradient(to top, rgba(20,42,59,.94) 0%, rgba(20,42,59,.86) 22%, rgba(20,42,59,.62) 46%, rgba(20,42,59,.28) 74%, rgba(20,42,59,.34) 100%),
  linear-gradient(to left, transparent 34%, rgba(20,42,59,.5) 100%); }

.hero-contours {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 58%;
  z-index: -1;
  width: 100%;
  pointer-events: none;
  opacity: 1;
}
html[dir="rtl"] .hero-contours {
  -webkit-mask-image: linear-gradient(to left, transparent 4%, #000 42%);
  mask-image: linear-gradient(to left, transparent 4%, #000 42%);
}
html[dir="ltr"] .hero-contours {
  -webkit-mask-image: linear-gradient(to right, transparent 4%, #000 42%);
  mask-image: linear-gradient(to right, transparent 4%, #000 42%);
}
.hero-contours path {
  fill: none;
  stroke: var(--bronze);
  stroke-width: 1.3;
  stroke-linecap: round;
  opacity: 0.6;
}
.js .hero-contours path {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw-contour 2.6s cubic-bezier(.22,.61,.36,1) forwards;
}
.js .hero-contours path:nth-child(2) { animation-delay: .35s; }
.js .hero-contours path:nth-child(3) { animation-delay: .7s; }

@keyframes draw-contour { to { stroke-dashoffset: 0; } }

.hero-body {
  position: relative;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(38px, 7vw, 74px);
  color: var(--white);
}

.hero-mark {
  width: 34px;
  height: auto;
  margin-bottom: 20px;
  opacity: .95;
}

.hero h1 {
  font-family: var(--font-ar);
  font-size: clamp(2.4rem, 9vw, 4.4rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.hero .hero-title-en {
  font-family: var(--font-en);
  font-size: clamp(1rem, 3.4vw, 1.35rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 16px;
}
html[lang="en"] .hero h1 { font-family: var(--font-en); font-size: clamp(2.2rem, 8vw, 4rem); }
html[lang="en"] .hero .hero-title-en { font-family: var(--font-ar); letter-spacing: 0; }

.hero-lede {
  max-width: 34ch;
  font-size: clamp(1rem, 3.4vw, 1.15rem);
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.75;
}
html[lang="en"] .hero-lede { max-width: 46ch; }

.hero-rule {
  width: 64px;
  height: 1px;
  background: var(--bronze);
  margin: 22px 0;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn-solid { background: var(--midnight); color: var(--white); }
.btn-solid:hover { background: #1D3A50; }

.btn-light { background: var(--white); color: var(--midnight); }
.btn-light:hover { background: var(--porcelain); }

.btn-ghost-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.55);
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--white); }

.btn-outline {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-outline:hover { border-color: var(--bronze); background: var(--bronze-wash); }

.btn-icon {
  width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.btn-icon:hover { border-color: var(--bronze); background: var(--bronze-wash); }
.btn-icon svg { width: 18px; height: 18px; }

.btn-sm { min-height: 40px; font-size: 0.88rem; padding: 0 15px; }

/* --------------------------------------------------------------- sections */
.section { padding: clamp(48px, 8vw, 88px) 0; }
.section-tight { padding: clamp(28px, 5vw, 44px) 0; }

.section-head { margin-bottom: 28px; }

.section-head h2 {
  font-size: clamp(1.55rem, 5.2vw, 2.2rem);
  font-weight: 600;
}
.section-head .subtitle {
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 1rem;
}
html[lang="ar"] .section-head h2 { font-family: var(--font-ar); }
html[lang="en"] .section-head h2 { font-family: var(--font-en); }

.arch-rule {
  width: 54px;
  height: 24px;
  margin-bottom: 16px;
  display: block;
  overflow: visible;
}
.arch-rule path { fill: none; stroke: var(--bronze); stroke-width: 1.5; }

/* --------------------------------------------------------------- controls */
.controls {
  background: var(--white);
  border-block: 1px solid var(--line);
}

.controls-inner { display: grid; gap: 16px; }

.search-field { position: relative; }
.search-field svg {
  position: absolute;
  inset-inline-start: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--ink-soft);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  min-height: 50px;
  padding-inline: 46px 44px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--porcelain);
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
}
.search-field input::placeholder { color: var(--ink-soft); }
.search-field input:focus { border-color: var(--bronze); background: var(--white); }

.search-clear {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.search-clear.is-visible { display: inline-flex; }
.search-clear svg { width: 15px; height: 15px; }

.filters {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--ink-muted);
  font-size: 0.92rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.chip:hover { border-color: var(--bronze); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--midnight);
  border-color: var(--midnight);
  color: var(--white);
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.link-btn {
  border: 0;
  background: transparent;
  padding: 8px 2px;
  min-height: 44px;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--bronze-line);
  font-size: 0.92rem;
}
.link-btn[hidden] { display: none; }

/* --------------------------------------------------------------- collections */
.collections { background: var(--porcelain); }

.collection-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.collection-strip::-webkit-scrollbar { display: none; }

@media (min-width: 900px) {
  .collection-strip {
    grid-auto-flow: row;
    grid-template-columns: repeat(5, 1fr);
    overflow: visible;
  }
}

.collection-card {
  scroll-snap-align: start;
  position: relative;
  text-align: start;
  min-height: 148px;
  padding: 18px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.collection-card:hover { border-color: var(--bronze-line); box-shadow: var(--shadow-card); }

.collection-card .arch-mark {
  position: absolute;
  inset-block-start: -12px;
  inset-inline-end: -20px;
  width: 62px;
  opacity: 0.07;
  pointer-events: none;
}

.collection-card h3 { font-size: 1.08rem; position: relative; }
.collection-card .count { font-size: 0.85rem; color: var(--ink-soft); position: relative; }

.collection-card[aria-pressed="true"] {
  background: var(--midnight);
  border-color: var(--midnight);
  color: var(--white);
}
.collection-card[aria-pressed="true"] .count { color: rgba(255, 255, 255, 0.75); }
.collection-card[aria-pressed="true"] .arch-mark { opacity: 0.2; }

/* --------------------------------------------------------------- grid */
.places { background: var(--white); }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 24px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 28px; } }

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--white);
  overflow: hidden;
  transition: box-shadow .22s ease, border-color .22s ease;
}
.card:hover { box-shadow: var(--shadow-card); border-color: var(--line-strong); }
.card.is-hidden { display: none; }

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--porcelain);
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.22,.61,.36,1);
}
.card:hover .card-media img { transform: scale(1.045); }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 20px;
  flex: 1;
}

.card-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.79rem;
  color: var(--ink-muted);
}
.card-cat::before {
  content: "";
  width: 16px; height: 1px;
  background: var(--bronze);
  flex-shrink: 0;
}

.card-title { display: flex; flex-direction: column; gap: 2px; }
.name-ar { font-family: var(--font-ar); font-size: 1.16rem; font-weight: 600; line-height: 1.4; }
.name-en { font-family: var(--font-en); font-size: 0.86rem; font-weight: 500; color: var(--ink-soft); line-height: 1.45; }
html[lang="en"] .card-title { flex-direction: column-reverse; }
html[lang="en"] .name-en { font-size: 1.12rem; font-weight: 600; color: var(--ink); }
html[lang="en"] .name-ar { font-size: 0.92rem; font-weight: 400; color: var(--ink-soft); }

.card-desc { font-size: 0.95rem; color: var(--ink-muted); line-height: 1.7; }
.card-note {
  font-size: 0.84rem;
  color: var(--ink-soft);
  padding-inline-start: 12px;
  border-inline-start: 1px solid var(--bronze-line);
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: auto;
  padding-top: 8px;
}
.card-actions-row { display: flex; gap: 9px; align-items: stretch; }
.card-actions-row .btn { flex: 1 1 auto; min-width: 0; }
.card-actions-row .btn-icon { flex: 0 0 auto; }
.card-actions .btn-directions { width: 100%; }
.card-actions .btn-directions span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-plan[aria-pressed="true"] {
  background: var(--midnight);
  border-color: var(--midnight);
  color: var(--white);
}
.btn-plan[aria-pressed="true"] .plan-add { display: none; }
.btn-plan .plan-added { display: none; }
.btn-plan[aria-pressed="true"] .plan-added { display: inline; }
.btn-plan[aria-pressed="true"] .icon-plus { display: none; }
.btn-plan .icon-check { display: none; }
.btn-plan[aria-pressed="true"] .icon-check { display: block; }

/* Scroll reveal (JS only, respects reduced motion) */
.js .card { opacity: 1; }
.js.reveal-on .card {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.22,.61,.36,1);
}
.js.reveal-on .card.is-visible { opacity: 1; transform: none; }

.empty-state {
  display: none;
  text-align: center;
  padding: 56px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-m);
  color: var(--ink-muted);
}
.empty-state.is-visible { display: block; }
.empty-state img { width: 40px; margin: 0 auto 16px; opacity: .5; }

/* --------------------------------------------------------------- notice */
.notice { background: var(--porcelain); }
.notice-inner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--white);
  font-size: 0.92rem;
  color: var(--ink-muted);
  line-height: 1.7;
}
.notice-inner svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--bronze); margin-top: 2px; }

/* --------------------------------------------------------------- footer */
.site-footer {
  position: relative;
  background: var(--midnight);
  color: var(--white);
  padding: clamp(48px, 8vw, 76px) 0 calc(clamp(48px, 8vw, 76px) + 60px);
  overflow: hidden;
}
@media (min-width: 900px) { .site-footer { padding-bottom: clamp(48px, 8vw, 76px); } }

.footer-pattern {
  position: absolute;
  inset: 0;
  background-image: url("../brand/Armada_Residence_Pattern_Tile_Bronze.png");
  background-size: 190px auto;
  background-repeat: repeat;
  opacity: 0.06;
  pointer-events: none;
}

.footer-inner { position: relative; display: grid; gap: 22px; justify-items: center; text-align: center; }
.footer-logo { height: 40px; width: auto; }
.footer-line-ar { font-family: var(--font-ar); font-size: 1.08rem; }
.footer-line-en { font-family: var(--font-en); font-size: 0.92rem; color: rgba(255, 255, 255, 0.72); }
.footer-divider { width: 56px; height: 1px; background: var(--bronze); }
.footer-legal { font-size: 0.8rem; color: rgba(255, 255, 255, 0.55); }

/* --------------------------------------------------------------- plan */
.plan-fab {
  position: fixed;
  inset-inline: auto;
  inset-block-end: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--midnight);
  color: var(--white);
  box-shadow: var(--shadow-lift);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.plan-fab.is-visible { opacity: 1; visibility: visible; }
@media (min-width: 900px) {
  .plan-fab { left: auto; transform: none; inset-inline-end: 28px; inset-block-end: 28px; }
}

.plan-fab .badge {
  min-width: 24px; height: 24px;
  border-radius: 999px;
  background: var(--bronze);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-en);
  padding: 0 6px;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(20, 42, 59, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
}
.sheet-overlay.is-open { opacity: 1; visibility: visible; }

.plan-sheet {
  position: fixed;
  z-index: 100;
  background: var(--white);
  display: flex;
  flex-direction: column;
  inset-inline: 0;
  bottom: 0;
  max-height: 86vh;
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  transform: translateY(102%);
  transition: transform .32s cubic-bezier(.22,.61,.36,1);
  box-shadow: 0 -20px 50px -30px rgba(20, 42, 59, 0.7);
}
.plan-sheet.is-open { transform: none; }

@media (min-width: 900px) {
  .plan-sheet {
    inset-block: 0;
    inset-inline-start: auto;
    inset-inline-end: 0;
    width: min(420px, 92vw);
    max-height: none;
    border-radius: 0;
    transform: translateX(0);
  }
  html[dir="rtl"] .plan-sheet { transform: translateX(-102%); }
  html[dir="ltr"] .plan-sheet { transform: translateX(102%); }
  html[dir="rtl"] .plan-sheet.is-open,
  html[dir="ltr"] .plan-sheet.is-open { transform: none; }
}

.sheet-grip {
  width: 44px; height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 10px auto 0;
}
@media (min-width: 900px) { .sheet-grip { display: none; } }

.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font-size: 1.15rem; margin-inline-end: auto; }
.sheet-close {
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--white);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sheet-close svg { width: 16px; height: 16px; }

.sheet-body { overflow-y: auto; padding: 12px 20px 20px; flex: 1; -webkit-overflow-scrolling: touch; }

.plan-empty { text-align: center; color: var(--ink-muted); padding: 44px 10px; }
.plan-empty img { width: 38px; margin: 0 auto 14px; opacity: .45; }

.plan-list { display: grid; gap: 12px; }

.plan-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}
.plan-item img { width: 72px; height: 54px; object-fit: cover; border-radius: var(--radius-s); }
.plan-item .plan-name { font-size: 0.98rem; font-weight: 600; line-height: 1.4; }
.plan-item .plan-sub { font-size: 0.8rem; color: var(--ink-soft); }
.plan-item-actions { display: flex; gap: 6px; align-items: center; }
.plan-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.plan-links .btn { flex: 1 1 100%; min-width: 0; justify-content: flex-start; }
.plan-links .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-item-actions .btn-icon { width: 40px; min-height: 40px; }
.plan-item-actions .btn-icon svg { width: 16px; height: 16px; }

.sheet-foot {
  display: grid;
  gap: 10px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--white);
}
.sheet-foot .btn { width: 100%; }
.sheet-note { font-size: 0.8rem; color: var(--ink-soft); text-align: center; line-height: 1.6; }

.toast {
  position: fixed;
  inset-block-end: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 120;
  background: var(--midnight);
  color: var(--white);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

body.sheet-open { overflow: hidden; }
body.sheet-open .toast { inset-block-end: auto; top: 84px; }

/* --------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .hero-contours path { stroke-dasharray: none; stroke-dashoffset: 0; }
  .js.reveal-on .card { opacity: 1; transform: none; }
  .card:hover .card-media img { transform: none; }
}

@media print {
  .site-header, .plan-fab, .plan-sheet, .sheet-overlay, .controls, .collections { display: none !important; }
}
