:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-soft: #fbfcff;
  --ink: #111827;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e6e9f0;
  --line-strong: #d6dbe6;
  --brand: #6d28d9;
  --brand-soft: #f1e9ff;
  --blue: #1d70d6;
  --blue-soft: #e7f1ff;
  --green: #18a058;
  --green-soft: #e8f8ef;
  --amber: #c88313;
  --amber-soft: #fff4dd;
  --red: #c24136;
  --red-soft: #fff0ef;
  --shadow: 0 16px 40px rgba(17, 24, 39, .07);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

button:hover,
a:hover {
  border-color: var(--line-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.hidden { display: none !important; }

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.auth-panel {
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-panel h1,
.app-header h1,
.section-head h2,
.work-panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.auth-panel h1 {
  font-size: 30px;
}

.connect-code-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.connect-code-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.connect-code-form input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.connect-code-form input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(109, 40, 217, .16);
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin: 18px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  display: block;
  height: 1px;
  background: var(--line);
  content: "";
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.muted {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.app-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 22px;
  height: 100vh;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.brand-lockup,
.sidebar-footer {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.brand-lockup strong,
.sidebar-footer strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-lockup small,
.sidebar-footer small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.brand-mark.small {
  width: 30px;
  height: 30px;
  background: #0f172a;
  font-size: 12px;
}

.module-tabs {
  display: grid;
  align-content: start;
  gap: 8px;
}

.module-tabs button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  justify-items: start;
  min-height: 44px;
  padding: 0 12px;
  border-color: transparent;
  background: transparent;
  color: #475467;
  text-align: left;
}

.module-tabs button span {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 900;
}

.module-tabs button.active {
  border-color: var(--brand-soft);
  background: var(--brand-soft);
  color: var(--brand);
}

.module-tabs button.active span {
  color: var(--brand);
}

.sidebar-footer {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.app-main {
  min-width: 0;
  padding: 18px 22px 70px;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.app-header h1 {
  font-size: 18px;
  line-height: 1.15;
}

.header-actions,
.button-row,
.quick-actions,
.card-actions,
.temp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.header-actions button,
.header-actions a,
.section-head button,
.panel-title-row button {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

.primary-action {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.secondary-action {
  width: 100%;
  border-color: var(--line-strong);
  background: var(--panel-soft);
  color: var(--ink);
}

.view-stack,
.view-panel {
  display: grid;
  gap: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.section-head h2 {
  font-size: 15px;
}

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

.status-card,
.work-panel,
.record-card,
.temp-card,
.device-card,
.slot-card,
.picker-row,
.issue-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.status-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  min-height: 104px;
  padding: 14px;
  overflow: hidden;
}

.status-card::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: .9;
}

.metric-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #f2f4f7;
  color: currentColor;
  font-size: 12px;
  font-weight: 900;
}

.status-card b {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.status-card strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.metric-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.status-card.ok { color: var(--green); }
.status-card.warn { color: var(--amber); }
.status-card.bad { color: var(--red); }
.status-card.info { color: var(--blue); }

.status-card.ok .metric-icon { background: var(--green-soft); }
.status-card.warn .metric-icon { background: var(--amber-soft); }
.status-card.bad .metric-icon { background: var(--red-soft); }
.status-card.info .metric-icon { background: var(--blue-soft); }

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(360px, .95fr);
  gap: 14px;
}

.work-panel {
  padding: 14px;
  box-shadow: 0 1px 0 rgba(17, 24, 39, .02);
}

.work-panel h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.calendar-weekday {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.calendar-day {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  padding: 4px;
}

.calendar-day.muted {
  color: var(--subtle);
}

.calendar-day.today {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.calendar-day.selected:not(.today) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.calendar-day .day-dots {
  display: flex;
  gap: 3px;
  height: 7px;
  align-items: center;
}

.dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--subtle);
}

.dot.cooling { background: var(--brand); }
.dot.temp { background: var(--blue); }
.dot.receiving { background: var(--green); }
.dot.issue { background: var(--amber); }

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.summary-list,
.record-list,
.temperature-grid,
.picker-list,
.task-list,
.issue-list,
.records-output {
  display: grid;
  gap: 10px;
}

.task-center-panel {
  border-color: #ded5fb;
}

.task-list {
  margin-top: 12px;
}

.picker-toolbar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.picker-search {
  width: 100%;
}

.picker-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.picker-tabs button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.picker-tabs button.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.picker-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.field-block {
  display: grid;
  gap: 7px;
}

.field-label {
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.cooling-picker {
  display: grid;
  gap: 10px;
}

.cooling-picker-toolbar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.cooling-picker-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cooling-picker-actions button {
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}

.cooling-product-results {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.cooling-product-option {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
}

.cooling-product-option.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.cooling-product-option strong,
.cooling-product-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cooling-product-option strong {
  color: inherit;
  font-size: 14px;
  white-space: nowrap;
}

.cooling-product-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.cooling-check {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-weight: 900;
}

.picker-results {
  display: grid;
  gap: 10px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--subtle);
  border-radius: 8px;
  background: #fff;
}

.task-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.task-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-card.cooling { border-left-color: var(--brand); }
.task-card.temperatures { border-left-color: var(--blue); }
.task-card.receiving { border-left-color: var(--green); }
.task-card.warn { background: #fffaf0; }
.task-card.bad { background: #fff7f6; }
.task-card.ok { background: #f7fff9; }

.task-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.task-due {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
}

.task-due.bad {
  color: var(--red);
}

.mini-task-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mini-task-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto minmax(140px, 1fr) minmax(120px, 160px);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.mini-task-row > span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-task-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.preset-row.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preset-row.compact button,
.temp-input-row.compact button {
  min-height: 32px;
  padding: 0 8px;
  font-size: 11px;
}

.temp-input-row.compact {
  grid-template-columns: minmax(64px, 1fr) auto;
  gap: 6px;
}

.temp-input-row.compact input {
  min-height: 32px;
}

.day-detail-panel {
  border-color: #dbeafe;
}

.day-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.advanced-panel summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.advanced-panel form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.empty-state {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.summary-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.summary-group header,
.summary-row,
.record-card header,
.temp-card header,
.picker-row header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.summary-group h3,
.record-card h4,
.temp-card h4,
.picker-row h4 {
  margin: 0;
  font-size: 13px;
}

.summary-row {
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.summary-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

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

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

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

label {
  display: grid;
  gap: 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

textarea {
  resize: vertical;
}

.mini-temp-grid {
  display: grid;
  gap: 7px;
}

.mini-temp-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) minmax(70px, 86px) auto;
  gap: 7px;
  align-items: center;
}

.mini-temp-row span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-temp-row input {
  min-height: 34px;
}

.quick-ops-panel h3 {
  margin-bottom: 10px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-actions button {
  display: grid;
  min-height: 60px;
  align-content: center;
  justify-items: start;
  padding: 10px 12px;
  color: #344054;
  text-align: left;
}

.quick-actions button span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.record-card,
.temp-card,
.device-card,
.picker-row,
.issue-item,
.slot-card {
  padding: 12px;
}

.issue-item {
  display: block;
  width: 100%;
  min-height: 40px;
  color: #344054;
  text-align: left;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--ink);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 900;
}

.tag.ok { background: var(--green-soft); color: #137547; }
.tag.warn { background: var(--amber-soft); color: #946000; }
.tag.bad { background: var(--red-soft); color: #a33b32; }
.tag.info { background: var(--blue-soft); color: #175aa8; }

.card-actions button,
.temp-actions button {
  min-height: 36px;
  padding: 0 10px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.slot-card {
  display: grid;
  gap: 6px;
}

.slot-card strong {
  font-size: 24px;
}

.temperature-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.temp-card {
  display: grid;
  gap: 10px;
}

.device-admin-panel {
  border-color: #dbeafe;
}

.device-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

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

.device-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.device-card.inactive {
  background: #f8fafc;
  opacity: .78;
}

.device-card-main {
  min-width: 0;
}

.device-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.device-card h4 {
  margin: 0;
  font-size: 13px;
}

.device-card-photo,
.temp-device-photo {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  object-fit: cover;
}

.device-card-photo {
  width: 82px;
  height: 82px;
}

.temp-device-title {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.temp-device-photo {
  width: 58px;
  height: 58px;
}

.device-photo-preview {
  display: grid;
  width: 118px;
  height: 88px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.device-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.temp-input-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto;
  gap: 8px;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.preset-row button {
  min-height: 40px;
}

.picker-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.picker-row.selected {
  border-color: var(--brand);
  background: #fbf9ff;
}

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

.picker-fields {
  display: grid;
  grid-template-columns: 148px minmax(92px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.picker-stepper {
  display: grid;
  grid-template-columns: 40px minmax(58px, 1fr) 40px;
  gap: 6px;
}

.picker-stepper button,
.picker-action {
  min-height: 40px;
}

.picker-action {
  padding: 0 12px;
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 900;
}

.picker-row.selected .picker-action {
  background: var(--brand);
  color: #fff;
}

.line-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

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

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) auto;
  gap: 8px;
  align-items: end;
}

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

.record-table th,
.record-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.notice-line {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.notice-line.ok { color: var(--green); }
.notice-line.bad { color: var(--red); }

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition: .18s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .status-grid,
  .quick-actions,
  .day-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .mini-task-row {
    grid-template-columns: minmax(120px, 1fr) auto;
  }

  .mini-task-row .preset-row,
  .mini-task-row .temp-input-row {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-lockup,
  .sidebar-footer {
    display: none;
  }

  .module-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .module-tabs::-webkit-scrollbar {
    display: none;
  }

  .module-tabs button {
    flex: 0 0 auto;
    grid-template-columns: 1fr;
    width: max-content;
    min-width: max-content;
    max-width: none;
    justify-items: center;
    padding: 0 14px;
    overflow: visible;
    white-space: nowrap;
  }

  .module-tabs button span {
    display: none;
  }

  .app-main {
    padding: 14px 10px 80px;
  }

  .app-header {
    display: grid;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .header-actions button,
  .header-actions a {
    padding: 0 6px;
    font-size: 11px;
  }

  .status-grid,
  .quick-actions,
  .day-detail-grid,
  .split-grid,
  .form-grid.two,
  .slot-grid,
  .file-row {
    grid-template-columns: 1fr;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-day {
    min-height: 42px;
  }

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

  .filter-bar,
  .temp-input-row,
  .picker-fields,
  .cooling-picker-actions,
  .task-card,
  .mini-temp-row {
    grid-template-columns: 1fr;
  }

  .task-actions {
    justify-items: stretch;
  }

  .task-actions button {
    width: 100%;
  }

  .mini-task-row {
    grid-template-columns: 1fr;
  }

  .preset-row.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
