:root {
  --bg: #f4f7fa;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-solid: #ffffff;
  --surface: #f7fafc;
  --surface-strong: #edf3f6;
  --line: rgba(148, 163, 184, 0.22);
  --line-strong: rgba(100, 116, 139, 0.3);
  --text: #172033;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --primary: #168c82;
  --primary-strong: #0f716a;
  --primary-soft: #e8f6f3;
  --primary-line: rgba(22, 140, 130, 0.2);
  --danger: #b85252;
  --danger-soft: #fff0f0;
  --warning: #a96b24;
  --warning-soft: #fff6e9;
  --ok: #2d7d64;
  --ok-soft: #eaf7f1;
  --info: #4b6f94;
  --shadow: 0 12px 32px rgba(31, 50, 71, 0.07);
  --shadow-soft: 0 4px 14px rgba(31, 50, 71, 0.055);
  --radius-card: 20px;
  --radius-control: 12px;
  --control-height: 46px;
}

* { box-sizing: border-box; }

html {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  color: var(--text);
  background: var(--bg);
  font-family: "Times New Roman", "Microsoft YaHei", "微软雅黑", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

button,
input,
select,
textarea,
dialog { color: var(--text); }

button,
input,
select,
textarea { transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease; }

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

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden, [data-permission]:not([data-permission-granted="true"]) { display: none !important; }
.tabs.one-tab { grid-template-columns: minmax(120px, 1fr); }

header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.topbar {
  width: min(100%, 1480px);
  min-height: 60px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.topbar-title { min-width: 0; }

.topbar-title h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.topbar-side {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 0;
}

.back-main-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: #355066;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.back-main-button svg { width: 21px; height: 21px; }
.back-main-button:hover { background: var(--primary-soft); color: var(--primary-strong); border-color: var(--primary-line); }
.back-main-button:active { transform: scale(0.96); }

.mobile-current-pond {
  display: none;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 700;
}

.status {
  max-width: 360px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--muted-light);
  vertical-align: 1px;
}

.status[data-state="ok"]::before { background: var(--ok); box-shadow: 0 0 0 4px rgba(45, 125, 100, 0.1); }
.status[data-state="error"]::before { background: var(--danger); box-shadow: 0 0 0 4px rgba(184, 82, 82, 0.1); }

main {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 18px 24px 44px;
  display: grid;
  gap: 18px;
}

.tabs-shell {
  display: flex;
  justify-content: flex-start;
}

.tabs {
  width: max-content;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 15px;
  background: #e9eef2;
}

.tabs.two-tabs { grid-template-columns: repeat(2, minmax(120px, 1fr)); }

.tab-btn {
  min-height: 38px;
  padding: 7px 16px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tab-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.55); }
.tab-btn.active {
  color: var(--primary-strong);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(31, 50, 71, 0.09);
}

.tab-panel { display: none; min-width: 0; }
.tab-panel.active { display: grid; gap: 18px; }

.record-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(350px, 1fr);
  gap: 18px;
  align-items: start;
}

.today-column {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.running-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.running-count.active { background: var(--ok-soft); color: var(--ok); }
.state-record-label { color: var(--muted); font-size: 11px; white-space: nowrap; }

.section {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-heading {
  min-width: 0;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading.compact { margin-bottom: 14px; }
.section-heading h2,
.catalog-toolbar h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

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

.section-note {
  margin: -7px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.form-group-title {
  margin: 18px 0 11px;
  color: #3c5265;
  font-size: 13px;
  line-height: 1.3;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.dynamic-fields { min-height: 72px; }
.dynamic-fields .form-row:empty { display: none; }

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

label {
  color: #52667a;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--control-height);
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  outline: none;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 2px rgba(31, 50, 71, 0.025);
}

input::placeholder,
textarea::placeholder { color: #9aa8b7; }

input:hover,
select:hover,
textarea:hover { border-color: rgba(100, 116, 139, 0.48); }

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(22, 140, 130, 0.7);
  box-shadow: 0 0 0 4px rgba(22, 140, 130, 0.1);
}

input:disabled,
select:disabled,
textarea:disabled {
  color: #8391a0;
  background: #eef2f5;
  cursor: not-allowed;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

.invalid,
.invalid:focus {
  border-color: rgba(184, 82, 82, 0.72);
  box-shadow: 0 0 0 4px rgba(184, 82, 82, 0.1);
}

.field-error {
  min-height: 16px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

button {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: var(--primary-strong); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(22, 140, 130, 0.14); }
button:disabled { opacity: 0.48; cursor: not-allowed; transform: none; }

button.secondary {
  border-color: var(--line);
  background: #eef3f5;
  color: #36505e;
}

button.secondary:hover { background: #e3ebee; color: #263e4a; }

button.tertiary {
  min-height: 36px;
  padding: 6px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--primary-strong);
}

button.tertiary:hover { background: rgba(22, 140, 130, 0.08); }

button.danger {
  border-color: rgba(184, 82, 82, 0.14);
  background: var(--danger-soft);
  color: var(--danger);
}

button.danger:hover { background: #fbe3e3; }

button.warning {
  border-color: rgba(169, 107, 36, 0.16);
  background: var(--warning-soft);
  color: var(--warning);
}

button.warning:hover { background: #f9ead5; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.pond-context {
  margin: 0 0 20px;
  padding: 16px;
  border: 1px solid var(--primary-line);
  border-radius: 16px;
  background: var(--primary-soft);
}

.pond-context.loading { opacity: 0.68; }

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

.context-title {
  color: #255c59;
  font-size: 14px;
  font-weight: 800;
}

.context-message {
  margin-top: 2px;
  color: #5d7775;
  font-size: 12px;
}

.context-toggle { display: none; flex: 0 0 auto; }

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

.context-item {
  min-width: 0;
  padding: 0 12px;
  border-right: 1px solid rgba(22, 140, 130, 0.14);
}

.context-item:first-child,
.context-item:nth-child(5) { padding-left: 0; }
.context-item:nth-child(4),
.context-item:last-child { border-right: 0; }

.context-item span {
  display: block;
  color: #66827f;
  font-size: 11px;
}

.context-item strong {
  display: block;
  margin-top: 3px;
  color: #183d3a;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.context-warning {
  display: none;
  margin-top: 13px;
  padding: 9px 11px;
  border-radius: 11px;
  background: var(--warning-soft);
  color: #8b5a20;
  font-size: 12px;
  line-height: 1.55;
}

.context-warning:not(:empty) { display: block; }

.safety-note {
  margin: 5px 0 11px;
  padding: 10px 12px;
  border: 1px solid rgba(169, 107, 36, 0.14);
  border-radius: 12px;
  background: var(--warning-soft);
  color: #80531f;
  font-size: 12px;
  line-height: 1.55;
}

.summary-card { padding: 16px; }

/* 总数独占一行，五类操作等宽排列。 */
.summary-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); overflow:hidden; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.metric { min-width:0; padding:12px 4px; display:flex; flex-direction:column; align-items:center; text-align:center; gap:5px; }
.metric:not(.metric-total):not(:last-child) { border-right:1px solid var(--line); }
.metric-icon { display:none; }
.metric-label { color:var(--muted); font-size:13px; white-space:nowrap; }
.metric strong { font-size:22px; line-height:1.15; }
.metric small { color:var(--muted); font-size:11px; line-height:1.4; overflow-wrap:anywhere; }
.metric-total { grid-column:1/-1; flex-direction:row; gap:8px; padding:12px 14px; border-bottom:1px solid var(--line); background:var(--panel-solid); }
.metric-total .metric-label { color:var(--text); font-size:15px; font-weight:600; }
.metric-total strong { margin-left:auto; font-size:28px; color:var(--primary-strong); }
.metric-total small { font-size:13px; }

.recent-card { padding-bottom: 12px; }
.recent-heading { align-items: center; }
.view-all-button { white-space: nowrap; }

.timeline {
  display: grid;
  max-height: 430px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.28) transparent;
}

.timeline-item {
  min-width: 0;
  padding: 13px 2px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child { border-bottom: 0; }

.timeline-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-strong);
  color: var(--primary-strong);
}

.timeline-icon svg { width: 18px; height: 18px; }
.timeline-content { min-width: 0; }
.timeline-title { font-size: 13px; font-weight: 800; line-height: 1.4; }
.timeline-detail { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; word-break: break-word; }
.timeline-meta { margin-top: 4px; color: var(--muted-light); font-size: 11px; line-height: 1.45; }
.timeline-time { padding-top: 2px; color: var(--muted); font-size: 11px; white-space: nowrap; }

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 15px;
  border-radius: 16px;
  background: var(--surface);
  align-items: start;
}


.history-results-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.history-results {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.history-results > summary {
  list-style: none;
  cursor: pointer;
  min-height: 64px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  background: #f8fbfc;
}
.history-results > summary::-webkit-details-marker { display: none; }
.details-chevron { width:16px; height:16px; flex:0 0 auto; fill:none; stroke:#4f6578; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; transition:transform 160ms ease; }
.history-results[open] > summary .details-chevron,
.history-export-menu[open] > summary .details-chevron { transform:rotate(180deg); }
.history-summary-title { flex: 0 0 auto; }
.history-summary-tools {
  min-width: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.history-result-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.history-export-menu { position:relative; min-width:0; }
.history-export-menu > summary { min-height:44px; padding:8px 12px; display:flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--line); border-radius:12px; background:#eef4f6; color:var(--text); font-size:15px; font-weight:600; cursor:pointer; list-style:none; white-space:nowrap; }
.history-export-menu > summary::-webkit-details-marker { display:none; }
.history-export-menu > summary:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.history-export-actions { position:absolute; top:calc(100% + 6px); right:0; z-index:20; display:grid; gap:4px; min-width:156px; padding:6px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 8px 24px #17203320; }
.history-export-actions button { min-height:44px; width:100%; padding:8px 12px; font-size:15px; font-weight:600; white-space:nowrap; }
.history-results-body { padding: 0; }
.history-results .table-wrap { margin-top: 0; border: 0; border-radius: 0; }
.history-results .message { padding-left: 14px; padding-right: 14px; }

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

table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f6f9fb;
  color: #53677a;
  font-size: 12px;
  white-space: nowrap;
}

tbody tr:hover { background: rgba(232, 246, 243, 0.38); }
tbody td:last-child { width: 1%; white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf4f8;
  color: #42677b;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.pill.disabled-record { background: #f0f2f4; color: #788592; }
.pill.active-record { background: var(--ok-soft); color: var(--ok); }
.muted-line { margin-top: 4px; color: var(--muted); font-size: 12px; }

.message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.message.error { color: var(--danger); }
.message.ok { color: var(--ok); }
.catalog-list-card > #catalogPageMessage:empty { display:none; }

.empty {
  min-height: 132px;
  padding: 24px 16px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--muted);
}

.empty-icon svg { width: 21px; height: 21px; }
.empty strong { color: #52667a; font-size: 14px; }
.empty small { max-width: 280px; color: var(--muted-light); line-height: 1.5; }
.loading-state { min-height: 116px; }

.mobile-history { display: none; }

.history-card {
  min-width: 0;
  padding: 14px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.history-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.history-card-time { flex: 0 0 auto; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: right; }
.history-card-primary { display: grid; gap: 5px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.history-card-details { padding-top: 8px; border-top: 1px solid var(--line); }
.history-card-details summary { color: var(--primary-strong); font-size: 12px; font-weight: 800; cursor: pointer; }
.history-card-details-body { margin-top: 8px; display: grid; gap: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.history-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.pager {
  display: none;
  margin-top: 14px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.pager.show { display: flex; }

.catalog-status-field { width:min(240px,100%); }
.catalog-choice-field .catalog-choice { margin-bottom: 8px; }
.manual-item-input.hidden { display: none; }
.catalog-toolbar { display:grid; gap:10px; margin-bottom:12px; }
.catalog-title-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.catalog-title-row h2 { margin:0; }
.icon-only-button {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
}
.icon-only-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-only-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 40;
  padding: 6px 9px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity .14s ease, transform .14s ease;
}
.icon-only-button[data-tooltip]:hover::after,
.icon-only-button[data-tooltip]:focus-visible::after { opacity: 1; transform: translateY(0); }
.catalog-dialog { width: min(980px, calc(100vw - 32px)); }
.catalog-dialog textarea { min-height: 92px; }
.catalog-search { display:grid; grid-template-columns:minmax(120px, 180px) minmax(0, 1fr) auto; gap:8px; }
.catalog-search select, .catalog-search input { width:100%; min-width:0; }
.catalog-search button { white-space:nowrap; }

.catalog-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.catalog-list > .empty { grid-column: 1 / -1; }
.catalog-item {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  align-items: start;
  gap: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.catalog-item.disabled { background: #fffafa; }
.catalog-item-head { grid-column:1/-1; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.catalog-item-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.catalog-item-title-text { min-width: 0; }
.catalog-item-title strong { display: block; word-break: break-word; line-height: 1.35; }
.catalog-item-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: var(--primary-soft); color: var(--primary-strong); }
.catalog-item-icon svg { width: 18px; height: 18px; }
.catalog-item-meta { display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.catalog-item-meta span { padding: 3px 7px; border-radius: 999px; background: var(--surface); }
.catalog-item-type-meta { margin-top: 4px; }
.catalog-item-status { display:inline-flex; align-items:center; gap:7px; flex:0 0 auto; }
.catalog-item-status .pill.disabled-record { background:#fff0f0; color:#c94646; }
.catalog-status-switch { width:42px; height:24px; min-width:42px; min-height:24px; padding:3px; display:inline-flex; align-items:center; border:0; border-radius:999px; box-shadow:inset 0 0 0 1px rgba(23,32,51,.08); cursor:pointer; transition:background-color 160ms ease, box-shadow 160ms ease; }
.catalog-status-switch > span { width:18px; height:18px; display:block; border-radius:50%; background:#fff; box-shadow:0 1px 4px rgba(23,32,51,.26); transition:transform 160ms ease; }
.catalog-status-switch.is-on { background:#249b72; }
.catalog-status-switch.is-on > span { transform:translateX(18px); }
.catalog-status-switch.is-off { background:#d95353; }
.catalog-status-switch.is-off > span { transform:translateX(0); }
.catalog-status-switch:hover { filter:brightness(.96); }
.catalog-status-switch:focus-visible { outline:3px solid rgba(22,140,130,.24); outline-offset:2px; }
.catalog-status-switch:disabled { cursor:wait; opacity:.58; }
.catalog-item-facts { grid-column:1/-1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 10px; }
.catalog-item-facts > span { min-width:0; display:flex; gap:6px; align-items:baseline; font-size:12px; line-height:1.5; }
.catalog-item-facts small { flex:none; color:var(--muted); font-size:12px; }
.catalog-item-facts b { font-weight:500; overflow-wrap:anywhere; }
.catalog-item > .catalog-item-actions { grid-column:1/-1; display:flex; justify-content:flex-end; gap:4px; margin:0; padding:0; }
.catalog-item > .catalog-item-actions button { width:auto; min-width:44px; min-height:44px; padding:6px 8px; font-size:13px; border-radius:8px; }
.catalog-item-note { color: var(--muted); font-size: 12px; line-height: 1.45; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.catalog-item-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; flex-wrap: nowrap; }
.catalog-item-actions button { width: 100%; min-width: 0; padding-left: 9px; padding-right: 9px; }
.catalog-pager { display: none; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.catalog-pager.show { display: flex; }
.catalog-pager span { min-width: 150px; color: var(--muted); font-size: 13px; text-align: center; }
.history-row-actions { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.table-action { min-height: 36px; padding: 6px 12px; border-radius: 10px; }

::backdrop { background: rgba(23, 32, 51, 0.42); backdrop-filter: blur(3px); }

dialog {
  width: min(500px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(23, 32, 51, 0.22);
}

.dialog-card {
  padding: 22px;
  display: grid;
  gap: 11px;
}

.dialog-card h3 { margin: 0; }
.dialog-card p { margin: 0; color: var(--muted); font-size: 13px; }

.edit-dialog { width: min(980px, calc(100vw - 32px)); }
.edit-dialog-card { gap: 14px; }
.edit-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.edit-dialog-heading h3 { margin: 0; font-size: 18px; }
.dialog-close { min-width: 36px; width: 36px; min-height: 36px; padding: 0; font-size: 24px; line-height: 1; }
.edit-context { padding: 10px 12px; border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 12px; }
.edit-dialog-actions { justify-content: flex-end; margin-top: 2px; }
.edit-dialog-actions button { min-width: 100px; }

@media (max-width: 1180px) {
  .catalog-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-layout { grid-template-columns: minmax(0, 1.6fr) minmax(330px, 1fr); }
  .context-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .context-item:nth-child(4) { border-right: 1px solid rgba(22, 140, 130, 0.14); }
  .context-item:nth-child(3),
  .context-item:nth-child(6),
  .context-item:last-child { border-right: 0; }
  .context-item:nth-child(4),
  .context-item:nth-child(7) { padding-left: 0; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .record-layout { grid-template-columns: 1fr; }
  .today-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline { max-height: 360px; }
  .catalog-list-card { width: 100%; }
}

@media (max-width: 1180px) and (min-width: 761px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-height: 66px;
    --radius-card: 18px;
  }

  body { padding-bottom: var(--safe-bottom); font-size: 15px; }
  header { padding-top: var(--safe-top); }

  .topbar {
    min-height: var(--header-height);
    padding: 9px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .topbar-main { gap: 9px; }
  .back-main-button { width: 42px; min-width: 42px; height: 42px; min-height: 42px; border-radius: 13px; }
  .topbar-title h1 { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
  .subtitle { display: none; }
  .topbar-side { max-width: 116px; }
  .mobile-current-pond { display: block; max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .status { max-width: 116px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .status::before { width: 6px; height: 6px; margin-right: 5px; }

  main { width: 100%; padding: 12px 12px 30px; gap: 12px; }

  .tabs-shell {
    position: sticky;
    top: calc(var(--header-height) + var(--safe-top));
    z-index: 15;
    margin: -2px -12px 0;
    padding: 8px 12px;
    background: rgba(244, 247, 250, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .tabs,
  .tabs.two-tabs {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tabs.two-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab-btn { min-width: 0; min-height: 39px; padding: 7px 5px; font-size: 13px; white-space: nowrap; }

  .record-layout,
  .today-column { grid-template-columns: 1fr; gap: 12px; }

  .section { width: 100%; padding: 16px; }
  .section-heading { margin-bottom: 15px; }
  .section-heading h2,
  .catalog-toolbar h2 { font-size: 17px; }

  .form-row { grid-template-columns: 1fr; gap: 9px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filters .field-error:empty { display: none; }
  .form-row { margin-bottom: 9px; }
  .field.wide { grid-column: auto; }
  .dynamic-fields { min-height: 0; }
  input,
  select,
  textarea,
  button { max-width: 100%; min-width: 0; min-height: 46px; font-size: 16px; }
  label,
  .field-error { font-size: 12px; }

  .pond-context { padding: 14px; margin-bottom: 17px; }
  .context-head { align-items: center; }
  .context-toggle { display: inline-flex; align-items: center; min-height: 34px; font-size: 12px; }
  .context-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 13px; }
  .context-item,
  .context-item:first-child,
  .context-item:nth-child(4),
  .context-item:nth-child(5),
  .context-item:nth-child(7) { padding: 0 10px; border-right: 1px solid rgba(22, 140, 130, 0.14); }
  .context-item:nth-child(odd) { padding-left: 0; }
  .context-item:nth-child(even) { padding-right: 0; border-right: 0; }
  .context-item:nth-child(n+5) { display: none; }
  .pond-context.expanded .context-item:nth-child(n+5) { display: block; }

  #eventForm > .actions {
    position: sticky;
    bottom: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 8px;
    margin: 12px -16px -16px;
    padding: 8px 16px calc(8px + var(--safe-bottom));
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -8px 22px rgba(31, 50, 71, 0.07);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
  }

  #eventForm > .actions button { width: 100%; min-height: 44px; padding: 8px 12px; font-size: 15px; }

  .timeline { max-height: none; }

  .filters { padding: 10px; margin-bottom: 10px; }

  .table-wrap { display: none; }
  .mobile-history { display: grid; gap: 10px; }
  .history-card-head { gap: 8px; }
  .history-card-time { max-width: 42%; }
  .history-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-card-actions button { width: 100%; }

  .pager { justify-content: stretch; grid-template-columns: 1fr auto 1fr; }
  .pager.show { display: grid; }
  .pager button { width: 100%; }
  #pageInfo { text-align: center; white-space: nowrap; }

  .history-results > summary { min-height: 58px; padding: 8px 10px; display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 2px 6px; }
  .history-summary-title { font-size: 14px; }
  .history-summary-tools { grid-column: 1; grid-row: 2; margin-left: 0; justify-content: flex-start; }
  .history-result-summary { font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
  .history-results > summary > .details-chevron { grid-column:2; grid-row:1 / 3; justify-self:center; }
  .history-results-toolbar { margin-top: 10px; gap: 8px; }
  .catalog-list { grid-template-columns: 1fr; }

  .catalog-search { grid-template-columns:minmax(96px, 0.8fr) minmax(0,1.2fr) auto; gap:6px; }
  .catalog-search select, .catalog-search input { min-height:44px; padding:8px 6px; font-size:16px; }
  .catalog-search button { min-height:44px; min-width:44px; padding:8px; font-size:14px; }
  .catalog-list { gap:8px; }
  .catalog-item { padding:10px; border-radius:12px; }
  .catalog-item-title strong { font-size:14px; }
  .catalog-item-icon { width:28px; height:28px; border-radius:8px; }
  .catalog-item .pill { flex:none; padding:3px 7px; font-size:11px; }
  .catalog-item-type-meta { gap:4px; font-size:11px; }
  .catalog-item-type-meta span { padding:2px 5px; }
  .catalog-item-head { gap: 8px; }
  .catalog-pager.show { display: grid; grid-template-columns: 1fr auto 1fr; }
  .catalog-pager button { width: 100%; }
  .catalog-pager span { min-width: 0; white-space: nowrap; }

  dialog { width: calc(100vw - 24px); max-height: min(88dvh, 720px); }
  .dialog-card { max-height: min(88dvh, 720px); overflow-y: auto; padding-bottom: calc(20px + var(--safe-bottom)); }
}

@media (max-width: 390px) {
  .topbar-side,
  .mobile-current-pond,
  .status { max-width: 94px; }
  .section { padding: 14px; }
  #eventForm > .actions { margin-right: -14px; margin-left: -14px; margin-bottom: -14px; padding-right: 14px; padding-left: 14px; }

  .history-card-head { display: grid; }
  .history-card-time { max-width: none; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }
}

/* 定时记录：独立于常用项目，避免把“常用选项”和“自动生成记录”混成一套状态。 */
.tabs.four-tabs { grid-template-columns: repeat(4, minmax(108px, 1fr)); }
.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.shared-pond-bar { display:flex; align-items:center; padding:10px 18px; margin-bottom:0; }
.shared-pond-bar .field { flex:1 1 auto; min-width:0; display:grid; grid-template-columns:auto minmax(280px,430px); align-items:center; justify-content:start; gap:8px 12px; }
.shared-pond-bar label { margin:0; white-space:nowrap; }
.shared-pond-bar select { min-height:44px; }
.shared-pond-bar .field-error:empty { display:none; }
.shared-pond-bar .field-error:not(:empty) { grid-column:2; }
.schedule-tasks { margin-top:24px; border-top:1px solid var(--line); padding-top:12px; }
.schedule-form-card { border:1px solid var(--primary-line); }
.schedule-form-card > .section-heading { position:relative; padding-right:52px; }
.schedule-dialog-close {
  position:absolute;
  top:18px;
  right:18px;
  float:none;
  width:38px;
  height:38px;
  padding:0;
  display:grid;
  place-items:center;
  font-size:22px;
  line-height:1;
  z-index:2;
}
.schedule-item.highlighted { border-left-color:var(--primary); background:var(--primary-soft); }
.schedule-run { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 0; border-bottom:1px solid var(--line); }
.schedule-run p { margin:4px 0; font-size:13px; color:var(--muted); }
.schedule-run .run-error { color:var(--warning); }
.schedule-run .actions { flex-shrink:0; flex-wrap:wrap; }
.schedule-form-card:focus-within { scroll-margin-top:16px; }
@media (max-width:720px) {
  .shared-pond-bar { display:block; padding:10px 12px; margin-bottom:0; }
  .shared-pond-bar .field { grid-template-columns:auto minmax(0,1fr); align-items:center; gap:8px; }
  .shared-pond-bar label { margin:0; white-space:nowrap; }
  .shared-pond-bar select { min-height:42px; font-size:16px; padding:8px; }
  .shared-pond-bar .field-error:empty { display:none; }
  .shared-pond-bar .field-error:not(:empty) { grid-column:1 / -1; }
  .schedule-run { display:block; }
  .schedule-run .actions { margin-top:10px; }

  }
.schedule-form-card,
.schedule-list-card { min-width: 0; }
.schedule-list { display: grid; gap:10px; }
.schedule-item {
  display:grid; gap:8px; padding:12px 14px; min-width:0;
  border:1px solid var(--line); border-left:3px solid transparent; border-radius:12px;
}
.schedule-item.disabled { opacity: 0.62; }
.schedule-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.schedule-item-head strong { font-size: 15px; }
.schedule-item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 12px;
  color: var(--muted);
  font-size: 12px;
}
.schedule-item-grid span {
  min-width: 0;
  padding: 4px 0;
  word-break: break-word;
}
.schedule-item-grid b { margin-right:8px; color:var(--text); font-weight:600; }
.schedule-item-head > div { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; min-width:0; }
.schedule-item-head strong { overflow-wrap:anywhere; }
.schedule-item-footer { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 16px; }
.schedule-item-result { display:flex; flex-wrap:wrap; gap:4px 16px; flex:1 1 260px; min-width:0; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.schedule-item .schedule-item-actions { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:6px; width:360px; max-width:100%; margin:0; flex-shrink:0; }
.schedule-item-actions:not(:has([data-action="schedule-edit"])) { width:96px; }
.schedule-item .schedule-item-actions button { min-width:0; width:100%; min-height:36px; padding:6px; font-size:13px; white-space:nowrap; border-radius:8px; }
.schedule-item .message { margin:0; }
.schedule-item .catalog-item-note { display:block; overflow:visible; overflow-wrap:anywhere; }

#scheduleForm .form-row { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 16px; margin-bottom:16px; }
#scheduleForm input, #scheduleForm select { width:100%; min-width:0; }
#scheduleForm input[readonly] { background:#f1f5f9; color:#52677d; }
#scheduleClockGrid { align-items:start; }
#scheduleRunningHint { margin:0 0 14px; }
.field-hint { margin-top: 5px; color: var(--muted); font-size: 11px; }

@media (max-width: 720px) {
  .tabs.four-tabs { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tabs.four-tabs .tab-btn { padding-left: 2px; padding-right: 2px; font-size: 12px; }
  .schedule-layout { grid-template-columns: 1fr; gap: 12px; }
  .schedule-item { padding:10px; }
  .schedule-item-grid { grid-template-columns:1fr; gap:2px; }
  .schedule-item .schedule-item-actions { width:100%; }
  .schedule-item .schedule-item-actions button { min-height:44px; font-size:12px; padding:6px 3px; }
  .schedule-item-actions:not(:has([data-action="schedule-edit"])) { max-width:100px; }
  #scheduleForm .form-row { grid-template-columns:1fr; gap:10px; margin-bottom:12px; }
  #scheduleForm .schedule-clock-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  #scheduleForm .schedule-clock-grid input { padding-left:8px; padding-right:8px; font-size:14px; }
}
:root { --timing-accent: #0d766e; }
.timing-panel { margin: 12px 0 20px; padding: 14px; background: #f0fdfa; border: 1px solid #b8e7df; border-radius: 12px; }
.timing-panel .form-row { margin-bottom: 6px; }
.ongoing-list { display: grid; gap: 10px; }
.ongoing-item { display: grid; gap: 8px; padding: 14px; border: 1px solid #d8e4ed; border-left: 3px solid var(--timing-accent); border-radius: 10px; overflow-wrap: anywhere; }
.ongoing-item p { margin: 0; font-size: 13px; line-height: 1.6; color: #52677d; }
.ongoing-item button { justify-self: start; }

#scheduleEditor { position:relative; width:min(860px,calc(100vw - 32px)); max-height:90dvh; overflow:auto; margin:auto; padding:24px; border:1px solid #badedc; border-radius:20px; box-shadow:0 24px 80px #102d4255; }
#scheduleEditor::backdrop { background:rgba(8,25,40,.55); backdrop-filter:blur(3px); }

/* 快捷表单、查询范围和计划工具栏统一布局。 */
.quick-basics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 14px; }
.quick-basics > .field:first-child { order:1; }
.quick-basics > .field:nth-child(2) { order:2; }
.quick-basics #timingPanel, .quick-basics #timingPanel > .form-row { display:contents; }
.quick-basics #timingPanel .field:first-child { order:3; }
.quick-basics #endedAtField { order:4; }
.quick-basics #oxygenDurationField { order:4; }
.duration-readout { display:flex; align-items:center; min-height:48px; box-sizing:border-box; padding:10px 14px; border:1px solid #b8e3dd; border-radius:12px; background:#f0fdfa; color:#0f766e; font-weight:600; overflow-wrap:anywhere; }
.quick-entry-card .field-error:empty, #formMessage:empty { display:none; }
.quick-entry-card .form-group-title { margin:14px 0 8px; }
.quick-entry-card .dynamic-fields { min-height:0; }
.quick-entry-card #remark { min-height:70px; }
.history-range-bar { grid-column:1/-1; grid-row:2; display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:8px; align-items:end; }
.history-range-field { min-width:0; }
.custom-history-field { display:none; }
.filters.custom-open .custom-history-field { display:grid; }
.history-range-bar button { white-space:nowrap; }
.history-range-bar:has(.history-export-menu[data-permission-granted="false"]) { grid-template-columns:minmax(0,1fr) auto; }
.history-section .field-error:empty { display:none; }
.schedule-toolbar { display:flex; align-items:center; gap:8px; }
.schedule-scope { display:flex; align-items:center; gap:8px; margin-right:auto; min-width:0; }
.schedule-scope select { width:auto; }
.schedule-refresh { display:grid; place-items:center; width:44px; min-width:44px; height:44px; min-height:44px; padding:10px; }
.schedule-refresh svg { width:20px; height:20px; }
.schedule-summary { margin:10px 0; color:var(--muted); font-size:12px; }
#scheduleMessage:empty { display:none; }
@media(max-width:760px) {
  .quick-entry-card { padding:12px; }
  .quick-entry-card .section-heading { margin-bottom:10px; }
  .quick-entry-card .pond-context { padding:10px; margin-bottom:12px; }
  .quick-entry-card .context-grid { row-gap:8px; }
  .quick-entry-card .field { gap:4px; }
  .quick-entry-card .quick-basics { grid-template-columns:1fr; gap:12px; }
  .quick-basics > .field:nth-child(2), .quick-basics #endedAtField, .quick-basics #oxygenDurationField { grid-column:1/-1; }
  .quick-entry-card input, .quick-entry-card select { min-height:44px; padding:8px 10px; }
  #eventForm .form-row, #editForm .form-row { grid-template-columns:1fr; gap:12px; }
  .quick-entry-card .form-row { margin-bottom:8px; }
  #eventForm > .actions { margin-left:-12px; margin-right:-12px; margin-bottom:-12px; padding-left:12px; padding-right:12px; }
  .history-range-bar { gap:6px; }
  .history-range-field { gap:4px; }
  .history-range-field label { font-size:12px; }
  .history-range-bar select { font-size:16px; padding:8px; min-height:44px; }
  .history-range-bar > button { min-height:44px; padding:8px 10px; font-size:15px; }
  .history-section, .catalog-list-card { padding:12px; }
  .history-section .section-heading { margin-bottom:10px; }
  .custom-history-field { grid-column:1/-1; }
  .schedule-toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto 44px; gap:6px; }
  .schedule-scope { display:block; margin:0; font-size:0; }
  .schedule-scope select { width:100%; min-height:44px; font-size:16px; padding:8px 6px; }
  #scheduleNewButton { padding:8px 10px; min-height:44px; font-size:13px; white-space:nowrap; }
  .schedule-toolbar:has(#scheduleNewButton.hidden), .schedule-toolbar:has(#scheduleNewButton[data-permission-granted="false"]) { grid-template-columns:minmax(0,1fr) 44px; }
}

/* Configurable records and recurring plans. */
.record-details { grid-column:1/-1; min-width:0; }
.optional-details { border:1px solid var(--border,#dce5ed); border-radius:10px; padding:12px 14px; margin:12px 0 16px; background:var(--card-bg,#fff); }
.optional-details > summary { cursor:pointer; font-weight:600; line-height:1.5; }
.optional-details[open] > summary { margin-bottom:14px; }
.inline-check { display:flex; align-items:center; gap:8px; margin:10px 0; }
.inline-check input,.weekday-options input { width:17px; height:17px; flex:0 0 auto; }
.detail-toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:end; margin:12px 0; }
.detail-toolbar .field { flex:1 1 190px; min-width:0; }
.detail-row { display:grid; grid-template-columns:minmax(0,2fr) minmax(76px,1fr) minmax(70px,1fr) auto; gap:10px; padding:12px 0; border-bottom:1px solid #e8eef3; align-items:end; }
.detail-row:last-child { margin-bottom:12px; }
.detail-row .field { min-width:0; margin:0; }
.detail-row input,.detail-row select { width:100%; min-width:0; }
.detail-row label { font-size:12px; color:#64748b; }
.detail-remove { padding:8px 10px; min-height:39px; }
.growth-detail-row { grid-template-columns:34px minmax(0,1fr) minmax(0,1fr) auto; }
.growth-detail-row > span { align-self:center; color:#64748b; }
.detail-total { color:#245c8c; margin:10px 0; font-weight:600; }
.detail-validation { color:#b42318; margin:8px 0; }
.detail-validation:empty { display:none; }
.health-sample-summary { display:block; margin:0 0 14px; padding:12px 14px; border-radius:10px; background:#eff8f7; color:#24645e; font-size:13px; line-height:1.6; }
#eventForm .catalog-choice-field .catalog-choice, #editForm .catalog-choice-field .catalog-choice { margin-bottom:0; }
#eventForm .field-error:empty, #editForm .field-error:empty { display:none; }
#eventForm .dynamic-fields textarea, #editForm .dynamic-fields textarea { min-height:76px; }
.weekday-options { display:flex; flex-wrap:wrap; gap:8px; }
.weekday-options label { display:flex; align-items:center; gap:6px; border:1px solid #dce5ed; border-radius:8px; padding:8px 10px; }
#scheduleForm .rotation-row { grid-template-columns:minmax(0,2fr) minmax(85px,1fr) minmax(70px,.8fr) auto; }
.record-detail-summary { margin-top:6px; font-size:12px; line-height:1.55; color:#64748b; overflow-wrap:anywhere; }
.metric #todayWaterAmount,.metric #todayWaterNet { display:block; white-space:normal; line-height:1.5; }
@media(max-width:720px) {
  .detail-row { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .detail-row .detail-remove { justify-self:end; }
  .growth-detail-row { grid-template-columns:24px minmax(0,1fr) minmax(0,1fr) auto; gap:6px; }
  .growth-detail-row .detail-remove { padding:8px; }
  #scheduleForm .rotation-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  #scheduleForm .rotation-row .field:first-child { grid-column:1/-1; }
  .weekday-options { gap:6px; }
  .weekday-options label { padding:7px; }
  .optional-details { padding:12px; }
}
.attachment-previews { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:12px; }
.attachment-previews figure { min-width:0; margin:0; }
.attachment-previews img { display:block; width:100%; max-height:240px; object-fit:contain; border:1px solid #dce5ed; border-radius:8px; background:#f7fafc; }
.attachment-previews figcaption { font-size:12px; color:#64748b; overflow-wrap:anywhere; margin:6px 0; }
#recordDetailDialog { max-width:780px; width:calc(100% - 32px); max-height:90dvh; overflow:auto; border:0; border-radius:16px; padding:0; }
@media(max-width:480px) { .attachment-previews { grid-template-columns:1fr; } }

#scheduleForm .rotation-row.has-purpose { grid-template-columns:minmax(0,1.8fr) minmax(70px,.8fr) minmax(65px,.7fr) minmax(95px,1fr) auto; }
@media(max-width:720px) { #scheduleForm .rotation-row.has-purpose { grid-template-columns:minmax(0,1fr) minmax(0,1fr); } }

/* One native choice control, with a separate clear action on every editable select. */
.select-control { position:relative; display:block; width:100%; min-width:0; }
.select-control > select { width:100%; padding-right:30px; }
.select-control.has-selection > select { padding-right:64px; }
.select-control.is-empty > select { color:var(--muted, #718096); }
.select-control > .select-clear { position:absolute; right:27px; top:50%; transform:translateY(-50%); display:grid; place-items:center; width:30px; height:30px; min-width:0; min-height:0; padding:0; border:0; border-radius:6px; background:transparent; color:#64748b; box-shadow:none; font:22px/1 Arial,sans-serif; cursor:pointer; }
.select-control > .select-clear:hover { background:#e8f3f2; color:#0f766e; }
.select-control > .select-clear:focus-visible { outline:2px solid #0f766e; outline-offset:1px; }
.select-control > .select-clear[hidden] { display:none; }
.oxygen-state { display:block; padding:12px 14px; border:1px solid #bde4df; border-radius:10px; background:#f0fdfa; color:#176963; line-height:1.6; }

.schedule-type-group + .schedule-type-group { margin-top:24px; }
.schedule-group-title { display:flex; align-items:center; gap:12px; margin:0 0 10px; padding:8px 0; color:#0f766e; font-size:16px; border-bottom:1px solid #d9e7e5; }
.schedule-group-title span { color:#64748b; font-size:12px; font-weight:400; }
