:root {
  --ink: #1B2A4A;
  --ink-soft: #3C4E73;
  --paper: #F5F3EC;
  --paper-deep: #EAE6D9;
  --stamp: #A6332A;
  --stamp-soft: #C24B3E;
  --seal: #B8912A;
  --cream: #FFFFFF;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, a { font: inherit; }

button {
  border: 0;
  cursor: pointer;
}

a { text-decoration: none; }

.app-shell {
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top right, rgba(184,145,42,.08), transparent 35%),
    var(--paper);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 18px 12px;
  background: rgba(245,243,236,.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(27,42,74,.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: 0 6px 16px rgba(27,42,74,.18);
}

.brand-name {
  margin: 0;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
}

.brand-tagline {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.lang-switch {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 999px;
}

.lang-switch button {
  padding: 6px 10px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.lang-switch button.active {
  background: var(--ink);
  color: var(--paper);
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(92px + var(--safe-bottom));
}

.section-header {
  padding: 24px 20px 15px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--stamp);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 7vw, 36px);
  line-height: 1.04;
}

.section-subtitle {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px;
}

.card {
  background: var(--cream);
  border: 1px solid var(--paper-deep);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(27,42,74,.055);
}

.category-card {
  min-height: 145px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.icon-circle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  font-size: 20px;
}

.category-name {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
}

.muted-small {
  margin: auto 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.3;
}

.content-block {
  padding: 24px 20px 0;
}

.block-title {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.channel-list,
.item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.channel-row,
.guide-row,
.store-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
}

.channel-row {
  color: inherit;
  text-decoration: none;
}

.channel-row:hover {
  border-color: var(--seal);
}

.channel-name {
  font-size: 14px;
  font-weight: 700;
}

.seal {
  display: inline-flex;
  align-items: center;
  border: 1px dashed var(--seal);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--seal);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
}

.notice {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.item-category {
  margin: 0 0 5px;
  color: var(--stamp);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.item-title {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.35;
}

.item-action {
  margin: 6px 0 0;
  color: var(--stamp-soft);
  font-size: 12px;
  font-weight: 700;
}

.item-symbol {
  flex: 0 0 auto;
  color: var(--paper-deep);
  font-size: 24px;
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 5px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar { display: none; }

.filter-btn {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--paper-deep);
  font-size: 12px;
  font-weight: 750;
}

.filter-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.store-list {
  padding: 12px 20px 0;
}

.price-box {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.price {
  color: var(--ink);
  font-family: "Courier New", monospace;
  font-weight: 850;
  font-size: 14px;
}

.external {
  color: var(--stamp-soft);
  font-size: 15px;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 20px 0;
}

.action-btn {
  min-height: 52px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 800;
}

.action-primary {
  background: var(--stamp);
  color: var(--paper);
}

.action-secondary {
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--paper-deep);
}

.legal-text {
  padding: 10px 20px 30px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.legal-link-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.legal-row span:last-child {
  color: var(--stamp);
  font-size: 18px;
}

.legal-row:hover { border-color: var(--seal); }

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  width: min(100%, 520px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--paper-deep);
}

.nav-btn {
  min-width: 0;
  padding: 7px 4px;
  border-radius: 13px;
  background: transparent;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nav-btn.active {
  background: var(--paper-deep);
  color: var(--ink);
}

.nav-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.install-banner {
  margin: 14px 20px 0;
  padding: 14px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--paper);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.install-banner.visible { display: flex; }

.install-copy strong {
  display: block;
  font-size: 13px;
}

.install-copy span {
  display: block;
  margin-top: 3px;
  opacity: .8;
  font-size: 10px;
}

.install-btn {
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--seal);
  color: white;
  font-size: 11px;
  font-weight: 800;
}

@media (min-width: 521px) {
  body { background: #DAD5C4; }
  .app-shell {
    margin-top: 22px;
    margin-bottom: 22px;
    min-height: calc(100dvh - 44px);
    border: 8px solid var(--ink);
    border-radius: 38px;
    overflow: hidden;
    box-shadow: 0 30px 65px rgba(27,42,74,.32);
  }
  .bottom-nav {
    bottom: 22px;
    width: min(calc(100% - 16px), 504px);
    border-radius: 0 0 29px 29px;
  }
}

@media (max-width: 350px) {
  .category-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 120px; }
}
