:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-soft: #f0f7f5;
  --text: #1a211f;
  --muted: #5f6b68;
  --line: #dde3de;
  --accent: #176b5b;
  --accent-strong: #0f4d41;
  --sun: #d98a21;
  --blue: #2d5f8b;
  --red: #b8483d;
  --shadow: 0 16px 40px rgba(26, 33, 31, 0.08);
  --shadow-soft: 0 8px 24px rgba(26, 33, 31, 0.06);
  --radius: 10px;
  --sidebar: 248px;
  --portal-max: 1200px;
  --header-height: 68px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --touch-min: 44px;
  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --stack-gap: 20px;
  --section-gap: 28px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 480px at 100% -10%, rgba(23, 107, 91, 0.08), transparent 60%),
    radial-gradient(900px 420px at 0% 0%, rgba(45, 95, 139, 0.06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

.maintenance-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.maintenance-panel {
  width: min(520px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.maintenance-panel h1 {
  margin-bottom: 10px;
}

.maintenance-panel p {
  margin-bottom: 18px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

body.app-booting .app-shell {
  visibility: hidden;
}

body.sidebar-disabled .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.sidebar-disabled .sidebar {
  display: none;
}

body.maintenance-auth .app-shell {
  display: block;
}

body.maintenance-auth .sidebar,
body.maintenance-auth .mobile-tabs,
body.maintenance-auth .topbar {
  display: none !important;
}

body.maintenance-auth .main {
  min-height: 100vh;
}

body.maintenance-auth .auth-page {
  min-height: 100vh;
  align-content: center;
  padding: 24px 0;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #fbfaf6;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  width: 100%;
  height: 44px;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  color: var(--accent-strong);
  background: #e5f1ee;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.main {
  padding: 0;
  min-width: 0;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 120;
  padding-top: var(--safe-top);
  background: rgba(251, 250, 246, 0.9);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.portal-header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  max-width: calc(var(--portal-max) + 48px);
  margin: 0 auto;
  min-height: var(--header-height);
  padding: 10px calc(24px + var(--safe-right)) 10px calc(24px + var(--safe-left));
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.portal-brand:hover .portal-brand-name {
  color: var(--accent-strong);
}

.portal-brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(23, 107, 91, 0.22);
}

.portal-brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portal-brand-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-nav {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.portal-nav-item {
  min-height: var(--touch-min);
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.portal-nav-item:hover {
  color: var(--accent-strong);
  background: rgba(23, 107, 91, 0.08);
}

.portal-nav-item.active {
  color: var(--accent-strong);
  background: #e5f1ee;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.portal-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
  min-width: 0;
  flex-shrink: 0;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 8px 26px rgba(43, 54, 50, 0.08);
}

.theme-toggle:hover,
.theme-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.theme-toggle-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-icon--sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle-icon--moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle-icon--sun {
  display: block;
}

.site-language-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.site-language-control[hidden] {
  display: none;
}

.site-language-control::before {
  content: "文";
  position: absolute;
  left: 10px;
  z-index: 1;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.site-language-control select {
  width: 118px;
  height: 36px;
  padding: 0 28px 0 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
}

.site-language-control select:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--surface-soft);
}

.site-language-control select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

.portal-search {
  position: relative;
  min-width: 0;
  flex: 0 1 auto;
}

.portal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.portal-actions .ghost-button,
.portal-actions .primary-button {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  flex-shrink: 0;
}

.page-body {
  width: min(100%, calc(var(--portal-max) + 48px));
  margin: 0 auto;
  padding: var(--space-lg) calc(24px + var(--safe-right)) calc(var(--space-xl) + var(--safe-bottom)) calc(24px + var(--safe-left));
}

.view-panel:not([hidden]) {
  display: grid;
  gap: var(--stack-gap);
}

.page-body > .view-panel,
.page-body > .site-footer {
  animation: portal-page-enter 0.35s ease both;
}

@keyframes portal-page-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
  max-width: none;
  white-space: nowrap;
}

.user-link {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.18;
}

h2 {
  margin-bottom: var(--space-sm);
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  margin-bottom: var(--space-sm);
  font-size: 16px;
  line-height: 1.35;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.ghost-button,
.primary-button,
.mini-button,
.text-button {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  height: 40px;
  padding: 0 14px;
  font-weight: 700;
}

.topbar-actions .ghost-button,
.topbar-actions .primary-button {
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0 2px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 18px;
}

.search-box {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(43, 54, 50, 0.06);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.search-symbol {
  color: var(--accent);
  font-size: 20px;
}

.home-search-shell {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.home-search-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 8px 26px rgba(43, 54, 50, 0.08);
}

.home-search-toggle:hover,
.home-search-shell.is-open .home-search-toggle {
  border-color: var(--accent);
  background: #e5f1ee;
}

.home-search-icon {
  position: relative;
  display: block;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.home-search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -3px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.home-search-shell .topbar-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(420px, calc(100vw - 56px));
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 250, 246, 0.98);
  box-shadow: var(--shadow);
}

.home-search-shell.is-desktop-inline .topbar-search-panel {
  position: static;
  top: auto;
  right: auto;
  width: min(360px, 34vw);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-search-shell.is-desktop-inline .portal-search-toggle {
  display: none;
}

.home-search-shell .topbar-search-panel .search-box {
  min-height: 42px;
  padding: 0 12px;
  box-shadow: none;
}

.home-search-shell .topbar-search-panel .primary-button {
  height: 42px;
  padding: 0 16px;
}

.market-strip {
  overflow: hidden;
  margin-bottom: var(--stack-gap);
}

.market-card {
  min-height: 44px;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
    #050807;
  border: 1px solid #17221f;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 34px rgba(16, 24, 22, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", "Noto Sans Mono CJK SC", monospace;
}

.market-track {
  --market-marquee-distance: 50%;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.market-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.market-group-clone {
  display: none;
}

.market-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.market-label,
.market-note-inline {
  color: #99a6a0;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.market-label {
  font-weight: 800;
}

.market-item strong {
  display: inline-block;
  min-width: 7ch;
  color: #f3f7f5;
  font-size: 14px;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.18);
}

.market-change {
  display: inline-block;
  min-width: 6ch;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.market-item [data-market-rate="nikkei"],
.market-item [data-market-rate-clone="nikkei"] {
  min-width: 10ch;
}

.market-item [data-nikkei-change],
.market-item [data-nikkei-change-clone] {
  min-width: 16ch;
}

.market-separator {
  color: #33433e;
  font-size: 14px;
  font-weight: 800;
}

.up {
  color: #22d27a;
  text-shadow: 0 0 10px rgba(34, 210, 122, 0.25);
}

.down {
  color: #ff4d5f;
  text-shadow: 0 0 10px rgba(255, 77, 95, 0.25);
}

.neutral {
  color: #9aa5ad;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.home-hero {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--stack-gap);
}

.home-hero-card {
  padding: clamp(22px, 4vw, 32px) clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, rgba(23, 107, 91, 0.1), rgba(255, 255, 255, 0.92) 42%),
    var(--surface);
  box-shadow: var(--shadow);
}

.home-hero-card h1 {
  margin: 0 0 var(--space-sm);
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
}

.home-hero-card .eyebrow {
  margin-bottom: var(--space-xs);
}

.home-hero-card p {
  margin: 0;
  max-width: 42rem;
  font-size: 15px;
}

.view-panel[hidden] {
  display: none;
}

.my-view {
  max-width: 760px;
  margin-inline: auto;
}

.news-block,
.guide-articles,
.bbs-header,
.bbs-detail,
.bbs-replies,
.bbs-empty,
.bbs-board-shell .bbs-board-head,
.search-results,
.static-page,
.auth-page {
  border-radius: calc(var(--radius) + 2px);
}

.my-auth {
  padding: 44px 0 24px;
  text-align: center;
}

.my-dashboard {
  padding: 24px 0;
  text-align: left;
}

.my-auth h2 {
  margin-bottom: 8px;
}

.my-auth > p:not(.eyebrow) {
  max-width: 36em;
  margin-inline: auto;
  color: var(--muted);
}

/* Profile hero */
.my-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 26px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: radial-gradient(140% 120% at 0% 0%, color-mix(in srgb, var(--accent) 14%, var(--surface)) 0%, var(--surface) 52%);
  box-shadow: var(--shadow);
}

.my-hero-info {
  flex: 1 1 240px;
  min-width: 0;
}

.my-hero-info .eyebrow {
  margin-bottom: 2px;
}

.my-hero-info h2 {
  margin: 0 0 12px;
  font-size: clamp(22px, 4vw, 28px);
}

.my-growth {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
}

.my-dashboard-home .verify-banner {
  max-width: none;
  margin: 16px 0 0;
}

@media (max-width: 560px) {
  .my-hero {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
  }

  .my-hero-info {
    width: 100%;
  }
}

.my-growth-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.my-growth-stat {
  display: grid;
  gap: 3px;
  padding: 12px 8px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}

.my-growth-stat span {
  color: var(--muted);
  font-size: 12px;
}

.my-growth-stat strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.my-growth-progress {
  margin-top: 14px;
}

.my-growth-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.my-growth-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.my-growth-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.my-growth-guide {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.my-growth-guide summary {
  padding: 12px 2px 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.my-growth-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.my-growth-guide-grid span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  font-size: 12px;
}

.my-growth-guide-grid b {
  display: grid;
  gap: 2px;
  color: var(--text);
}

.my-growth-guide-grid b small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.my-growth-guide-grid em {
  color: var(--accent-strong);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.my-growth-guide p {
  margin: 8px 2px 0;
  font-size: 12px;
  line-height: 1.6;
}

.my-growth-guide-grid .my-growth-guide-empty {
  grid-column: 1 / -1;
  justify-content: center;
  color: var(--muted);
}

.my-auth-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.my-avatar-settings {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0;
  max-width: none;
  text-align: center;
}

.my-avatar-preview {
  flex-shrink: 0;
  width: 104px;
  height: 104px;
}

.my-avatar-preview img,
.my-avatar-preview .user-avatar {
  width: 104px;
  height: 104px;
  box-shadow: 0 8px 22px rgba(43, 54, 50, 0.12);
}

.my-avatar-preview.is-viewable,
.profile-avatar.is-viewable {
  cursor: pointer;
}

.my-avatar-preview.is-viewable:focus-visible,
.profile-avatar.is-viewable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 50%;
}

.my-avatar-actions {
  min-width: 0;
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.my-avatar-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.my-avatar-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.my-avatar-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.my-avatar-progress-track {
  width: min(180px, 42vw);
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.my-avatar-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 120ms ease-out;
}

.my-avatar-progress-text {
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.my-avatar-message {
  margin: 0;
  min-height: 1.2em;
  font-size: 13px;
}

.my-avatar-message.success {
  color: var(--accent);
}

.my-avatar-message.error {
  color: var(--red);
}

.user-avatar {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  vertical-align: middle;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.user-avatar--empty {
  display: inline-grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.my-avatar-preview .user-avatar--empty,
.profile-avatar .user-avatar--empty {
  font-size: 28px;
}

.my-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.my-grid button {
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(43, 54, 50, 0.05);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.my-grid button:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--surface-soft);
  box-shadow: 0 8px 22px rgba(23, 107, 91, 0.1);
}

.my-grid button:not(:disabled):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.my-grid button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: #f3f4f2;
  box-shadow: none;
}

.my-grid button.has-unread {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  color: var(--accent-strong);
}

.my-grid button[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--surface-soft);
}

.my-grid-action--logout {
  color: var(--red);
}

.my-grid-action--logout:not(:disabled):hover {
  border-color: var(--red);
  color: var(--red);
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--red) 16%, transparent);
}

.my-subpage {
  width: 100%;
}

.my-page-back {
  justify-self: start;
  width: fit-content;
  height: auto;
  min-height: 32px;
  margin-bottom: 8px;
  text-align: left;
}

.my-notification-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

[data-nav-key="my"] {
  position: relative;
}

.account-nav-label {
  display: inline-block;
  min-width: 0;
  max-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.nav-item .account-nav-label {
  flex: 1 1 auto;
}

.account-nav-badge {
  position: absolute;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(148, 48, 48, 0.2);
}

.nav-item .account-nav-badge {
  top: 3px;
  right: 5px;
}

.portal-nav-item .account-nav-badge {
  top: -4px;
  right: -3px;
}

.mobile-tabs button .account-nav-label {
  max-width: min(16vw, 68px);
}

.mobile-tabs button .account-nav-badge {
  top: 2px;
  left: calc(50% + 9px);
}

.password-form[hidden] {
  display: none;
}

.password-form {
  margin: 18px auto 0;
  max-width: 420px;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(43, 54, 50, 0.06);
  text-align: left;
}

.password-form h3 {
  margin-bottom: 0;
}

.password-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.password-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

.password-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

.password-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.password-message.error {
  color: var(--red);
}

.password-message.success {
  color: var(--accent);
}

.password-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.submit-form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.submit-form textarea,
.submit-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  color: var(--text);
  outline: none;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}

.submit-form select {
  min-height: 44px;
  padding: 0 12px;
}

.submit-form textarea:focus,
.submit-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

.submit-composer {
  max-width: 1080px;
  gap: 16px;
}

.submit-composer-head,
.submit-editor-meta,
.submit-navigation,
.my-submission-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.submit-composer-head h3 {
  margin: 0 0 4px;
}

.submit-draft-status,
.submit-editor-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.submit-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.submit-steps button,
.submit-format-toolbar button {
  min-height: 40px;
  border: 0;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.submit-steps button + button {
  border-left: 1px solid var(--line);
}

.submit-steps button.is-active {
  background: var(--accent);
  color: #fff;
}

.submit-step {
  display: grid;
  gap: 14px;
}

.submit-step[hidden] {
  display: none;
}

.submit-writing-step {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  align-items: start;
}

.submit-editor-pane,
.submit-preview-pane,
.submit-confirm-step {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.submit-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.submit-format-toolbar select {
  flex: 0 0 auto;
  width: auto;
  min-height: 38px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.submit-format-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.submit-format-toolbar button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.submit-format-toolbar button > span:first-child,
.submit-format-toolbar button > b,
.submit-format-toolbar button > i {
  min-width: 15px;
  color: var(--accent-strong);
  font-size: 14px;
  font-style: normal;
}

.submit-editor-view-tabs {
  display: none;
}

.submit-editor-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.submit-editor-label small {
  color: var(--muted);
  font-weight: 600;
}

.submit-content-label textarea {
  min-height: 420px;
  line-height: 1.7;
  resize: vertical;
}

.submit-preview-pane,
.submit-confirm-step {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.submit-document-overview {
  display: grid;
  gap: 5px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.submit-document-overview strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submit-document-overview > span:not(.eyebrow),
.submit-document-overview small {
  color: var(--muted);
  font-size: 12px;
}

.submit-document-overview small b {
  color: var(--accent-strong);
}

.submit-preview-title {
  margin-top: 4px;
}

.submit-preview {
  min-height: 240px;
  overflow-wrap: anywhere;
}

.submit-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.submit-preview code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 0.92em;
}

.submit-preview hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.submit-document-stats {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px 12px;
}

.submit-preview-empty,
.submit-review-rule {
  color: var(--muted);
  font-size: 13px;
}

.submit-confirm-summary {
  border-bottom: 1px solid var(--line);
}

.submit-confirm-summary h3 {
  margin: 0;
}

.submit-navigation {
  justify-content: flex-end;
}

.my-submissions {
  margin: 22px auto 0;
  max-width: 520px;
  text-align: left;
}

.my-notifications {
  margin: 22px auto 0;
  max-width: 640px;
  text-align: left;
}

.my-submissions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.my-submissions-head h3 {
  margin: 0;
}

.my-submissions-list {
  display: grid;
  gap: 10px;
}

.my-notifications-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.my-notifications-status {
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.my-notifications-status.error {
  color: var(--red);
}

.my-notifications-status.success {
  color: var(--accent-strong);
}

.my-notifications-list {
  display: grid;
  gap: 10px;
}

.my-notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.my-notification-item.unread {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.my-private-message-item {
  cursor: pointer;
}

.my-notification-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.my-notification-main a {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  line-height: 1.45;
}

.my-notification-main a:hover {
  color: var(--accent-strong);
}

.my-notification-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.my-private-message-content {
  white-space: pre-wrap;
}

.my-notification-main time,
.my-notification-read {
  color: var(--muted);
  font-size: 12px;
}

.my-submissions-empty {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  background: var(--surface-soft);
}

.my-submission-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.my-submission-actions {
  justify-content: flex-end;
}

.my-submission-reason {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff4df;
  color: #8a4c00;
  font-size: 13px;
}

.my-submission-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.my-submission-main a,
.my-submission-main span {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  word-break: break-word;
}

.my-submission-main a:hover {
  color: var(--accent-strong);
}

.my-submission-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.my-submission-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  background: #eef2f4;
  color: var(--muted);
}

.my-submission-status.status-pending_review {
  background: #fff1e6;
  color: #b85c00;
}

.my-submission-status.status-published {
  background: #e4f0ed;
  color: var(--accent-strong);
}

.my-submission-status.status-scheduled {
  background: #eef2ff;
  color: #3454b4;
}

.my-submission-status.status-archived {
  background: #fff4df;
  color: var(--amber);
}

.my-submission-status.status-rejected {
  background: #fde8e8;
  color: var(--red);
}

.main-column,
.right-column {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.news-block,
.section-split,
.stage-card,
.auth-card,
.search-card,
.guide-card,
.safety-card {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px;
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-md);
}

.section-head.compact {
  margin-bottom: 12px;
}

.news-list {
  border-top: 1px solid var(--line);
}

.news-block,
.guide-articles {
  padding: clamp(18px, 3vw, 26px);
}

.news-block-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-md);
}

.news-block-head span {
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: var(--blue);
}

.news-block-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.2;
}

.news-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-md);
  align-items: center;
  padding: 14px 6px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.news-item.has-thumbnail {
  grid-template-columns: minmax(0, 1fr) clamp(112px, 16vw, 160px);
}

.news-item[href] {
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.news-item[href]:hover {
  background: var(--surface-soft);
}

.news-item[href]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.news-item-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.news-item h3 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0;
}

.news-item-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.4;
}

.news-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-soft);
}

@media (max-width: 640px) {
  .news-block {
    padding: 16px;
  }

  .news-block-head {
    margin-bottom: 8px;
  }

  .news-block-head h2 {
    font-size: 20px;
  }

  .news-item {
    gap: 12px;
    padding: 9px 0;
  }

  .news-item.has-thumbnail {
    grid-template-columns: minmax(0, 1fr) clamp(104px, 30vw, 118px);
  }

  .news-item h3 {
    font-size: 19px;
    line-height: 1.45;
  }

  .news-meta {
    gap: 6px 12px;
    font-size: 14px;
  }

  .news-thumb {
    border-radius: 6px;
  }
}

@media (max-width: 420px) {
  .news-item.has-thumbnail {
    grid-template-columns: minmax(0, 1fr) clamp(84px, 28vw, 104px);
  }

  .news-thumb {
    width: 100%;
  }
}

.mini-button {
  height: 34px;
}

.auth-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.auth-page[hidden] {
  display: none;
}

.auth-page {
  display: grid;
  justify-items: center;
  padding: 48px 0;
}

.auth-dialog {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 184px;
  padding: 4px;
  border-radius: var(--radius);
  background: #eef1ee;
  margin-bottom: 18px;
}

.auth-tab {
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: 0 4px 14px rgba(43, 54, 50, 0.08);
}

.auth-copy {
  margin-bottom: 16px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-password-control {
  position: relative;
}

.auth-form .auth-password-control input {
  padding-right: 68px;
}

.auth-form input::-ms-reveal,
.auth-form input::-ms-clear {
  display: none;
}

.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  transform: translateY(-50%);
  cursor: pointer;
}

.password-visibility-toggle:hover {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.password-visibility-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.auth-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

.auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 91, 0.12);
}

.auth-form .auth-terms-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.auth-form .auth-terms-field input {
  flex: 0 0 auto;
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.auth-terms-field a {
  color: var(--accent);
  font-weight: 800;
}

.auth-form .auth-terms-field[hidden] {
  display: none;
}

.auth-captcha-field {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.auth-captcha-field[hidden] {
  display: none;
}

.auth-captcha-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-captcha-head strong {
  color: var(--text);
  font-size: 14px;
}

.auth-captcha-prompt {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-page .wide {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.auth-page .wide:hover {
  background: var(--accent-strong);
}

.auth-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-message.error {
  color: var(--red);
}

.auth-message.success {
  color: var(--accent);
}

.search-card {
  background: #0f4d41;
  color: #fff;
}

.search-card p {
  color: rgba(255, 255, 255, 0.78);
}

.search-orb {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
  font-weight: 900;
  margin-bottom: 16px;
}

.wide {
  width: 100%;
  background: #fff;
  color: var(--accent-strong);
  border-color: #fff;
}

.guide-list {
  display: grid;
  gap: 8px;
}

.guide-list a {
  padding: 11px 12px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  background: #f7f9f7;
  border: 1px solid #e7ebe7;
  font-weight: 700;
}

.safety-card ul {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.mobile-tabs {
  display: none;
}

.mobile-tabs button {
  min-height: var(--touch-min);
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.mobile-tab-icon {
  font-size: 16px;
  line-height: 1;
}

.mobile-tab-label {
  line-height: 1.1;
}

.mobile-tabs button.active {
  color: var(--accent-strong);
  background: #e5f1ee;
}

.site-footer {
  margin-top: var(--section-gap);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer-inner {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-md) 0 var(--space-sm);
}

.site-footer-brand,
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
}

.site-footer-brand {
  font-size: 13px;
  font-weight: 800;
}

.site-footer a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-nav {
  font-size: 13px;
}

@media (max-width: 1120px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .right-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-card,
  .safety-card {
    grid-column: auto;
  }

  .market-card {
    padding: 0 12px;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .portal-brand-subtitle {
    display: none;
  }

  .portal-nav-item {
    padding: 0 12px;
    font-size: 13px;
  }

  .home-search-shell.is-desktop-inline .topbar-search-panel {
    width: min(280px, 30vw);
  }

  .portal-header-inner {
    gap: var(--space-md);
  }
}

@media (min-width: 901px) {
  body.sidebar-disabled .portal-nav {
    display: flex;
  }

  body:not(.sidebar-disabled) .portal-nav {
    display: none;
  }

  body:not(.sidebar-disabled) .portal-brand {
    display: none;
  }

  .page-body {
    padding-top: var(--space-xl);
    padding-bottom: calc(var(--space-xl) + var(--space-md));
  }

  .news-block,
  .guide-articles {
    padding: clamp(22px, 3vw, 28px);
  }

  .portal-header-inner {
    grid-template-columns: auto minmax(0, 1fr) minmax(300px, auto);
  }

  .portal-search {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    max-width: 420px;
  }

  .home-search-shell.is-desktop-inline .topbar-search-panel .search-box {
    min-height: 42px;
    box-shadow: none;
  }

  .home-search-shell.is-desktop-inline .topbar-search-panel .primary-button {
    height: 42px;
  }

  .ghost-button:hover,
  .primary-button:hover,
  .text-button:hover,
  .nav-item:hover,
  .portal-nav-item:hover {
    filter: brightness(0.98);
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    padding-bottom: calc(74px + var(--safe-bottom));
  }

  .sidebar {
    display: none;
  }

  .portal-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 56px;
    padding-inline: calc(16px + var(--safe-right)) calc(16px + var(--safe-left));
  }

  .portal-brand {
    gap: 8px;
    max-width: 100%;
  }

  .portal-brand-copy {
    display: grid;
    min-width: 0;
  }

  .portal-brand-name {
    max-width: min(34vw, 132px);
    font-size: 16px;
  }

  .portal-brand-subtitle {
    display: none;
  }

  .portal-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .portal-nav {
    display: none !important;
  }

  .portal-tools {
    gap: var(--space-sm);
    align-items: center;
  }

  .home-search-shell.is-open .topbar-search-panel {
    position: fixed;
    top: calc(56px + var(--safe-top) + 8px);
    left: max(16px, var(--safe-left));
    right: max(16px, var(--safe-right));
    width: auto;
    max-width: none;
    z-index: 140;
    padding: 12px;
    box-shadow: var(--shadow);
  }

  .page-body {
    padding: 16px calc(16px + var(--safe-right)) calc(88px + var(--safe-bottom)) calc(16px + var(--safe-left));
  }

  .market-strip {
    overflow: hidden;
  }

  .right-column {
    grid-template-columns: 1fr;
  }

  .mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px 10px calc(8px + var(--safe-bottom));
    background: rgba(251, 250, 246, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .site-footer {
    margin-top: 22px;
  }
}

.cookie-consent {
  position: fixed;
  z-index: 220;
  right: max(20px, var(--safe-right));
  bottom: max(20px, var(--safe-bottom));
  left: max(20px, var(--safe-left));
  display: block;
  max-width: 920px;
  margin-inline: auto;
  padding: 18px 20px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent-copy {
  display: grid;
  gap: 4px;
}

.cookie-consent-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cookie-consent-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.cookie-consent-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 14px;
}

.cookie-consent-actions button {
  white-space: nowrap;
}

.cookie-consent-actions a {
  color: var(--accent);
  font-weight: 700;
}

.cookie-preferences {
  display: grid;
  gap: 16px;
}

.cookie-preferences[hidden],
.cookie-consent-summary[hidden] {
  display: none;
}

.cookie-preferences-head,
.cookie-preferences-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-preferences-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.cookie-preferences-head a {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 700;
}

.cookie-preference-list {
  display: grid;
  gap: 8px;
}

.cookie-preference-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.cookie-preference-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.cookie-preference-row span {
  display: grid;
  gap: 2px;
}

.cookie-preference-row em,
.cookie-preference-row b {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.cookie-preference-row--unavailable {
  opacity: 0.72;
}

.cookie-preferences-actions {
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .cookie-consent {
    bottom: calc(76px + var(--safe-bottom));
  }
}

@media (max-width: 640px) {
  .cookie-consent {
    gap: 14px;
    padding: 16px;
  }

  .cookie-consent-summary,
  .cookie-consent-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-consent-actions button {
    width: 100%;
  }

  .cookie-preferences-head {
    align-items: flex-start;
  }

  .cookie-preference-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .cookie-preference-row > b {
    grid-column: 2;
  }
}
