:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  --background: #0d0e11;
  --surface: #15171b;
  --surface-strong: #1b1d22;
  --surface-soft: #202126;
  --border: #302d27;
  --border-soft: #292a2e;
  --text: #f5efe4;
  --muted: #a79f92;
  --faint: #777168;
  --gold: #d5a54c;
  --gold-bright: #f0cf84;
  --gold-soft: #2c2416;
  --green: #76cf89;
  --red: #ec8076;
  --orange: #c97b4d;
  --shadow: rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(213, 165, 76, 0.08), transparent 34rem),
    var(--background);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(21, 23, 27, 0.94);
  box-shadow: 0 24px 80px var(--shadow);
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #1a1206;
  background: linear-gradient(145deg, var(--gold-bright), #9f681d);
  box-shadow: 0 10px 30px rgba(213, 165, 76, 0.24);
  font-size: 25px;
  font-weight: 800;
}

.brand-mark-small {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 18px;
  box-shadow: none;
}

.eyebrow {
  margin: 24px 0 8px;
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(30px, 8vw, 42px);
  line-height: 1.05;
}

.login-copy {
  margin: 14px 0 28px;
  color: var(--muted);
  line-height: 1.55;
}

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

.login-panel label {
  font-size: 13px;
  font-weight: 650;
}

.login-panel input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--text);
  border: 1px solid #48433a;
  border-radius: 10px;
  background: #101115;
}

.login-panel input:focus {
  border-color: var(--gold);
}

.field-help {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.4;
}

.form-error {
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.primary-action {
  min-height: 48px;
  margin-top: 4px;
  padding: 11px 16px;
  border: 0;
  border-radius: 10px;
  color: #1c1306;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  font-weight: 750;
  cursor: pointer;
}

.primary-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.quiet-action:disabled,
.icon-action:disabled {
  opacity: 0.5;
  cursor: wait;
}

.dashboard-view {
  min-height: 100vh;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 18, 22, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}

.brand > span:last-child {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0.11em;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.collector-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.collector-state.is-active {
  color: var(--green);
}

.collector-state.is-error {
  color: var(--red);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(118, 207, 137, 0.1);
}

.quiet-action,
.icon-action {
  min-height: 38px;
  border: 1px solid #393630;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.quiet-action {
  padding: 8px 11px;
}

.quiet-action:hover,
.icon-action:hover {
  color: var(--text);
  border-color: #5a5142;
  background: rgba(213, 165, 76, 0.06);
}

.app-shell {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 12px;
  border-right: 1px solid var(--border);
  background: #111216;
}

.nav-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.nav-item-active {
  color: #f8e4ba;
  background: var(--gold-soft);
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-item-disabled {
  opacity: 0.55;
}

.nav-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-button:hover {
  color: var(--text);
  background: rgba(213, 165, 76, 0.06);
}

.nav-item small {
  margin-left: auto;
  color: var(--gold);
  font-size: 10px;
}

.nav-icon {
  width: 20px;
  color: var(--gold-bright);
  text-align: center;
}

.sidebar-foot {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 12px 10px;
  color: var(--green);
  font-size: 11px;
}

.sidebar-foot small {
  color: var(--faint);
  line-height: 1.4;
}

.main-content {
  min-width: 0;
  padding: 26px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.page-heading .eyebrow {
  margin: 0 0 7px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(27px, 4vw, 37px);
  line-height: 1.1;
}

.page-heading p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.heading-status {
  display: grid;
  gap: 4px;
  color: var(--gold-bright);
  font-size: 12px;
  text-align: right;
}

.heading-status small {
  color: var(--faint);
}

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

.summary-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: var(--surface);
}

.summary-card > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  font-size: clamp(19px, 3vw, 25px);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-card small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.48fr);
  gap: 16px;
  align-items: start;
}

.watchlist-panel,
.chart-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  background: var(--surface);
}

.panel-header,
.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.panel-header h2,
.chart-header h2 {
  margin: 0;
  font-size: 15px;
}

.panel-header small,
.chart-header p {
  display: block;
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 10px;
}

.icon-action {
  width: 38px;
  padding: 0;
  font-size: 18px;
}

.icon-action.is-loading {
  cursor: wait;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.filter-row {
  display: flex;
  gap: 6px;
  padding: 11px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-soft);
  scrollbar-width: thin;
}

.filter-row button,
.period-buttons button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #3b3832;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}

.filter-row button[aria-pressed="true"],
.period-buttons button[aria-pressed="true"] {
  color: #1b1306;
  border-color: var(--gold);
  background: var(--gold);
  font-weight: 700;
}

.cards-list {
  max-height: 620px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.card-row {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

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

.card-row:hover {
  background: #191b20;
}

.card-row[aria-pressed="true"] {
  background: var(--gold-soft);
  box-shadow: inset 3px 0 0 var(--gold);
}

.card-thumbnail,
.card-thumbnail-fallback {
  width: 46px;
  height: 60px;
  grid-area: 1 / 1;
  border-radius: 6px;
}

.card-thumbnail {
  position: relative;
  z-index: 1;
  display: block;
  object-fit: cover;
  background: #24201a;
}

.card-thumbnail-fallback {
  display: grid;
  place-items: center;
  color: #f3ddb1;
  background: linear-gradient(145deg, #3e211c, #9b671f);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

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

.card-copy strong,
.card-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-copy strong {
  font-size: 12px;
}

.card-copy small {
  margin-top: 4px;
  color: var(--faint);
  font-size: 10px;
}

.freshness-label {
  display: inline-flex !important;
  width: fit-content;
  margin-top: 6px !important;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--muted) !important;
  background: var(--surface-soft);
}

.freshness-label.is-fresh {
  color: var(--green) !important;
  background: rgba(118, 207, 137, 0.08);
}

.freshness-label.is-stale {
  color: var(--orange) !important;
  background: rgba(201, 123, 77, 0.09);
}

.card-value {
  min-width: 76px;
  text-align: right;
}

.card-value strong,
.card-value small {
  display: block;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-value strong {
  font-size: 12px;
}

.card-value small {
  margin-top: 4px;
  color: var(--faint);
  font-size: 10px;
}

.empty-list {
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

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

.selected-card-art {
  width: 42px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  color: #f6e4bd;
  background: linear-gradient(145deg, #3e211c, #9b671f);
  font-size: 10px;
  font-weight: 800;
}

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

.selected-card h2,
.selected-card p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-price {
  min-width: 120px;
  text-align: right;
}

.selected-price strong,
.selected-price small {
  display: block;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.selected-price strong {
  font-size: 21px;
}

.selected-price small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.selected-price small.is-positive {
  color: var(--green);
}

.selected-price small.is-negative {
  color: var(--red);
}

.chart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px 2px;
}

.period-buttons {
  display: flex;
  gap: 5px;
}

.period-buttons button {
  min-width: 42px;
  border-radius: 8px;
}

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 15px;
  height: 2px;
  display: inline-block;
}

.legend-market {
  background: var(--gold);
}

.legend-low {
  background: var(--orange);
}

.legend-history {
  height: 0 !important;
  border-top: 2px dashed #b59b70;
}

.chart-container {
  position: relative;
  min-height: 360px;
  padding: 4px 10px 0;
}

.price-chart {
  width: 100%;
  height: auto;
  min-height: 320px;
  display: block;
  touch-action: pan-y;
}

.chart-grid-line {
  stroke: #2c2d31;
  stroke-width: 1;
}

.chart-axis-label {
  fill: #8f897f;
  font-size: 11px;
}

.chart-market-area {
  fill: rgba(213, 165, 76, 0.09);
}

.chart-market-line,
.chart-low-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-market-line {
  stroke: var(--gold);
  stroke-width: 3;
}

.chart-history-line {
  fill: none;
  stroke: #b59b70;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 7 6;
}

.chart-low-line {
  stroke: var(--orange);
  stroke-width: 2;
}

.chart-latest-point {
  fill: var(--gold);
  stroke: var(--surface);
  stroke-width: 3;
}

.chart-history-point {
  fill: #b59b70;
  stroke: var(--surface);
  stroke-width: 2;
}

.chart-guide {
  stroke: #706b62;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.chart-hover-market,
.chart-hover-low {
  stroke: var(--surface);
  stroke-width: 3;
}

.chart-hover-market {
  fill: var(--gold);
}

.chart-hover-low {
  fill: var(--orange);
}

.chart-hit-area {
  fill: transparent;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  max-width: 210px;
  padding: 9px 10px;
  pointer-events: none;
  border: 1px solid #454138;
  border-radius: 9px;
  color: var(--text);
  background: #111216;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  font-size: 11px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.chart-tooltip strong,
.chart-tooltip span {
  display: block;
}

.chart-tooltip span {
  color: var(--muted);
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.chart-empty strong {
  color: var(--text);
  font-size: 14px;
}

.chart-empty span {
  max-width: 330px;
  font-size: 12px;
  line-height: 1.5;
}

.chart-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--faint);
  font-size: 10px;
}

.collector-error {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(236, 128, 118, 0.35);
  border-radius: 10px;
  color: var(--red);
  background: rgba(236, 128, 118, 0.07);
  font-size: 12px;
}

.settings-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #403a31;
  border-radius: 18px;
  color: var(--text);
  background: #111216;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.settings-dialog::backdrop {
  background: rgba(4, 5, 7, 0.76);
  backdrop-filter: blur(5px);
}

.settings-dialog-inner {
  max-height: min(820px, calc(100vh - 28px));
  overflow-y: auto;
}

.settings-header,
.activity-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.settings-header {
  padding: 22px;
  border-bottom: 1px solid var(--border-soft);
}

.settings-header .eyebrow {
  margin: 0 0 7px;
}

.settings-header h2,
.activity-heading h3 {
  margin: 0;
}

.settings-header h2 {
  font-size: 21px;
}

.settings-header p:last-child,
.activity-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.collector-settings-form {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-soft);
}

.collector-settings-form > label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.settings-control-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 9px;
}

.settings-control-row select {
  min-height: 42px;
  padding: 8px 34px 8px 11px;
  border: 1px solid #403a31;
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
}

.settings-control-row .quiet-action,
.settings-control-row .primary-action {
  min-height: 42px;
  padding: 8px 14px;
  white-space: nowrap;
}

.collector-settings-form .field-help {
  margin: 9px 0 0;
}

.history-import-section {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-soft);
}

.history-import-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 9px 12px;
  align-items: center;
}

.history-import-grid label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.history-import-grid input {
  min-width: 0;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #403a31;
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
}

.history-import-grid input[type="file"] {
  padding: 7px;
}

.history-import-section .field-help {
  margin: 10px 0;
}

.history-import-section code {
  color: #d9c59f;
  overflow-wrap: anywhere;
}

.history-actions {
  display: flex;
  gap: 9px;
  margin-bottom: 12px;
}

.history-preview-summary {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
}

.history-preview-summary strong {
  color: var(--text);
}

.history-preview-errors {
  max-height: 130px;
  margin: 8px 0 0;
  padding: 9px 12px 9px 28px;
  overflow-y: auto;
  border: 1px solid rgba(236, 128, 118, 0.3);
  border-radius: 10px;
  color: var(--red);
  background: rgba(236, 128, 118, 0.06);
  font-size: 10px;
}

.action-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--green);
  font-size: 11px;
}

.action-status.is-error {
  color: var(--red);
}

.activity-section {
  padding: 20px 22px 22px;
}

.activity-heading {
  margin-bottom: 12px;
}

.activity-heading h3 {
  font-size: 15px;
}

.activity-log {
  display: grid;
  gap: 8px;
}

.activity-entry {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface);
}

.activity-status-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green);
}

.activity-entry.is-partial .activity-status-dot {
  background: var(--orange);
}

.activity-entry.is-failed .activity-status-dot {
  background: var(--red);
}

.activity-entry.is-running .activity-status-dot {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(213, 165, 76, 0.1);
}

.activity-copy strong,
.activity-copy span,
.activity-copy small {
  display: block;
}

.activity-copy strong {
  font-size: 12px;
}

.activity-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.activity-copy small {
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--red);
  font-size: 10px;
}

.activity-time {
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap;
}

.activity-empty {
  margin: 0;
  padding: 24px;
  border: 1px dashed #3b3832;
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

@media (max-width: 1050px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .cards-list {
    max-height: 420px;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 11px 13px;
  }

  .brand small,
  .collector-state span:last-child {
    display: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: 54px;
    flex-direction: row;
    align-items: center;
    padding: 7px 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-item {
    min-height: 38px;
    padding: 7px 10px;
    white-space: nowrap;
  }

  .sidebar-foot {
    display: none;
  }

  .main-content {
    padding: 19px 14px;
  }

  .page-heading {
    align-items: flex-start;
  }

  .heading-status {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .login-view {
    padding: 14px;
  }

  .login-panel {
    padding: 26px 20px;
  }

  .quiet-action {
    min-width: 42px;
    padding: 8px 9px;
  }

  #logout-button {
    font-size: 0;
  }

  #logout-button::after {
    content: "↪";
    font-size: 18px;
  }

  .page-heading {
    display: grid;
    gap: 12px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .summary-card {
    padding: 12px;
  }

  .panel-header,
  .chart-header {
    padding: 13px;
  }

  .chart-header {
    align-items: center;
  }

  .selected-card-art {
    display: none;
  }

  .selected-price {
    min-width: 96px;
  }

  .selected-price strong {
    font-size: 17px;
  }

  .chart-controls {
    align-items: flex-start;
    flex-direction: column;
    padding: 10px 12px 2px;
  }

  .chart-legend {
    justify-content: flex-start;
  }

  .chart-container {
    min-height: 300px;
    padding: 0;
  }

  .price-chart {
    min-height: 290px;
  }

  .chart-footer {
    flex-direction: column;
  }

  .settings-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
  }

  .settings-dialog-inner {
    max-height: calc(100vh - 18px);
  }

  .settings-header,
  .collector-settings-form,
  .history-import-section,
  .activity-section {
    padding: 16px;
  }

  .history-import-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .history-import-grid label:not(:first-child) {
    margin-top: 6px;
  }

  .history-actions {
    flex-direction: column;
  }

  .settings-control-row {
    grid-template-columns: 1fr 1fr;
  }

  .settings-control-row select {
    grid-column: 1 / -1;
  }

  .activity-entry {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .activity-time {
    grid-column: 2;
  }
}

@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;
  }
}
