:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f9fafb;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success-bg: #d1fae5;
  --success-text: #065f46;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.login-body {
  background: #f8fafc;
}

.login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 410px;
  padding: 32px;
  width: 100%;
}

.login-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.brand-mark {
  align-items: center;
  background: var(--primary);
  border-radius: 8px;
  color: white;
  display: flex;
  font-size: 22px;
  font-weight: 700;
  height: 44px;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
}

.login-card h1 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.subtitle,
.page-subtitle,
.panel-note {
  color: var(--muted);
  font-size: 14px;
}

.login-card .subtitle {
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.form-group label {
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
}

.form-group input,
.form-group select,
.date-control input,
.compact-select {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: var(--text);
  min-height: 40px;
  padding: 8px 10px;
}

.form-group input:focus,
.form-group select:focus,
.date-control input:focus,
.compact-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.btn {
  align-items: center;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: white;
  border: 1px solid #d1d5db;
  color: #374151;
}

.btn-secondary:hover {
  background: #f9fafb;
}

.btn.small {
  min-height: 34px;
  padding: 6px 12px;
}

.full-width {
  width: 100%;
}

.message {
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
  padding: 12px;
}

.message.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.message.error {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.dashboard {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: white;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  height: 72px;
  justify-content: space-between;
  left: 0;
  padding: 0 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 20;
}

.topbar-left,
.topbar-right {
  align-items: center;
  display: flex;
  gap: 14px;
}

.topbar h1 {
  font-size: 20px;
  line-height: 1.2;
}

.topbar-subtitle,
.user-info {
  color: var(--muted);
  font-size: 13px;
}

.date-control {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

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

.date-control input {
  min-height: 40px;
  width: 150px;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.icon-button:hover {
  background: #f3f4f6;
  color: var(--text);
}

.dashboard-content {
  display: flex;
  min-height: calc(100vh - 72px);
  padding-top: 72px;
}

.sidebar {
  background: white;
  border-right: 1px solid var(--border);
  flex: 0 0 270px;
  padding: 24px 0;
  transition: flex-basis 0.2s;
}

.sidebar.collapsed {
  flex-basis: 78px;
}

.sidebar.collapsed .menu-text {
  display: none;
}

.sidebar-link {
  align-items: center;
  border-left: 3px solid transparent;
  color: var(--muted);
  display: flex;
  gap: 12px;
  min-height: 46px;
  padding: 0 24px;
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: #f3f4f6;
  border-left-color: var(--primary);
  color: var(--text);
}

.sidebar-link svg {
  flex: 0 0 auto;
}

.main-content {
  flex: 1;
  overflow-x: auto;
  padding: 28px;
  min-width: 0;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 22px;
}

.page-header h2 {
  font-size: 24px;
  line-height: 1.2;
  margin-bottom: 4px;
}

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

.kpi-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 116px;
  padding: 18px;
}

.kpi-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.kpi-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  margin-top: -5px;
}

.kpi-card strong {
  font-size: 28px;
  line-height: 1.1;
}

.kpi-card small {
  color: var(--muted);
  font-size: 15px;
}

.content-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
}

.panel {
  padding: 18px;
}

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

.panel-header h3 {
  font-size: 17px;
}

.chart-wrap {
  height: 340px;
  position: relative;
}

.chart-mobile-legend {
  display: none;
}

.sensor-picker {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 12px;
}

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

#sensorSelectionCount {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.threshold-control {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

.threshold-control input {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: var(--text);
  font-weight: 700;
  min-height: 30px;
  padding: 3px 6px;
  width: 58px;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 2px;
}

.sensor-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 74px;
  overflow: auto;
  padding-right: 4px;
}

.master-line-picker {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 10px;
}

.master-line-picker-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.sensor-chip {
  background: #f8fafc;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  color: #374151;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  min-height: 30px;
  padding: 5px 10px;
}

.sensor-chip.active {
  background: color-mix(in srgb, var(--sensor-color) 12%, white);
  border-color: var(--sensor-color);
  color: #111827;
}

.analysis-preview {
  color: #374151;
  font-size: 14px;
  white-space: pre-line;
}

.analysis-text {
  background: #fbfdff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #374151;
  font: inherit;
  min-height: 340px;
  padding: 18px;
  white-space: pre-wrap;
}

.works-text {
  line-height: 1.65;
}

.table-container {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.data-table {
  border-collapse: collapse;
  width: 100%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 13px 16px;
  text-align: left;
}

.data-table th {
  background: var(--surface-muted);
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s;
}

.clickable-row:hover,
.clickable-row:focus-visible {
  background: #f8fbff;
  outline: none;
}

.clickable-row.selected {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.sensor-detail-panel {
  margin-bottom: 16px;
  scroll-margin-top: 96px;
}

.sensor-detail-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.sensor-detail-table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 520px;
  overflow: auto;
}

.detail-table {
  border-collapse: collapse;
  min-width: 620px;
  width: 100%;
}

.detail-table th,
.detail-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 13px;
  text-align: left;
  white-space: nowrap;
}

.detail-table th {
  background: var(--surface-muted);
  color: #374151;
  font-size: 12px;
  font-weight: 800;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

.detail-table td {
  color: #374151;
  font-size: 13px;
}

.detail-table tr:last-child td {
  border-bottom: 0;
}

.sensor-config-table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}

.sensor-config-table {
  min-width: 980px;
}

.sensor-config-table td:first-child strong,
.sensor-config-table td:first-child span {
  display: block;
}

.sensor-config-table td:first-child span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.sensor-config-table input {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: var(--text);
  min-height: 36px;
  padding: 6px 8px;
  width: 100%;
}

.input-with-unit {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.input-with-unit span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
}

.status-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.form-panel {
  max-width: 760px;
}

.toggle-row {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  margin: -2px 0 20px;
  padding-bottom: 20px;
}

.toggle-row h3 {
  font-size: 17px;
  margin-bottom: 4px;
}

.toggle-row p {
  color: var(--muted);
  font-size: 14px;
}

.switch {
  display: inline-flex;
  height: 30px;
  position: relative;
  width: 54px;
  flex: 0 0 54px;
}

.switch input {
  opacity: 0;
}

.switch span {
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  inset: 0;
  overflow: hidden;
  position: absolute;
  transition: background-color 0.15s;
}

.switch span::before {
  background: white;
  border-radius: 50%;
  content: "";
  height: 24px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition: left 0.15s;
  width: 24px;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::before {
  left: 27px;
}

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

.form-group-wide {
  grid-column: 1 / -1;
}

.form-group-btn {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.btn-full {
  width: 100%;
}

.input-btn-row {
  display: flex;
  gap: 10px;
}

.input-btn-row input {
  flex: 1;
  min-width: 0;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

@media (max-width: 980px) {
  .kpi-grid,
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }

  .panel-large {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  body {
    background: white;
  }

  .topbar {
    align-items: flex-start;
    box-shadow: none;
    gap: 10px;
    flex-wrap: wrap;
    height: 112px;
    min-height: 112px;
    padding: 10px 14px;
  }

  .topbar-left {
    flex: 1 1 100%;
    gap: 10px;
    min-width: 0;
  }

  .topbar-left > div {
    min-width: 0;
  }

  .topbar h1 {
    font-size: 17px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-subtitle {
    display: block;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-right {
    display: grid;
    flex: 1 1 100%;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 72px auto;
    width: 100%;
  }

  .date-control {
    min-width: 0;
  }

  .date-control span {
    display: none;
  }

  .date-control input {
    font-size: 14px;
    min-width: 0;
    width: 100%;
  }

  .dashboard-content {
    display: block;
    min-height: 100vh;
    padding-top: 112px;
  }

  .sidebar {
    align-items: center;
    border-right: 0;
    border-top: 1px solid var(--border);
    bottom: 0;
    box-shadow: 0 -1px 12px rgba(15, 23, 42, 0.08);
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    left: 0;
    padding: 0;
    position: fixed;
    right: 0;
    z-index: 30;
  }

  .sidebar.collapsed {
    flex-basis: auto;
  }

  .sidebar.collapsed .menu-text,
  .sidebar .menu-text {
    display: block;
  }

  .sidebar-link {
    border-left: 0;
    border-top: 3px solid transparent;
    flex-direction: column;
    gap: 3px;
    min-height: 62px;
    padding: 7px 4px 6px;
    text-align: center;
  }

  .sidebar-link:hover,
  .sidebar-link.active {
    border-left-color: transparent;
    border-top-color: var(--primary);
  }

  .sidebar-link svg {
    height: 19px;
    width: 19px;
  }

  .sidebar-link .menu-text {
    font-size: 8px;
    font-weight: 700;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .icon-button {
    display: none;
  }

  .main-content {
    background: #f8fafc;
    min-height: calc(100vh - 112px);
    overflow-x: hidden;
    padding: 18px 14px 86px;
  }

  .kpi-grid,
  .content-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .content-grid {
    display: block;
    max-width: 100%;
    width: 100%;
  }

  .content-grid > * + * {
    margin-top: 12px;
  }

  .panel,
  .panel-large {
    max-width: 100%;
    grid-column: auto;
    min-width: 0;
  }

  .page-header {
    margin-bottom: 14px;
  }

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

  .page-subtitle {
    font-size: 13px;
  }

  .kpi-grid {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
  }

  .kpi-card {
    gap: 7px;
    min-height: 102px;
    padding: 13px;
  }

  .kpi-card span {
    font-size: 11px;
    line-height: 1.2;
  }

  .kpi-card em {
    font-size: 11px;
    line-height: 1.2;
    margin-top: -3px;
  }

  .kpi-card strong {
    font-size: 23px;
    overflow-wrap: anywhere;
  }

  .kpi-card small {
    font-size: 12px;
  }

  .panel {
    padding: 14px;
  }

  .chart-panel {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 12px 10px 14px;
    width: 100%;
  }

  .panel-header {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    max-width: 100%;
    min-width: 0;
  }

  .panel-header h3 {
    font-size: 15px;
    line-height: 1.25;
  }

  .panel-note {
    font-size: 12px;
    white-space: nowrap;
  }

  .chart-wrap {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid #eef2f7;
    border-radius: 8px;
    height: 252px;
    max-width: 100%;
    min-width: 0;
    padding: 6px 4px 2px;
  }

  .sensor-picker {
    margin-bottom: 9px;
    max-width: 100%;
    min-width: 0;
    padding: 8px 10px;
  }

  .sensor-picker-header {
    align-items: flex-start;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 9px;
    max-width: 100%;
    min-width: 0;
  }

  #sensorSelectionCount {
    font-size: 12px;
    line-height: 1.25;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .sensor-picker-actions {
    justify-content: flex-end;
    min-width: 0;
  }

  .threshold-control {
    font-size: 12px;
  }

  .threshold-control input {
    min-height: 28px;
    width: 52px;
  }

  .sensor-chip-grid {
    flex-wrap: nowrap;
    max-width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .sensor-chip {
    flex: 0 0 auto;
    font-size: 12px;
    min-height: 32px;
  }

  .master-line-picker {
    margin-top: 8px;
    padding-top: 8px;
  }

  .chart-mobile-legend {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 11px;
    font-weight: 700;
    gap: 8px 12px;
    max-width: 100%;
    min-width: 0;
    justify-content: flex-start;
    margin: 0 2px 7px;
  }

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

  .legend-dot {
    border-radius: 50%;
    display: inline-block;
    height: 8px;
    width: 8px;
  }

  .legend-average {
    background: #2563eb;
  }

  .legend-minimum {
    background: #94a3b8;
  }

  .legend-maximum {
    background: #f43f5e;
  }

  .legend-line {
    background: #f97316;
    border-radius: 999px;
    display: inline-block;
    height: 2px;
    width: 16px;
  }

  .analysis-preview {
    font-size: 13px;
  }

  .analysis-text {
    font-size: 14px;
    min-height: 420px;
    padding: 14px;
  }

  .table-container {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
    overflow: hidden;
  }

  .data-table td {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 11px 13px;
    text-align: right;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .data-table td::before {
    color: var(--muted);
    content: attr(data-label);
    flex: 0 0 42%;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
  }

  .clickable-row.selected {
    box-shadow: inset 4px 0 0 var(--primary), var(--shadow);
  }

  .sensor-detail-panel {
    margin-bottom: 12px;
  }

  .sensor-detail-panel .panel-header {
    margin-bottom: 10px;
  }

  .sensor-detail-meta {
    font-size: 12px;
    line-height: 1.35;
  }

  .sensor-detail-table-wrap {
    max-height: 430px;
    overflow-x: auto;
  }

  .detail-table {
    min-width: 560px;
  }

  .detail-table th,
  .detail-table td {
    padding: 9px 10px;
  }

  .sensor-config-table-wrap {
    border: 0;
    overflow: visible;
  }

  .sensor-config-table {
    min-width: 0;
  }

  .sensor-config-table input {
    text-align: right;
  }

  .input-with-unit {
    min-width: 110px;
  }

  .toggle-row {
    align-items: flex-start;
    gap: 16px;
  }

  .toggle-row h3 {
    font-size: 16px;
  }

  .toggle-row p {
    font-size: 13px;
  }

  .form-actions .btn,
  .form-actions {
    width: 100%;
  }

  .user-info {
    display: none;
  }

  .compact-select {
    min-height: 34px;
    padding: 5px 8px;
  }

  .btn.small {
    min-height: 34px;
    padding: 5px 9px;
  }
}

@media (max-width: 390px) {
  .main-content {
    padding-left: 10px;
    padding-right: 10px;
  }

  .sensor-picker-header {
    grid-template-columns: 1fr;
  }

  .sensor-picker-actions {
    justify-content: flex-start;
  }

  .kpi-card {
    padding: 11px;
  }

  .kpi-card strong {
    font-size: 21px;
  }

  .sidebar-link .menu-text {
    font-size: 9px;
  }
}

@media (max-width: 720px) and (max-height: 760px) {
  .main-content {
    padding-top: 12px;
  }

  .page-header {
    margin-bottom: 10px;
  }

  .page-header h2 {
    font-size: 20px;
  }

  .kpi-grid {
    gap: 8px;
    margin-bottom: 10px;
  }

  .kpi-card {
    min-height: 88px;
    padding: 10px 11px;
  }

  .kpi-card span,
  .kpi-card em {
    font-size: 10px;
  }

  .kpi-card strong {
    font-size: 20px;
  }

  .chart-panel {
    padding: 10px;
  }

  .chart-panel .panel-header {
    margin-bottom: 8px;
  }

  .sensor-picker {
    margin-bottom: 6px;
    padding: 7px 9px;
  }

  .chart-mobile-legend {
    font-size: 10px;
    gap: 6px 9px;
    margin-bottom: 5px;
  }

  .chart-wrap {
    height: 160px;
    padding-top: 4px;
  }
}

/* ─── Cookie consent banner ────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--surface, #fff);
  border-top: 2px solid var(--border, #e2e8f0);
  box-shadow: 0 -4px 20px rgba(0,0,0,.10);
  padding: 18px 28px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-banner-body {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cookie-banner-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1e293b);
  margin: 0;
}

.cookie-banner-desc {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  margin: 0;
  line-height: 1.5;
}

.cookie-banner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.cookie-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 500;
  white-space: nowrap;
}

.cookie-tag-essential {
  background: #dcfce7;
  color: #166534;
}

.cookie-tag-optional {
  background: #fef9c3;
  color: #713f12;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
  padding-top: 2px;
}

.cookie-banner-actions button {
  white-space: nowrap;
  font-size: 13px;
  padding: 7px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  border: none;
}

.cookie-banner-actions .btn-cookie-accept {
  background: var(--primary, #2563eb);
  color: #fff;
}

.cookie-banner-actions .btn-cookie-accept:hover { opacity: .88; }

.cookie-banner-actions .btn-cookie-deny {
  background: transparent;
  color: var(--text-secondary, #64748b);
  border: 1px solid var(--border, #e2e8f0) !important;
}

.cookie-banner-actions .btn-cookie-deny:hover {
  background: var(--surface-hover, #f1f5f9);
}

.cookie-banner[hidden] { display: none; }

@media (max-width: 600px) {
  .cookie-banner { padding: 14px 16px; }
  .cookie-banner-actions { width: 100%; justify-content: flex-end; }
}
