:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --ink: #1e2423;
  --muted: #66716e;
  --line: #d9dfdb;
  --teal: #0f766e;
  --teal-soft: #dff4ee;
  --amber: #bd7a13;
  --amber-soft: #fff0d3;
  --coral: #c9543f;
  --coral-soft: #ffe5de;
  --green: #367a41;
  --green-soft: #e3f4df;
  --blue: #356ea3;
  --blue-soft: #e0edf8;
  --shadow: 0 18px 36px rgba(30, 36, 35, 0.08);
  --bottom-menu-height: 76px;
  --ad-banner-height: 0px;
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

body:has(.app-view:not([hidden]) .phone-page) .topbar {
  display: none;
}

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

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-menu-height) + var(--ad-banner-height) + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.brand h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  gap: 0;
}

[hidden] {
  display: none !important;
}

.app-view:not(.layout) {
  padding: 18px clamp(16px, 2vw, 28px) 40px;
}

.control-panel {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100vh - var(--bottom-menu-height) - var(--ad-banner-height) - env(safe-area-inset-bottom));
  overflow: auto;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #eff5f2;
}

.workspace {
  min-width: 0;
  padding: 18px clamp(16px, 2vw, 28px) 40px;
}

.panel-section,
.detail-panel,
.formula-panel,
.sheet-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-section {
  margin-bottom: 14px;
  padding: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.section-title output {
  color: var(--ink);
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented button,
.action-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  color: var(--ink);
  cursor: pointer;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  font-weight: 800;
}

.action-button.full {
  width: 100%;
  margin-top: 12px;
}

.action-button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.segmented button {
  padding: 8px;
  font-weight: 700;
}

.segmented button[aria-selected="true"] {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #074a45;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.field-grid.compact {
  grid-template-columns: 1fr;
}

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

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd4cf;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field small {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
}

.selected-room {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.room-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.room-line b {
  font-size: 14px;
}

.input-group {
  margin-top: 14px;
}

.input-group:first-child {
  margin-top: 0;
}

.input-group h2 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.25;
}

.result-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.mobile-results {
  display: none;
}

.metric {
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(26px, 3.1vw, 38px);
  line-height: 1.15;
  letter-spacing: 0;
}

.metric strong small {
  margin-left: 4px;
  font-size: 0.72em;
  font-weight: 700;
}

.metric span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.metric.good {
  border-color: #badbb6;
  background: var(--green-soft);
}

.metric.warn {
  border-color: #f1d29b;
  background: var(--amber-soft);
}

.metric.bad {
  border-color: #efbfaf;
  background: var(--coral-soft);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.detail-panel,
.formula-panel,
.sheet-panel {
  padding: 16px;
}

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

.panel-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #174b75;
  font-size: 12px;
  font-weight: 800;
}

.badge.good {
  background: var(--green-soft);
  color: var(--green);
}

.badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.bad {
  background: var(--coral-soft);
  color: var(--coral);
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.calc-table th,
.calc-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.calc-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calc-table td:last-child,
.calc-table th:last-child {
  text-align: right;
}

.formula-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.formula-list li {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: #28302e;
  font-family: Consolas, "Microsoft JhengHei", monospace;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.source-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sheet-panel {
  margin-top: 14px;
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.sheet-item {
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.sheet-item b {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  color: var(--muted);
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed #cbd4cf;
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfa;
}

.app-hero,
.page-heading,
.integration-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.app-hero,
.page-heading {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-hero h2,
.page-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.app-card-grid,
.dashboard-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.app-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-hub-grid {
  max-width: 1180px;
}

.project-hub-grid .app-card {
  min-height: 168px;
}

.project-hub-grid .app-card strong {
  font-size: clamp(30px, 4vw, 44px);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: start;
}

.app-card {
  min-height: 130px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

button.app-card {
  text-align: left;
  cursor: pointer;
}

button.app-card:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.summary-card {
  position: relative;
}

.summary-card::after {
  content: "查看";
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.summary-card:disabled::after {
  content: "";
}

.summary-card:hover,
.summary-card:focus-visible {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 18px 36px rgba(15, 118, 110, 0.14);
}

.app-card span,
.case-meta {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.app-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.15;
}

.app-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.app-view:has(.phone-page) {
  padding: 0 0 40px;
  background: #f4f6f8;
}

.phone-page {
  min-height: calc(100vh - var(--bottom-menu-height) - var(--ad-banner-height) - env(safe-area-inset-bottom));
  padding-bottom: calc(var(--bottom-menu-height) + var(--ad-banner-height) + 20px);
  background: #f4f6f8;
}

.route-header {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 112px;
  padding: 34px clamp(16px, 4vw, 40px) 20px;
  background: #2397e8;
  color: #ffffff;
}

.route-back {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  font-size: 48px;
  line-height: 1;
  cursor: pointer;
}

.route-header h2 {
  margin: 0;
  overflow: hidden;
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.route-mini-button,
.route-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 900;
}

.route-mini-button {
  cursor: pointer;
}

.route-pill {
  background: #ff9f1c;
}

.project-summary-hero,
.phone-card,
.record-hero-card {
  margin: 16px clamp(14px, 4vw, 40px);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(30, 36, 35, 0.08);
}

.project-summary-hero {
  display: grid;
  gap: 10px;
  padding: 22px;
  border-top: 4px solid #2397e8;
}

.project-summary-hero span,
.phone-card-title span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.project-summary-hero strong {
  font-size: clamp(46px, 10vw, 76px);
  line-height: 1;
}

.project-summary-hero small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.list-hero {
  background: linear-gradient(135deg, #ffffff 0%, #eef8ff 100%);
}

.phone-card {
  padding: 18px;
}

.phone-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.phone-card-title h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.app-list {
  display: grid;
  gap: 0;
}

.project-row,
.case-row {
  border-bottom: 1px solid #e8ecef;
}

.swipe-row {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.swipe-actions {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, 74px);
  width: 148px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.swipe-row.swipe-open .swipe-actions {
  opacity: 1;
  pointer-events: auto;
}

.swipe-action {
  border: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.swipe-action.copy {
  background: #2397e8;
}

.swipe-action.delete {
  background: #c4171f;
}

.swipe-content {
  position: relative;
  z-index: 3;
  background: #ffffff;
  transition: transform 180ms ease;
  will-change: transform;
}

.swipe-row.swipe-open .swipe-content {
  transform: translateX(-148px);
}

.project-row:last-child,
.case-row:last-child {
  border-bottom: 0;
}

.project-row-main,
.case-row-main {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 86px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.project-row-main:focus-visible,
.case-row-main:focus-visible {
  outline: 3px solid rgba(35, 151, 232, 0.22);
  outline-offset: 2px;
  border-radius: 8px;
}

.row-icon,
.record-big-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 900;
}

.row-icon {
  width: 58px;
  height: 58px;
  font-size: 20px;
}

.row-icon.teal,
.record-big-icon.teal {
  background: #51bea6;
}

.row-icon.amber,
.record-big-icon.amber {
  background: #f5bd45;
}

.row-icon.blue,
.record-big-icon.blue {
  background: #5e8ee8;
}

.row-icon.coral,
.record-big-icon.coral {
  background: #f45e61;
}

.row-copy {
  min-width: 0;
}

.case-row-title {
  display: block;
  overflow: hidden;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-copy small,
.case-row-result small,
.project-row-latest {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.case-row-result {
  text-align: right;
}

.case-row-result b {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  white-space: nowrap;
}

.row-chevron {
  color: #c5ccd2;
  font-size: 34px;
  line-height: 1;
}

.project-row-latest {
  margin: -4px 36px 12px 78px;
}

.record-hero-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 34px 20px;
}

.record-big-icon {
  width: 132px;
  height: 132px;
  font-size: 42px;
}

.record-hero-card strong {
  font-size: clamp(48px, 12vw, 78px);
  line-height: 1;
}

.record-hero-card small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.info-line {
  display: grid;
  grid-template-columns: 42px minmax(100px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 64px;
  border-bottom: 1px solid #e8ecef;
}

.info-line:last-child {
  border-bottom: 0;
}

.info-mark {
  color: #666c70;
  font-weight: 900;
}

.info-line span:not(.info-mark) {
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
}

.info-line b {
  justify-self: end;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.35;
  text-align: right;
}

.input-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.input-line {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #e8ecef;
  border-radius: 8px;
  background: #fbfcfa;
}

.input-line span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.input-line b {
  font-size: 18px;
  line-height: 1.2;
}

.input-line small {
  color: var(--muted);
  font-size: 12px;
}

.record-bottom-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px clamp(14px, 4vw, 40px) 28px;
  padding: 14px clamp(14px, 4vw, 40px);
  border: 1px solid #e8ecef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(30, 36, 35, 0.08);
}

.action-button.danger {
  border-color: #c4171f;
  background: #c4171f;
  color: #ffffff;
}

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

.project-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-note,
.project-form .action-button {
  grid-column: 1 / -1;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-list.app-list,
.case-list.app-list {
  grid-template-columns: 1fr;
  gap: 0;
}

.project-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.project-card.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.project-card-main {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.project-card-main:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 4px;
  border-radius: 8px;
}

.project-card-main:hover h3 {
  color: var(--teal);
}

.project-card h3 {
  margin: 4px 0 6px;
  font-size: 18px;
  line-height: 1.25;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.project-open-hint {
  display: inline-flex;
  margin-top: 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.project-latest {
  display: grid;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.project-latest b {
  color: var(--ink);
  font-size: 13px;
}

.project-latest.empty {
  border-top-style: dashed;
}

.floor-group-list {
  display: grid;
  gap: 10px;
}

.floor-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.floor-group b {
  min-width: 0;
  overflow-wrap: anywhere;
}

.floor-group span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.case-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.case-card-main {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.case-card-main:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 4px;
  border-radius: 8px;
}

.case-card-main:hover h3 {
  color: var(--teal);
}

.case-card h3 {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.25;
}

.case-open-hint {
  display: inline-flex;
  margin-top: 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.case-result {
  text-align: right;
}

.case-result b {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.case-result span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.icon-action,
.text-action {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.icon-action {
  padding: 5px 8px;
}

.text-action {
  padding: 5px 10px;
}

.integration-panel {
  margin-top: 14px;
}

.integration-panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.integration-panel p {
  margin: 0;
  color: var(--muted);
}

.quick-mode-grid,
.report-actions {
  display: grid;
  gap: 10px;
}

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

.quick-mode-grid button,
.report-actions button {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.quick-mode-grid button {
  display: grid;
  place-items: center;
  gap: 4px;
}

.quick-mode-grid button[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #074a45;
}

.report-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.search-panel {
  margin-bottom: 14px;
}

.search-box {
  display: grid;
  gap: 8px;
}

.search-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-height: 54px;
  border: 1px solid #cbd4cf;
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.quick-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-keywords button {
  min-height: 34px;
  border: 1px solid #cbd4cf;
  border-radius: 999px;
  padding: 5px 12px;
  background: #fbfcfa;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

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

.source-link {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  text-decoration: none;
}

.source-link b {
  font-size: 16px;
}

.source-link span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ad-banner {
  display: grid;
  grid-template-columns: auto minmax(260px, 970px);
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: calc(100% - clamp(32px, 4vw, 56px));
  max-width: 1160px;
  min-height: 82px;
  margin: 0 auto calc(var(--bottom-menu-height) + 20px);
  padding: 10px 14px;
  border: 1px solid #d9dfdb;
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.ad-banner[hidden] {
  display: none !important;
}

.ad-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.evac-ad-unit {
  width: 100%;
  min-width: 260px;
  min-height: 64px;
}

.notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-soft);
  color: #174b75;
  font-size: 14px;
  font-weight: 800;
}

.notice.good {
  border-color: #badbb6;
  background: var(--green-soft);
  color: var(--green);
}

.notice.warn {
  border-color: #f1d29b;
  background: var(--amber-soft);
  color: var(--amber);
}

.notice.bad {
  border-color: #efbfaf;
  background: var(--coral-soft);
  color: var(--coral);
}

.privacy-actions {
  margin-top: 12px;
}

.privacy-actions .action-button {
  width: 100%;
  text-decoration: none;
}

.legal-page {
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.legal-hero,
.legal-card,
.legal-actions {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-hero {
  margin-bottom: 14px;
  padding: 22px;
}

.legal-hero h1 {
  margin: 4px 0 8px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
}

.legal-hero p,
.legal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.legal-card {
  margin-bottom: 12px;
  padding: 18px 20px;
}

.legal-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.legal-actions {
  padding: 16px;
}

.legal-actions .action-button {
  text-decoration: none;
}

.bottom-menu {
  position: fixed;
  right: 0;
  bottom: calc(var(--ad-banner-height) + env(safe-area-inset-bottom));
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  min-height: var(--bottom-menu-height);
  padding: 8px clamp(10px, 3vw, 28px) calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(217, 223, 219, 0.92);
  background: rgba(251, 252, 250, 0.96);
  box-shadow: 0 -12px 28px rgba(30, 36, 35, 0.08);
  backdrop-filter: blur(14px);
}

.bottom-menu button {
  display: grid;
  grid-template-rows: 24px auto;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.bottom-menu button[aria-current="page"] {
  border-color: #b8ddd6;
  background: var(--teal-soft);
  color: #074a45;
}

.menu-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  background: #eef4f1;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
}

.bottom-menu button[aria-current="page"] .menu-mark {
  background: var(--teal);
  color: #ffffff;
}

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

  .control-panel {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

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

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

  .app-card-grid,
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-list {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 18px 14px;
  }

  .control-panel,
  .workspace,
  .app-view:not(.layout) {
    padding: 12px;
  }

  .app-view:has(.phone-page) {
    padding: 0 0 40px;
  }

  .panel-section,
  .detail-panel,
  .formula-panel,
  .sheet-panel,
  .metric {
    border-radius: 8px;
    box-shadow: none;
  }

  .segmented,
  .field-grid,
  .result-strip,
  .sheet-grid,
  .app-card-grid,
  .pricing-grid,
  .dashboard-grid,
  .quick-mode-grid,
  .project-form {
    grid-template-columns: 1fr;
  }

  .app-hero,
  .page-heading,
  .integration-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions {
    justify-content: stretch;
  }

  .hero-actions .action-button,
  .page-heading .action-button {
    width: 100%;
  }

  .case-card {
    grid-template-columns: 1fr;
  }

  .case-result {
    text-align: left;
  }

  .case-actions {
    justify-content: stretch;
  }

  .case-actions .icon-action {
    flex: 1;
  }

  .route-header {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    min-height: 106px;
    padding: 30px 14px 18px;
  }

  .route-back {
    width: 44px;
    height: 44px;
    font-size: 44px;
  }

  .route-mini-button,
  .route-pill {
    min-height: 38px;
    padding: 7px 12px;
    font-size: 14px;
  }

  .project-summary-hero,
  .phone-card,
  .record-hero-card {
    margin-right: 14px;
    margin-left: 14px;
  }

  .project-row-main,
  .case-row-main {
    grid-template-columns: 58px minmax(0, 1fr) auto 18px;
    gap: 10px;
  }

  .row-icon {
    width: 52px;
    height: 52px;
  }

  .case-row-title {
    font-size: 19px;
  }

  .case-row-result b {
    font-size: 20px;
  }

  .input-list {
    grid-template-columns: 1fr;
  }

  .info-line {
    grid-template-columns: 34px minmax(82px, 0.62fr) minmax(0, 1fr);
    gap: 10px;
  }

  .info-line span:not(.info-mark) {
    font-size: 15px;
  }

  .info-line b {
    font-size: 16px;
  }

  .record-bottom-actions {
    gap: 8px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .floor-group {
    align-items: flex-start;
    flex-direction: column;
  }

  .floor-group span {
    flex: auto;
  }

  .search-actions .action-button {
    width: 100%;
  }

  .metric {
    min-height: 112px;
  }

  .calc-table {
    font-size: 13px;
  }

  .mobile-results {
    display: grid;
    margin: calc(var(--bottom-menu-height) + 10px) 0 14px;
  }

  .workspace > .result-strip {
    display: none;
  }

  .calc-table th:nth-child(2),
  .calc-table td:nth-child(2) {
    display: none;
  }
}
