@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,700;8..60,800&display=swap');

:root {
  color-scheme: light;
  --green-950: #06271d;
  --green-900: #0a3527;
  --green-800: #0e4a34;
  --green-700: #126343;
  --green-600: #168055;
  --green-100: #e7f3e8;
  --cream-50: #fffdf7;
  --cream-100: #fbf6e7;
  --cream-200: #f5e9c8;
  --gold-500: #d8a935;
  --gold-400: #edc65f;
  --gold-200: #f5dda0;
  --ink: #173329;
  --muted: #65766d;
  --line: rgba(20, 74, 51, .14);
  --shadow-sm: 0 8px 24px rgba(5, 43, 29, .08);
  --shadow-md: 0 18px 44px rgba(5, 43, 29, .14);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--cream-100); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(237, 198, 95, .13), transparent 26rem),
    linear-gradient(180deg, var(--cream-50), var(--cream-100));
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(78px + var(--safe-bottom));
}
body.sheet-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { border: 0; }
svg.icon { width: 1.3em; height: 1.3em; display: block; fill: none; }

.skip-link {
  position: fixed; z-index: 1000; left: 12px; top: -80px;
  padding: 12px 16px; border-radius: 12px; background: #fff; color: var(--green-900);
}
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shell { width: min(100% - 32px, 700px); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 80;
  background: rgba(255, 253, 247, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.header-row { min-height: 74px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.brand-seal {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%;
  display: grid; place-items: center; color: var(--gold-400);
  background: linear-gradient(145deg, var(--green-800), var(--green-950));
  border: 2px solid var(--gold-400); box-shadow: 0 0 0 4px rgba(216, 169, 53, .12);
}
.brand-seal svg { width: 30px; height: 30px; }
.brand-copy { display: grid; gap: 2px; min-width: 0; }
.brand-copy strong {
  font: 800 clamp(.98rem, 4.3vw, 1.2rem)/1.15 'Source Serif 4', Georgia, serif;
  color: var(--green-900); letter-spacing: -.015em;
}
.brand-copy small { color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-tools { display: flex; gap: 8px; }
.icon-button {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  color: var(--green-900); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.icon-button:active { transform: translateY(1px); }
.icon-button svg { width: 22px; height: 22px; }

.hero { padding: 22px 0 16px; }
.hero-card {
  position: relative; overflow: hidden; padding: 24px;
  background: linear-gradient(145deg, #0d4a34, #062b20 78%);
  color: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.hero-card::before {
  content: ''; position: absolute; width: 230px; height: 230px; right: -110px; top: -120px; border-radius: 50%;
  border: 1px solid rgba(237, 198, 95, .35); box-shadow: 0 0 0 38px rgba(237, 198, 95, .05), 0 0 0 76px rgba(237, 198, 95, .035);
}
.hero-kicker { margin: 0 0 8px; color: var(--gold-400); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { margin: 0; max-width: 13ch; font: 800 clamp(2rem, 8.6vw, 3.2rem)/.98 'Source Serif 4', Georgia, serif; letter-spacing: -.035em; }
.hero-copy { margin: 14px 0 0; max-width: 36rem; color: rgba(255, 255, 255, .78); line-height: 1.65; font-size: .93rem; }
.hero-status { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); color: #fff; font-size: .74rem;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #43d988; box-shadow: 0 0 0 4px rgba(67,217,136,.13); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.hero-stat { padding: 13px 10px; border-radius: 15px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.hero-stat strong { display: block; color: var(--gold-400); font: 800 1.18rem/1 'Source Serif 4', Georgia, serif; }
.hero-stat span { display: block; margin-top: 4px; color: rgba(255,255,255,.7); font-size: .65rem; }

.main { padding: 4px 0 36px; }
.section { padding: 18px 0; scroll-margin-top: 84px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.section-heading small { display: block; margin-bottom: 4px; color: #a27516; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.section-heading h2 { margin: 0; font: 800 clamp(1.55rem, 6.6vw, 2.2rem)/1.08 'Source Serif 4', Georgia, serif; letter-spacing: -.02em; color: var(--green-900); }
.section-link { flex: 0 0 auto; color: var(--green-700); font-size: .78rem; font-weight: 700; }

.today-strip {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px;
  border-radius: var(--radius-md); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.today-symbol { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; color: var(--green-800); background: linear-gradient(145deg, #fff4cf, #f2d67c); border: 1px solid rgba(216,169,53,.35); }
.today-symbol svg { width: 28px; height: 28px; }
.today-main strong { display: block; color: var(--green-900); font-size: 1rem; }
.today-main p { margin: 4px 0 0; color: var(--muted); font-size: .81rem; line-height: 1.5; }
.today-tags { grid-column: 1 / -1; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.today-tags::-webkit-scrollbar { display: none; }
.today-tag { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: var(--green-800); background: var(--green-100); font-size: .68rem; font-weight: 600; }

.notice-list { display: grid; gap: 10px; }
.notice-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  min-height: 76px; padding: 12px 13px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.notice-icon, .quick-icon, .feature-icon {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center;
  color: var(--green-800); background: linear-gradient(145deg, #fff3ca, #edcc70); border: 1px solid rgba(216,169,53,.34);
}
.notice-icon svg, .quick-icon svg, .feature-icon svg { width: 25px; height: 25px; }
.notice-card strong { display: block; font-size: .86rem; color: var(--green-900); }
.notice-card p { margin: 3px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.notice-arrow { color: var(--gold-500); }
.notice-arrow svg { width: 20px; height: 20px; }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-action {
  min-height: 112px; padding: 14px; text-align: left; border-radius: 20px;
  background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: grid; gap: 11px; align-content: start;
}
.quick-action:active { transform: translateY(1px); }
.quick-action strong { display: block; color: var(--green-900); font-size: .88rem; }
.quick-action small { display: block; margin-top: 3px; color: var(--muted); font-size: .66rem; line-height: 1.4; }

.activity-list { display: grid; gap: 10px; }
.activity-card {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 15px; border-radius: 18px;
  background: linear-gradient(145deg, #0e4a34, #082e22); color: #fff; border: 1px solid rgba(237,198,95,.22);
}
.activity-number { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-400); color: var(--green-950); font-weight: 800; font-size: .72rem; }
.activity-card strong { display: block; font-size: .84rem; line-height: 1.4; }
.activity-card small { display: block; margin-top: 5px; color: rgba(255,255,255,.68); font-size: .68rem; }

.branch-card, .feature-card, .explore-card {
  padding: 17px; border-radius: var(--radius-md); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.field-label { display: block; margin-bottom: 8px; color: var(--green-900); font-size: .76rem; font-weight: 700; }
.branch-select, .sheet-input, .sheet-textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; background: var(--cream-50); color: var(--ink); outline: none;
}
.branch-select, .sheet-input { min-height: 50px; padding: 0 13px; }
.sheet-textarea { min-height: 118px; padding: 13px; resize: vertical; }
.branch-select:focus, .sheet-input:focus, .sheet-textarea:focus { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(22,128,85,.1); }
.branch-result { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-top: 13px; padding: 13px; border-radius: 15px; background: var(--green-100); }
.branch-result strong { display: block; color: var(--green-900); font-size: .86rem; }
.branch-result small { display: block; margin-top: 3px; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.branch-result svg { width: 26px; height: 26px; color: var(--green-700); }
.branch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.action-button, .action-link {
  min-height: 48px; padding: 0 12px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: .75rem; font-weight: 700; text-align: center;
}
.action-button.primary, .action-link.primary { color: #fff; background: linear-gradient(145deg, var(--green-700), var(--green-900)); }
.action-button.secondary, .action-link.secondary { color: var(--green-800); background: var(--cream-100); border: 1px solid var(--line); }

.feature-grid { display: grid; gap: 10px; }
.feature-card { display: grid; grid-template-columns: auto 1fr; gap: 13px; }
.feature-card h3 { margin: 0; color: var(--green-900); font: 800 1.05rem/1.2 'Source Serif 4', Georgia, serif; }
.feature-card p { margin: 5px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.55; }
.feature-card a, .feature-card button { margin-top: 10px; color: var(--green-700); background: none; padding: 0; font-size: .72rem; font-weight: 800; }

.explore-card {
  position: relative; overflow: hidden; min-height: 190px; color: #fff;
  background:
    linear-gradient(90deg, rgba(6,39,29,.97), rgba(6,39,29,.72)),
    url('/tph-village-map-v1.webp') center/cover;
}
.explore-card::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(237,198,95,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(237,198,95,.07) 1px, transparent 1px); background-size: 24px 24px; pointer-events: none; }
.explore-card > * { position: relative; z-index: 1; }
.explore-card .feature-icon { color: var(--gold-400); background: rgba(255,255,255,.08); border-color: rgba(237,198,95,.34); }
.explore-card h3 { margin: 18px 0 7px; color: #fff; font: 800 1.45rem/1.1 'Source Serif 4', Georgia, serif; }
.explore-card p { margin: 0; color: rgba(255,255,255,.72); font-size: .75rem; line-height: 1.55; max-width: 32rem; }
.explore-card a { display: inline-flex; align-items: center; gap: 8px; margin-top: 15px; color: var(--gold-400); font-size: .75rem; font-weight: 800; }

.utility-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.utility-card { min-height: 78px; padding: 11px 8px; border-radius: 16px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; gap: 7px; text-align: center; color: var(--green-800); font-size: .65rem; font-weight: 700; }
.utility-card svg { width: 23px; height: 23px; }
.utility-card[aria-disabled='true'] { opacity: .58; }

.site-footer { margin-top: 14px; padding: 30px 0 34px; background: var(--green-950); color: rgba(255,255,255,.72); }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand strong { color: var(--gold-400); font: 800 1.15rem/1.2 'Source Serif 4', Georgia, serif; }
.footer-brand .brand-seal { width: 42px; height: 42px; flex-basis: 42px; }
.footer-copy { margin: 14px 0 0; font-size: .74rem; line-height: 1.65; }
.footer-links { display: grid; gap: 8px; margin-top: 18px; }
.footer-links a, .footer-links button { padding: 12px 0; color: rgba(255,255,255,.82); background: none; text-align: left; font-size: .74rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-note { margin-top: 18px; color: rgba(255,255,255,.4); font-size: .63rem; }

.bottom-nav {
  position: fixed; z-index: 90; left: 0; right: 0; bottom: 0;
  padding: 8px 10px var(--safe-bottom); background: rgba(255,253,247,.96); border-top: 1px solid var(--line); backdrop-filter: blur(18px);
}
.bottom-nav-inner { max-width: 700px; margin: auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.bottom-link { min-height: 52px; display: grid; place-items: center; gap: 3px; color: #738077; font-size: .61rem; font-weight: 600; }
.bottom-link svg { width: 22px; height: 22px; }
.bottom-link.active { color: var(--green-700); }
.bottom-link.active::before { content: ''; position: absolute; width: 30px; height: 3px; transform: translateY(-29px); border-radius: 999px; background: var(--gold-500); }

.sheet-backdrop { position: fixed; z-index: 120; inset: 0; background: rgba(2,21,15,.58); opacity: 0; visibility: hidden; transition: .2s ease; }
.sheet-backdrop.open { opacity: 1; visibility: visible; }
.bottom-sheet {
  position: fixed; z-index: 130; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto;
  padding: 10px 16px calc(20px + var(--safe-bottom)); border-radius: 26px 26px 0 0; background: var(--cream-50);
  transform: translateY(105%); transition: transform .25s ease; box-shadow: 0 -24px 60px rgba(0,0,0,.2);
}
.bottom-sheet.open { transform: translateY(0); }
.sheet-handle { width: 44px; height: 5px; margin: 0 auto 12px; border-radius: 999px; background: #cdd5cf; }
.sheet-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.sheet-kicker { color: #a27516; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sheet-title { margin: 4px 0 0; color: var(--green-900); font: 800 1.65rem/1.1 'Source Serif 4', Georgia, serif; }
.sheet-close { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; display: grid; place-items: center; color: var(--green-900); background: var(--cream-200); }
.sheet-close svg { width: 20px; height: 20px; }
.sheet-body { margin-top: 15px; }
.sheet-body p { color: var(--muted); font-size: .8rem; line-height: 1.6; }
.sheet-list { display: grid; gap: 9px; margin: 13px 0; }
.sheet-list article { padding: 13px; border-radius: 15px; background: #fff; border: 1px solid var(--line); }
.sheet-list strong { display: block; color: var(--green-900); font-size: .8rem; }
.sheet-list small { display: block; margin-top: 4px; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.sheet-form { display: grid; gap: 10px; margin-top: 13px; }
.sheet-form label span { display: block; margin-bottom: 6px; color: var(--green-900); font-size: .72rem; font-weight: 700; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.sheet-note { display: block; margin-top: 10px; color: var(--muted); font-size: .63rem; line-height: 1.5; }

.search-overlay { position: fixed; z-index: 140; inset: 0; display: none; padding: max(16px, env(safe-area-inset-top)) 16px 16px; background: rgba(6,39,29,.97); }
.search-overlay.open { display: block; }
.search-panel { max-width: 700px; margin: auto; }
.search-top { display: flex; gap: 9px; }
.search-box { flex: 1; min-height: 52px; padding: 0 15px; border-radius: 16px; border: 1px solid rgba(255,255,255,.12); color: #fff; background: rgba(255,255,255,.08); outline: none; }
.search-box::placeholder { color: rgba(255,255,255,.55); }
.search-close { width: 52px; border-radius: 16px; background: var(--gold-400); color: var(--green-950); display: grid; place-items: center; }
.search-results { display: grid; gap: 9px; margin-top: 15px; }
.search-result { padding: 14px; border-radius: 15px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); color: #fff; }
.search-result strong { display: block; font-size: .82rem; }
.search-result small { display: block; margin-top: 4px; color: rgba(255,255,255,.62); font-size: .68rem; line-height: 1.45; }
.empty-result { color: rgba(255,255,255,.62); font-size: .78rem; }

.toast { position: fixed; z-index: 160; left: 50%; bottom: calc(86px + var(--safe-bottom)); width: min(calc(100% - 32px), 520px); transform: translate(-50%, 16px); padding: 13px 15px; border-radius: 14px; color: #fff; background: var(--green-900); box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transition: .2s ease; font-size: .75rem; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

@media (min-width: 640px) {
  body { padding-bottom: 0; }
  .shell { width: min(100% - 48px, 980px); }
  .header-row { min-height: 82px; }
  .hero { padding-top: 28px; }
  .hero-card { padding: 32px; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .activity-list { grid-template-columns: repeat(3, 1fr); }
  .activity-card { grid-template-columns: 34px 1fr; }
  .bottom-nav { position: sticky; bottom: auto; top: 82px; padding: 0; border-top: 0; border-bottom: 1px solid var(--line); }
  .bottom-nav-inner { max-width: 980px; }
  .bottom-link { min-height: 54px; grid-auto-flow: column; place-content: center; gap: 8px; font-size: .72rem; }
  .bottom-link.active::before { transform: translateY(27px); }
}

@media (min-width: 920px) {
  .shell { width: min(100% - 64px, 1120px); }
  .hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
  .hero-card { min-height: 340px; display: grid; align-content: center; }
  .desktop-aside { display: grid !important; gap: 12px; }
  .main-columns { display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; align-items: start; }
  .main-columns > div { min-width: 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .bottom-nav-inner { max-width: 1120px; }
}

@media (max-width: 380px) {
  .shell { width: min(100% - 22px, 700px); }
  .hero-card { padding: 20px; }
  .quick-action { min-height: 104px; padding: 12px; }
  .brand-copy strong { font-size: .92rem; }
  .brand-copy small { max-width: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
