:root {
  --ink: #10233F;
  --muted: #5B6575;
  --line: #D6DCE5;
  --line-soft: #E3E8EF;
  --soft: #F2F5F9;
  --page: #F7F9FC;
  --card: #FFFFFF;
  --accent: #0B4F8C;
  --accent-soft: #EAF2FB;
  --sea: #0E7C7B;
  --sea-soft: #E3F2F1;
  --sea-ink: #0A5655;
  --warn-bg: #FCEFD9;
  --warn-ink: #8A4B12;
  --danger-bg: #FBE7E4;
  --danger-ink: #8C1D10;
  --radius: 16px;
  --display: 'Space Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Manrope, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--accent); }
a:hover { color: #083A68; }
button { font-family: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
svg { display: block; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
main.wrap { padding-top: 28px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 24px; outline: none; }
.loading { color: var(--muted); }

/* ---------- header / nav ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; min-height: 44px; align-items: center; }
.brand-name { font-family: var(--display); font-size: 28px; font-weight: 700; color: var(--accent); }
.brand-sub { font-size: 13px; color: var(--muted); }
.topnav { display: flex; flex-wrap: wrap; gap: 4px; }
.topnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; font-weight: 700; text-decoration: none; color: #3D4A5C; }
.topnav a.active { background: var(--accent-soft); color: var(--accent); }

.tabbar { display: none; }

.footer { border-top: 1px solid var(--line-soft); background: var(--card); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 18px; padding-bottom: 18px; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 16px; font-weight: 700; }

/* ---------- generic ---------- */
.page-title { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1.1; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { font-size: 17px; font-weight: 700; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.note { font-size: 12px; font-weight: 600; color: var(--warn-ink); background: var(--warn-bg); border-radius: 8px; padding: 8px 12px; align-self: flex-start; }
.link-btn { background: none; border: 0; padding: 0; min-height: 44px; color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; }
.back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; background: none; border: 0; padding: 0; min-height: 44px; color: var(--accent); font-weight: 700; font-size: 15px; cursor: pointer; }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 10px; font-weight: 700; font-size: 14px; text-decoration: none; border: 0; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { color: #fff; background: #083A68; }
.btn-soft { background: var(--soft); color: var(--ink); }
.btn-soft:hover { color: var(--ink); background: #E6EBF2; }
.btn-outline { background: transparent; border: 1px solid var(--line); color: var(--accent); }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* ---------- home ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.hero-text { flex: 2 1 380px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.hero-text h1 { font-family: var(--display); font-size: 48px; line-height: 1.05; font-weight: 700; }
.weather { flex: 1 1 220px; border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--line-soft); }
.weather.today { background: var(--accent-soft); border-color: transparent; }
.weather .w-day { font-size: 14px; font-weight: 700; color: var(--muted); }
.weather.today .w-day { color: var(--accent); }
.weather .w-temp { font-family: var(--display); font-size: 34px; font-weight: 600; }
.weather .w-temp small { font-size: 18px; color: var(--muted); }
.weather .w-wind.strong { color: var(--warn-ink); font-weight: 700; }
.weather .w-icon { font-size: 13px; font-weight: 700; color: var(--muted); }

.dep { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--soft); border: 0; border-radius: 14px; padding: 16px; cursor: pointer; width: 100%; text-decoration: none; color: var(--ink); }
.dep:hover { color: var(--ink); background: #E9EEF4; }
.dep-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--accent); }
.dep-icon.sea { background: var(--sea); }
.dep-icon svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dep-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.dep-label { font-size: 13px; color: var(--muted); }
.dep-time { font-family: var(--display); font-size: 22px; font-weight: 600; }
.dep-in { font-size: 13px; font-weight: 700; color: var(--accent); }
.dep-in.sea { color: var(--sea); }

.mini { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--soft); border: 0; border-radius: 14px; padding: 12px 14px; cursor: pointer; width: 100%; color: var(--ink); text-decoration: none; }
.mini:hover { color: var(--ink); background: #E9EEF4; }
.mini-date { flex: none; width: 44px; display: flex; flex-direction: column; align-items: center; }
.mini-date small { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.mini-date b { font-family: var(--display); font-size: 20px; }
.mini-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mini-body b { font-size: 15px; }
.mini-body span { font-size: 13px; color: var(--muted); }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.quick a { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.quick a b { font-size: 16px; }
.quick a span { font-size: 13px; color: var(--muted); }

.cine { background: var(--soft); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.cine small { color: var(--muted); font-size: 13px; }

/* ---------- bus ---------- */
.bus-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.bus-side { flex: 1 1 260px; display: flex; flex-direction: column; gap: 14px; }
.bus-times { flex: 999 1 520px; min-width: 0; }
.times-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.time-row { display: flex; justify-content: space-between; align-items: center; border-radius: 12px; padding: 12px 16px; background: var(--soft); }
.time-row b { font-family: var(--display); font-size: 18px; font-weight: 600; }
.time-row span { font-size: 12px; font-weight: 700; }
.time-row.past { background: #fff; color: #6B7585; border: 1px solid #EEF1F5; }
.time-row.next { background: var(--accent); color: #fff; }
.time-row .fn { font-size: 11px; font-weight: 600; opacity: .8; }

.ferry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.ferry-cell { border-radius: 10px; padding: 10px 0; text-align: center; font-family: var(--display); font-size: 16px; font-weight: 600; background: var(--sea-soft); color: var(--sea-ink); }
.ferry-cell.past { background: #fff; color: #6B7585; border: 1px solid #EEF1F5; }
.ferry-cell.next { background: var(--sea); color: #fff; }
.info-box { background: var(--sea-soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.island { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.island-time { font-family: var(--display); font-size: 20px; font-weight: 600; width: 64px; }
.island b { display: block; font-size: 15px; }
.island span { font-size: 13px; color: var(--muted); }

/* ---------- events ---------- */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.ev { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ev-top { display: flex; gap: 14px; align-items: flex-start; }
.ev-date { flex: none; width: 56px; height: 72px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ev-date small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ev-date b { font-family: var(--display); font-size: 24px; line-height: 1; }
.ev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tag { align-self: flex-start; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 8px; }
.ev-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.ev-meta { font-size: 13px; color: var(--muted); }
.ev-when { font-size: 13px; font-weight: 600; }

.t-music { background: #EFEAF7; color: #4A2F78; }
.t-feast { background: #FCEFD9; color: #6B3A0E; }
.t-culture { background: #EAF2FB; color: #0B3F70; }
.t-market { background: #E3F2F1; color: #0A5655; }
.t-food { background: #FBE7E4; color: #8C1D10; }
.t-cinema { background: #E6EBF2; color: #1F2A44; }

.cta { border: 1px dashed #B8C2D0; background: var(--card); border-radius: 14px; padding: 18px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.cta b { display: block; font-size: 16px; }
.cta span { font-size: 14px; color: var(--muted); }

/* ---------- local ---------- */
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; min-height: 52px; max-width: 640px; }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); outline: none; min-height: 44px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.group { display: flex; flex-direction: column; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 4px; text-align: left; min-height: 112px; border: 0; border-radius: 14px; padding: 16px; cursor: pointer; }
.tile b { font-size: 16px; }
.tile span { font-size: 13px; line-height: 1.35; opacity: .85; }
.tile em { font-style: normal; font-size: 12px; font-weight: 700; margin-top: auto; }
.g-eat { background: #FCEFD9; color: #6B3A0E; }
.g-move { background: #E3F2F1; color: #0A5655; }
.g-home { background: #EAF2FB; color: #0B3F70; }
.g-pro { background: #EFEAF7; color: #4A2F78; }
.promo { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.promo b { display: block; font-family: var(--display); font-size: 22px; font-weight: 600; }
.promo span { font-size: 14px; color: #D6DCE5; }
.promo a { background: #fff; color: var(--ink); border-radius: 10px; padding: 12px 18px; font-weight: 700; font-size: 14px; text-decoration: none; }

.biz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.biz { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.biz.featured { background: #FFFBF3; border-color: #F0D3A4; }
.biz-name { font-size: 16px; font-weight: 700; }
.biz-meta { font-size: 12px; font-weight: 600; color: var(--muted); }
.biz-desc { font-size: 14px; flex: 1; }
.badge { flex: none; font-size: 11px; font-weight: 700; color: var(--warn-ink); background: var(--warn-bg); border-radius: 999px; padding: 4px 8px; }

.detail { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.detail-main { flex: 1 1 340px; display: flex; flex-direction: column; gap: 16px; }
.photo { height: 220px; border-radius: var(--radius); background: #E6EBF2; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.facts { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; font-size: 14px; }
.facts div + div { border-top: 1px solid var(--line-soft); }
.facts span { color: var(--muted); }
.menu { flex: 1 1 380px; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.menu h2 { font-family: var(--display); font-size: 26px; }
.menu h3 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--warn-ink); margin-bottom: 4px; }
.menu-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EEF1F5; }
.menu-item b { display: block; font-size: 15px; font-weight: 600; }
.menu-item span { font-size: 13px; color: var(--muted); }
.menu-item strong { flex: none; }

/* ---------- info ---------- */
.numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.num { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: 14px; padding: 18px; }
.num b { font-weight: 700; }
.num span { color: var(--accent); font-weight: 700; }
.num.emergency { background: var(--danger-bg); color: var(--danger-ink); border-color: transparent; }
.num.emergency span { color: var(--danger-ink); font-family: var(--display); font-size: 22px; }
.num.missing span { color: var(--muted); }

/* ---------- phone layout ---------- */
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  main.wrap { padding-top: 20px; padding-bottom: 110px; gap: 20px; }
  .topnav, .brand-sub { display: none; }
  .topbar-inner { padding-top: 8px; padding-bottom: 8px; }
  .page-title { font-size: 30px; }
  .hero-text h1 { font-size: 34px; }
  .hero { gap: 10px; }
  .weather { flex: 1 1 140px; padding: 14px; }
  .weather .w-temp { font-size: 26px; }
  .footer { margin-bottom: 76px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: #fff; border-top: 1px solid var(--line-soft);
    padding: 6px 8px calc(10px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; }
  .tabbar a.active { color: var(--accent); }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .ev-grid, .biz-grid { grid-template-columns: 1fr; }
}
