:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-elevated: rgba(255, 255, 255, 0.78);
  --bg-solid: #ffffff;
  --sidebar: rgba(246, 246, 248, 0.78);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --muted-strong: #515154;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.16);
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --heat-0: #ebedf0;
  --heat-1: #9be9a8;
  --heat-2: #40c463;
  --heat-3: #30a14e;
  --heat-4: #216e39;
  --green: #2e7d32;
  --orange: #b45309;
  --red: #c2410c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --toolbar-height: 76px;
}

html[data-resolved-theme="dark"] {
  color-scheme: dark;
  --bg: #101012;
  --bg-elevated: rgba(30, 30, 32, 0.76);
  --bg-solid: #1f1f22;
  --sidebar: rgba(24, 24, 27, 0.8);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --muted-strong: #c7c7cc;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --heat-0: #2a2a2d;
  --heat-1: #0e4429;
  --heat-2: #006d32;
  --heat-3: #26a641;
  --heat-4: #39d353;
  --green: #66bb6a;
  --orange: #f4a261;
  --red: #ff9f0a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 113, 227, 0.08), transparent 30rem),
    radial-gradient(circle at 92% 10%, rgba(52, 199, 89, 0.08), transparent 26rem),
    var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

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

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(210px, 292px) minmax(260px, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: var(--toolbar-height);
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
}

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

.brand > div:last-child {
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(231, 234, 238, 0.72));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

html[data-resolved-theme="dark"] .brand-mark {
  background: linear-gradient(145deg, rgba(70, 70, 76, 0.7), rgba(30, 30, 34, 0.8));
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  fill: var(--text);
}

.brand h1,
.brand p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand h1 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0;
}

.brand p {
  color: var(--muted);
  font-size: 12px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-solid);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.search-field svg,
.icon-button svg,
.segmented svg,
.drop-zone svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-field svg {
  color: var(--muted);
  flex: 0 0 auto;
}

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

.toolbar-controls {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

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

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.08);
}

.segmented button,
.text-button,
.icon-button,
.settings-trigger,
.import-button,
.primary-button {
  border: 0;
  cursor: pointer;
}

.settings-trigger {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-solid);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.settings-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.saved-reset {
  flex: 0 0 auto;
  min-height: 36px;
}

.import-guide-menu {
  position: relative;
  flex: 0 0 auto;
}

.import-guide-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-solid);
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  list-style: none;
}

.import-guide-menu summary::-webkit-details-marker {
  display: none;
}

.guide-popover {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 60;
  width: 360px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-solid);
  box-shadow: var(--shadow);
}

.guide-popover h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.guide-popover ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
}

.guide-popover li + li {
  margin-top: 7px;
}

.guide-popover strong {
  color: var(--text);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 28px;
  padding: 0 11px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.segmented.compact button {
  min-width: 32px;
  padding: 0 8px;
}

.segmented button.is-active {
  background: var(--bg-solid);
  color: var(--text);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
}

.select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-solid);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.select-wrap select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-weight: 650;
}

.import-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.import-button input,
.primary-button + input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon-button {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-solid);
  color: var(--text);
  border: 1px solid var(--line);
}

.sidebar {
  position: sticky;
  top: var(--toolbar-height);
  height: calc(100vh - var(--toolbar-height));
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
}

.sidebar-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 8px;
  background: linear-gradient(var(--sidebar) 80%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.text-button {
  padding: 4px 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
}

.folder-tree {
  padding: 8px 10px 24px;
}

.folder-item {
  margin: 2px 0;
}

.folder-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.folder-row:hover {
  background: rgba(127, 127, 127, 0.1);
}

.folder-row.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.folder-disclosure {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--muted);
}

.folder-disclosure svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.16s ease;
}

.folder-row[aria-expanded="true"] .folder-disclosure svg {
  transform: rotate(90deg);
}

.folder-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.folder-count {
  min-width: 28px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.12);
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.folder-children {
  margin-left: 14px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.folder-item.is-collapsed > .folder-children {
  display: none;
}

.content {
  min-width: 0;
  padding: 22px clamp(16px, 2.4vw, 34px) 34px;
}

.page-view {
  min-width: 0;
}

.filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text);
}

.filter-banner strong {
  display: block;
  font-size: 13px;
}

.filter-banner span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.filter-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.stat-card,
.domain-panel,
.results-panel,
.insight-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
}

.stat-card {
  min-width: 0;
  padding: 14px;
}

.stat-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 25px;
  font-weight: 720;
  letter-spacing: 0;
}

.stat-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.domain-panel {
  margin-top: 18px;
  margin-bottom: 0;
  padding: 16px;
}

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.ranking-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.insight-card {
  min-width: 0;
  padding: 16px;
}

.section-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chart-scroll {
  width: 100%;
  margin-top: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}

.graph-scroll {
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.04);
}

.heatmap-chart svg,
.trend-chart,
.folder-graph {
  display: block;
}

.heat-cell {
  cursor: pointer;
  stroke: var(--bg-solid);
  stroke-width: 1;
}

.heat-cell:hover,
.trend-bars rect:hover {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.trend-bars rect {
  fill: rgba(0, 113, 227, 0.32);
  cursor: pointer;
}

html[data-resolved-theme="dark"] .trend-bars rect {
  fill: rgba(10, 132, 255, 0.42);
}

.trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
}

.chart-axis text {
  fill: var(--muted);
  font-size: 11px;
}

.chart-axis path,
.chart-axis line {
  stroke: var(--line-strong);
}

.graph-links path {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.2;
}

.graph-node {
  cursor: pointer;
}

.graph-node circle {
  fill: var(--bg-solid);
  stroke: var(--accent);
  stroke-width: 1.6;
}

.graph-node.domain circle {
  fill: var(--green);
  stroke: var(--green);
}

.graph-node text {
  fill: var(--text);
  font-size: 11px;
  font-weight: 650;
}

.graph-node.domain text {
  fill: var(--muted-strong);
  font-weight: 600;
}

.ranking-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.ranking-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.05);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.ranking-item:hover {
  border-color: var(--line-strong);
  background: rgba(127, 127, 127, 0.09);
}

.ranking-title,
.ranking-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-title {
  font-size: 12px;
  font-weight: 750;
}

.ranking-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.ranking-value {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
}

.section-title,
.results-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-title h2,
.results-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.section-title span,
.result-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.domain-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.domain-chip {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.06);
}

.domain-chip-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.domain-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-bar {
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.13);
}

.domain-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #34c759);
}

.results-panel {
  padding: 18px;
}

.breadcrumb {
  min-height: 18px;
  margin-bottom: 3px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
}

.bookmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(304px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

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

.bookmark-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  min-height: 136px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-solid);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.bookmark-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.bookmark-grid.is-list .bookmark-card {
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 92px;
  align-items: start;
}

.site-icon {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(0, 113, 227, 0.18), rgba(52, 199, 89, 0.13)),
    var(--bg);
  color: var(--accent);
  font-size: 15px;
  font-weight: 760;
  text-transform: uppercase;
}

.site-icon img {
  position: absolute;
  inset: 7px;
  width: calc(100% - 14px);
  height: calc(100% - 14px);
  border-radius: 5px;
  object-fit: contain;
  image-rendering: auto;
}

.site-icon.has-img span {
  opacity: 0;
}

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

.bookmark-title {
  display: -webkit-box;
  min-height: 42px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.bookmark-grid.is-list .bookmark-title {
  min-height: 0;
  -webkit-line-clamp: 1;
}

.bookmark-url {
  min-width: 0;
  overflow: hidden;
}

.bookmark-url {
  display: -webkit-box;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bookmark-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.bookmark-chips span {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.08);
  color: var(--muted-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
}

.empty-results {
  display: grid;
  min-height: 240px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-results h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 17px;
}

.empty-results p {
  margin: 0;
}

.import-empty {
  position: fixed;
  inset: var(--toolbar-height) 0 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.drop-zone {
  display: grid;
  width: min(620px, 100%);
  min-height: 390px;
  place-items: center;
  padding: 32px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  text-align: center;
  box-shadow: var(--shadow);
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone svg {
  width: 38px;
  height: 38px;
  color: var(--accent);
}

.drop-zone h2 {
  margin: 10px 0 0;
  font-size: 20px;
}

.drop-zone p {
  margin: 6px 0 18px;
  color: var(--muted);
}

.export-help {
  width: 100%;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(127, 127, 127, 0.06);
  text-align: left;
}

.export-help h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 750;
}

.export-help ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.export-help li + li {
  margin-top: 7px;
}

.export-help strong {
  color: var(--text);
}

.mobile-scrim {
  position: fixed;
  inset: var(--toolbar-height) 0 0;
  z-index: 24;
  background: rgba(0, 0, 0, 0.22);
}

@media (max-width: 1360px) {
  .toolbar {
    grid-template-columns: auto minmax(190px, 240px) minmax(210px, 1fr);
  }

  .toolbar-controls {
    grid-column: 2 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    top: 122px;
    height: calc(100vh - 122px);
  }
}

@media (max-width: 860px) {
  :root {
    --toolbar-height: 132px;
  }

  .app-shell {
    display: block;
  }

  .toolbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }

  .icon-button {
    display: inline-flex;
  }

  .brand {
    min-width: 0;
  }

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

  .toolbar-controls {
    grid-column: 1 / -1;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .guide-popover {
    left: 0;
    right: auto;
    width: min(360px, calc(100vw - 20px));
  }

  .sidebar {
    position: fixed;
    top: var(--toolbar-height);
    bottom: 0;
    left: 0;
    z-index: 25;
    width: min(330px, 86vw);
    height: auto;
    transform: translateX(-104%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .content {
    padding-top: 18px;
  }

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

  .insight-grid,
  .ranking-grid {
    grid-template-columns: 1fr;
  }

  .graph-scroll {
    max-height: 520px;
  }
}

@media (max-width: 560px) {
  :root {
    --toolbar-height: 166px;
  }

  body {
    font-size: 13px;
  }

  .toolbar {
    padding: 10px;
  }

  .toolbar-controls {
    overflow: visible;
    flex-wrap: wrap;
    align-items: center;
    padding-bottom: 0;
  }

  .settings-trigger {
    display: inline-flex;
  }

  .settings-panel {
    position: absolute;
    top: 46px;
    left: 0;
    z-index: 50;
    display: none;
    width: min(360px, calc(100vw - 20px));
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-solid);
    box-shadow: var(--shadow);
  }

  body.settings-open .settings-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .settings-panel .segmented,
  .settings-panel .select-wrap,
  .settings-panel .import-guide-menu,
  .settings-panel .saved-reset {
    width: 100%;
  }

  .settings-panel .segmented {
    justify-content: center;
  }

  .settings-panel .select-wrap {
    justify-content: space-between;
  }

  .settings-panel .select-wrap span {
    display: inline;
  }

  .settings-panel .import-guide-menu summary,
  .settings-panel .saved-reset {
    width: 100%;
  }

  .settings-panel .guide-popover {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .segmented button {
    min-width: 52px;
    padding: 0 8px;
  }

  .select-wrap span {
    display: none;
  }

  .stats-row,
  .domain-list,
  .bookmark-grid {
    grid-template-columns: 1fr;
  }

  .filter-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-actions {
    width: 100%;
    justify-content: space-between;
  }

  .section-title,
  .results-heading {
    display: block;
  }

  .result-count,
  .section-title span {
    display: block;
    margin-top: 4px;
  }

  .bookmark-grid.is-list .bookmark-card,
  .bookmark-card {
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: 120px;
  }

  .site-icon {
    width: 40px;
    height: 40px;
  }

  .site-icon img {
    inset: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
  }
}
