/* Disk grid + cards */
.disk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.disk-card {
  background: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-large-increased);
  padding: 18px;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.2, 0, 0, 1),
              box-shadow 0.15s cubic-bezier(0.2, 0, 0, 1);
  display: flex; flex-direction: column; gap: 8px; position: relative;
}
.disk-card:hover { box-shadow: var(--md-sys-elevation-2); transform: translateY(-2px); }
.disk-card-header { display: flex; align-items: center; gap: 6px; }
.disk-card-header .device { font-size: 16px; font-weight: 500; flex: 1; }

/* Disk type badges */
.disk-type {
  font-size: 10px; padding: 1px 8px;
  border-radius: var(--md-sys-shape-corner-full);
  font-weight: 500; letter-spacing: 0.2px; cursor: pointer;
}
.disk-type.nvme { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.disk-type.ssd  { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.disk-type.hdd  { background: var(--md-sys-color-warning-container); color: var(--md-sys-color-on-warning-container); }

/* Badge (PASSED/FAILED) */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: var(--md-sys-shape-corner-full);
  font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.badge.pass { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.badge.fail { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }

/* Health bar */
.hb-wrap { display: flex; align-items: center; gap: 8px; }
.hb-track {
  flex: 1; height: 8px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-extra-small);
  overflow: hidden;
}
.hb-fill {
  height: 100%; border-radius: var(--md-sys-shape-corner-extra-small);
  transition: width 0.4s cubic-bezier(0.05, 0.7, 0.1, 1);
}
.hb-label { font-size: 14px; font-weight: 500; white-space: nowrap; }

/* Info rows */
.row-info {
  font-size: 14px; display: flex; gap: 12px;
  color: var(--md-sys-color-on-surface-variant);
}
.row-info strong { color: var(--md-sys-color-on-surface); font-weight: 500; }

/* Meta grid */
.meta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; font-size: 14px;
}
.meta-grid .mi { display: flex; flex-direction: column; gap: 1px; }
.meta-grid .ml {
  font-size: 11px; color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase; letter-spacing: 0.3px;
}
.meta-grid .mv { font-weight: 500; }

/* Footer info */
.footer-info {
  font-size: 13px; color: var(--md-sys-color-on-surface-variant);
  padding-top: 6px; border-top: 1px solid var(--md-sys-color-outline-variant);
}

/* Detail header */
.detail-hdr {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  margin-bottom: 16px;
}
.detail-hdr .dn { font-size: 20px; font-weight: 600; letter-spacing: -0.2px; flex: 1; }
.detail-hdr .ds { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }

/* Time chips */
.time-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.time-chips .chip {
  padding: 4px 14px; border-radius: var(--md-sys-shape-corner-full);
  font-size: 12px; font-weight: 500;
  background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface);
  cursor: pointer; transition: 0.15s cubic-bezier(0.2, 0, 0, 1);
  border: none; font-family: inherit;
}
.time-chips .chip.active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }

/* Metric cards */
.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px; margin-bottom: 14px;
}
.metric-card {
  background: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 12px 14px; text-align: center;
}
.metric-card .big { font-size: 24px; font-weight: 600; letter-spacing: -0.2px; }
.metric-card .lbl {
  font-size: 10px; color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase; letter-spacing: 0.3px; margin-top: 1px;
}

/* Health block (detail) */
.health-block {
  display: flex; gap: 12px; align-items: center;
  padding: 18px; background: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-large-increased); margin-bottom: 14px;
}
.health-block .hb-track { height: 14px; }
.health-block .hb-fill { height: 14px; }
.health-block .hsc { font-size: 28px; font-weight: 600; letter-spacing: -0.3px; }
.health-block .hl { font-size: 12px; }

/* Charts */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.chart-box {
  background: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-large); padding: 16px;
}
.chart-box h3 {
  font-size: 13px; font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.2px;
}
.chart-box canvas { max-height: 180px; }

/* SMART table */
.smart-section {
  background: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-large-increased);
  padding: 18px; margin-bottom: 14px;
}
.smart-section h3 {
  font-size: 13px; font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.2px;
  display: flex; align-items: center; gap: 8px;
}
.smart-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.smart-table th {
  text-align: left; padding: 6px 4px;
  border-bottom: 2px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.2px;
}
.smart-table td { padding: 5px 4px; border-bottom: 1px solid var(--md-sys-color-outline-variant); white-space: nowrap; }
.smart-table .stat { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; }
.smart-table .stat.good { color: var(--md-sys-color-success); }
.smart-table .stat.warn { color: #ef6c00; }
.smart-table .stat.crit { color: var(--md-sys-color-error); }
.smart-table .stat.info { color: var(--md-sys-color-on-surface-variant); }
.smart-table tr:hover td { background: var(--md-sys-color-surface-container-low); }
.smart-table .raw-cell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; font-family: monospace; }

/* Comparison table */
.comp-table { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--md-sys-color-surface); border-radius: var(--md-sys-shape-corner-large); overflow: hidden; }
.comp-table th, .comp-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--md-sys-color-surface-container); }
.comp-table th { background: var(--md-sys-color-surface-container); font-size: 11px; text-transform: uppercase; letter-spacing: 0.2px; font-weight: 500; white-space: nowrap; }
.comp-table .dev-hdr { font-size: 13px; font-weight: 500; }
.comp-table .attr-name { font-weight: 500; color: var(--md-sys-color-on-surface-variant); }
.comp-table .val-cell { text-align: center; font-weight: 500; }
.comp-table tr:hover td { background: var(--md-sys-color-surface-container-low); }

/* Native MD3-like outlined controls */
.md-btn, .md-select {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  height: 32px;
  border-radius: 9999px;
  border: 1px solid var(--md-sys-color-outline);
  background: transparent;
  color: var(--md-sys-color-primary);
  cursor: pointer;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: border-color 0.15s cubic-bezier(0.2,0,0,1),
              background 0.15s cubic-bezier(0.2,0,0,1);
  outline: none;
  box-sizing: border-box;
  white-space: nowrap;
}
.md-btn:hover, .md-select:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}
.md-btn:focus-visible, .md-select:focus-visible {
  border-width: 2px;
  border-color: var(--md-sys-color-primary);
}
.md-btn.show-all, .md-select.show-all {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-color: var(--md-sys-color-primary);
}

/* Native select with dropdown arrow */
.md-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2372796e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.md-select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300694e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.md-select option {
  font-size: 12px;
  padding: 4px 8px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}
@media (prefers-color-scheme: dark) {
  .md-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2388958b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  }
  .md-select:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2354d7ae' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] .md-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2388958b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
:root[data-theme="dark"] .md-select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2354d7ae' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Attribute picker — pill trigger + floating rounded panel */
.attr-picker { position: relative; text-transform: none; letter-spacing: normal; }
.attr-picker-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  height: 32px;
  text-transform: none;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--md-sys-color-outline);
  background: transparent;
  color: var(--md-sys-color-primary);
  cursor: pointer;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s cubic-bezier(0.2,0,0,1),
              background 0.15s cubic-bezier(0.2,0,0,1);
  outline: none;
}
.attr-picker-btn:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}
.attr-picker-btn:focus-visible {
  border-width: 2px;
  border-color: var(--md-sys-color-primary);
}
.attr-picker-btn[aria-expanded="true"] md-icon { transform: rotate(180deg); }
.attr-picker-btn md-icon { transition: transform 0.15s cubic-bezier(0.2,0,0,1); }

.attr-picker-scrim { position: fixed; inset: 0; z-index: 15; background: transparent; }

.attr-picker-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 260px;
  max-width: 320px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-corner-large);
  box-shadow: 0 4px 16px rgba(0,0,0,0.16), 0 1px 4px rgba(0,0,0,0.08);
}
.attr-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--md-sys-shape-corner-medium);
  cursor: pointer;
  transition: background 0.1s cubic-bezier(0.2,0,0,1);
}
.attr-picker-item:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}
.api-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.api-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.api-sub {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
}
.attr-picker-item .api-check { visibility: hidden; font-size: 18px; color: var(--md-sys-color-primary); flex-shrink: 0; }
.attr-picker-item.active .api-check { visibility: visible; }

/* Hamburger drawer */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer-scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  transition: opacity 0.2s cubic-bezier(0.2,0,0,1);
}
.drawer-panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: 280px;
  background: var(--md-sys-color-surface);
  display: flex; flex-direction: column;
  box-shadow: 4px 0 12px rgba(0,0,0,0.15);
  animation: slideIn 0.2s cubic-bezier(0.2,0,0,1);
}
@keyframes slideIn {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
.drawer-header {
  padding: 24px 20px 12px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.drawer-title { font-size: 18px; font-weight: 500; }
.drawer-subtitle { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }
.drawer-nav { display: flex; flex-direction: column; padding: 8px 0; }
.drawer-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; border: none; background: none;
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--md-sys-color-on-surface);
  cursor: pointer; text-align: left; outline: none;
  transition: background 0.15s;
}
.drawer-item:hover { background: var(--md-sys-color-surface-container-low); }
.drawer-item md-icon { font-size: 20px; color: var(--md-sys-color-on-surface-variant); }

/* Modal overlay (reusable for About, Settings, etc.) */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
}
.modal-panel {
  position: relative; width: 340px; max-width: 90vw;
  background: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: fadeIn 0.15s cubic-bezier(0.2,0,0,1);
}
@keyframes fadeIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.modal-header { display: flex; align-items: center; padding: 20px 24px 12px; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.modal-header span:first-child { flex: 1; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 12px 24px 20px; display: flex; gap: 16px; border-top: 1px solid var(--md-sys-color-outline-variant); }

/* About specific */
.about-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.about-row .about-label { color: var(--md-sys-color-on-surface-variant); }
.about-link { color: var(--md-sys-color-primary); text-decoration: none; font-size: 13px; font-weight: 500; }
.about-link:hover { text-decoration: underline; }

/* Settings specific */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }

/* Snapshot badge in SMART table header */
.snap-badge {
  font-size: 10px; background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  padding: 2px 10px; border-radius: var(--md-sys-shape-corner-full);
  font-weight: 500; letter-spacing: 0.2px;
  white-space: nowrap;
}
/* History rows */
.hist-row { cursor: pointer; }
.hist-row:hover td { background: var(--md-sys-color-surface-container-low) !important; }
.hist-row.snap-active td { background: var(--md-sys-color-primary-container) !important; color: var(--md-sys-color-on-primary-container); }

/* Disk info grid */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-item { display: flex; flex-direction: column; gap: 1px; }
.info-lbl { font-size: 10px; color: var(--md-sys-color-on-surface-variant); text-transform: uppercase; letter-spacing: 0.3px; }
.info-val { font-size: 13px; font-weight: 500; }

/* Error page */
.error-msg { text-align: center; padding: 48px 20px; color: var(--md-sys-color-on-surface-variant); }
.error-msg .big-icon { font-size: 48px; margin-bottom: 12px; color: var(--md-sys-color-error); }
.error-msg .desc { margin: 8px 0 20px; font-size: 14px; }

/* Utility */
.hidden { display: none !important; }
