:root {
  color-scheme: dark;
  --text: #f7f9ff;
  --muted: rgba(236, 243, 255, 0.76);
  --soft: rgba(255, 255, 255, 0.08);
  --glass: rgba(112, 164, 255, 0.16);
  --glass-strong: rgba(105, 158, 255, 0.23);
  --border: rgba(255, 255, 255, 0.21);
  --border-strong: rgba(255, 255, 255, 0.32);
  --cyan: #6ae5ff;
  --pink: #ff73b9;
  --mint: #62f1d1;
  --orange: #ff9d61;
  --violet: #bca1ff;
  --green: #54eb82;
  --red: #ff6f7d;
  --shadow: 0 22px 60px rgba(2, 18, 73, 0.34);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: #15377e;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(75, 207, 255, 0.37), transparent 31%),
    radial-gradient(circle at 88% 8%, rgba(255, 118, 192, 0.55), transparent 28%),
    radial-gradient(circle at 75% 76%, rgba(96, 93, 255, 0.38), transparent 35%),
    linear-gradient(135deg, #13377f 0%, #244fb7 42%, #5f3dc7 70%, #cf62ad 100%);
  background-attachment: fixed;
}

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

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(123, 231, 255, 0.92);
  outline-offset: 2px;
}

.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(65px);
  pointer-events: none;
}

.ambient--one {
  width: 360px;
  height: 360px;
  top: -110px;
  left: -90px;
  background: rgba(61, 221, 255, 0.22);
}

.ambient--two {
  width: 430px;
  height: 430px;
  top: 12%;
  right: -170px;
  background: rgba(255, 114, 195, 0.23);
}

.ambient--three {
  width: 520px;
  height: 520px;
  bottom: -260px;
  left: 28%;
  background: rgba(80, 112, 255, 0.25);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1600px, calc(100% - 28px));
  min-height: calc(100vh - 28px);
  margin: 14px auto;
}

.topbar,
.control-panel,
.result-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(15, 59, 143, 0.2);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  margin-bottom: 14px;
}

.v2-sidebar,
.v2-topbar-title {
  display: none;
}

.ui-version-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 12px;
  background: rgba(61, 119, 214, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.ui-version-button {
  min-width: 36px;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255,255,255,.72);
  background: transparent;
  font-size: 10px;
  font-weight: 900;
}

.ui-version-button.is-active {
  border-color: rgba(255,255,255,.28);
  color: white;
  background: rgba(255,255,255,.15);
}

.login-screen,
.plant-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card,
.plant-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045)),
    rgba(15, 59, 143, 0.28);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

.login-card .brand-mark,
.plant-card .brand-mark {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.login-card h1,
.plant-card h1 {
  font-size: 28px;
  line-height: 1.05;
}

.login-card p:not(.status-text):not(.error-text),
.plant-card p:not(.status-text):not(.error-text) {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.plant-card {
  width: min(760px, 100%);
}

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

.plant-option {
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  color: var(--text);
  text-align: left;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.plant-option:hover,
.plant-option.is-active {
  transform: translateY(-2px);
  border-color: rgba(123, 231, 255, .72);
  background:
    linear-gradient(135deg, rgba(106, 229, 255, .18), rgba(255, 115, 185, .14)),
    rgba(255,255,255,.1);
}

.plant-option strong {
  align-self: end;
  font-size: 24px;
  line-height: 1.1;
}

.plant-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.brand {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: white;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0;
  background: linear-gradient(145deg, #17c7ff, #355cff 58%, #6a36e8);
  box-shadow: 0 11px 30px rgba(19, 79, 255, 0.48), inset 0 1px 0 rgba(255,255,255,.35);
}

h1,
h2,
h3,
p,
figure,
dl {
  margin: 0;
}

h1 {
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.15;
}

.brand p,
.pane-heading p,
.status-text,
.tile-heading span,
.metric span,
.batch-card-head span,
.batch-previews figcaption {
  color: var(--muted);
}

.brand p,
.pane-heading p {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.45;
}

.mode-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 16px;
  background: rgba(61, 119, 214, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.tab-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 8px 14px;
  background: transparent;
  color: rgba(255,255,255,.84);
  font-size: 12px;
  font-weight: 800;
  transition: transform .18s ease, filter .18s ease, background .18s ease;
}

.tab-button:hover {
  background: rgba(255,255,255,.08);
}

.tab-button.is-active {
  border-color: rgba(255,255,255,.24);
  background: linear-gradient(105deg, #ff4d80 0%, #d150b7 42%, #5d5cff 100%);
  box-shadow: 0 12px 26px rgba(220, 61, 156, .3), inset 0 1px 0 rgba(255,255,255,.25);
  color: #fff;
}

.tab-button:disabled {
  cursor: not-allowed;
  opacity: .42;
  filter: grayscale(.25);
}

.language-switch {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 14px;
  background: rgba(61, 119, 214, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.topbar-action {
  min-width: 86px;
}

.plant-switch {
  min-width: 132px;
  white-space: nowrap;
}

.project-screen {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(15, 59, 143, 0.2);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
}

.project-screen-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid rgba(255,255,255,.14);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.project-screen-head h2 {
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
}

.project-screen-head p:not(.status-text):not(.error-text) {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.project-create-form {
  margin: 0;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  padding: 13px;
  background: rgba(255,255,255,.06);
}

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

.project-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 0;
  color: white;
  text-align: left;
  background:
    linear-gradient(145deg, rgba(255,255,255,.11), rgba(255,255,255,.025)),
    rgba(42, 91, 180, .18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 12px 26px rgba(6, 31, 97, .16);
}

.project-card:hover {
  transform: translateY(-1px);
  border-color: rgba(106, 229, 255, .58);
}

.project-cover {
  width: 100%;
  aspect-ratio: 2 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  color: white;
  background: rgba(255,255,255,.08);
}

.project-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.project-cover span {
  color: rgba(255,255,255,.86);
  font-size: 34px;
  font-weight: 900;
}

.project-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.project-card strong {
  overflow: hidden;
  color: white;
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
}

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

.project-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.project-card dl div {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,.06);
}

.project-card dt {
  color: rgba(236,243,255,.72);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.project-card dd {
  margin: 3px 0 0;
  color: white;
  font-size: 15px;
  font-weight: 900;
}

.project-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, auto) minmax(74px, auto);
  gap: 8px;
  padding: 0 14px 14px;
}

.project-delete-action {
  color: white;
  background:
    linear-gradient(135deg, rgba(255, 83, 123, .9), rgba(255, 115, 185, .68)),
    rgba(255,255,255,.08);
}

.lang-button {
  min-width: 42px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(255,255,255,.82);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
}

.lang-button.is-active {
  border-color: rgba(255,255,255,.24);
  color: white;
  background: linear-gradient(105deg, #ff4d80 0%, #d150b7 42%, #5d5cff 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

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

.workspace:has([data-pane="composer"].is-active) {
  grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
}

.control-panel {
  align-self: start;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 14px;
}

.result-panel {
  min-width: 0;
  padding: 18px;
}

.tab-pane,
.result-view {
  display: none;
}

.tab-pane.is-active,
.result-view.is-active {
  display: block;
}

.pane-heading,
.result-header {
  border-bottom: 1px solid rgba(255,255,255,.14);
}

.pane-heading {
  padding: 4px 4px 14px;
}

.pane-heading h2,
.result-header h2 {
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

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

fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.035)),
    rgba(61, 119, 214, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 24px rgba(12, 40, 115, 0.14);
}

legend {
  padding: 0 6px;
  color: rgba(255,255,255,.96);
  font-size: 12px;
  font-weight: 800;
}

label {
  display: grid;
  gap: 5px;
  color: rgba(255,255,255,.9);
  font-size: 10.5px;
  font-weight: 700;
}

.field-hint {
  color: rgba(236, 243, 255, 0.72);
  font-size: 10px;
  line-height: 1.4;
}

input,
select,
textarea {
  width: 100%;
  min-height: 35px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(72, 124, 214, 0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(228, 238, 255, 0.6);
}

select {
  appearance: auto;
}

option {
  color: #13265d;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(94, 149, 239, 0.2);
}

textarea {
  min-height: 77px;
  resize: vertical;
  line-height: 1.42;
}

input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
  accent-color: #37caff;
}

input[type="file"] {
  min-height: 42px;
  padding: 7px;
  font-size: 10px;
}

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

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

.check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  color: rgba(255,255,255,.88);
  font-size: 10px;
  user-select: none;
}

.primary-action {
  width: 100%;
  min-height: 42px;
  margin-top: 2px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  color: white;
  background: linear-gradient(105deg, #ff4d80 0%, #d150b7 42%, #5d5cff 100%);
  box-shadow: 0 12px 26px rgba(220, 61, 156, .3), inset 0 1px 0 rgba(255,255,255,.25);
  font-size: 12px;
  font-weight: 850;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.primary-action:hover,
.download-actions a:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

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

.error-text {
  min-height: 18px;
  color: #ffd2dc;
  font-size: 11px;
  line-height: 1.35;
}

.result-header {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 0 4px 14px;
}

.status-text {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: rgba(238,247,255,.88);
  font-size: 10px;
  font-weight: 700;
}

.status-text::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 13px rgba(70, 238, 128, .92);
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.download-actions a,
.download-actions button {
  min-height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 9px;
  padding: 0 14px;
  color: white;
  text-decoration: none;
  background: rgba(255,255,255,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 10px 22px rgba(8, 33, 107, .22);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}

.download-actions a.report-download,
.download-actions button.report-download {
  border-color: rgba(255,255,255,.34);
  background: linear-gradient(105deg, #ff4d80 0%, #d150b7 42%, #5d5cff 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 12px 26px rgba(18, 24, 78, .26);
}

.secondary-action {
  min-height: 40px;
  border: 1px solid rgba(125, 229, 255, .34);
  border-radius: 9px;
  padding: 0 13px;
  color: white;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
  font-size: 10px;
  font-weight: 820;
  cursor: pointer;
}

#save-project-button,
#delete-project-button {
  width: 100%;
}

.danger-action {
  border-color: rgba(255, 103, 128, .42);
  background: rgba(255, 70, 104, .13);
}

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

.metric {
  min-width: 0;
  min-height: 77px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.115), rgba(255,255,255,.025)),
    rgba(70, 121, 211, .12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11), 0 8px 20px rgba(4, 34, 109, .12);
}

.metric::before {
  content: "◎";
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 0 18px currentColor;
}

.metric:nth-child(2n)::before { content: "♨"; color: var(--orange); }
.metric:nth-child(3n)::before { content: "⌖"; color: var(--pink); }
.metric:nth-child(4n)::before { content: "◌"; color: var(--violet); }
.metric:nth-child(5n)::before { content: "▣"; color: var(--mint); }

.metric div {
  min-width: 0;
}

.metric span {
  display: block;
  margin-bottom: 5px;
  color: rgba(236,244,255,.77);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  overflow: hidden;
  color: white;
  font-size: 15px;
  line-height: 1.14;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.device-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
}

.device-strip span {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(125, 229, 255, .34);
  border-radius: 999px;
  padding: 5px 10px;
  color: white;
  background: rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
  font-size: 11px;
  font-weight: 800;
}

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

.batch-bulk-host {
  display: block;
  margin-bottom: 12px;
}

.project-loading-panel {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 360px;
  align-content: center;
  border: 1px solid rgba(106, 229, 255, .28);
  border-radius: 12px;
  padding: 32px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(33, 150, 243, .12), rgba(98, 241, 209, .08)),
    rgba(255,255,255,.045);
}

.project-loading-panel strong {
  font-size: 22px;
}

.project-loading-panel span {
  color: var(--muted);
  font-weight: 800;
}

.project-loading-panel progress {
  width: min(420px, 100%);
  height: 14px;
  accent-color: var(--cyan);
}

.project-loading-panel em {
  color: var(--mint);
  font-style: normal;
  font-weight: 900;
}

.batch-bulk-toolbar {
  grid-column: 1 / -1;
  position: relative;
  z-index: 40;
  display: block;
  align-self: start;
  isolation: isolate;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(18, 38, 87, .96), rgba(10, 24, 58, .96)),
    #10204d;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}

.batch-bulk-toolbar summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.batch-bulk-toolbar summary::-webkit-details-marker {
  display: none;
}

.batch-bulk-toolbar summary::before {
  content: "▸";
  color: var(--cyan);
  font-weight: 950;
}

.batch-bulk-toolbar[open] summary::before {
  content: "▾";
}

.batch-bulk-toolbar summary > span {
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.batch-bulk-toolbar summary em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-bulk-panel {
  display: grid;
  grid-template-columns: minmax(190px, .65fr) minmax(320px, 1.15fr);
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,.14);
  padding: 10px;
}

.batch-bulk-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255,255,255,.045);
}

.batch-bulk-group h4 {
  margin: 0;
  color: rgba(236,243,255,.78);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.batch-bulk-check,
.batch-card-select,
.thermal-select-image-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-size: 11px;
  font-weight: 850;
}

.batch-bulk-toolbar strong {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.batch-bulk-toolbar input[type="text"],
.batch-bulk-toolbar input[type="number"],
.batch-bulk-toolbar input[type="search"],
.batch-bulk-toolbar select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  box-sizing: border-box;
}

.batch-bulk-toolbar select {
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  padding: 0 10px;
  color: white;
  background: rgba(255,255,255,.08);
  font-size: 10px;
  font-weight: 850;
}

.batch-bulk-toolbar button {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  padding: 0 11px;
  color: white;
  background: rgba(255,255,255,.09);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.batch-bulk-toolbar [data-bulk-rename] {
  background: linear-gradient(105deg, #ff4d80 0%, #d150b7 42%, #5d5cff 100%);
}

.batch-bulk-toolbar [data-bulk-delete] {
  background: rgba(255, 91, 112, .24);
}

.batch-filter-empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(255,255,255,.25);
  border-radius: 14px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.batch-upload-progress {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(125, 229, 255, .28);
  border-radius: 12px;
  padding: 9px;
  background: rgba(18, 24, 78, .22);
}

.batch-upload-progress[hidden] {
  display: none;
}

.batch-upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: white;
  font-size: 11px;
  font-weight: 850;
}

.batch-upload-progress progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}

.batch-upload-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}

.batch-upload-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(105deg, #19c5ff, #5d5cff);
}

.batch-upload-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(105deg, #19c5ff, #5d5cff);
}

.batch-upload-progress.is-processing progress {
  position: relative;
  background: rgba(255,255,255,.12);
}

.batch-upload-progress.is-processing progress::-webkit-progress-bar {
  background:
    linear-gradient(90deg, rgba(25, 197, 255, .18), rgba(93, 92, 255, .75), rgba(25, 197, 255, .18));
  background-size: 220% 100%;
  animation: upload-processing-sweep 1.1s linear infinite;
}

.batch-upload-progress.is-processing progress::-moz-progress-bar {
  background:
    linear-gradient(90deg, rgba(25, 197, 255, .18), rgba(93, 92, 255, .75), rgba(25, 197, 255, .18));
  background-size: 220% 100%;
  animation: upload-processing-sweep 1.1s linear infinite;
}

@keyframes upload-processing-sweep {
  from { background-position: 0% 50%; }
  to { background-position: 220% 50%; }
}

.batch-submit-fallback {
  display: none;
}

.batch-card,
.image-tile {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.19);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.025)),
    rgba(42, 91, 180, .14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 12px 26px rgba(6, 31, 97, .15);
}

.batch-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  padding: 12px;
}

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

.batch-card-head > div {
  min-width: 0;
}

.batch-card-select {
  flex: 0 0 auto;
  padding-top: 2px;
}

.thermal-select-image-button {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 7;
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  color: #151515;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  cursor: pointer;
}

.thermal-select-image-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.thermal-select-image-button span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid #2a2a2a;
  border-radius: 4px;
  color: transparent;
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
}

.thermal-select-image-button:has(input:checked) {
  border-color: #19c5ff;
  background: #19c5ff;
}

.thermal-select-image-button:has(input:checked) span {
  border-color: white;
  color: white;
}

.batch-card-head strong {
  display: block;
  font-size: 17px;
  line-height: 1.15;
}

.batch-card-head span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 750;
}

.batch-card mark {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255,255,255,.08);
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.batch-card mark.ok {
  color: #dfffe8;
  background: rgba(84, 235, 130, .18);
}

.batch-card mark.warn {
  color: #fff2c7;
  background: rgba(255, 190, 66, .18);
}

.batch-card mark.bad {
  color: #ffd2dc;
  background: rgba(255, 91, 112, .18);
}

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

.batch-previews img,
.missing-preview,
.image-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  border-radius: 12px;
  background: #1f1646;
}

.thermal-measure-shell {
  position: relative;
}

.thermal-measure-target {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #1f1646;
  cursor: crosshair;
}

.thermal-measure-target::after {
  content: "+";
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: white;
  background: rgba(18, 24, 78, .45);
  backdrop-filter: blur(10px);
  font-size: 18px;
  font-weight: 850;
  opacity: 0;
  transition: opacity .18s ease;
}

.thermal-measure-target:hover::after {
  opacity: 1;
}

.thermal-zoom-button {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 4;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  color: white;
  background: rgba(18, 24, 78, .5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 18px rgba(0,0,0,.2);
  backdrop-filter: blur(12px);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.thermal-polygon-button {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 4;
  min-height: 28px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px;
  padding: 0 9px;
  color: white;
  background: rgba(18, 24, 78, .58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 18px rgba(0,0,0,.2);
  backdrop-filter: blur(12px);
  font-size: 9px;
  font-weight: 900;
}

.thermal-delete-image-button {
  display: none;
}

.measurement-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.measurement-marker {
  --marker-color: #00f08a;
  position: absolute;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  background: transparent;
  filter: drop-shadow(0 0 4px rgba(18, 24, 78, .9)) drop-shadow(0 0 8px var(--marker-color));
}

.measurement-marker::before,
.measurement-marker::after {
  content: "";
  position: absolute;
  background: var(--marker-color);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.measurement-marker::before {
  width: 2px;
  height: 14px;
}

.measurement-marker::after {
  width: 14px;
  height: 2px;
}

.polygon-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.line-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.polygon-overlay polygon,
#polygon-draft polygon {
  vector-effect: non-scaling-stroke;
}

.line-overlay line {
  vector-effect: non-scaling-stroke;
}

.polygon-overlay .polygon-region-label {
  paint-order: stroke;
  stroke: rgba(18, 24, 78, .94);
  stroke-width: 3px;
  stroke-linejoin: round;
  fill: white;
  font-size: 34px;
  font-weight: 900;
}

.line-overlay .line-region-label {
  paint-order: stroke;
  stroke: rgba(18, 24, 78, .94);
  stroke-width: 3px;
  stroke-linejoin: round;
  fill: white;
  font-size: 34px;
  font-weight: 900;
}

.unit-temperature-name-button {
  appearance: none;
  border: 0;
  padding: 0;
  max-width: 100%;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.unit-temperature-name-button:hover,
.unit-temperature-name-button:focus-visible {
  text-decoration: underline;
  outline: none;
}

.unit-temperature-name-input {
  width: min(150px, 100%);
  border: 1px solid #9aa0a6;
  padding: 3px 5px;
  color: inherit;
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.polygon-extreme {
  --extreme-color: #6ae5ff;
  position: absolute;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--extreme-color);
  border-radius: 50%;
  background: rgba(18, 24, 78, .35);
  box-shadow: 0 0 0 1px rgba(18, 24, 78, .72), 0 0 5px var(--extreme-color);
}

.polygon-extreme::before,
.polygon-extreme::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: white;
}

.polygon-extreme::before {
  width: 1px;
  height: 8px;
}

.polygon-extreme::after {
  width: 8px;
  height: 1px;
}

.polygon-extreme-max {
  --extreme-color: #ff5c93;
}

.polygon-extreme-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: max-content;
  max-width: 48px;
  border: 1px solid var(--extreme-color);
  border-radius: 3px;
  padding: 1px 3px;
  color: white;
  background: rgba(18, 24, 78, .86);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .28);
  font-size: 7px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.polygon-extreme.align-left .polygon-extreme-label {
  right: 8px;
  left: auto;
}

.polygon-extreme.align-below .polygon-extreme-label {
  top: 8px;
  bottom: auto;
}

.polygon-list {
  display: grid;
  gap: 7px;
}

.polygon-result {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(4, minmax(64px, .7fr)) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-left: 4px solid rgba(106,229,255,.9);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(18,24,78,.2);
}

.polygon-result.level-1 { border-left-color: #ffd369; }
.polygon-result.level-2 { border-left-color: #ff985e; }
.polygon-result.level-3 { border-left-color: #ff4d80; }

.polygon-result strong,
.polygon-result span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: white;
  font-size: 10px;
}

.polygon-result span {
  color: rgba(240,247,255,.82);
  font-weight: 800;
}

.polygon-result button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 0;
  color: white;
  background: rgba(255,255,255,.08);
  font-size: 15px;
  font-weight: 900;
}

.polygon-result .polygon-result-actions {
  display: flex;
  gap: 5px;
}

.batch-previews figcaption {
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 9px;
  font-weight: 750;
}

.missing-preview {
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.64);
  font-weight: 900;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.08), rgba(255,255,255,.08) 10px, rgba(255,255,255,.03) 10px, rgba(255,255,255,.03) 20px);
}

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

.capture-time-trigger {
  margin-top: 6px;
  font-size: 12px;
}

.capture-time-editor:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.2);
}

.capture-time-editor label {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.capture-time-editor input {
  min-height: 36px;
}

.zoom-capture-time-edit {
  margin-left: 8px;
}

.zoom-capture-time-form:not([hidden]) {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.zoom-capture-time-form label {
  display: grid;
  gap: 4px;
}

.zoom-capture-time-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.batch-facts div {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,.06);
}

.batch-facts dt {
  color: rgba(236,244,255,.72);
  font-size: 8.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.batch-facts dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 850;
}

.label-fact dd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.label-fact dd span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.label-fact dd button {
  flex: 0 0 auto;
  min-height: 24px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  padding: 0 8px;
  color: white;
  background: rgba(255,255,255,.09);
  font-size: 9px;
  font-weight: 850;
}

.history-chart-panel,
.history-table-wrap,
.history-overview-section {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.025)),
    rgba(18, 24, 78, .18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 12px 26px rgba(6, 31, 97, .13);
}

.history-chart-panel {
  padding: 12px;
}

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

.history-assessments {
  margin-bottom: 12px;
}

.assessment-panel {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 14px;
  background: rgba(18,24,78,.18);
}

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

.assessment-head h3 {
  margin: 0;
  color: white;
  font-size: 15px;
}

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

.assessment-count {
  border: 1px solid rgba(255,255,255,.14);
  border-top: 3px solid #6ae5ff;
  border-radius: 9px;
  padding: 9px;
  background: rgba(255,255,255,.055);
}

.assessment-count.level-1 { border-top-color: #ffd369; }
.assessment-count.level-2 { border-top-color: #ff985e; }
.assessment-count.level-3 { border-top-color: #ff4d80; }

.assessment-count span,
.assessment-count strong {
  display: block;
  color: white;
}

.assessment-count span {
  color: rgba(240,247,255,.72);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.assessment-count strong {
  margin-top: 4px;
  font-size: 18px;
}

.assessment-table {
  width: 100%;
  min-width: 760px;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 10px;
}

.assessment-table th,
.assessment-table td {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 8px;
  color: white;
  text-align: left;
}

.assessment-table th {
  color: rgba(240,247,255,.7);
  font-size: 8px;
  text-transform: uppercase;
}

.level-badge {
  display: inline-grid;
  place-items: center;
  min-height: 24px;
  border: 1px solid rgba(106,229,255,.44);
  border-radius: 999px;
  padding: 0 9px;
  color: white;
  background: rgba(106,229,255,.12);
  font-size: 9px;
  font-weight: 900;
}

.level-badge.level-1 { border-color: rgba(255,211,105,.7); background: rgba(255,211,105,.14); }
.level-badge.level-2 { border-color: rgba(255,152,94,.75); background: rgba(255,152,94,.16); }
.level-badge.level-3 { border-color: rgba(255,77,128,.8); background: rgba(255,77,128,.18); }

.history-overview-section {
  min-width: 0;
  padding: 12px;
}

.history-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history-overview-head h3 {
  margin: 0;
  color: white;
  font-size: 14px;
  line-height: 1.2;
}

.history-overview-head span {
  min-width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: white;
  background: rgba(255,255,255,.12);
  font-size: 12px;
  font-weight: 900;
}

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

.history-overview-card {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,.08);
}

.history-overview-card strong,
.history-overview-card span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.history-overview-card strong {
  color: white;
  font-size: 14px;
  line-height: 1.2;
}

.history-overview-card span {
  margin-top: 4px;
  color: rgba(236,244,255,.7);
  font-size: 10px;
  font-weight: 800;
}

.history-overview-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 9px 0 0;
}

.history-overview-card dl div {
  min-width: 0;
  border-radius: 8px;
  padding: 7px;
  background: rgba(255,255,255,.08);
}

.history-overview-card dt {
  color: rgba(236,244,255,.68);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.history-overview-card dd {
  overflow: hidden;
  margin: 3px 0 0;
  color: white;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.history-chart-panel canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.history-table-wrap {
  margin-top: 12px;
  overflow: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  font-size: 11px;
}

.history-table th,
.history-table td {
  border-bottom: 1px solid rgba(255,255,255,.12);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.history-table th {
  color: rgba(236,244,255,.78);
  background: rgba(255,255,255,.07);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.history-table td {
  color: white;
  font-weight: 700;
}

.measurement-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 0;
}

.batch-card > .measurement-list:empty,
.batch-card > .polygon-list:empty,
.batch-card > .line-list:empty {
  display: none;
}

.measurement-editor,
.label-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 13px;
  padding: 8px;
  background: rgba(18, 24, 78, .24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.label-editor.device-label-editor {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.label-editor label {
  display: grid;
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.label-editor label span {
  color: inherit;
  font-size: 10px;
  font-weight: 850;
}

.measurement-editor[hidden],
.label-editor[hidden] {
  display: none;
}

.measurement-editor input,
.label-editor input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  box-sizing: border-box;
}

.measurement-editor button,
.label-editor button {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 9px;
  padding: 0 10px;
  color: white;
  background: rgba(255,255,255,.08);
  font-size: 10px;
  font-weight: 850;
}

.label-editor.device-label-editor button {
  justify-self: stretch;
}

.measurement-editor button:first-of-type,
.label-editor button:first-of-type {
  background: linear-gradient(105deg, #ff4d80 0%, #d150b7 42%, #5d5cff 100%);
}

.measurement-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 4px 5px 4px 9px;
  color: white;
  background: linear-gradient(105deg, rgba(255, 77, 128, .34), rgba(93, 92, 255, .32));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
  font-size: 11px;
  font-weight: 850;
}

.unit-temperature-color-input {
  width: 30px;
  height: 24px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 5px;
  padding: 1px;
  background: rgba(255,255,255,.08);
  cursor: pointer;
}

.measurement-delete-button {
  display: inline-grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-height: 18px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 50%;
  padding: 0;
  color: white;
  background: rgba(18,24,78,.34);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.measurement-delete-button:hover {
  border-color: rgba(255,255,255,.55);
  background: rgba(255,77,128,.55);
}

.single-measure-panel {
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}

.single-measure-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.single-measure-head h3 {
  margin: 0;
  color: white;
  font-size: 15px;
  font-weight: 900;
}

.single-measure-head button {
  min-height: 30px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 0 12px;
  color: white;
  background: rgba(255,255,255,.08);
  font-size: 10px;
  font-weight: 850;
}

.measurement-empty {
  color: rgba(236,244,255,.68);
  font-size: 12px;
  font-weight: 750;
}

.zoom-modal[hidden] {
  display: none;
}

.polygon-modal[hidden] {
  display: none;
}

.zoom-modal,
.polygon-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.polygon-modal {
  z-index: 22;
}

.zoom-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 14, 54, .62);
  backdrop-filter: blur(12px);
}

.zoom-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(15, 59, 143, 0.38);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.16);
}

.polygon-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto auto auto;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  overflow: auto;
  background: rgba(24, 63, 153, .97);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.16);
}

.polygon-canvas {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  max-height: min(66vh, 760px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  background: #1f1646;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.polygon-canvas img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(66vh, 760px);
  object-fit: contain;
}

#polygon-draft {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#polygon-draft polyline {
  fill: rgba(255, 211, 82, .12);
  stroke: #ffe36f;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

#polygon-draft circle {
  fill: #fff;
  stroke: #ff4d80;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.polygon-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.polygon-toolbar > span {
  margin-right: auto;
  color: rgba(240,247,255,.82);
  font-size: 12px;
  font-weight: 850;
}

.polygon-style-control,
.polygon-color-control {
  display: flex;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  color: rgba(240,247,255,.8);
  font-size: 10px;
  font-weight: 850;
}

.polygon-style-control input {
  width: 120px;
  accent-color: #ffe36f;
}

.polygon-style-control output {
  min-width: 32px;
  color: white;
  font-size: 10px;
  font-weight: 900;
}

.polygon-color-control input {
  width: 38px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 7px;
  padding: 2px;
  background: rgba(255,255,255,.08);
}

.polygon-toolbar button,
.polygon-editor button {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  padding: 0 12px;
  color: white;
  background: rgba(255,255,255,.08);
  font-size: 11px;
  font-weight: 850;
}

.polygon-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, .45fr) auto;
  gap: 10px;
  margin: 0;
  align-items: end;
}

.polygon-editor label {
  gap: 5px;
}

.polygon-editor button {
  background: #e84c91;
}

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

.zoom-header h2 {
  font-size: 22px;
}

.zoom-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#zoom-level {
  min-width: 54px;
  text-align: center;
  color: white;
  font-size: 11px;
  font-weight: 850;
}

.zoom-close,
.zoom-actions button,
.zoom-editor button {
  min-height: 36px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  padding: 0 12px;
  color: white;
  background: rgba(255,255,255,.08);
  font-size: 11px;
  font-weight: 850;
}

.zoom-image-button {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  background: #1f1646;
  cursor: crosshair;
  overflow: auto;
  max-height: min(68vh, 760px);
  align-items: start;
  justify-items: start;
}

.zoom-image-button img {
  display: block;
  width: 100%;
  transform-origin: top left;
  object-fit: contain;
}

.zoom-annotation-layer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  pointer-events: none;
}

.zoom-polygon-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.zoom-line-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.zoom-measurement-label {
  position: absolute;
  left: 12px;
  top: -8px;
  border-radius: 4px;
  padding: 2px 5px;
  color: #fff;
  background: rgba(18, 24, 78, .82);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.zoom-marker {
  position: absolute;
  z-index: 3;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(18, 24, 78, .95)) drop-shadow(0 0 11px rgba(255, 115, 185, .95));
}

.zoom-marker::before,
.zoom-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: white;
  transform: translate(-50%, -50%);
}

.zoom-marker::before {
  width: 2px;
  height: 18px;
}

.zoom-marker::after {
  width: 18px;
  height: 2px;
}

.zoom-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0;
}

.zoom-editor[hidden] {
  display: none;
}

.zoom-editor button {
  background: linear-gradient(105deg, #ff4d80 0%, #d150b7 42%, #5d5cff 100%);
}

.app-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, calc(100vw - 36px));
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  background: rgba(18, 24, 78, .94);
  box-shadow: 0 18px 44px rgba(0,0,0,.32);
  font-size: 14px;
  font-weight: 800;
}

.app-notice[hidden] {
  display: none;
}

.app-notice.success {
  background: rgba(19, 124, 78, .95);
}

.app-notice.warning {
  background: rgba(72, 58, 28, .96);
}

.app-notice.error {
  background: rgba(142, 35, 60, .96);
}

.app-notice-actions {
  display: flex;
  gap: 8px;
}

.app-notice button {
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 8px;
  padding: 8px 11px;
  color: #fff;
  background: rgba(255,255,255,.13);
  font-weight: 850;
  cursor: pointer;
}

.app-notice button.danger {
  border-color: rgba(255,121,121,.7);
  background: rgba(255,74,111,.5);
}

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

.image-tile {
  overflow: hidden;
  padding: 10px;
}

.tile-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 1px 2px 9px;
}

h3 {
  font-size: 12px;
  font-weight: 800;
}

.tile-heading span {
  font-size: 9px;
  font-weight: 750;
}

.image-surface {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: #1f1646;
}

.template-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 14px;
}

.template-preset-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.template-preset-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.03)),
    rgba(61, 119, 214, 0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.template-preset-card strong {
  font-size: 13px;
  line-height: 1.25;
}

.template-preset-card span {
  color: rgba(236, 243, 255, 0.76);
  font-size: 10.5px;
  line-height: 1.42;
}

.template-preset-card a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.template-guide-section {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.035)),
    rgba(61, 119, 214, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 24px rgba(12, 40, 115, 0.14);
}

.template-guide-section h3 {
  font-size: 16px;
  line-height: 1.2;
}

.template-field-list {
  display: grid;
  gap: 9px;
}

.template-field-list div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.template-field-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.template-field-list dt,
.template-code {
  overflow-wrap: anywhere;
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
}

.template-field-list dd {
  margin: 0;
  color: rgba(236, 243, 255, 0.76);
  font-size: 11px;
  line-height: 1.4;
}

.template-code {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: rgba(13, 26, 78, .28);
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.composer-action-grid button {
  width: 100%;
}

.composer-project-dashboard {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.composer-project-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.composer-project-metrics div {
  min-width: 0;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 9px;
  background: rgba(255,255,255,.075);
}

.composer-project-metrics span {
  overflow: hidden;
  color: rgba(236, 243, 255, .72);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.composer-project-metrics strong {
  color: white;
  font-size: 18px;
  line-height: 1.05;
}

.composer-project-devices {
  max-height: 84px;
  overflow: auto;
  padding-bottom: 0;
}

.composer-project-gallery {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 330px);
  overflow: auto;
  padding-right: 2px;
}

.composer-project-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 14px;
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.105), rgba(255,255,255,.025)),
    rgba(44, 94, 183, .14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

.composer-project-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.composer-project-card-head strong,
.composer-project-card-head span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.composer-project-card-head strong {
  font-size: 16px;
  line-height: 1.1;
}

.composer-project-card-head span {
  margin-top: 3px;
  color: rgba(236, 243, 255, .74);
  font-size: 10px;
  font-weight: 750;
}

.composer-project-card-head mark {
  flex: 0 0 auto;
  align-self: start;
  max-width: 118px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 5px 8px;
  color: white;
  background: rgba(255,255,255,.11);
  font-size: 8px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.composer-preview-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 7px;
}

.composer-project-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.composer-project-facts div {
  min-width: 0;
  border-radius: 9px;
  padding: 7px;
  background: rgba(255,255,255,.075);
}

.composer-project-facts dt {
  color: rgba(236, 243, 255, .68);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.composer-project-facts dd {
  margin: 3px 0 0;
  color: white;
  font-size: 11px;
  font-weight: 850;
}

.composer-measurement-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 27px;
}

.composer-measurement-list .measurement-chip {
  margin: 0;
  font-size: 10px;
}

.composer-measurement-list .measurement-empty {
  opacity: .72;
}

.composer-polygon-list {
  display: grid;
  gap: 6px;
}

.composer-polygon-summary {
  display: grid;
  grid-template-columns: minmax(86px, 1.2fr) repeat(3, minmax(60px, .8fr)) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-left: 3px solid #6ae5ff;
  border-radius: 7px;
  padding: 6px 7px;
  background: rgba(18,24,78,.18);
}

.composer-polygon-summary.level-1 { border-left-color: #ffd369; }
.composer-polygon-summary.level-2 { border-left-color: #ff985e; }
.composer-polygon-summary.level-3 { border-left-color: #ff4d80; }

.composer-polygon-summary strong,
.composer-polygon-summary span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: white;
  font-size: 9px;
}

.composer-polygon-summary span {
  color: rgba(240,247,255,.82);
  font-weight: 800;
}

.composer-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255,255,255,.13);
  margin-top: 14px;
}

.composer-toolbar label {
  margin: 0;
}

.composer-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.composer-toolbar-actions button {
  min-width: 88px;
}

.composer-export-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  margin: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  padding: 7px 10px;
  color: rgba(236, 243, 255, .9);
  background: rgba(255,255,255,.07);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.composer-export-option input {
  width: 16px;
  min-height: 16px;
}

.composer-template-option select {
  min-height: 28px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 6px;
  padding: 4px 8px;
  color: #102033;
  background: #fff;
  font-weight: 800;
}

.composer-toolbar-actions button[hidden],
.composer-document-shell[hidden] {
  display: none !important;
}

.composer-toolbar .error-text {
  grid-column: 1 / -1;
}

.composer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding-top: 14px;
}

.composer-document-shell,
.composer-source-section {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(255,255,255,.1), rgba(255,255,255,.025)),
    rgba(61, 119, 214, 0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 10px 24px rgba(9, 34, 103, .14);
}

.composer-document-shell {
  padding: 14px;
}

.composer-editor {
  min-height: 720px;
  max-width: 900px;
  margin: 0 auto;
  padding: 34px;
  border-radius: 6px;
  color: #14233a;
  background: #fff;
  box-shadow: 0 22px 50px rgba(6, 18, 54, .28);
  line-height: 1.55;
  outline: none;
}

.composer-editor.is-dragging {
  box-shadow: 0 0 0 3px rgba(106, 229, 255, .7), 0 22px 50px rgba(6, 18, 54, .28);
}

.composer-editor h1 {
  margin-bottom: 14px;
  color: #13223a;
  font-size: 26px;
}

.composer-editor h2 {
  margin: 22px 0 9px;
  color: #19345e;
  font-size: 18px;
}

.composer-editor p {
  margin: 10px 0;
}

.composer-editor table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

.composer-editor th,
.composer-editor td {
  border: 1px solid #c7d2e2;
  padding: 8px;
  vertical-align: top;
}

.composer-editor th {
  background: #eef4fb;
}

.composer-meta-table th {
  width: 150px;
}

.composer-drop-placeholder {
  border: 1px dashed #a8b5c8;
  border-radius: 6px;
  padding: 18px;
  color: #65748b;
  background: #f8fbff;
}

.composer-figure {
  margin: 16px 0;
  page-break-inside: avoid;
}

.composer-annotated-image {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
}

.composer-polygon-layer {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.composer-line-layer {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.composer-polygon-layer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.composer-line-layer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.composer-polygon-layer polygon {
  vector-effect: non-scaling-stroke;
}

.composer-line-layer line {
  vector-effect: non-scaling-stroke;
}

.composer-polygon-layer text {
  fill: #10c66a;
  stroke: none;
  font-size: 24px;
  font-weight: 900;
}

.composer-line-layer text {
  fill: #10c66a;
  stroke: none;
  font-size: 24px;
  font-weight: 900;
}

.composer-polygon-extreme {
  position: absolute;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: 1px solid currentColor;
  border-radius: 0;
  color: #fff;
  background: transparent;
  box-shadow: 0 0 2px rgba(0, 0, 0, .72);
}

.composer-polygon-extreme::before,
.composer-polygon-extreme::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.composer-polygon-extreme::before {
  left: -5px;
  right: -5px;
  top: 6px;
  height: 1px;
}

.composer-polygon-extreme::after {
  top: -5px;
  bottom: -5px;
  left: 6px;
  width: 1px;
}

.composer-polygon-extreme > span {
  display: none;
}

.composer-figure img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  border-radius: 5px;
  object-fit: contain;
}

.composer-report-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 3px #111);
  pointer-events: none;
}

.composer-report-marker::before,
.composer-report-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--marker-color, #00f08a);
  transform: translate(-50%, -50%);
}

.composer-report-marker::before {
  width: 2px;
  height: 16px;
}

.composer-report-marker::after {
  width: 16px;
  height: 2px;
}

.composer-report-marker span {
  position: absolute;
  left: 12px;
  top: -8px;
  border: 0;
  padding: 0;
  color: var(--marker-color, #00f08a);
  background: transparent;
  box-shadow: none;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
  text-shadow: 0 1px 1px #fff, 0 -1px 1px #fff, 1px 0 1px #fff, -1px 0 1px #fff;
}

.composer-figure figcaption {
  margin-top: 7px;
  color: #65748b;
  font-size: 12px;
}

.composer-temperature-info {
  margin-top: 10px;
  color: #172033;
}

.composer-temperature-info h4 {
  margin: 0 0 6px;
  color: #172033;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.1;
}

.composer-temperature-info table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.composer-temperature-info th,
.composer-temperature-info td {
  border: 1px solid #c8c8c8;
  padding: 6px 8px;
  color: #172033;
  background: white;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  vertical-align: middle;
}

.composer-temperature-info th {
  color: white !important;
  background: #585858;
  font-weight: 800;
}

.composer-side-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.composer-source-section {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.composer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.composer-section-head h3 {
  font-size: 13px;
}

.composer-section-head span,
.composer-section-head button {
  min-height: 28px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 4px 9px;
  color: white;
  background: rgba(255,255,255,.08);
  font-size: 10px;
  font-weight: 800;
}

.composer-image-palette {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 430px;
  overflow: auto;
}

.composer-image-choice {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  padding: 7px;
  color: white;
  background: rgba(255,255,255,.07);
  cursor: grab;
  text-align: left;
  user-select: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.composer-image-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(106, 229, 255, .44);
  background: rgba(255,255,255,.11);
}

.composer-image-choice.is-dragging {
  cursor: grabbing;
  opacity: .72;
  transform: scale(.985);
}

.composer-image-choice .composer-preview-media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  pointer-events: none;
}

.composer-image-choice .composer-polygon-layer {
  position: absolute;
  inset: 0;
  display: block;
  overflow: visible;
  pointer-events: none;
}

.composer-image-choice .composer-report-marker {
  width: 12px;
  height: 12px;
  z-index: 2;
  pointer-events: none;
}

.composer-image-choice .composer-report-marker::before {
  width: 2px;
  height: 12px;
}

.composer-image-choice .composer-report-marker::after {
  width: 12px;
  height: 2px;
}

.composer-image-choice .composer-report-marker span {
  left: 9px;
  top: -7px;
  padding: 0;
  color: #00f08a;
  background: transparent;
  font-size: 8px;
  text-shadow: 0 1px 1px #fff, 0 -1px 1px #fff, 1px 0 1px #fff, -1px 0 1px #fff;
}

.composer-image-choice span {
  overflow: hidden;
  color: rgba(236, 243, 255, .78);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.composer-image-choice .composer-polygon-extreme > span {
  overflow: visible;
  color: white;
  font-size: 7px;
  font-weight: 900;
  text-overflow: clip;
}

.composer-sheet-wrap {
  overflow: auto;
  border: 1px solid #9fa7b3;
  border-radius: 0;
  background: #fff;
}

.composer-sheet {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  border: 1px solid #9fa7b3;
}

.composer-sheet th,
.composer-sheet td {
  min-width: 90px;
  height: 34px;
  border: 1px solid #b8c0cc;
  padding: 6px 8px;
  color: #1f2937;
  background: #fff;
  font-size: 11px;
  line-height: 1.3;
  outline: none;
}

.composer-sheet th {
  border-color: #aeb8c6;
  background: #eaf8fb;
  color: #111827;
  font-weight: 850;
}

.composer-sheet td:focus,
.composer-sheet th:focus {
  box-shadow: inset 0 0 0 2px #24b4d8;
}

.composer-sheet td.is-drop-target,
.composer-sheet th.is-drop-target {
  background: #edf9ff;
  box-shadow: inset 0 0 0 3px #24b4d8;
}

.composer-sheet-report-block {
  display: block;
  min-width: 260px;
  max-width: 520px;
  color: #172033;
}

.composer-sheet-report-block .composer-figure {
  margin: 0;
}

.composer-sheet-report-block .composer-annotated-image {
  max-width: 100%;
}

.composer-sheet-report-block .composer-figure img {
  width: 100%;
  max-height: 360px;
  border-radius: 2px;
}

.composer-sheet-report-block .composer-temperature-info h4 {
  font-size: 16px;
}

.composer-sheet-report-block .composer-temperature-info th,
.composer-sheet-report-block .composer-temperature-info td {
  border: 1px solid #b8c0cc;
  padding: 5px 6px;
  font-size: 11px;
}

.composer-sheet td:has(.composer-sheet-report-block) {
  min-width: 320px;
  height: auto;
  padding: 8px;
  background: white;
}

.standard-panel {
  display: grid;
  gap: 14px;
  margin: 16px 0 20px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255,255,255,.065);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}

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

.standard-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.standard-head h3 {
  margin: 0;
  color: white;
  font-size: 18px;
}

.standard-head span {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 6px 10px;
  color: rgba(240, 247, 255, .9);
  font-size: 12px;
  font-weight: 800;
}

.standard-panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 9px;
  padding: 7px 12px;
  color: white;
  background: rgba(13, 42, 112, .26);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.standard-panel-toggle:hover {
  background: rgba(255,255,255,.14);
}

.standard-panel-toggle:focus-visible {
  outline: 2px solid #6ae5ff;
  outline-offset: 2px;
}

.standard-panel-toggle b {
  width: 16px;
  font-size: 17px;
  line-height: 1;
}

.standard-panel-body {
  display: grid;
  gap: 14px;
}

.standard-panel-body[hidden] {
  display: none;
}

.standard-panel.is-collapsed {
  gap: 0;
}

.formula-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(106, 229, 255, .32);
  border-radius: 14px;
  padding: 16px;
  background: rgba(14, 35, 92, .22);
}

.formula-card strong {
  color: white;
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1.05;
}

.formula-card span,
.standard-subhead {
  color: rgba(234, 242, 255, .82);
  font-size: 13px;
  line-height: 1.45;
}

.threshold-list span {
  color: rgba(234, 242, 255, .78);
  font-size: 12px;
  line-height: 1.35;
}

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

.threshold-list strong {
  grid-column: 1 / -1;
  color: white;
  font-size: 13px;
}

.threshold-list span {
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 9px;
  background: rgba(255,255,255,.055);
}

.standard-assessment-results {
  display: grid;
  gap: 9px;
  border-top: 1px solid rgba(255,255,255,.14);
  padding-top: 12px;
}

.standard-assessment-results h4 {
  margin: 0;
  color: white;
  font-size: 13px;
}

.standard-assessment-results .assessment-counts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.standard-assessment-empty {
  margin: 0;
  color: rgba(240,247,255,.72);
  font-size: 12px;
  font-weight: 750;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .project-screen-head {
    grid-template-columns: 1fr;
  }

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

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

  .workspace:has([data-pane="composer"].is-active) {
    grid-template-columns: 1fr;
  }

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

  .composer-toolbar {
    grid-template-columns: 1fr;
  }

  .composer-toolbar-actions {
    justify-content: flex-start;
  }

  .control-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 18px, 1600px);
    margin: 9px auto;
  }

  .mode-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .metrics-grid,
  .batch-grid,
  .image-grid,
  .template-guide,
  .project-grid,
  .plant-grid,
  .history-overview,
  .threshold-list,
  .assessment-counts,
  .standard-assessment-results .assessment-counts {
    grid-template-columns: 1fr;
  }

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

  .batch-bulk-panel,
  .batch-bulk-row {
    grid-template-columns: 1fr;
  }

  .batch-bulk-toolbar summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .batch-bulk-toolbar summary strong,
  .batch-bulk-toolbar summary em {
    grid-column: 2;
  }

  .composer-project-gallery {
    max-height: 560px;
  }

  .composer-editor {
    min-height: 560px;
    padding: 22px;
  }

  .history-overview-grid {
    grid-template-columns: 1fr;
  }

  .result-header {
    display: grid;
  }

  .download-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .brand {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

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

  .standard-head-actions,
  .standard-panel-toggle {
    width: 100%;
  }

  .grid-two,
  .batch-previews,
  .batch-facts,
  .measurement-editor,
  .label-editor,
  .composer-action-grid,
  .composer-image-palette,
  .composer-project-previews,
  .composer-project-facts,
  .composer-project-metrics,
  .composer-polygon-summary,
  .polygon-editor,
  .polygon-result {
    grid-template-columns: 1fr;
  }

  .project-card-actions {
    grid-template-columns: 1fr 1fr;
  }

  .project-delete-action {
    grid-column: 1 / -1;
  }
}
