:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-soft: #f8f9f6;
  --ink: #17211f;
  --muted: #65706c;
  --faint: #8a938f;
  --line: #dfe4dc;
  --line-strong: #c9d0c7;
  --teal: #0f766e;
  --teal-dark: #0a5d58;
  --blue: #315f91;
  --gold: #a46b17;
  --claret: #8e3f4e;
  --red: #a33a3a;
  --shadow: 0 1px 2px rgba(23, 33, 31, 0.05), 0 14px 36px rgba(23, 33, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 760;
}

h2 {
  font-size: 14px;
  line-height: 1.25;
  margin-bottom: 12px;
  font-weight: 760;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 18px 28px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 244, 241, 0.96);
  backdrop-filter: blur(12px);
}

.topbar > div {
  display: grid;
  gap: 5px;
}

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

.tabs,
.segmented {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 3px;
  box-shadow: 0 1px 2px rgba(23, 33, 31, 0.05);
}

.tab,
.grain {
  min-width: 82px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 680;
}

.tab.active {
  background: var(--ink);
  color: #fff;
}

.grain {
  min-width: 68px;
}

.grain.active {
  background: var(--teal);
  color: #fff;
}

.grain.unavailable {
  color: #a5aca8;
}

main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 24px 28px 36px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.share-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(23, 33, 31, 0.04);
}

.share-panel .eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.share-panel h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.share-panel p {
  max-width: 680px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.share-panel a {
  display: inline-block;
  margin-top: 9px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 680;
  word-break: break-word;
}

.share-panel img {
  width: 132px;
  height: 132px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}

.metric {
  min-height: 84px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(23, 33, 31, 0.04);
}

.metric span {
  display: block;
  color: var(--faint);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(20px, 2.3vw, 27px);
  line-height: 1.05;
  font-weight: 780;
}

.toolbar,
.valuation-tool,
.live-scrape,
.panel,
.summary-item,
.schema-layout > section,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) minmax(180px, 0.8fr) 140px 180px;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.market-overview-toolbar {
  grid-template-columns: minmax(260px, 420px);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 104px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(15, 118, 110, 0.65);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.check {
  min-height: 40px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 640;
  text-transform: none;
}

.check input {
  width: 16px;
  height: 16px;
}

.table-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 12px 2px 8px;
  color: var(--muted);
  font-size: 13px;
}

.table-meta strong {
  color: var(--ink);
}

.house-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.house-overview-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.house-overview-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.house-overview-card header strong {
  font-size: 32px;
  line-height: 1;
  font-weight: 780;
}

.house-jump {
  justify-self: start;
  min-width: 118px;
}

.house-review-select {
  width: min(340px, 100%);
  margin-top: 10px;
}

.house-focus {
  margin-top: 16px;
}

.house-focus-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 285px);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2ed;
  color: #46514d;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fafbf8;
}

td.title {
  min-width: 320px;
  max-width: 560px;
}

.title a {
  color: inherit;
  text-decoration-color: rgba(15, 118, 110, 0.38);
  text-underline-offset: 3px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f8f6;
  color: #36413e;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}

.badge.iwa {
  border-color: rgba(15, 118, 110, 0.3);
  color: var(--teal);
}

.badge.celtic {
  border-color: rgba(164, 107, 23, 0.34);
  color: var(--gold);
}

.badge.wb {
  border-color: rgba(49, 95, 145, 0.3);
  color: var(--blue);
}

.badge.dup {
  border-color: rgba(163, 58, 58, 0.3);
  color: var(--red);
  margin-left: 6px;
}

.wb-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.wb-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.notice {
  display: none;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(164, 107, 23, 0.32);
  border-radius: 8px;
  color: #734906;
  background: #fff8e9;
  font-size: 13px;
}

.notice.show {
  display: block;
}

.valuation-tool {
  display: grid;
  gap: 15px;
  margin: 0 0 18px;
  padding: 16px;
  border-left: 4px solid var(--teal);
}

.valuation-search {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 124px;
  gap: 12px;
  align-items: end;
}

.valuation-search button {
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  font-weight: 760;
}

.valuation-search button:hover {
  background: var(--teal-dark);
}

.valuation-output {
  display: grid;
  gap: 12px;
}

.valuation-intel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.smart-interpret {
  color: var(--muted);
  font-size: 12px;
}

.smart-interpret strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.valuation-result-head {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
}

.live-scrape {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  background: #fbfcfa;
}

.scanner-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(520px, 1.25fr);
  gap: 16px;
}

.personal-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(440px, 1.1fr);
  gap: 16px;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.map-panel {
  min-height: 690px;
}

.map-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px;
  gap: 12px;
  align-items: end;
}

.ireland-map-wrap {
  min-height: 560px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 48% 42%, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 36%),
    linear-gradient(180deg, #f7fbf8, #eef5f3);
  overflow: hidden;
}

#irelandMap {
  width: min(100%, 620px);
  height: auto;
  display: block;
}

.ireland-shape {
  fill: #e5efe7;
  stroke: #7f9d8b;
  stroke-width: 1.65;
  stroke-linejoin: round;
  filter: drop-shadow(0 12px 18px rgba(24, 47, 38, 0.14));
}

.ni-shape {
  fill: #d8e7e8;
  stroke: #6f9188;
  stroke-width: 1.45;
  stroke-linejoin: round;
}

.distillery-marker circle {
  fill: var(--teal);
  stroke: #fff;
  stroke-width: 2;
}

.distillery-marker text {
  fill: #25302d;
  font-size: 10px;
  font-weight: 720;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 3px;
}

.distillery-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.distillery-item:last-child {
  border-bottom: 0;
}

.distillery-item strong {
  overflow-wrap: anywhere;
}

.distillery-item span:not(.badge) {
  color: var(--muted);
  font-size: 12px;
}

.personal-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) 130px 100px minmax(260px, 1.4fr) 92px;
  gap: 12px;
  align-items: end;
}

.diary-form {
  grid-template-columns: minmax(260px, 1fr) 150px 110px;
  align-items: start;
}

.personal-form label:has(textarea) {
  grid-column: 1 / -1;
  align-self: stretch;
}

.personal-form button,
.row-action {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  padding: 0 12px;
  font-weight: 760;
}

.row-action {
  min-height: 30px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.diary-form > button {
  width: max-content;
  min-width: 132px;
}

.photo-linker {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-weight: 760;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.photo-link-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.save-status {
  align-self: center;
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.save-status[data-kind="ok"] {
  color: var(--teal);
}

.save-status[data-kind="error"] {
  color: #a2472f;
}

.wide-personal {
  grid-column: 1 / -1;
}

.diary-photo-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.diary-photo-strip img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.voice-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(23, 33, 31, 0.16);
  border-radius: 8px;
  background: #f5f7f2;
}

.voice-panel > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.voice-panel strong {
  font-size: 13px;
}

.voice-panel span,
.voice-transcript {
  color: var(--muted);
  font-size: 12px;
}

.voice-transcript {
  min-height: 40px;
  padding: 10px;
  border: 1px solid rgba(23, 33, 31, 0.14);
  border-radius: 6px;
  background: #fff;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.diary-recorder .scanner-actions {
  justify-content: flex-start;
}

.voice-upload {
  max-width: 360px;
  text-transform: uppercase;
}

.voice-upload input {
  height: auto;
  padding: 8px 10px;
}

.diary-moment {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.diary-current {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.diary-current span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.diary-current strong {
  font-size: 15px;
}

.diary-current p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.scanner-card {
  display: grid;
  gap: 14px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.scanner-drop {
  min-height: 112px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--teal);
  font-size: 13px;
  font-weight: 760;
  text-align: center;
}

.scanner-drop input {
  width: min(100%, 360px);
  height: auto;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 10px;
  color: var(--ink);
  text-transform: none;
}

.scanner-preview {
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9f6;
}

.camera-panel {
  display: grid;
  gap: 10px;
}

.camera-panel video {
  display: none;
  width: 100%;
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101817;
  object-fit: cover;
}

.camera-panel video.live {
  display: block;
}

.preview-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  padding: 8px;
}

.scanner-preview img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.file-preview,
.file-tile {
  min-height: 104px;
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
}

.file-preview span {
  font-size: 12px;
}

.scanner-search {
  grid-template-columns: 1fr 120px;
}

.scanner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.scanner-actions button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 680;
}

.camera-help {
  font-size: 12px;
  color: var(--muted);
}

.bottle-details {
  display: grid;
  gap: 10px;
}

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

.detail-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.detail-item span {
  display: block;
  color: var(--faint);
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.detail-item strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.scanner-intel {
  display: grid;
  gap: 10px;
}

.smart-guess {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(49, 95, 145, 0.24);
  border-radius: 8px;
  background: #f5f8fb;
}

.smart-guess .badge {
  justify-self: start;
}

.smart-guess strong {
  overflow-wrap: anywhere;
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  display: inline-grid;
  gap: 2px;
  text-align: left;
  max-width: 100%;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: #26312e;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 680;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.suggestion-chip:hover {
  border-color: rgba(15, 118, 110, 0.45);
  color: var(--teal);
}

.visual-suggestion-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.visual-suggestion {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px;
  text-align: left;
}

.visual-suggestion img,
.match-thumb {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.visual-suggestion span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.visual-suggestion strong,
.visual-suggestion em {
  overflow-wrap: anywhere;
}

.visual-suggestion em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
}

.match-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

#scannerSavePersonal {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.db-head {
  margin-top: 18px;
}

.scan-library {
  display: grid;
  gap: 10px;
}

.scan-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.scan-thumb {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.scan-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-item strong {
  overflow-wrap: anywhere;
}

.live-head {
  margin-bottom: 0;
}

.live-head .badge {
  align-self: start;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(500px, 1.35fr) minmax(300px, 0.75fr);
  gap: 16px;
}

.live-grid {
  grid-template-columns: minmax(320px, 0.78fr) minmax(520px, 1.22fr);
}

.panel {
  min-width: 0;
  padding: 15px;
}

.panel.wide {
  min-height: 260px;
}

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

.panel header select {
  width: 180px;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 92px minmax(150px, 1fr) 104px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-label {
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bar-track {
  position: relative;
  height: 24px;
  border-radius: 6px;
  background: #e9eee8;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.bar-value {
  color: #33403c;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

.rank-item {
  display: grid;
  gap: 5px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.rank-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rank-item strong {
  overflow-wrap: anywhere;
}

.rank-meta {
  color: var(--muted);
  font-size: 12px;
}

.table-wrap.small {
  max-height: 380px;
}

.split {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(400px, 1.2fr);
  gap: 16px;
}

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

.live-house-panel {
  margin-bottom: 16px;
}

.live-house-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}

.live-house-card {
  display: grid;
  gap: 12px;
}

.live-house-metrics {
  grid-template-columns: repeat(4, minmax(70px, 1fr));
}

.mini-table {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.mini-table a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.mini-table a + a {
  border-top: 1px solid var(--line);
}

.mini-table span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item {
  padding: 14px;
}

.summary-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.summary-item strong {
  overflow-wrap: anywhere;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.compact .summary-grid {
  grid-template-columns: repeat(2, minmax(80px, 1fr));
}

.schema-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(380px, 1.1fr);
  gap: 16px;
}

.schema-layout > section {
  padding: 16px;
}

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

.schema-list li {
  display: grid;
  gap: 4px;
}

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

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

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--surface-soft);
  font-size: 12px;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    min-width: 0;
  }

  .metrics,
  .share-panel,
  .toolbar,
  .split,
  .schema-layout,
  .dashboard-grid,
  .live-grid,
  .scanner-layout,
  .personal-layout,
  .personal-form,
  .map-layout,
  .map-toolbar,
  .valuation-search,
  .valuation-result-head {
    grid-template-columns: 1fr;
  }

  .share-panel img {
    width: 148px;
    height: 148px;
  }

  .wb-head,
  .panel header {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented,
  .panel header select {
    width: 100%;
  }

  .grain {
    flex: 1;
    min-width: 0;
  }

  main,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
}
