/*
 * WAYFARE PRODUCT SYSTEM
 * Direction: Wayfinding Field Console
 * A calm, dense workbench for Chinese working-holiday travellers.
 */

:root {
  color-scheme: light;
  --wf-canvas: #f3f6f4;
  --wf-surface: #ffffff;
  --wf-surface-subtle: #edf2ef;
  --wf-surface-raised: #ffffff;
  --wf-overlay: rgba(19, 31, 27, 0.58);
  --wf-text: #17231f;
  --wf-text-secondary: #4d5d57;
  --wf-text-muted: #71807b;
  --wf-border: #d8e0dc;
  --wf-border-strong: #b9c7c1;
  --wf-primary: #176b5b;
  --wf-primary-hover: #10594c;
  --wf-primary-soft: #e3f0eb;
  --wf-accent: #b86b18;
  --wf-accent-soft: #f7ead9;
  --wf-success: #267455;
  --wf-warning: #a96112;
  --wf-danger: #b3423b;
  --wf-info: #315f78;
  --wf-radius-xs: 3px;
  --wf-radius-sm: 6px;
  --wf-radius-md: 10px;
  --wf-radius-lg: 14px;
  --wf-shadow-raised: 0 10px 30px rgba(27, 44, 38, 0.08);
  --wf-shadow-overlay: 0 24px 72px rgba(13, 24, 20, 0.24);
  --wf-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --wf-fast: 120ms;
  --wf-normal: 180ms;
  --wf-rail: 236px;
  --wf-context: 48px;
  --wf-control: 42px;
  --wf-font: Inter, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --wf-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Legacy variable bridge. Existing business UI consumes these names. */
  --primary: var(--wf-primary);
  --btn-text: #ffffff;
  --bg: var(--wf-canvas);
  --box-bg: var(--wf-surface);
  --box: var(--wf-surface);
  --text: var(--wf-text);
  --muted: var(--wf-text-muted);
  --border: var(--wf-border);
  --accent: var(--wf-danger);
  --glow: rgba(23, 107, 91, 0.12);
  --gold: var(--wf-accent);
  --w-safe: var(--wf-success);
  --w-danger: var(--wf-danger);
  --income: var(--wf-success);
  --expense: var(--wf-danger);
  --glass-bg: rgba(255, 255, 255, 0.96);
  --glass-border: var(--wf-border);
}

/* Journey stage desk: one clear context, then three next actions. */
.wf-stage-panel {
  margin: 0 0 22px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  background: var(--wf-surface);
  overflow: hidden;
}

.wf-stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
}

.wf-stage-kicker,
.housing-section-kicker,
.housing-eyebrow {
  margin-bottom: 6px;
  color: var(--wf-primary);
  font: 700 10px var(--wf-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.wf-stage-head h2,
.housing-section-head h2,
.housing-sources h2,
.housing-hero h1 {
  margin: 0;
  color: var(--wf-text);
  letter-spacing: -0.035em;
}

.wf-stage-head h2 {
  font-size: 20px;
}

.wf-stage-head p {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--wf-text-secondary);
  font-size: 12px;
  line-height: 1.65;
}

.wf-stage-country,
.housing-country {
  flex: 0 0 auto;
  min-width: 54px;
  padding: 6px 9px;
  border: 1px solid var(--wf-border-strong);
  border-radius: var(--wf-radius-xs);
  color: var(--wf-text-secondary);
  font: 700 10px var(--wf-mono);
  text-align: center;
}

.wf-stage-selector {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--wf-border);
  border-bottom: 1px solid var(--wf-border);
}

.wf-stage-selector button {
  min-width: 0;
  min-height: 43px;
  padding: 10px 12px;
  border: 0;
  border-right: 1px solid var(--wf-border);
  border-radius: 0;
  background: var(--wf-surface-subtle);
  color: var(--wf-text-muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background var(--wf-fast) var(--wf-ease), color var(--wf-fast) var(--wf-ease);
}

.wf-stage-selector button:last-child {
  border-right: 0;
}

.wf-stage-selector button span {
  margin-right: 6px;
  font: 650 9px var(--wf-mono);
  opacity: 0.72;
}

.wf-stage-selector button:hover {
  background: var(--wf-surface-raised);
  color: var(--wf-text-secondary);
}

.wf-stage-selector button.active {
  box-shadow: inset 0 -2px 0 var(--wf-primary);
  background: var(--wf-primary-soft);
  color: var(--wf-primary);
}

.wf-stage-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
}

.wf-priority-list {
  min-width: 0;
}

.wf-priority-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--wf-border);
  color: inherit;
  text-decoration: none;
}

.wf-priority-row:last-child {
  border-bottom: 0;
}

.wf-priority-row:hover {
  background: var(--wf-surface-subtle);
}

.wf-priority-index,
.housing-source-index {
  color: var(--wf-text-muted);
  font: 650 10px var(--wf-mono);
}

.wf-priority-copy {
  min-width: 0;
}

.wf-priority-copy strong,
.wf-priority-copy small {
  display: block;
}

.wf-priority-copy strong {
  color: var(--wf-text);
  font-size: 13px;
}

.wf-priority-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--wf-text-secondary);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-priority-action {
  color: var(--wf-primary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.wf-stage-shortcuts {
  padding: 15px;
  border-left: 1px solid var(--wf-border);
  background: var(--wf-surface-subtle);
}

.wf-stage-shortcuts-label {
  margin: 0 4px 8px;
  color: var(--wf-text-muted);
  font: 700 9px var(--wf-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wf-stage-shortcuts a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 37px;
  padding: 0 9px;
  border-bottom: 1px solid var(--wf-border);
  color: var(--wf-text-secondary);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.wf-stage-shortcuts a:last-child {
  border-bottom: 0;
}

.wf-stage-shortcuts a:hover {
  color: var(--wf-primary);
}

/* Housing decision desk */
body[data-wf-page="housing"] .housing-shell {
  max-width: 1120px;
}

.housing-local-header {
  display: none;
}

.housing-text-link {
  color: var(--wf-primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.housing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.58fr);
  align-items: end;
  gap: 32px;
  padding: 30px 0 22px;
  border-bottom: 1px solid var(--wf-border-strong);
}

.housing-hero h1 {
  font-size: clamp(26px, 4vw, 38px);
}

.housing-hero p {
  margin: 0;
  color: var(--wf-text-secondary);
  font-size: 12px;
  line-height: 1.75;
}

.housing-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(270px, 0.62fr);
  margin-top: 22px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  background: var(--wf-surface);
  overflow: hidden;
}

.housing-planner {
  min-width: 0;
  padding: 22px;
}

.housing-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.housing-section-head h2,
.housing-sources h2 {
  font-size: 19px;
}

.housing-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 16px;
  margin-top: 20px;
}

.housing-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.housing-field > span {
  color: var(--wf-text-secondary);
  font-size: 11px;
  font-weight: 650;
}

.housing-field select,
.housing-field input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--wf-border-strong);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface-raised);
  color: var(--wf-text);
  font: 600 13px var(--wf-font);
  outline: none;
}

.housing-field select {
  padding: 0 11px;
}

.housing-field input {
  padding: 0 11px 0 27px;
}

.housing-field select:focus,
.housing-field input:focus {
  border-color: var(--wf-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wf-primary) 18%, transparent);
}

.housing-money-input {
  position: relative;
}

.housing-money-input b {
  position: absolute;
  top: 50%;
  left: 11px;
  z-index: 1;
  color: var(--wf-text-muted);
  font: 600 12px var(--wf-mono);
  transform: translateY(-50%);
}

.housing-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
  border-top: 1px solid var(--wf-border);
  border-bottom: 1px solid var(--wf-border);
}

.housing-results > div {
  min-width: 0;
  padding: 14px 12px;
  border-right: 1px solid var(--wf-border);
}

.housing-results > div:first-child {
  padding-left: 0;
}

.housing-results > div:last-child {
  border-right: 0;
}

.housing-results span,
.housing-results strong {
  display: block;
}

.housing-results span {
  color: var(--wf-text-muted);
  font-size: 10px;
}

.housing-results strong {
  margin-top: 6px;
  overflow: hidden;
  color: var(--wf-text);
  font: 700 14px var(--wf-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.housing-budget-note {
  margin-top: 14px;
  padding-left: 11px;
  border-left: 3px solid var(--wf-border-strong);
  color: var(--wf-text-secondary);
  font-size: 11px;
  line-height: 1.6;
}

.housing-budget-note.is-safe { border-color: var(--wf-success); }
.housing-budget-note.is-warn { border-color: var(--wf-warning); }
.housing-budget-note.is-risk { border-color: var(--wf-danger); }

.housing-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.housing-primary-btn {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--wf-primary);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

#housingSaveState {
  color: var(--wf-success);
  font-size: 11px;
}

.housing-fineprint {
  margin: 14px 0 0;
  color: var(--wf-text-muted);
  font-size: 9px;
  line-height: 1.65;
}

.housing-sources {
  padding: 22px 18px;
  border-left: 1px solid var(--wf-border);
  background: var(--wf-surface-subtle);
}

.housing-sources > p {
  margin: 7px 0 17px;
  color: var(--wf-text-secondary);
  font-size: 11px;
  line-height: 1.6;
}

.housing-source-list {
  border-top: 1px solid var(--wf-border);
}

.housing-source-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 13px 0;
  border-bottom: 1px solid var(--wf-border);
  color: inherit;
  text-decoration: none;
}

.housing-source-row strong,
.housing-source-row small {
  display: block;
}

.housing-source-row strong {
  color: var(--wf-text);
  font-size: 12px;
}

.housing-source-row small {
  margin-top: 3px;
  color: var(--wf-text-muted);
  font-size: 9px;
  line-height: 1.45;
}

.housing-source-row > b {
  color: var(--wf-primary);
  font-size: 13px;
}

.housing-source-rule {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--wf-danger) 35%, var(--wf-border));
  border-radius: var(--wf-radius-sm);
  background: color-mix(in srgb, var(--wf-danger) 6%, transparent);
}

.housing-source-rule strong,
.housing-source-rule span {
  display: block;
}

.housing-source-rule strong {
  color: var(--wf-danger);
  font-size: 11px;
}

.housing-source-rule span {
  margin-top: 4px;
  color: var(--wf-text-secondary);
  font-size: 10px;
  line-height: 1.55;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.housing-live {
  margin: 30px 0 0;
  padding-top: 4px;
}

.housing-live-head p {
  margin: 7px 0 0;
  color: var(--wf-text-secondary);
  font-size: 11px;
}

.housing-source-health {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.housing-source-health > a,
.housing-source-health > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  color: inherit;
  text-decoration: none;
}

.housing-source-health i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wf-text-muted);
}

.housing-source-health .is-ok i {
  background: var(--wf-success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wf-success) 12%, transparent);
}

.housing-source-health .is-error i {
  background: var(--wf-danger);
}

.housing-source-health strong,
.housing-source-health small {
  display: block;
}

.housing-source-health strong {
  color: var(--wf-text);
  font-size: 10px;
}

.housing-source-health small {
  margin-top: 1px;
  color: var(--wf-text-muted);
  font-size: 8px;
}

.housing-source-health > span.is-error {
  color: var(--wf-danger);
  font-size: 10px;
}

.housing-live-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(120px, 0.72fr));
  gap: 8px;
  margin-top: 14px;
  padding: 10px;
  border-top: 1px solid var(--wf-border-strong);
  border-bottom: 1px solid var(--wf-border-strong);
  background: var(--wf-surface-subtle);
}

.housing-live-toolbar label {
  min-width: 0;
}

.housing-live-toolbar input,
.housing-live-toolbar select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface-raised);
  color: var(--wf-text);
  font: 600 11px var(--wf-font);
  outline: none;
}

.housing-live-toolbar input:focus,
.housing-live-toolbar select:focus {
  border-color: var(--wf-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wf-primary) 16%, transparent);
}

.housing-live-meta {
  min-height: 32px;
  padding: 10px 2px 8px;
  color: var(--wf-text-muted);
  font: 600 9px var(--wf-mono);
}

.housing-listings {
  border-top: 1px solid var(--wf-border-strong);
}

.housing-listing-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 108px 88px;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 15px 4px;
  border-bottom: 1px solid var(--wf-border);
}

.housing-listing-row:hover {
  background: color-mix(in srgb, var(--wf-primary) 3%, transparent);
}

.housing-listing-source span,
.housing-listing-source small {
  display: block;
}

.housing-listing-source span {
  color: var(--wf-primary);
  font-size: 10px;
  font-weight: 750;
}

.housing-listing-source small {
  margin-top: 4px;
  color: var(--wf-text-muted);
  font-size: 8px;
}

.housing-listing-main {
  min-width: 0;
}

.housing-listing-main h3 {
  margin: 0;
  overflow: hidden;
  color: var(--wf-text);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.housing-listing-location {
  margin-top: 4px;
  overflow: hidden;
  color: var(--wf-text-secondary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.housing-listing-main p {
  display: -webkit-box;
  max-width: 760px;
  margin: 5px 0 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  color: var(--wf-text-muted);
  font-size: 9px;
  line-height: 1.45;
}

.housing-listing-price {
  text-align: right;
}

.housing-listing-price strong,
.housing-listing-price span {
  display: block;
}

.housing-listing-price strong {
  color: var(--wf-text);
  font: 750 16px var(--wf-mono);
}

.housing-listing-price span {
  margin-top: 3px;
  color: var(--wf-text-muted);
  font-size: 8px;
}

.housing-listing-open {
  color: var(--wf-primary);
  font-size: 10px;
  font-weight: 750;
  text-align: right;
  text-decoration: none;
  white-space: nowrap;
}

.housing-data-state {
  padding: 28px 16px;
  border-bottom: 1px solid var(--wf-border);
  color: var(--wf-text-muted);
  font-size: 11px;
  text-align: center;
}

.housing-data-state.is-error {
  color: var(--wf-danger);
}

.housing-load-more {
  display: block;
  min-width: 160px;
  min-height: 38px;
  margin: 16px auto 0;
  padding: 0 16px;
  border: 1px solid var(--wf-border-strong);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  color: var(--wf-text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.housing-load-more[hidden] {
  display: none;
}

.housing-data-policy {
  margin: 13px 0 0;
  color: var(--wf-text-muted);
  font-size: 9px;
  line-height: 1.6;
}

.housing-checks {
  margin: 28px 0 52px;
}

.housing-section-head > a {
  color: var(--wf-primary);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.housing-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
  border-top: 1px solid var(--wf-border-strong);
  border-bottom: 1px solid var(--wf-border-strong);
}

.housing-check-grid details {
  min-width: 0;
  padding: 15px 17px;
  border-right: 1px solid var(--wf-border);
}

.housing-check-grid details:last-child {
  border-right: 0;
}

.housing-check-grid summary {
  color: var(--wf-text);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.housing-check-grid ul {
  margin: 12px 0 0;
  padding-left: 17px;
  color: var(--wf-text-secondary);
  font-size: 10px;
  line-height: 1.7;
}

.housing-check-grid li + li {
  margin-top: 7px;
}

@media (max-width: 760px) {
  .wf-chat-fab {
    right: 12px !important;
    bottom: calc(84px + env(safe-area-inset-bottom)) !important;
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0 !important;
    justify-content: center;
    overflow: visible;
    font-size: 0 !important;
  }

  .wf-chat-fab::before {
    content: "互助";
    font-size: 11px;
    letter-spacing: -0.02em;
  }

  .wf-stage-head {
    padding: 16px 15px 13px;
  }

  .wf-stage-head h2 {
    font-size: 18px;
  }

  .wf-stage-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wf-stage-selector button:nth-child(2) {
    border-right: 0;
  }

  .wf-stage-selector button:nth-child(-n+2) {
    border-bottom: 1px solid var(--wf-border);
  }

  .wf-stage-content {
    display: block;
  }

  .wf-priority-row {
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 9px;
    padding: 12px 14px;
  }

  .wf-priority-copy small {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    white-space: normal;
  }

  .wf-priority-action {
    display: none;
  }

  .wf-stage-shortcuts {
    padding: 11px 14px;
    border-top: 1px solid var(--wf-border);
    border-left: 0;
  }

  .wf-stage-shortcuts > div:last-child {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wf-stage-shortcuts a {
    justify-content: center;
    padding: 0 5px;
    border-right: 1px solid var(--wf-border);
    border-bottom: 0;
    font-size: 11px;
    text-align: center;
  }

  .wf-stage-shortcuts a:last-child {
    border-right: 0;
  }

  body[data-wf-page="housing"] .housing-shell {
    padding-left: 15px;
    padding-right: 15px;
  }

  .housing-hero,
  .housing-workspace {
    display: block;
  }

  .housing-hero {
    padding: 22px 0 17px;
  }

  .housing-hero p {
    margin-top: 10px;
  }

  .housing-planner,
  .housing-sources {
    padding: 17px 15px;
  }

  .housing-form-grid,
  .housing-check-grid {
    grid-template-columns: 1fr;
  }

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

  .housing-results > div:nth-child(2) {
    border-right: 0;
  }

  .housing-results > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--wf-border);
  }

  .housing-results > div:nth-child(3) {
    padding-left: 0;
  }

  .housing-sources {
    border-top: 1px solid var(--wf-border);
    border-left: 0;
  }

  .housing-check-grid details {
    border-right: 0;
    border-bottom: 1px solid var(--wf-border);
  }

  .housing-check-grid details:last-child {
    border-bottom: 0;
  }

  .housing-live {
    margin-top: 24px;
  }

  .housing-live-head {
    display: block;
  }

  .housing-live-head > a {
    display: inline-block;
    margin-top: 9px;
  }

  .housing-source-health {
    display: grid;
    grid-template-columns: 1fr;
  }

  .housing-live-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .housing-search-field {
    grid-column: 1 / -1;
  }

  .housing-live-toolbar label:last-child {
    grid-column: 1 / -1;
  }

  .housing-listing-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 14px 2px;
  }

  .housing-listing-source {
    grid-column: 1;
    grid-row: 1;
  }

  .housing-listing-price {
    grid-column: 2;
    grid-row: 1;
  }

  .housing-listing-main {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .housing-listing-main h3,
  .housing-listing-location {
    white-space: normal;
  }

  .housing-listing-main p {
    -webkit-line-clamp: 2;
  }

  .housing-listing-open {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
    min-height: 30px;
    padding-top: 7px;
    text-align: left;
  }
}

html[data-theme="cyber"] {
  color-scheme: dark;
  --wf-canvas: #111715;
  --wf-surface: #18201d;
  --wf-surface-subtle: #202a26;
  --wf-surface-raised: #222c28;
  --wf-overlay: rgba(4, 8, 7, 0.74);
  --wf-text: #ecf2ef;
  --wf-text-secondary: #b8c5bf;
  --wf-text-muted: #8b9b94;
  --wf-border: #33413b;
  --wf-border-strong: #4b5c54;
  --wf-primary: #65b49e;
  --wf-primary-hover: #81c5b2;
  --wf-primary-soft: #203a33;
  --wf-accent: #dfa35f;
  --wf-accent-soft: #3d3020;
  --wf-danger: #e17870;
  --wf-success: #70bd92;
  --wf-info: #79a9c4;
  --wf-shadow-raised: 0 12px 34px rgba(0, 0, 0, 0.22);
  --wf-shadow-overlay: 0 28px 80px rgba(0, 0, 0, 0.5);
  --btn-text: #10211c;
}

html[data-theme="ocean"] {
  --wf-primary: #315f78;
  --wf-primary-hover: #244d64;
  --wf-primary-soft: #e3edf2;
  --wf-info: #315f78;
}

html[data-theme="sakura"] {
  --wf-primary: #875e68;
  --wf-primary-hover: #704b55;
  --wf-primary-soft: #f3e8eb;
}

html[data-theme="eyecare"] {
  --wf-canvas: #edf3ec;
  --wf-surface-subtle: #e5eee4;
  --wf-primary: #356449;
  --wf-primary-hover: #294f39;
  --wf-primary-soft: #dcebdd;
}

html {
  min-width: 320px;
  scroll-padding-top: calc(var(--wf-context) + 16px);
  background: var(--wf-canvas);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

body.wf-enhanced {
  margin: 0;
  min-height: 100vh;
  padding: var(--wf-context) 0 0 var(--wf-rail);
  background: var(--wf-canvas);
  color: var(--wf-text);
  font-family: var(--wf-font);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.006em;
  transition: background-color var(--wf-normal) var(--wf-ease), color var(--wf-normal) var(--wf-ease);
}

body.wf-enhanced::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--wf-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--wf-border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.12;
}

::selection {
  color: var(--wf-text);
  background: var(--wf-primary-soft);
}

a {
  color: var(--wf-primary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--wf-primary-hover);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
[role="button"],
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

h1,
h2,
h3,
.title {
  text-wrap: balance;
}

p,
li,
td,
.wf-msg-text,
.msg-content {
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--wf-primary) 34%, transparent);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible) {
  outline: none;
}

button,
.btn,
.m-btn,
.btn-full,
.small-btn,
.edit-btn,
.ai-btn,
.ai-scan-btn,
.fab {
  min-height: var(--wf-control);
  border: 1px solid transparent;
  border-radius: var(--wf-radius-sm);
  box-shadow: none;
  font-weight: 700;
  letter-spacing: 0;
  transition:
    background-color var(--wf-fast) var(--wf-ease),
    border-color var(--wf-fast) var(--wf-ease),
    color var(--wf-fast) var(--wf-ease),
    opacity var(--wf-fast) var(--wf-ease);
}

button:not(:disabled),
[role="button"]:not([aria-disabled="true"]) {
  cursor: pointer;
}

button:disabled,
.btn:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.48;
}

.btn,
.m-submit,
.btn-full,
.fab,
button.primary {
  background: var(--wf-primary);
  color: #ffffff;
}

.btn:hover:not(:disabled),
.m-submit:hover:not(:disabled),
.btn-full:hover:not(:disabled),
.fab:hover:not(:disabled),
button.primary:hover:not(:disabled) {
  background: var(--wf-primary-hover);
}

.m-cancel,
.secondary,
.edit-btn,
.small-btn,
.filter-btn,
.type-btn,
.tgt-btn,
.preset-btn,
.segment-btn,
.cat-btn,
.main-tab-btn,
.switch-btn {
  border-color: var(--wf-border);
  background: var(--wf-surface);
  color: var(--wf-text-secondary);
}

input,
select,
textarea,
.input-group input,
.field input,
.field select,
.field textarea,
.form-group input,
.form-group select,
.modal-content input,
.modal-content textarea {
  width: 100%;
  min-height: var(--wf-control);
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  color: var(--wf-text);
  box-shadow: none;
  outline: none;
  padding: 9px 12px;
  font-size: 14px;
  transition:
    border-color var(--wf-fast) var(--wf-ease),
    box-shadow var(--wf-fast) var(--wf-ease),
    background-color var(--wf-fast) var(--wf-ease);
}

/* Native binary controls must never inherit the full-width text-field geometry. */
body.wf-enhanced input[type="checkbox"],
body.wf-enhanced input[type="radio"],
body.wf-enhanced .modal-content input[type="checkbox"],
body.wf-enhanced .modal-content input[type="radio"] {
  width: 20px !important;
  min-width: 20px;
  height: 20px;
  min-height: 20px !important;
  margin: 2px 0 0;
  padding: 0 !important;
  border-radius: 4px;
  box-shadow: none;
  flex: 0 0 20px;
  accent-color: var(--wf-primary);
}

body.wf-enhanced input[type="radio"],
body.wf-enhanced .modal-content input[type="radio"] {
  border-radius: 50%;
}

body.wf-enhanced input[type="hidden"] {
  display: none !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--wf-text-muted);
  opacity: 0.82;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--wf-border-strong);
}

input:focus,
select:focus,
textarea:focus,
.input-group input:focus {
  border-color: var(--wf-primary);
  background: var(--wf-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wf-primary) 13%, transparent);
}

label,
.label,
.form-label,
.field > label,
.input-label {
  color: var(--wf-text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.wf-skip-link {
  position: fixed;
  top: 8px;
  left: calc(var(--wf-rail) + 12px);
  z-index: 10000;
  padding: 8px 12px;
  border-radius: var(--wf-radius-sm);
  background: var(--wf-text);
  color: var(--wf-surface);
  transform: translateY(-150%);
  transition: transform var(--wf-fast) var(--wf-ease);
}

.wf-skip-link:focus {
  transform: translateY(0);
}

/* Shared application frame */
.wf-app-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 900;
  width: var(--wf-rail);
  border-right: 1px solid var(--wf-border);
  background: color-mix(in srgb, var(--wf-surface) 96%, transparent);
  display: flex;
  flex-direction: column;
}

.wf-brand {
  min-height: 88px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--wf-border);
  text-decoration: none;
  color: var(--wf-text);
}

.wf-brand:hover {
  color: var(--wf-text);
}

.wf-brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 820;
  letter-spacing: 0.08em;
}

.wf-brand-mark svg {
  width: 25px;
  height: 25px;
  color: var(--wf-primary);
}

.wf-brand-sub {
  display: block;
  margin: 5px 0 0 35px;
  color: var(--wf-text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wf-rail-nav {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 15px 10px 24px;
  scrollbar-width: thin;
}

.wf-nav-group {
  margin: 0 0 17px;
}

.wf-nav-label {
  padding: 0 9px 7px;
  color: var(--wf-text-muted);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.wf-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 37px;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--wf-radius-sm);
  color: var(--wf-text-secondary);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition:
    color var(--wf-fast) var(--wf-ease),
    background-color var(--wf-fast) var(--wf-ease);
}

.wf-nav-link:hover {
  color: var(--wf-text);
  background: var(--wf-surface-subtle);
}

.wf-nav-link.is-active {
  color: var(--wf-primary);
  background: var(--wf-primary-soft);
}

.wf-nav-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: var(--wf-primary);
}

.wf-nav-icon {
  width: 21px;
  color: var(--wf-text-muted);
  font-family: var(--wf-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.wf-nav-link.is-active .wf-nav-icon {
  color: var(--wf-primary);
}

.wf-rail-foot {
  padding: 13px 18px calc(13px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--wf-border);
  color: var(--wf-text-muted);
  font-size: 10px;
  line-height: 1.5;
}

.wf-rail-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--wf-text-secondary);
  font-weight: 700;
}

.wf-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wf-success);
}

.wf-context-bar {
  position: fixed;
  inset: 0 0 auto var(--wf-rail);
  z-index: 880;
  height: var(--wf-context);
  border-bottom: 1px solid var(--wf-border);
  background: color-mix(in srgb, var(--wf-surface) 94%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
}

.wf-context-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.wf-context-eyebrow {
  color: var(--wf-text-muted);
  font-family: var(--wf-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wf-context-title {
  overflow: hidden;
  color: var(--wf-text);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-context-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wf-country-pill,
.wf-command-trigger {
  min-height: 30px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  color: var(--wf-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
}

.wf-country-pill span {
  color: var(--wf-primary);
  font-family: var(--wf-mono);
}

.wf-command-trigger kbd {
  border: 1px solid var(--wf-border);
  border-bottom-color: var(--wf-border-strong);
  border-radius: 3px;
  background: var(--wf-surface-subtle);
  color: var(--wf-text-muted);
  padding: 1px 5px;
  font: 9px var(--wf-mono);
}

.wf-mobile-dock {
  display: none;
}

/* Existing page shell normalization */
body.wf-enhanced .mobile-wrapper,
body.wf-enhanced .wrap {
  width: min(100%, 1180px);
  max-width: 1180px;
  min-height: auto;
  height: auto;
  margin: 0 auto;
  padding: 0 32px 64px;
  background: transparent;
  box-shadow: none;
}

body.wf-enhanced .header,
body.wf-enhanced .top,
body.wf-enhanced .top-nav {
  position: sticky;
  top: var(--wf-context);
  z-index: 80;
  min-height: 64px;
  margin: 0 -32px 24px;
  padding: 12px 32px;
  border: 0;
  border-bottom: 1px solid var(--wf-border);
  background: color-mix(in srgb, var(--wf-canvas) 96%, transparent);
  box-shadow: none;
  backdrop-filter: none;
}

body.wf-enhanced .title,
body.wf-enhanced .top .title {
  color: var(--wf-text);
  font-size: 17px;
  font-weight: 790;
  letter-spacing: -0.02em;
}

body.wf-enhanced .sub,
body.wf-enhanced .subtitle {
  color: var(--wf-text-muted);
  font-size: 12px;
}

body.wf-enhanced .back,
body.wf-enhanced .back-btn,
body.wf-enhanced .refresh-btn,
body.wf-enhanced .refresh-btn-login,
body.wf-enhanced .close-btn {
  min-width: 36px;
  width: 36px;
  min-height: 36px;
  height: 36px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  color: var(--wf-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: none;
  opacity: 1;
}

body.wf-enhanced .card,
body.wf-enhanced .auth-box,
body.wf-enhanced .country-picker,
body.wf-enhanced .profile-card,
body.wf-enhanced .task-brief-card,
body.wf-enhanced .leaderboard-hud,
body.wf-enhanced .weather-matrix,
body.wf-enhanced .input-card,
body.wf-enhanced .res-card,
body.wf-enhanced .wealth-dashboard,
body.wf-enhanced .progress-card,
body.wf-enhanced .legal-banner,
body.wf-enhanced .guide-banner {
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  background: var(--wf-surface);
  box-shadow: none;
  color: var(--wf-text);
}

body.wf-enhanced .card,
body.wf-enhanced .input-card,
body.wf-enhanced .res-card {
  padding: 18px;
}

body.wf-enhanced .legal-banner {
  border-left: 3px solid var(--wf-warning);
  background: var(--wf-accent-soft);
  color: var(--wf-text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

body.wf-enhanced .legal-banner strong {
  color: var(--wf-warning);
}

body.wf-enhanced .guide-banner {
  border-left: 3px solid var(--wf-primary);
  background: var(--wf-surface);
  transition: border-color var(--wf-fast) var(--wf-ease), background-color var(--wf-fast) var(--wf-ease);
}

body.wf-enhanced .guide-banner:hover {
  border-color: var(--wf-primary);
  background: var(--wf-primary-soft);
}

body.wf-enhanced .section-header,
body.wf-enhanced .grid-header,
body.wf-enhanced .modal-header {
  border-bottom-color: var(--wf-border);
}

body.wf-enhanced .s-title,
body.wf-enhanced .grid-header,
body.wf-enhanced .modal-title {
  color: var(--wf-text);
  font-weight: 780;
  letter-spacing: -0.015em;
}

body.wf-enhanced .s-more {
  color: var(--wf-primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

body.wf-enhanced .tabs,
body.wf-enhanced .segment-group,
body.wf-enhanced .type-toggle,
body.wf-enhanced .switch-bar {
  padding: 3px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface-subtle);
}

body.wf-enhanced .tab,
body.wf-enhanced .segment-btn,
body.wf-enhanced .type-btn,
body.wf-enhanced .switch-btn,
body.wf-enhanced .filter-btn,
body.wf-enhanced .tgt-btn,
body.wf-enhanced .preset-btn,
body.wf-enhanced .cat-btn,
body.wf-enhanced .main-tab-btn {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--wf-radius-xs);
  background: transparent;
  color: var(--wf-text-muted);
  box-shadow: none;
}

body.wf-enhanced .tab.active,
body.wf-enhanced .segment-btn.active,
body.wf-enhanced .type-btn.active,
body.wf-enhanced .switch-btn.active,
body.wf-enhanced .filter-btn.active,
body.wf-enhanced .tgt-btn.active,
body.wf-enhanced .preset-btn.active,
body.wf-enhanced .cat-btn.active,
body.wf-enhanced .main-tab-btn.active {
  border-color: var(--wf-border);
  background: var(--wf-surface);
  color: var(--wf-primary);
  box-shadow: 0 1px 2px rgba(21, 36, 31, 0.06);
}

body.wf-enhanced .modal,
body.wf-enhanced .modal-overlay {
  padding: 24px;
  background: var(--wf-overlay);
  backdrop-filter: none;
}

body.wf-enhanced .modal-content {
  width: min(100%, 520px);
  max-width: 520px;
  border: 1px solid var(--wf-border-strong);
  border-radius: var(--wf-radius-lg);
  background: var(--wf-surface-raised);
  color: var(--wf-text);
  box-shadow: var(--wf-shadow-overlay);
  overscroll-behavior: contain;
}

body.wf-enhanced #toast {
  top: auto;
  bottom: -90px;
  left: calc(50% + var(--wf-rail) / 2);
  max-width: min(560px, calc(100vw - var(--wf-rail) - 40px));
  padding: 11px 15px;
  border: 1px solid var(--wf-border-strong);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-text);
  color: var(--wf-surface);
  box-shadow: var(--wf-shadow-raised);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  white-space: normal;
  transition: bottom var(--wf-normal) var(--wf-ease);
}

body.wf-enhanced #toast.show {
  top: auto;
  bottom: 24px;
}

body.wf-enhanced #toast.error {
  background: var(--wf-danger);
  color: #ffffff;
}

body.wf-enhanced .empty-state,
body.wf-enhanced .empty,
body.wf-enhanced .loading-text {
  color: var(--wf-text-muted);
}

body.wf-enhanced .empty-state,
body.wf-enhanced .empty {
  min-height: 120px;
  padding: 32px 20px;
  border: 1px dashed var(--wf-border-strong);
  border-radius: var(--wf-radius-md);
  background: var(--wf-surface-subtle);
  display: grid;
  place-items: center;
}

body.wf-enhanced .severe-warning {
  margin: 14px 0;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--wf-danger) 32%, var(--wf-border));
  border-left: 3px solid var(--wf-danger);
  border-radius: var(--wf-radius-sm);
  background: color-mix(in srgb, var(--wf-danger) 8%, var(--wf-surface));
  color: var(--wf-text-secondary);
  box-shadow: none;
  font-size: 12px;
  line-height: 1.55;
}

body.wf-enhanced .severe-warning a {
  color: var(--wf-danger);
}

body.wf-enhanced .view-toggle,
body.wf-enhanced .main-tab-bar {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface-subtle);
  box-shadow: none;
}

body.wf-enhanced .view-btn,
body.wf-enhanced .grid-action-btn {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--wf-radius-xs);
  background: transparent;
  color: var(--wf-text-muted);
  box-shadow: none;
}

body.wf-enhanced .view-btn.active {
  border-color: var(--wf-border);
  background: var(--wf-surface);
  color: var(--wf-primary);
  box-shadow: 0 1px 2px rgba(21, 36, 31, 0.06);
}

/* Home: one clear daily surface and a dense two-column workbench */
body[data-wf-page="index"] .mobile-wrapper {
  padding-bottom: 88px;
}

body[data-wf-page="index"] .top-nav {
  margin-bottom: 0;
}

body[data-wf-page="index"] .brand-logo {
  color: var(--wf-text);
  font-size: 15px;
  font-weight: 840;
  letter-spacing: 0.07em;
}

body[data-wf-page="index"] #r-mode {
  margin-left: 7px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-xs);
  background: var(--wf-surface-subtle);
  color: var(--wf-text-muted);
  padding: 3px 6px;
  font: 9px var(--wf-mono);
}

body[data-wf-page="index"] .stamina-pill {
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  color: var(--wf-accent);
  box-shadow: none;
}

body[data-wf-page="index"] .global-ticker {
  min-height: 32px;
  margin: 0 -32px;
  border-bottom: 1px solid var(--wf-border);
  background: var(--wf-surface-subtle);
  color: var(--wf-text-secondary);
}

body[data-wf-page="index"] .ticker-text {
  font-size: 11px;
}

body[data-wf-page="index"] .pwa-guide {
  margin: 18px 0 0;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-primary-soft);
  color: var(--wf-text-secondary);
  box-shadow: none;
}

.wf-daily-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 30px 0 20px;
  border-bottom: 1px solid var(--wf-border);
}

.wf-daily-kicker {
  margin-bottom: 7px;
  color: var(--wf-primary);
  font: 700 10px var(--wf-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wf-daily-head h1 {
  margin: 0;
  color: var(--wf-text);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.wf-daily-head p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--wf-text-secondary);
  font-size: 13px;
}

.wf-daily-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.wf-daily-actions a {
  min-height: 38px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  color: var(--wf-text-secondary);
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.wf-daily-actions a:first-child {
  border-color: var(--wf-primary);
  background: var(--wf-primary);
  color: #ffffff;
}

.wf-home-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 12px;
  padding: 20px 0;
}

.wf-home-overview .legal-banner,
.wf-home-overview .guide-banner {
  grid-column: 1;
  margin: 0;
}

.wf-home-overview .clock-bar,
.wf-home-overview .weather-matrix {
  grid-column: 2;
  margin: 0;
}

.wf-home-overview .clock-bar {
  grid-row: 1;
}

.wf-home-overview .weather-matrix {
  grid-row: 2;
}

.wf-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.72fr);
  align-items: start;
  gap: 24px;
  padding-top: 4px;
}

.wf-home-stream,
.wf-home-rail {
  min-width: 0;
}

.wf-home-rail {
  position: sticky;
  top: calc(var(--wf-context) + 80px);
  display: grid;
  gap: 12px;
}

body[data-wf-page="index"] .section-header {
  margin: 0;
  padding: 14px 0 10px;
}

body[data-wf-page="index"] .task-brief-card,
body[data-wf-page="index"] .leaderboard-hud {
  margin: 0;
  padding: 16px;
}

body[data-wf-page="index"] .feed-card,
body[data-wf-page="index"] .job-card,
body[data-wf-page="index"] .market-card {
  border: 0;
  border-bottom: 1px solid var(--wf-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-wf-page="index"] .bottom-nav {
  display: none;
}

body[data-wf-page="index"] .grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body[data-wf-page="index"] .grid-item {
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  box-shadow: none;
}

body[data-wf-page="index"] .profile-card {
  padding: 22px;
}

body[data-wf-page="index"] .gb-icon {
  filter: none;
  text-shadow: none;
}

body[data-wf-page="index"] #rewardModal .modal-content,
body[data-wf-page="index"] #agreeModal .modal-content,
body[data-wf-page="index"] #countryModal .modal-content {
  border: 1px solid var(--wf-border-strong) !important;
  background: var(--wf-surface-raised) !important;
  color: var(--wf-text) !important;
  box-shadow: var(--wf-shadow-overlay) !important;
}

body[data-wf-page="index"] #agreeModal,
body[data-wf-page="index"] #countryModal,
body[data-wf-page="index"] #rewardModal {
  background: var(--wf-overlay) !important;
}

/* Login: purposeful split screen, no app rail */
body[data-wf-page="login"] {
  min-height: 100vh;
  padding: 0;
  background: var(--wf-canvas);
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(480px, 1.1fr);
  align-items: stretch;
}

body[data-wf-page="login"]::before {
  opacity: 0.2;
}

.wf-login-story {
  position: relative;
  min-height: 100vh;
  padding: 48px clamp(38px, 6vw, 84px);
  border-right: 1px solid var(--wf-border);
  background: var(--wf-primary);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wf-login-story::after {
  content: "AU 33.8688° S · 151.2093° E\A NZ 36.8509° S · 174.7645° E";
  position: absolute;
  right: 28px;
  bottom: 34px;
  color: rgba(255, 255, 255, 0.45);
  font: 10px/1.8 var(--wf-mono);
  white-space: pre;
  text-align: right;
}

.wf-login-wordmark {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.wf-login-wordmark svg {
  width: 28px;
  height: 28px;
}

.wf-login-story-main {
  max-width: 520px;
  padding: 60px 0 100px;
}

.wf-login-story-kicker {
  margin-bottom: 13px;
  color: rgba(255, 255, 255, 0.68);
  font: 700 10px var(--wf-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wf-login-story h1 {
  max-width: 470px;
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.wf-login-story p {
  max-width: 460px;
  margin: 20px 0 28px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.75;
}

.wf-login-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.wf-login-proof div {
  padding: 14px 12px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.wf-login-proof strong {
  display: block;
  margin-bottom: 3px;
  color: #ffffff;
  font-size: 13px;
}

body[data-wf-page="login"] .mobile-wrapper {
  width: min(100%, 540px);
  max-width: 540px;
  min-height: 100vh;
  margin: 0 auto;
  padding: max(54px, 8vh) 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body[data-wf-page="login"] .logo-area {
  margin-bottom: 24px;
  text-align: left;
}

body[data-wf-page="login"] .logo-icon {
  display: none;
}

body[data-wf-page="login"] .logo-title {
  color: var(--wf-text);
  font-size: 25px;
  font-weight: 820;
  letter-spacing: -0.035em;
}

.wf-login-lead {
  margin: 7px 0 0;
  color: var(--wf-text-secondary);
  font-size: 13px;
}

body[data-wf-page="login"] .country-picker,
body[data-wf-page="login"] .auth-box {
  padding: 18px;
  margin-bottom: 12px;
  border-radius: var(--wf-radius-md);
  box-shadow: none;
}

body[data-wf-page="login"] .country-title {
  color: var(--wf-text-secondary);
  font-size: 12px;
  font-weight: 760;
}

body[data-wf-page="login"] .country-btn {
  min-height: 44px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface-subtle);
  color: var(--wf-text-secondary);
}

body[data-wf-page="login"] .country-btn.active {
  border-color: var(--wf-primary);
  background: var(--wf-primary-soft);
  color: var(--wf-primary);
  box-shadow: inset 0 0 0 1px var(--wf-primary);
}

body[data-wf-page="login"] .country-note {
  color: var(--wf-text-muted);
  font-size: 11px;
}

body[data-wf-page="login"] .tabs {
  margin-bottom: 18px;
}

body[data-wf-page="login"] .tab {
  flex: 1;
  padding: 8px 10px;
}

body[data-wf-page="login"] .input-group {
  margin-bottom: 13px;
}

body[data-wf-page="login"] .wf-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--wf-text-secondary);
  font-size: 12px;
  font-weight: 720;
}

body[data-wf-page="login"] .forgot-pwd {
  color: var(--wf-primary);
  text-decoration: none;
}

body[data-wf-page="login"] .refresh-btn-login {
  top: 18px;
  right: 18px;
}

body[data-wf-page="login"] #toast {
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
}

/* Command surface */
.wf-command {
  position: fixed;
  inset: 0;
  z-index: 4000;
  padding: min(12vh, 100px) 20px 20px;
  background: var(--wf-overlay);
  display: none;
  align-items: flex-start;
  justify-content: center;
}

.wf-command.is-open {
  display: flex;
}

.wf-command-panel {
  width: min(620px, 100%);
  overflow: hidden;
  border: 1px solid var(--wf-border-strong);
  border-radius: var(--wf-radius-lg);
  background: var(--wf-surface-raised);
  box-shadow: var(--wf-shadow-overlay);
}

.wf-command-search {
  position: relative;
  padding: 14px;
  border-bottom: 1px solid var(--wf-border);
}

.wf-command-search input {
  height: 46px;
  padding-left: 38px;
  font-size: 15px;
}

.wf-command-search::before {
  content: "/";
  position: absolute;
  top: 26px;
  left: 29px;
  z-index: 1;
  color: var(--wf-text-muted);
  font: 14px var(--wf-mono);
}

.wf-command-results {
  max-height: min(58vh, 520px);
  overflow: auto;
  padding: 7px;
}

.wf-command-item {
  min-height: 52px;
  border-radius: var(--wf-radius-sm);
  color: var(--wf-text);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  text-decoration: none;
}

.wf-command-item:hover,
.wf-command-item.is-selected {
  background: var(--wf-primary-soft);
  color: var(--wf-text);
}

.wf-command-index {
  color: var(--wf-text-muted);
  font: 10px var(--wf-mono);
}

.wf-command-name {
  font-size: 13px;
  font-weight: 760;
}

.wf-command-desc {
  color: var(--wf-text-muted);
  font-size: 10px;
}

.wf-command-group {
  color: var(--wf-text-muted);
  font: 9px var(--wf-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wf-command-empty {
  padding: 42px 20px;
  color: var(--wf-text-muted);
  text-align: center;
}

/* Existing chat, now part of the same product language */
body.wf-enhanced .wf-chat-fab {
  right: 20px;
  bottom: 20px;
  min-height: 42px;
  border: 1px solid var(--wf-primary);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-primary);
  color: #ffffff;
  box-shadow: var(--wf-shadow-raised);
  font-size: 12px;
  font-weight: 760;
}

body.wf-enhanced .wf-chat-panel {
  right: 20px;
  bottom: 72px;
  border: 1px solid var(--wf-border-strong);
  border-radius: var(--wf-radius-lg);
  background: var(--wf-surface-raised);
  box-shadow: var(--wf-shadow-overlay);
  backdrop-filter: none;
}

body.wf-enhanced .wf-chat-head,
body.wf-enhanced .wf-chat-foot,
body.wf-enhanced .wf-chat-rooms,
body.wf-enhanced .wf-chat-login {
  border-color: var(--wf-border);
  background: var(--wf-surface);
}

body.wf-enhanced .wf-chat-body {
  background: var(--wf-surface-subtle);
}

body.wf-enhanced .wf-chat-room,
body.wf-enhanced .wf-msg {
  border-color: var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  box-shadow: none;
}

body.wf-enhanced .wf-chat-room.active,
body.wf-enhanced .wf-msg.mine {
  border-color: var(--wf-primary);
  background: var(--wf-primary-soft);
  color: var(--wf-text);
}

body.wf-enhanced .wf-chat-close {
  border: 1px solid var(--wf-border);
  background: var(--wf-surface-subtle);
  color: var(--wf-text-secondary);
}

/* Maps and data-heavy pages */
body[data-wf-page="news"] {
  overflow: hidden;
}

body[data-wf-page="news"] .mobile-wrapper {
  width: 100%;
  max-width: none;
  height: calc(100vh - var(--wf-context));
  padding: 0;
}

body[data-wf-page="news"] .header {
  margin: 0;
}

body[data-wf-page="news"] .content-area,
body[data-wf-page="news"] .main-content {
  min-height: 0;
}

body[data-wf-page="news"] #ugcModal {
  align-items: center;
  padding: 24px;
}

body[data-wf-page="news"] #ugcModal .modal-content {
  width: min(640px, 100%);
  max-width: 640px;
  max-height: min(820px, calc(100dvh - 48px));
  border-radius: var(--wf-radius-lg);
}

body[data-wf-page="news"] #ugcModal .modal-header {
  padding: 17px 20px;
  border-radius: var(--wf-radius-lg) var(--wf-radius-lg) 0 0;
}

body[data-wf-page="news"] #ugcModal .modal-body {
  padding: 18px 20px 22px;
}

body[data-wf-page="news"] #ugcModal .modal-footer {
  padding: 14px 20px 18px;
  gap: 12px;
  box-shadow: none;
}

body[data-wf-page="news"] #ugcModal .input-group {
  min-width: 0;
  padding: 12px;
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
}

body[data-wf-page="news"] #ugcModal .input-group input,
body[data-wf-page="news"] #ugcModal .input-group select,
body[data-wf-page="news"] #ugcModal .input-group textarea {
  min-width: 0;
}

body[data-wf-page="news"] #ugcModal .form-section-title {
  margin: 18px 0 8px;
  color: var(--wf-text-secondary);
}

body[data-wf-page="news"] #ugcModal .segment-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-wf-page="news"] #ugcModal .segment-btn {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface-subtle);
  color: var(--wf-text-secondary);
}

body[data-wf-page="news"] #ugcModal .segment-btn.active {
  border-color: var(--wf-primary);
  background: var(--wf-primary-soft);
  color: var(--wf-primary);
  box-shadow: inset 0 0 0 1px var(--wf-primary);
}

body[data-wf-page="news"] #ugcModal .smart-tags-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

body[data-wf-page="news"] #ugcModal .smart-tag-btn {
  min-width: 0;
  padding: 8px 7px;
  border-radius: var(--wf-radius-sm);
  text-align: center;
}

body[data-wf-page="news"] #ugcModal .disclaimer-box {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 11px 12px;
  border-radius: var(--wf-radius-sm);
  align-items: flex-start;
  background: var(--wf-surface-subtle);
}

body[data-wf-page="news"] #ugcModal .disclaimer-text {
  min-width: 0;
  color: var(--wf-text-secondary);
  font-size: 11px;
  line-height: 1.55;
  text-align: left;
  overflow-wrap: anywhere;
}

body.wf-enhanced table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

body.wf-enhanced th {
  color: var(--wf-text-muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

body.wf-enhanced th,
body.wf-enhanced td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--wf-border);
}

body.wf-enhanced .badge,
body.wf-enhanced .chip,
body.wf-enhanced .f-tag,
body.wf-enhanced .smart-tag-btn {
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-xs);
  background: var(--wf-surface-subtle);
  color: var(--wf-text-secondary);
  box-shadow: none;
}

@media (max-width: 1050px) {
  :root {
    --wf-rail: 208px;
  }

  body[data-wf-page="index"] .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .wf-home-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.7fr);
    gap: 16px;
  }

  body[data-wf-page="login"] {
    grid-template-columns: minmax(320px, 0.76fr) minmax(430px, 1fr);
  }
}

@media (max-width: 820px) {
  :root {
    --wf-context: 46px;
  }

  body.wf-enhanced {
    padding: var(--wf-context) 0 calc(72px + env(safe-area-inset-bottom));
  }

  .wf-app-rail {
    display: none;
  }

  .wf-context-bar {
    left: 0;
    padding: 0 14px;
  }

  .wf-context-copy {
    gap: 6px;
  }

  .wf-context-eyebrow {
    display: none;
  }

  .wf-command-trigger {
    width: 34px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .wf-command-trigger::before {
    content: "/";
    font: 14px var(--wf-mono);
  }

  .wf-command-trigger kbd {
    display: none;
  }

  .wf-mobile-dock {
    position: fixed;
    inset: auto 0 0;
    z-index: 870;
    min-height: calc(58px + env(safe-area-inset-bottom));
    padding: 5px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--wf-border);
    background: color-mix(in srgb, var(--wf-surface) 96%, transparent);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wf-mobile-dock a {
    min-height: 48px;
    border-radius: var(--wf-radius-sm);
    color: var(--wf-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
  }

  .wf-mobile-dock a.is-active {
    color: var(--wf-primary);
    background: var(--wf-primary-soft);
  }

  .wf-mobile-dock b {
    font: 9px var(--wf-mono);
  }

  .wf-skip-link {
    left: 8px;
  }

  body.wf-enhanced .mobile-wrapper,
  body.wf-enhanced .wrap {
    width: 100%;
    padding: 0 16px 36px;
  }

  body.wf-enhanced .header,
  body.wf-enhanced .top,
  body.wf-enhanced .top-nav {
    top: var(--wf-context);
    margin: 0 -16px 18px;
    padding: 10px 16px;
  }

  body.wf-enhanced #toast {
    left: 50%;
    max-width: calc(100vw - 28px);
  }

  body.wf-enhanced #toast.show {
    bottom: calc(74px + env(safe-area-inset-bottom));
  }

  body[data-wf-page="index"] .bottom-nav {
    inset: auto 0 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: calc(60px + env(safe-area-inset-bottom));
    height: calc(60px + env(safe-area-inset-bottom)) !important;
    transform: none !important;
    padding: 4px 8px env(safe-area-inset-bottom) !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: column;
    align-items: stretch;
    z-index: 875;
    border-top: 1px solid var(--wf-border);
    background: var(--wf-surface);
    box-shadow: none;
  }

  body[data-wf-page="index"] .bottom-nav .nav-item {
    min-width: 0;
    min-height: 52px;
    height: 52px;
    padding: 4px 2px;
    border: 0;
    border-radius: var(--wf-radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    background: transparent;
    color: var(--wf-text-muted);
    font-size: 10px;
  }

  body[data-wf-page="index"] .bottom-nav .nav-item.active {
    background: var(--wf-primary-soft);
    color: var(--wf-primary);
  }

  body[data-wf-page="index"] .bottom-nav .nav-icon {
    margin: 0;
    font-size: 16px;
    line-height: 1;
  }

  body[data-wf-page="index"] .wf-mobile-dock {
    display: none;
  }

  body[data-wf-page="index"] .global-ticker {
    margin: 0 -16px;
  }

  .wf-daily-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 23px 0 17px;
  }

  .wf-daily-head h1 {
    font-size: 26px;
  }

  .wf-daily-actions {
    width: 100%;
  }

  .wf-daily-actions a {
    flex: 1;
    justify-content: center;
  }

  .wf-home-overview,
  .wf-home-grid {
    display: block;
  }

  .wf-home-overview > *,
  .wf-home-stream > *,
  .wf-home-rail > * {
    margin-bottom: 10px;
  }

  .wf-home-grid {
    padding-top: 0;
  }

  .wf-home-rail {
    position: static;
  }

  body[data-wf-page="index"] .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.wf-enhanced .wf-chat-fab {
    right: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body.wf-enhanced .wf-chat-panel {
    inset: auto 8px calc(124px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
  }

  body[data-wf-page="login"] {
    display: block;
    padding: 0;
  }

  .wf-login-story {
    min-height: auto;
    padding: 26px 22px 30px;
    border: 0;
    border-bottom: 1px solid var(--wf-border);
  }

  .wf-login-story-main {
    padding: 32px 0 0;
  }

  .wf-login-story h1 {
    max-width: 330px;
    font-size: 34px;
  }

  .wf-login-story p {
    margin: 14px 0 22px;
  }

  .wf-login-story::after {
    display: none;
  }

  body[data-wf-page="login"] .mobile-wrapper {
    min-height: auto;
    padding: 30px 18px 56px;
  }

  body[data-wf-page="login"] .refresh-btn-login {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  body[data-wf-page="news"] {
    padding-bottom: 0;
  }

  body[data-wf-page="news"] .wf-mobile-dock {
    display: none;
  }
}

@media (max-width: 480px) {
  .wf-country-pill {
    padding: 5px 7px;
  }

  .wf-country-pill strong {
    display: none;
  }

  body.wf-enhanced .card,
  body.wf-enhanced .input-card,
  body.wf-enhanced .res-card {
    padding: 15px;
  }

  body[data-wf-page="index"] .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wf-login-story {
    padding: 22px 18px 24px;
  }

  .wf-login-story-main {
    padding-top: 26px;
  }

  .wf-login-story h1 {
    max-width: 320px;
    font-size: 30px;
  }

  .wf-login-story p {
    margin-bottom: 0;
    font-size: 12px;
    line-height: 1.65;
  }

  .wf-login-proof {
    display: none;
  }

  body[data-wf-page="login"] .country-row {
    gap: 7px;
  }

  .wf-command {
    padding: 8px;
  }

  .wf-command-panel {
    border-radius: var(--wf-radius-md);
  }

  body[data-wf-page="news"] #ugcModal {
    align-items: flex-end;
    padding: 0;
  }

  body[data-wf-page="news"] #ugcModal .modal-content {
    max-height: 92dvh;
    border-radius: var(--wf-radius-lg) var(--wf-radius-lg) 0 0;
  }

  body[data-wf-page="news"] #ugcModal .modal-header,
  body[data-wf-page="news"] #ugcModal .modal-body,
  body[data-wf-page="news"] #ugcModal .modal-footer {
    padding-left: 15px;
    padding-right: 15px;
  }

  body[data-wf-page="news"] #ugcModal .smart-tags-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .wf-app-rail,
  .wf-context-bar,
  .wf-mobile-dock,
  .wf-chat-fab,
  .wf-command {
    display: none !important;
  }

  body.wf-enhanced {
    padding: 0;
    background: #ffffff;
  }
}

/* ========================================================================
   SOUTHERN CROSS LIVEBOARD · 2026 PRODUCT REBUILD
   Real work and housing first. Calm density, explicit state, no fake glow.
   ======================================================================== */

:root,
html[data-theme="default"] {
  color-scheme: dark;
  --wf-canvas: #06161d;
  --wf-surface: #0c2832;
  --wf-surface-subtle: #0a212a;
  --wf-surface-raised: #123843;
  --wf-overlay: rgba(1, 10, 14, 0.78);
  --wf-text: #f3f8f6;
  --wf-text-secondary: #b4c6c7;
  --wf-text-muted: #789397;
  --wf-border: rgba(173, 220, 220, 0.14);
  --wf-border-strong: rgba(173, 220, 220, 0.27);
  --wf-primary: #ff6b4a;
  --wf-primary-hover: #ff8367;
  --wf-primary-soft: rgba(255, 107, 74, 0.13);
  --wf-housing: #2dd4b2;
  --wf-housing-soft: rgba(45, 212, 178, 0.13);
  --wf-accent: #2dd4b2;
  --wf-accent-soft: rgba(242, 184, 75, 0.11);
  --wf-success: #48c7a8;
  --wf-warning: #f2b84b;
  --wf-danger: #ff6b67;
  --wf-info: #55bdf4;
  --wf-radius-xs: 3px;
  --wf-radius-sm: 6px;
  --wf-radius-md: 10px;
  --wf-radius-lg: 14px;
  --wf-shadow-raised: 0 12px 30px rgba(0, 8, 12, 0.26);
  --wf-shadow-overlay: 0 28px 80px rgba(0, 5, 8, 0.62);
  --wf-ease: cubic-bezier(0.2, 0.75, 0.2, 1);
  --wf-fast: 120ms;
  --wf-normal: 180ms;
  --wf-slow: 240ms;
  --wf-rail: 224px;
  --wf-context: 52px;
  --wf-control: 44px;
  --wf-font: "Segoe UI Variable Text", "Noto Sans SC", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --wf-display: "Arial Narrow", "Segoe UI Variable Display", "Noto Sans SC", sans-serif;
  --wf-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  --primary: var(--wf-primary);
  --btn-text: #07151b;
  --bg: var(--wf-canvas);
  --box-bg: var(--wf-surface);
  --box: var(--wf-surface);
  --text: var(--wf-text);
  --muted: var(--wf-text-muted);
  --border: var(--wf-border);
  --accent: var(--wf-danger);
  --glow: rgba(255, 107, 74, 0.12);
  --gold: var(--wf-warning);
  --w-safe: var(--wf-success);
  --w-danger: var(--wf-danger);
  --income: var(--wf-success);
  --expense: var(--wf-danger);
  --glass-bg: rgba(8, 30, 39, 0.96);
  --glass-border: var(--wf-border-strong);
}

html {
  background: var(--wf-canvas);
}

body.wf-enhanced {
  background: var(--wf-canvas);
  color: var(--wf-text);
}

body.wf-enhanced::before {
  background-image:
    linear-gradient(rgba(173, 220, 220, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(173, 220, 220, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 1;
}

body.wf-enhanced input,
body.wf-enhanced select,
body.wf-enhanced textarea,
body.wf-enhanced option {
  color-scheme: dark;
}

body.wf-enhanced input,
body.wf-enhanced select,
body.wf-enhanced textarea,
body.wf-enhanced .input-group input,
body.wf-enhanced .input-group select,
body.wf-enhanced .input-group textarea {
  border-color: var(--wf-border);
  background-color: #091e27;
  color: var(--wf-text);
}

body.wf-enhanced input:focus,
body.wf-enhanced select:focus,
body.wf-enhanced textarea:focus {
  border-color: var(--wf-info);
  box-shadow: 0 0 0 3px rgba(85, 189, 244, 0.13);
}

body.wf-enhanced button,
body.wf-enhanced .btn,
body.wf-enhanced .btn-full,
body.wf-enhanced .m-submit,
body.wf-enhanced .fab {
  color: #07151b;
}

body.wf-enhanced .secondary,
body.wf-enhanced .small-btn,
body.wf-enhanced .edit-btn,
body.wf-enhanced .filter-btn,
body.wf-enhanced .type-btn,
body.wf-enhanced .segment-btn,
body.wf-enhanced .cat-btn,
body.wf-enhanced .main-tab-btn,
body.wf-enhanced .switch-btn {
  color: var(--wf-text-secondary);
}

body.wf-enhanced .card,
body.wf-enhanced .auth-box,
body.wf-enhanced .country-picker,
body.wf-enhanced .profile-card,
body.wf-enhanced .task-brief-card,
body.wf-enhanced .leaderboard-hud,
body.wf-enhanced .weather-matrix,
body.wf-enhanced .input-card,
body.wf-enhanced .res-card,
body.wf-enhanced .wealth-dashboard,
body.wf-enhanced .progress-card,
body.wf-enhanced .legal-banner,
body.wf-enhanced .guide-banner {
  border-color: var(--wf-border);
  background: var(--wf-surface);
  color: var(--wf-text);
}

body.wf-enhanced .legal-banner {
  border-left-color: var(--wf-warning);
  background: rgba(242, 184, 75, 0.08);
}

body.wf-enhanced .guide-banner {
  border-left-color: var(--wf-info);
}

/* App chrome: the live route begins in the rail and continues through context. */
.wf-app-rail {
  border-color: var(--wf-border);
  background: #081e27;
}

.wf-brand {
  min-height: 92px;
  border-color: var(--wf-border);
  background: #071a22;
}

.wf-brand-mark {
  font-family: var(--wf-display);
  font-size: 17px;
  font-stretch: condensed;
  letter-spacing: 0.14em;
}

.wf-brand-mark svg {
  color: var(--wf-primary);
}

.wf-brand-sub {
  color: var(--wf-text-muted);
  letter-spacing: 0.16em;
}

.wf-nav-label {
  color: #68868a;
}

.wf-nav-link {
  border-radius: 5px;
  color: var(--wf-text-secondary);
}

.wf-nav-link:hover {
  background: rgba(173, 220, 220, 0.055);
  color: var(--wf-text);
}

.wf-nav-link.is-active {
  background: rgba(255, 107, 74, 0.1);
  color: #ff9a83;
}

.wf-nav-link[href="housing.html"].is-active {
  background: var(--wf-housing-soft);
  color: var(--wf-housing);
}

.wf-nav-link[href="housing.html"].is-active::before {
  background: var(--wf-housing);
}

.wf-nav-link[href="housing.html"].is-active .wf-nav-icon {
  color: var(--wf-housing);
}

.wf-nav-link.is-active::before {
  left: -1px;
  height: 22px;
  background: var(--wf-primary);
  box-shadow: none;
}

.wf-rail-foot {
  border-color: var(--wf-border);
  background: #071a22;
}

.wf-context-bar {
  border-color: var(--wf-border);
  background: rgba(8, 30, 39, 0.94);
  backdrop-filter: blur(14px);
}

.wf-context-bar::after {
  content: "";
  position: absolute;
  inset: auto 22px -1px 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--wf-primary) 0 62px, transparent 62px);
  pointer-events: none;
}

.wf-context-eyebrow {
  color: #6f9095;
}

.wf-country-pill,
.wf-command-trigger {
  border-color: var(--wf-border);
  background: #0a242e;
  color: var(--wf-text-secondary);
}

.wf-country-pill span {
  color: var(--wf-housing);
}

.wf-command-trigger:hover {
  border-color: var(--wf-border-strong);
  background: var(--wf-surface);
}

.wf-command {
  backdrop-filter: blur(3px);
}

.wf-command-panel {
  border-color: var(--wf-border-strong);
  background: #0b2630;
}

.wf-command-item:hover,
.wf-command-item.is-selected {
  background: rgba(85, 189, 244, 0.1);
}

/* Homepage: real opportunities appear before supporting tools. */
body[data-wf-page="index"] #view-discover.active {
  display: flex !important;
  flex-direction: column;
}

body[data-wf-page="index"] .wf-daily-head { order: 0; }
body[data-wf-page="index"] .wf-home-grid { order: 1; }
body[data-wf-page="index"] .wf-stage-panel { order: 2; }
body[data-wf-page="index"] .wf-home-overview { order: 3; }

body[data-wf-page="index"] .global-ticker {
  border-color: var(--wf-border);
  background: #081e27;
  color: var(--wf-text-secondary);
}

.wf-daily-head {
  align-items: center;
  padding: 28px 0 22px;
  border-color: var(--wf-border);
}

.wf-daily-kicker {
  color: var(--wf-info);
}

.wf-daily-head h1 {
  max-width: 720px;
  font-family: var(--wf-display);
  font-size: clamp(27px, 3.2vw, 38px);
  font-weight: 760;
  letter-spacing: -0.035em;
}

.wf-daily-head p {
  max-width: 700px;
  color: var(--wf-text-secondary);
}

.wf-daily-actions a {
  min-height: 44px;
  border-color: var(--wf-border-strong);
  background: transparent;
  color: var(--wf-text);
  padding: 9px 15px;
  font-size: 12px;
}

.wf-daily-actions a:first-child {
  border-color: var(--wf-primary);
  background: var(--wf-primary);
  color: #07151b;
}

.wf-daily-actions a:nth-child(2) {
  border-color: rgba(45, 212, 178, 0.48);
  background: var(--wf-housing-soft);
  color: var(--wf-housing);
}

.wf-home-grid {
  grid-template-columns: minmax(0, 1.62fr) minmax(260px, 0.7fr);
  gap: 22px;
  padding: 18px 0 24px;
}

.wf-home-stream {
  overflow: hidden;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  background: var(--wf-surface-subtle);
}

body[data-wf-page="index"] .wf-home-stream .section-header {
  min-height: 48px;
  padding: 13px 16px 10px;
  border-bottom: 1px solid var(--wf-border);
}

body[data-wf-page="index"] .wf-home-stream .section-header:not(:first-child) {
  border-top: 1px solid var(--wf-border-strong);
}

.feed-job-card,
.feed-market-card,
.feed-housing-card {
  margin: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--wf-border) !important;
  border-radius: 0 !important;
  background: var(--wf-surface) !important;
  box-shadow: none !important;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--wf-fast) var(--wf-ease), border-color var(--wf-fast) var(--wf-ease);
}

.feed-job-card {
  display: block;
  padding: 14px 16px;
}

.feed-job-card:hover,
.feed-market-card:hover,
.feed-housing-card:hover {
  background: var(--wf-surface-raised) !important;
  color: inherit;
}

.feed-job-card:last-child,
.feed-market-card:last-child,
.feed-housing-card:last-child {
  border-bottom: 0 !important;
}

.feed-job-card .fj-title {
  color: var(--wf-text) !important;
  font-size: 14px;
}

.feed-job-card .fj-tag {
  border-radius: 3px;
  background: var(--wf-surface-subtle);
  color: var(--wf-text-secondary);
}

.feed-job-card .fj-tag.highlight {
  border-color: rgba(255, 107, 74, 0.35);
  background: var(--wf-primary-soft);
  color: #ff9a83;
}

.feed-housing-card {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 16px;
}

.fh-signal {
  align-self: stretch;
  border-radius: 2px;
  background: var(--wf-housing);
}

.fh-copy,
.fh-meta {
  min-width: 0;
}

.fh-copy strong,
.fh-copy span,
.fh-meta strong,
.fh-meta span {
  display: block;
}

.fh-copy strong {
  overflow: hidden;
  color: var(--wf-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fh-copy span,
.fh-meta span {
  margin-top: 3px;
  color: var(--wf-text-muted);
  font-size: 10px;
}

.fh-meta {
  text-align: right;
}

.fh-meta strong {
  color: var(--wf-housing);
  font: 700 12px var(--wf-mono);
}

.feed-market-card {
  min-height: 62px;
  padding: 12px 16px;
}

.feed-market-card .fm-new {
  color: var(--wf-warning);
}

.wf-stage-panel {
  margin: 0 0 20px;
  border-color: var(--wf-border);
  background: var(--wf-surface);
}

.wf-stage-selector button {
  border-color: var(--wf-border);
  background: var(--wf-surface-subtle);
  color: var(--wf-text-muted);
}

.wf-stage-selector button.active {
  background: var(--wf-primary-soft);
  color: #ff9a83;
}

.wf-priority-row:hover {
  background: var(--wf-surface-raised);
}

body[data-wf-page="index"] .task-brief-card,
body[data-wf-page="index"] .leaderboard-hud {
  border-color: var(--wf-border);
  background: var(--wf-surface);
}

/* Housing: real listings are the primary task; planning follows. */
body[data-wf-page="housing"] {
  --wf-primary: var(--wf-housing);
  --wf-primary-hover: #55dec3;
  --wf-primary-soft: var(--wf-housing-soft);
  --primary: var(--wf-housing);
  --glow: rgba(45, 212, 178, 0.12);
}

body[data-wf-page="housing"] main {
  display: flex;
  flex-direction: column;
}

body[data-wf-page="housing"] .housing-hero { order: 0; }
body[data-wf-page="housing"] .housing-section-nav { order: 1; }
body[data-wf-page="housing"] .housing-live { order: 2; }
body[data-wf-page="housing"] .housing-workspace { order: 3; }
body[data-wf-page="housing"] .housing-checks { order: 4; }

.housing-hero {
  padding: 30px 0 20px;
  border-color: var(--wf-border);
}

.housing-hero h1 {
  font-family: var(--wf-display);
  font-size: clamp(27px, 3vw, 38px);
}

.housing-hero p {
  max-width: 720px;
  color: var(--wf-text-secondary);
}

.housing-section-nav {
  position: sticky;
  top: calc(var(--wf-context) + 8px);
  z-index: 72;
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: rgba(8, 30, 39, 0.94);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}

.housing-section-nav::-webkit-scrollbar { display: none; }

.housing-section-nav a {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--wf-text-secondary);
  font-size: 12px;
  font-weight: 720;
  text-decoration: none;
}

.housing-section-nav a:first-child {
  background: var(--wf-housing-soft);
  color: var(--wf-housing);
}

.housing-live,
.housing-planner,
.housing-sources,
.housing-checks {
  border-color: var(--wf-border);
  background: var(--wf-surface);
}

.housing-live {
  margin: 0 0 22px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
}

.housing-live .housing-section-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--wf-border);
}

.housing-source-health {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--wf-border);
  background: var(--wf-surface-subtle);
}

.housing-source-health > a,
.housing-source-health > span {
  border-color: var(--wf-border);
  background: transparent;
}

.housing-live-toolbar {
  grid-template-columns: minmax(220px, 1.8fr) repeat(4, minmax(120px, 0.8fr));
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--wf-border);
  background: #0a222b;
}

.housing-live-toolbar input,
.housing-live-toolbar select {
  min-height: 42px;
  border-color: var(--wf-border);
  background-color: #081c24;
  color: var(--wf-text);
}

.housing-live-meta {
  min-height: 38px;
  margin: 0;
  padding: 10px 16px;
  border-bottom: 1px solid var(--wf-border);
  color: var(--wf-text-muted);
  font: 10px var(--wf-mono);
}

.housing-listings {
  border: 0;
  border-radius: 0;
  background: var(--wf-surface);
}

.housing-listing-row {
  grid-template-columns: 132px minmax(0, 1fr) 126px 86px;
  gap: 16px;
  min-height: 116px;
  padding: 15px 18px;
  border-color: var(--wf-border);
  background: transparent;
  content-visibility: auto;
  contain-intrinsic-size: 116px;
}

.housing-listing-row:hover {
  background: var(--wf-surface-raised);
}

.housing-listing-main h3 {
  color: var(--wf-text);
  font-size: 14px;
}

.housing-listing-main p {
  color: var(--wf-text-muted);
}

.housing-listing-price strong {
  color: var(--wf-housing);
}

.housing-listing-open {
  min-height: 36px;
  border: 1px solid rgba(45, 212, 178, 0.35);
  border-radius: 4px;
  background: var(--wf-housing-soft);
  color: var(--wf-housing);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  text-align: center;
  text-decoration: none;
}

.housing-data-policy {
  margin: 0;
  padding: 13px 18px 17px;
  border-top: 1px solid var(--wf-border);
  background: var(--wf-surface-subtle);
  color: var(--wf-text-muted);
}

.housing-load-more {
  width: calc(100% - 28px);
  margin: 14px;
  border-color: var(--wf-border-strong);
  background: var(--wf-surface-raised);
  color: var(--wf-text);
}

.housing-workspace {
  margin-bottom: 22px;
}

.housing-planner,
.housing-sources {
  box-shadow: none;
}

.housing-primary-btn {
  background: var(--wf-housing);
  color: #06161d;
}

.housing-checks details {
  border-color: var(--wf-border);
  background: var(--wf-surface-subtle);
}

/* Work discovery: list first, only verified coordinates reach the map. */
body[data-wf-page="news"] {
  --wf-primary: #ff6b4a;
  --primary: #ff6b4a;
  --ugc: #2dd4b2;
  --time-tag: #f2b84b;
}

body[data-wf-page="news"] .header {
  display: none !important;
}

body[data-wf-page="news"] .view-toggle {
  min-height: 48px;
  padding: 4px 12px;
  border-color: var(--wf-border);
  background: #081e27;
}

body[data-wf-page="news"] .view-btn {
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  color: var(--wf-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

body[data-wf-page="news"] .view-btn.active {
  border: 0;
  background: var(--wf-primary-soft);
  color: #ff9a83;
}

body[data-wf-page="news"] #dataDashboard {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 20px 44px;
}

body[data-wf-page="news"] .legal-banner {
  border-left-color: var(--wf-warning);
  background: rgba(242, 184, 75, 0.08);
}

body[data-wf-page="news"] .search-input {
  min-height: 46px;
  border-radius: var(--wf-radius-sm);
  background: #091e27;
}

body[data-wf-page="news"] .main-tab-bar {
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface-subtle);
  box-shadow: none;
}

body[data-wf-page="news"] .main-tab-btn {
  border-radius: 4px;
}

body[data-wf-page="news"] .loc-btn,
body[data-wf-page="news"] .q-btn {
  min-height: 44px;
  border-style: solid;
  border-radius: 4px;
  background: var(--wf-surface);
  color: var(--wf-text-secondary);
}

body[data-wf-page="news"] .loc-btn.active,
body[data-wf-page="news"] .q-btn.active {
  border-color: rgba(255, 107, 74, 0.45);
  background: var(--wf-primary-soft);
  color: #ff9a83;
}

body[data-wf-page="news"] .cards-wrapper {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-md);
  background: var(--wf-surface);
}

body[data-wf-page="news"] .job-card {
  margin: 0;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid var(--wf-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  content-visibility: auto;
  contain-intrinsic-size: 220px;
}

body[data-wf-page="news"] .job-card:last-child {
  border-bottom: 0;
}

body[data-wf-page="news"] .job-card:hover {
  background: var(--wf-surface-raised);
}

body[data-wf-page="news"] .job-title-zh {
  color: var(--wf-text);
}

body[data-wf-page="news"] .tag,
body[data-wf-page="news"] .ugc-parsed-box,
body[data-wf-page="news"] .ugc-meta {
  border-radius: 4px;
  background: var(--wf-surface-subtle);
}

body[data-wf-page="news"] .btn-view,
body[data-wf-page="news"] .btn-cyber-unlock {
  border-radius: var(--wf-radius-sm);
  background: var(--wf-primary);
  color: #07151b;
  box-shadow: none;
}

body[data-wf-page="news"] .btn-cyber-unlock {
  background-image: none;
}

body[data-wf-page="news"] .cyber-lock-icon {
  animation: none;
}

body[data-wf-page="news"] .fab {
  width: auto;
  min-width: 96px;
  height: 50px;
  padding: 0 16px;
  border-radius: var(--wf-radius-md);
  background: var(--wf-primary);
  color: #07151b;
  font-size: 12px;
  box-shadow: var(--wf-shadow-raised);
}

/* One mobile navigation. Old per-page docks are intentionally suppressed. */
@media (max-width: 820px) {
  body.wf-enhanced {
    padding: var(--wf-context) 0 calc(68px + env(safe-area-inset-bottom));
  }

  body[data-wf-page="index"] .bottom-nav,
  body[data-wf-page="news"] .bottom-nav {
    display: none !important;
  }

  body[data-wf-page="index"] .wf-mobile-dock,
  body[data-wf-page="news"] .wf-mobile-dock,
  body[data-wf-page="housing"] .wf-mobile-dock,
  .wf-mobile-dock {
    position: fixed;
    inset: auto 0 0;
    z-index: 980;
    min-height: calc(62px + env(safe-area-inset-bottom));
    padding: 4px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--wf-border-strong);
    background: rgba(7, 26, 34, 0.94);
    backdrop-filter: blur(16px);
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wf-mobile-dock a,
  .wf-mobile-dock button {
    position: relative;
    min-width: 0;
    min-height: 54px;
    padding: 5px 3px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--wf-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 720;
    text-decoration: none;
  }

  body.wf-enhanced .wf-mobile-dock .wf-mobile-tools {
    color: var(--wf-text-muted);
  }

  .wf-mobile-dock a svg,
  .wf-mobile-dock button svg {
    width: 20px;
    height: 20px;
  }

  .wf-mobile-dock a.is-active {
    background: var(--wf-primary-soft);
    color: var(--wf-primary);
  }

  .wf-mobile-dock a[href="housing.html"].is-active {
    background: var(--wf-housing-soft);
    color: var(--wf-housing);
  }

  .wf-context-bar {
    padding: 0 12px;
  }

  .wf-context-bar::after {
    right: 12px;
    left: 12px;
  }

  body.wf-enhanced .mobile-wrapper,
  body.wf-enhanced .wrap {
    padding-right: 14px;
    padding-left: 14px;
  }

  body[data-wf-page="index"] .top-nav {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .wf-daily-head {
    gap: 16px;
    padding: 22px 0 17px;
  }

  .wf-daily-head h1 {
    font-size: 29px;
  }

  .wf-daily-head p {
    font-size: 12px;
    line-height: 1.65;
  }

  .wf-daily-actions a {
    min-height: 46px;
  }

  .wf-home-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 0 18px;
  }

  .wf-home-stream {
    width: 100%;
  }

  .wf-home-rail {
    width: 100%;
  }

  .feed-housing-card {
    grid-template-columns: 4px minmax(0, 1fr);
    gap: 10px;
  }

  .fh-meta {
    grid-column: 2;
    text-align: left;
  }

  .fh-copy strong {
    white-space: normal;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .wf-stage-panel {
    margin-bottom: 14px;
  }

  .wf-stage-head {
    padding: 16px 14px 13px;
  }

  .wf-stage-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wf-stage-selector button:nth-child(2) {
    border-right: 0;
  }

  .wf-stage-selector button:nth-child(-n+2) {
    border-bottom: 1px solid var(--wf-border);
  }

  body[data-wf-page="housing"] .housing-shell {
    padding-bottom: 24px;
  }

  .housing-hero {
    padding: 22px 0 15px;
  }

  .housing-hero h1 {
    font-size: 29px;
  }

  .housing-hero p {
    font-size: 12px;
    line-height: 1.65;
  }

  .housing-section-nav {
    top: calc(var(--wf-context) + 6px);
    width: 100%;
    margin-bottom: 12px;
  }

  .housing-section-nav a {
    flex: 1 0 auto;
    min-height: 40px;
    text-align: center;
  }

  .housing-live .housing-section-head {
    padding: 15px 14px 12px;
  }

  .housing-source-health {
    padding: 9px 10px;
  }

  .housing-live-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .housing-live-toolbar .housing-search-field {
    grid-column: 1 / -1;
  }

  .housing-live-toolbar label:last-child {
    grid-column: 1 / -1;
  }

  .housing-live-toolbar input,
  .housing-live-toolbar select {
    min-height: 46px;
    font-size: 16px;
  }

  .housing-listing-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    min-height: 0;
    padding: 14px;
    content-visibility: auto;
    contain-intrinsic-size: 190px;
  }

  .housing-listing-source {
    grid-column: 1;
    grid-row: 1;
  }

  .housing-listing-main {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .housing-listing-main p {
    -webkit-line-clamp: 2;
  }

  .housing-listing-price {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .housing-listing-open {
    grid-column: 1 / -1;
    grid-row: 3;
    min-height: 44px;
    justify-self: stretch;
  }

  .housing-workspace {
    display: block;
  }

  .housing-planner,
  .housing-sources {
    margin-bottom: 12px;
  }

  body[data-wf-page="news"] {
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }

  body[data-wf-page="news"] .mobile-wrapper {
    height: calc(100dvh - var(--wf-context) - 62px - env(safe-area-inset-bottom));
  }

  body[data-wf-page="news"] #dataDashboard {
    padding: 12px 10px 22px;
  }

  body[data-wf-page="news"] .legal-banner {
    margin-bottom: 10px;
  }

  body[data-wf-page="news"] .cards-wrapper {
    border-radius: var(--wf-radius-sm);
  }

  body[data-wf-page="news"] .job-card {
    padding: 15px 14px;
  }

  body[data-wf-page="news"] .job-desc {
    font-size: 13px;
    line-height: 1.65;
  }

  body[data-wf-page="news"] .fab {
    top: auto;
    right: auto;
    left: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body.wf-enhanced .wf-chat-fab {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: var(--wf-radius-md);
    bottom: calc(76px + env(safe-area-inset-bottom));
    font-size: 0;
  }

  body.wf-enhanced .wf-chat-fab::before {
    content: "互助";
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .wf-context-actions {
    gap: 5px;
  }

  .wf-country-pill {
    min-width: 44px;
    min-height: 44px;
  }

  .wf-command-trigger {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .housing-section-nav a {
    min-height: 44px;
  }

  .wf-home-stream {
    margin-right: 0;
    margin-left: 0;
  }

  .housing-live,
  .housing-planner,
  .housing-sources,
  .housing-checks {
    border-radius: var(--wf-radius-sm);
  }
}

/* ========================================================================
   RESPONSIVE APP SHELL · JULY 2026
   One safe-area owner, one navigation system, one mobile action layer.
   This final layer intentionally normalizes legacy page-level mobile shells.
   ======================================================================== */

:root {
  --wf-safe-top: env(safe-area-inset-top, 0px);
  --wf-safe-right: env(safe-area-inset-right, 0px);
  --wf-safe-bottom: env(safe-area-inset-bottom, 0px);
  --wf-safe-left: env(safe-area-inset-left, 0px);
  --wf-appbar-h: 52px;
  --wf-appbar-total: calc(var(--wf-appbar-h) + var(--wf-safe-top));
  --wf-dock-h: 64px;
  --wf-dock-total: calc(var(--wf-dock-h) + var(--wf-safe-bottom));
  --wf-mobile-gutter: 14px;
  --wf-z-appbar: 880;
  --wf-z-dock: 980;
  --wf-z-sheet: 1800;
  --wf-z-dialog: 4000;
  --wf-z-toast: 9000;
}

html,
body {
  max-width: 100%;
}

body.wf-enhanced {
  overflow-x: clip;
}

body.wf-enhanced img,
body.wf-enhanced video,
body.wf-enhanced canvas {
  max-width: 100%;
}

.wf-context-bar {
  z-index: var(--wf-z-appbar);
}

.wf-context-leading {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.wf-context-back {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--wf-border);
  border-radius: var(--wf-radius-sm);
  background: var(--wf-surface);
  color: var(--wf-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.wf-context-back svg {
  width: 16px;
  height: 16px;
}

.wf-context-copy {
  flex: 1 1 auto;
}

.wf-mobile-dock {
  z-index: var(--wf-z-dock);
}

.wf-command {
  z-index: var(--wf-z-dialog);
}

body.wf-enhanced #toast {
  z-index: var(--wf-z-toast);
}

/* Compact tablets keep the full information architecture available without
   forcing a 208px rail into an iPad-sized canvas. */
@media (max-width: 1100px) {
  body.wf-enhanced {
    width: 100%;
    min-height: 100dvh;
    padding-top: var(--wf-appbar-total) !important;
    padding-right: 0 !important;
    padding-bottom: calc(var(--wf-dock-total) + 16px) !important;
    padding-left: 0 !important;
  }

  .wf-app-rail {
    display: none !important;
  }

  .wf-context-bar {
    inset: 0 0 auto !important;
    width: 100%;
    height: var(--wf-appbar-total) !important;
    padding-top: var(--wf-safe-top) !important;
    padding-right: max(12px, var(--wf-safe-right)) !important;
    padding-bottom: 0 !important;
    padding-left: max(12px, var(--wf-safe-left)) !important;
    border-bottom: 1px solid var(--wf-border-strong);
    background: #071a22;
    backdrop-filter: none;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
  }

  .wf-context-bar::after {
    display: none !important;
  }

  .wf-context-leading,
  .wf-country-pill {
    grid-column: 1;
    grid-row: 1;
  }

  .wf-context-leading {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .wf-context-copy {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    justify-self: stretch;
    justify-content: center;
    text-align: center;
  }

  .wf-context-eyebrow {
    display: none !important;
  }

  .wf-context-title {
    width: 100%;
    font-size: 13px;
    font-weight: 760;
    letter-spacing: 0.01em;
    text-align: center;
  }

  .wf-context-actions {
    display: contents !important;
  }

  .wf-country-pill,
  .wf-context-back,
  .wf-command-trigger {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0;
    padding: 0 !important;
    border: 1px solid var(--wf-border-strong);
    border-radius: 8px;
    background: #0a222c;
    color: var(--wf-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }

  .wf-country-pill span {
    color: var(--wf-housing);
    font: 700 11px var(--wf-mono);
  }

  .wf-country-pill strong {
    display: none !important;
  }

  .wf-context-back svg,
  .wf-command-trigger svg {
    width: 20px;
    height: 20px;
  }

  .wf-context-back-label {
    display: none !important;
  }

  .wf-command-trigger {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    font-size: 0 !important;
  }

  .wf-command-trigger::before {
    content: none !important;
  }

  .wf-command-trigger kbd,
  .wf-command-label {
    display: none !important;
  }

  .wf-context-back:focus-visible,
  .wf-command-trigger:focus-visible,
  .wf-mobile-dock a:focus-visible,
  .wf-mobile-dock button:focus-visible {
    outline: 2px solid var(--wf-info);
    outline-offset: 2px;
  }

  .wf-mobile-dock {
    position: fixed !important;
    inset: auto 0 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: var(--wf-dock-total) !important;
    padding-top: 4px !important;
    padding-right: max(8px, var(--wf-safe-right)) !important;
    padding-bottom: var(--wf-safe-bottom) !important;
    padding-left: max(8px, var(--wf-safe-left)) !important;
    border: 0 !important;
    border-top: 1px solid var(--wf-border-strong) !important;
    border-radius: 0 !important;
    background: #071a22 !important;
    box-shadow: 0 -10px 30px rgba(0, 8, 12, 0.22) !important;
    backdrop-filter: none !important;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    align-items: start;
    gap: 0 !important;
  }

  .wf-mobile-dock > a,
  .wf-mobile-dock > button {
    position: relative;
    width: 100%;
    min-width: 0 !important;
    height: 60px;
    min-height: 60px !important;
    margin: 0 !important;
    padding: 6px 2px 5px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--wf-text-muted) !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1;
    text-decoration: none;
    touch-action: manipulation;
  }

  .wf-mobile-dock > a::before,
  .wf-mobile-dock > button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 22px;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: transparent;
    transform: translateX(-50%);
  }

  .wf-mobile-dock > a.is-active,
  .wf-mobile-dock > button.is-active {
    color: var(--wf-primary) !important;
  }

  .wf-mobile-dock > a.is-active::before,
  .wf-mobile-dock > button.is-active::before {
    background: currentColor;
  }

  .wf-mobile-dock > a[href="housing.html"].is-active {
    color: var(--wf-housing) !important;
  }

  .wf-mobile-dock > a svg,
  .wf-mobile-dock > button svg {
    width: 21px !important;
    height: 21px !important;
    flex: 0 0 auto;
  }

  .wf-mobile-dock .wf-notify-dot {
    top: 5px !important;
    right: calc(50% - 18px) !important;
  }

  body.wf-enhanced .mobile-wrapper,
  body.wf-enhanced .wrap,
  body.wf-enhanced main,
  body.wf-enhanced #app {
    min-width: 0;
    max-width: 100%;
  }

  body.wf-enhanced .mobile-wrapper,
  body.wf-enhanced .wrap {
    width: min(100%, 820px) !important;
    min-height: 0;
    height: auto;
    margin-right: auto !important;
    margin-left: auto !important;
    padding-top: 0 !important;
    padding-right: max(var(--wf-mobile-gutter), var(--wf-safe-right)) !important;
    padding-bottom: 28px !important;
    padding-left: max(var(--wf-mobile-gutter), var(--wf-safe-left)) !important;
    overflow: visible;
  }

  /* The shared app bar owns navigation. Legacy headers become compact local
     action toolbars instead of repeating the page title and back button. */
  body.wf-enhanced .header,
  body.wf-enhanced .top,
  body.wf-enhanced .top-nav {
    top: var(--wf-appbar-total) !important;
    min-height: 48px;
    margin-top: 0 !important;
    margin-right: calc(-1 * max(var(--wf-mobile-gutter), var(--wf-safe-right))) !important;
    margin-bottom: 12px !important;
    margin-left: calc(-1 * max(var(--wf-mobile-gutter), var(--wf-safe-left))) !important;
    padding-top: 6px !important;
    padding-right: max(var(--wf-mobile-gutter), var(--wf-safe-right)) !important;
    padding-bottom: 6px !important;
    padding-left: max(var(--wf-mobile-gutter), var(--wf-safe-left)) !important;
    border-bottom-color: var(--wf-border) !important;
    background: color-mix(in srgb, var(--wf-canvas) 96%, transparent) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    justify-content: flex-end !important;
  }

  body.wf-enhanced .header > .back-btn,
  body.wf-enhanced .header > .title,
  body.wf-enhanced .top > .back,
  body.wf-enhanced .top .title,
  body.wf-enhanced .top-nav .brand-logo {
    display: none !important;
  }

  body.wf-enhanced .top {
    min-height: 0;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    border-bottom: 0 !important;
    background: transparent !important;
    align-items: flex-start !important;
  }

  body.wf-enhanced .top .sub {
    max-width: 68ch;
    color: var(--wf-text-muted);
  }

  body.wf-enhanced .top .stamina {
    display: none !important;
  }

  body.wf-enhanced .header:not(:has(button, .header-actions, .stamina-box, .stamina-pill, a:not(.back-btn))),
  body[data-wf-page="index"] .top-nav {
    display: none !important;
  }

  /* Manual reload and quota chrome were repeated on almost every legacy
     screen. Mobile browsers already provide refresh; AI cost remains visible
     at the action itself. Keep only a real page-level secondary link. */
  body.wf-enhanced .header:not(.housing-local-header),
  body.wf-enhanced .refresh-btn,
  body.wf-enhanced .stamina-box,
  body.wf-enhanced .stamina-pill {
    display: none !important;
  }

  body[data-wf-page="housing"] .housing-local-header {
    min-height: 40px;
    margin-bottom: 8px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
  }

  body[data-wf-page="housing"] .housing-text-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }

  body.wf-enhanced .refresh-btn,
  body.wf-enhanced .header-actions button,
  body.wf-enhanced .header-actions a {
    min-width: 44px;
    min-height: 44px;
  }

  /* One community entry: the dock. The chat surface itself becomes a true
     mobile sheet and never competes with page actions. */
  body.wf-enhanced .wf-chat-fab {
    display: none !important;
  }

  body.wf-enhanced .wf-chat-panel {
    position: fixed !important;
    inset: var(--wf-appbar-total) 0 var(--wf-dock-total) !important;
    width: min(100%, 680px) !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 auto !important;
    border: 0 !important;
    border-right: 1px solid var(--wf-border-strong) !important;
    border-left: 1px solid var(--wf-border-strong) !important;
    border-radius: 0 !important;
    background: var(--wf-canvas) !important;
    box-shadow: var(--wf-shadow-overlay) !important;
    backdrop-filter: none !important;
    z-index: var(--wf-z-sheet) !important;
  }

  .wf-chat-head {
    min-height: 58px;
    padding: 10px max(14px, var(--wf-safe-right)) 10px max(14px, var(--wf-safe-left)) !important;
    border-bottom-color: var(--wf-border-strong) !important;
    background: var(--wf-surface) !important;
  }

  .wf-chat-title {
    font-size: 15px !important;
  }

  .wf-chat-close {
    width: 44px !important;
    height: 44px !important;
    border-radius: 8px !important;
  }

  .wf-chat-rooms {
    padding: 8px max(12px, var(--wf-safe-right)) 8px max(12px, var(--wf-safe-left)) !important;
    background: var(--wf-surface-subtle) !important;
  }

  .wf-chat-room {
    min-height: 40px;
    border-radius: 6px !important;
  }

  .wf-chat-body {
    padding: 14px max(12px, var(--wf-safe-right)) 14px max(12px, var(--wf-safe-left)) !important;
    overscroll-behavior: contain;
  }

  .wf-chat-foot {
    padding: 10px max(12px, var(--wf-safe-right)) 10px max(12px, var(--wf-safe-left)) !important;
    background: var(--wf-surface) !important;
  }

  .wf-chat-input {
    min-height: 44px;
    font-size: 16px !important;
  }

  .wf-chat-send {
    min-width: 64px;
    min-height: 44px;
    border-radius: 8px !important;
  }

  /* Command palette respects the notch, home indicator and virtual keyboard. */
  .wf-command {
    padding-top: calc(var(--wf-safe-top) + 8px) !important;
    padding-right: max(8px, var(--wf-safe-right)) !important;
    padding-bottom: calc(var(--wf-dock-total) + 8px) !important;
    padding-left: max(8px, var(--wf-safe-left)) !important;
    align-items: flex-start !important;
  }

  .wf-command-panel {
    width: min(100%, 720px) !important;
    max-height: calc(100dvh - var(--wf-safe-top) - var(--wf-dock-total) - 16px) !important;
    border-radius: 12px !important;
  }

  .wf-command-search input {
    min-height: 48px;
    font-size: 16px !important;
  }

  body.wf-enhanced #toast {
    top: auto !important;
    bottom: -90px !important;
    width: auto;
    height: auto;
    max-width: calc(100% - max(24px, var(--wf-safe-left)) - max(24px, var(--wf-safe-right)));
  }

  body.wf-enhanced #toast.show {
    top: auto !important;
    bottom: calc(var(--wf-dock-total) + 10px) !important;
  }

  /* Dynamic viewport ownership: no body + wrapper + inner-scroller triple lock. */
  body[data-wf-page="news"] {
    width: 100% !important;
    height: auto !important;
    min-height: 100dvh;
    overflow-y: auto !important;
  }

  body[data-wf-page="news"] .mobile-wrapper {
    height: auto !important;
    min-height: calc(100dvh - var(--wf-appbar-total) - var(--wf-dock-total));
    overflow: visible !important;
  }

  body[data-wf-page="news"] .container-inner,
  body[data-wf-page="news"] #dataDashboard {
    min-height: 0;
    height: auto !important;
    overflow: visible !important;
  }

  body[data-wf-page="news"] #dataDashboard {
    padding-bottom: 88px !important;
  }

  body[data-wf-page="news"] .loc-scroll-wrapper,
  body[data-wf-page="news"] .quick-filter-wrapper {
    margin-right: calc(-1 * max(var(--wf-mobile-gutter), var(--wf-safe-right)));
    margin-left: calc(-1 * max(var(--wf-mobile-gutter), var(--wf-safe-left)));
    padding-right: max(var(--wf-mobile-gutter), var(--wf-safe-right));
    padding-left: max(var(--wf-mobile-gutter), var(--wf-safe-left));
    scroll-padding-inline: max(var(--wf-mobile-gutter), var(--wf-safe-left));
    overscroll-behavior-inline: contain;
  }

  body[data-wf-page="news"] .fab {
    position: fixed !important;
    inset: auto max(12px, var(--wf-safe-right)) calc(var(--wf-dock-total) + 10px) max(12px, var(--wf-safe-left)) !important;
    width: auto !important;
    min-width: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    border-radius: 8px !important;
    z-index: calc(var(--wf-z-dock) - 1) !important;
  }

  body[data-wf-page="market"] .fab-ai {
    position: fixed !important;
    inset: auto max(12px, var(--wf-safe-right)) calc(var(--wf-dock-total) + 10px) max(12px, var(--wf-safe-left)) !important;
    width: auto !important;
    min-width: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 16px !important;
    border-radius: 8px !important;
    transform: none !important;
    box-shadow: var(--wf-shadow-raised) !important;
    z-index: calc(var(--wf-z-dock) - 1) !important;
  }

  /* Remaining legacy page actions sit in one reserved slot above the dock. */
  body.wf-enhanced:not([data-wf-page="news"]) .fab,
  body.wf-enhanced .floating-btn,
  body.wf-enhanced .add-btn {
    right: max(14px, var(--wf-safe-right)) !important;
    bottom: calc(var(--wf-dock-total) + 12px) !important;
    left: auto !important;
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    border-radius: 10px !important;
    box-shadow: var(--wf-shadow-raised) !important;
    z-index: calc(var(--wf-z-dock) - 1) !important;
  }

  body[data-wf-page="scripts"] .fab {
    width: 58px !important;
    min-width: 58px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap;
  }

  body.wf-enhanced:has(.fab),
  body.wf-enhanced:has(.fab-ai),
  body.wf-enhanced:has(.floating-btn),
  body.wf-enhanced:has(.add-btn) {
    padding-bottom: calc(var(--wf-dock-total) + 78px) !important;
  }

  /* Mobile dialogs own one scroll surface and respect the keyboard. */
  body.wf-enhanced .modal-overlay,
  body.wf-enhanced .modal,
  body.wf-enhanced [class*="modal-overlay"] {
    max-width: 100vw;
    max-height: 100dvh;
  }

  body.wf-enhanced .modal-content,
  body.wf-enhanced .modal-card,
  body.wf-enhanced .sheet {
    max-height: calc(100dvh - var(--wf-safe-top)) !important;
    overscroll-behavior: contain;
  }

  .wf-home-grid,
  .housing-workspace {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-wf-page="login"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (min-width: 600px) and (max-width: 1100px) {
  :root {
    --wf-mobile-gutter: 24px;
  }

  .wf-mobile-dock {
    right: auto !important;
    bottom: max(12px, var(--wf-safe-bottom)) !important;
    left: 50% !important;
    width: min(640px, calc(100% - 32px)) !important;
    min-height: 64px !important;
    padding: 3px 8px !important;
    border: 1px solid var(--wf-border-strong) !important;
    border-radius: 14px !important;
    transform: translateX(-50%);
  }

  body.wf-enhanced {
    padding-bottom: 92px !important;
  }

  body.wf-enhanced .wf-chat-panel {
    bottom: 92px !important;
  }

  body[data-wf-page="news"] .fab,
  body[data-wf-page="market"] .fab-ai {
    bottom: calc(var(--wf-dock-total) + 22px) !important;
  }

  .wf-home-grid {
    width: min(100%, 920px);
    margin-right: auto;
    margin-left: auto;
  }
}

/* Login is a self-contained authentication surface, not an app-shell page. */
@media (max-width: 1100px) {
  body.wf-enhanced[data-wf-page="login"] {
    min-height: 100dvh !important;
    padding: 0 !important;
  }

  body[data-wf-page="login"] .refresh-btn-login {
    top: max(18px, calc(var(--wf-safe-top) + 10px)) !important;
    right: max(18px, calc(var(--wf-safe-right) + 14px)) !important;
  }
}

@media (min-width: 700px) and (max-width: 1100px) {
  body.wf-enhanced[data-wf-page="login"] {
    display: grid !important;
    grid-template-columns: minmax(300px, 0.78fr) minmax(430px, 1fr) !important;
    align-items: stretch !important;
  }

  body[data-wf-page="login"] .wf-login-story {
    min-height: 100dvh;
    padding: 36px clamp(28px, 4vw, 48px);
  }

  body[data-wf-page="login"] .wf-login-story-main {
    padding: 48px 0 72px;
  }

  body[data-wf-page="login"] .wf-login-story h1 {
    font-size: clamp(34px, 4.5vw, 48px);
  }

  body[data-wf-page="login"] .mobile-wrapper {
    width: 100% !important;
    max-width: 540px !important;
    min-height: 100dvh;
    padding: max(44px, calc(var(--wf-safe-top) + 28px)) 28px max(44px, calc(var(--wf-safe-bottom) + 28px)) !important;
  }
}

@media (max-width: 560px) {
  :root {
    --wf-mobile-gutter: 14px;
  }

  body.wf-enhanced input,
  body.wf-enhanced select,
  body.wf-enhanced textarea {
    font-size: 16px;
  }

  body.wf-enhanced .grid-2,
  body.wf-enhanced .form-grid,
  body.wf-enhanced .field-grid,
  body.wf-enhanced .input-grid,
  body.wf-enhanced .req-grid,
  body.wf-enhanced .row-2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.wf-enhanced .input-row,
  body.wf-enhanced .form-row {
    min-width: 0;
  }

  body.wf-enhanced .input-row > input,
  body.wf-enhanced .input-row > select,
  body.wf-enhanced .form-row > input,
  body.wf-enhanced .form-row > select {
    min-width: 0;
  }

  body.wf-enhanced .modal-overlay,
  body.wf-enhanced [class*="modal-overlay"] {
    align-items: flex-end !important;
    padding: var(--wf-safe-top) 0 0 !important;
  }

  body.wf-enhanced .modal-content,
  body.wf-enhanced .modal-card,
  body.wf-enhanced .sheet {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-left: 0 !important;
    border-radius: 14px 14px 0 0 !important;
  }

  body[data-wf-page="housing"] .housing-live-toolbar {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-wf-page="housing"] .housing-live-toolbar > * {
    grid-column: 1 !important;
  }

  body[data-wf-page="index"] .wf-daily-head h1 {
    font-size: clamp(26px, 8vw, 32px) !important;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  body[data-wf-page="index"] .wf-daily-head h1 .wf-user-name,
  body[data-wf-page="index"] .wf-daily-head h1 [data-user-name] {
    font-size: 0.64em;
  }

  body[data-wf-page="news"] .job-title-zh {
    font-size: 16px !important;
    line-height: 1.45;
  }

  body[data-wf-page="news"] .action-bar {
    flex-wrap: wrap;
  }

  body[data-wf-page="news"] .action-bar > * {
    min-width: min(100%, 132px);
  }
}

@supports not (height: 100dvh) {
  body.wf-enhanced,
  body.wf-enhanced .wf-chat-panel,
  body.wf-enhanced .modal-content,
  body.wf-enhanced .modal-card,
  body.wf-enhanced .sheet {
    min-height: -webkit-fill-available;
  }
}
