:root {
  --bg: radial-gradient(circle at 15% 10%, #f3f7ff 0, #dfe9f5 35%, #cad8e8 100%);
  --paper: #fdfdfd;
  --ink: #142033;
  --subtle: #52637a;
  --line: #c7d3e2;
  --accent: #0b7a75;
  --accent-2: #e69f00;
  --success: #0f7a3a;
  --danger: #b42b3d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #fdfefe, #eef6f8);
}

.topbar h1 {
  margin: 0;
  font-size: 1.45rem;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--subtle);
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px 20px 0;
}

.mode-tab {
  width: 100%;
  border: 1px solid #b9c8db;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  color: var(--ink);
  padding: 11px 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 3px 9px rgba(19, 38, 65, 0.08);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
  text-align: center;
}

.mode-tab:hover {
  border-color: #7f98b5;
  box-shadow: 0 5px 12px rgba(19, 38, 65, 0.14);
}

.mode-tab:focus-visible {
  outline: 2px solid #0d3b66;
  outline-offset: 2px;
}

.mode-tab.is-active {
  background: linear-gradient(180deg, #ffffff 0%, #f0f8ff 100%);
  border-color: #0d6d9f;
  color: #0d3b66;
  box-shadow: 0 7px 16px rgba(13, 59, 102, 0.18);
  transform: translateY(-1px);
}

.ghost {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.board-page {
  padding: 20px;
}

.tab-panel {
  display: grid;
  gap: 22px;
}

.tab-panel[hidden] {
  display: none !important;
}

.board-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.87);
  backdrop-filter: blur(4px);
}

.board-title {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.board-title h2 {
  margin: 0;
}

.board-title p {
  margin: 4px 0 0;
  color: var(--subtle);
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 12px;
}

.front-wafer-wrap {
  position: relative;
}

.front-wafer-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.wafer-create-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, auto));
  gap: 8px;
  align-items: end;
}

.wafer-create-form label {
  display: grid;
  gap: 4px;
  color: var(--subtle);
  font-size: 0.8rem;
}

.wafer-create-form input,
.wafer-create-form select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
  background: #fff;
}

.wafer-create-form button {
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), #117fbc);
  cursor: pointer;
  height: 36px;
}

.wafer-create-preview {
  border: 1px dashed #a4b7ca;
  border-radius: 8px;
  background: #f6faff;
  padding: 6px 8px;
  min-height: 36px;
}

.wafer-create-preview span {
  display: block;
  font-size: 0.72rem;
  color: var(--subtle);
}

.wafer-create-preview strong {
  display: block;
  font-size: 0.8rem;
  color: var(--ink);
}

.wafer-process-board {
  display: grid;
  gap: 12px;
  padding: 10px 12px 14px;
}

.stock-family-tables {
  display: grid;
  gap: 12px;
  padding: 10px 12px 14px;
}

.stock-family-block {
  border: 1px solid #c8d4e2;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--family-bg, #f8fbff), #ffffff);
  padding: 10px;
}

.stock-family-block h3 {
  margin: 0 0 8px;
  color: #1e4d73;
}

.stock-probe-table td {
  font-size: 0.82rem;
}

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

.settings-card {
  border: 1px solid #d1dbe7;
  border-radius: 12px;
  background: #f9fcff;
  padding: 10px;
}

.settings-card h3 {
  margin: 0 0 8px;
  color: #1e4c72;
}

.settings-inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.settings-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.settings-delete-selected-btn {
  padding: 5px 9px;
  font-size: 0.78rem;
}

.settings-inline-form input[type="text"] {
  border: 1px solid #b8cadd;
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  min-width: 120px;
}

.settings-inline-form button {
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), #117fbc);
  cursor: pointer;
}

.settings-inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--subtle);
  font-size: 0.8rem;
}

.settings-table td,
.settings-table th,
.settings-family-table td,
.settings-family-table th {
  text-align: center;
}

.settings-table td:nth-child(3),
.settings-table td:nth-child(4),
.settings-family-table td:nth-child(3) {
  text-align: left;
}

.settings-cell-input {
  width: 100%;
  border: 1px solid #b8cadd;
  border-radius: 6px;
  padding: 4px 6px;
  font: inherit;
  font-size: 0.8rem;
  background: #fff;
}

.settings-family-coating-wrap {
  overflow-x: auto;
}

.settings-family-probe-wrap {
  display: grid;
  gap: 12px;
}

.settings-family-table {
  table-layout: fixed;
  width: max-content;
  min-width: 0;
}

.settings-coating-head {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.settings-coating-head-label {
  white-space: normal;
  line-height: 1.05;
  font-size: 0.72rem;
  text-align: center;
}

.settings-coating-th {
  width: 78px;
  min-width: 78px;
  max-width: 78px;
}

.settings-coating-th.is-drop-target {
  outline: 2px dashed #4d84b3;
  outline-offset: -3px;
  background: #eaf4ff;
}

.settings-coating-handle {
  border: 1px solid #9fb9d3;
  background: #f3f8ff;
  color: #365978;
  border-radius: 6px;
  width: 34px;
  height: 24px;
  line-height: 1;
  cursor: grab;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0;
}

.settings-coating-handle:active {
  cursor: grabbing;
}

.settings-family-table th:nth-child(1),
.settings-family-table td:nth-child(1) {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
}

.settings-family-table th:nth-child(2),
.settings-family-table td:nth-child(2) {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  text-align: center;
}

.settings-family-table th:nth-child(3),
.settings-family-table td:nth-child(3) {
  width: 14ch;
  min-width: 14ch;
  max-width: 14ch;
}

.settings-family-table th:nth-child(4),
.settings-family-table td:nth-child(4) {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  text-align: center;
}

.settings-family-probe-table {
  table-layout: fixed;
  width: max-content;
  min-width: 0;
}

.settings-family-probe-table th:nth-child(1),
.settings-family-probe-table td:nth-child(1) {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
}

.settings-family-probe-table th:nth-child(2),
.settings-family-probe-table td:nth-child(2) {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  text-align: center;
}

.settings-family-probe-table th:nth-child(3),
.settings-family-probe-table td:nth-child(3) {
  width: 26ch;
  min-width: 26ch;
  max-width: 26ch;
}

.settings-family-probe-table th:nth-child(4),
.settings-family-probe-table td:nth-child(4) {
  width: 7ch;
  min-width: 7ch;
  max-width: 7ch;
  text-align: center;
}

.settings-family-probe-table th:nth-child(5),
.settings-family-probe-table td:nth-child(5) {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  text-align: center;
}

.settings-family-probe-table td:nth-child(3) .settings-cell-input,
.settings-family-probe-table td:nth-child(4) .settings-cell-input {
  min-width: 0;
}

.settings-family-order-handle {
  border: 1px solid #9fb9d3;
  background: #f3f8ff;
  color: #365978;
  border-radius: 6px;
  width: 34px;
  height: 24px;
  line-height: 1;
  cursor: grab;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0;
}

.settings-family-order-handle:active {
  cursor: grabbing;
}

.settings-probe-order-handle {
  border: 1px solid #9fb9d3;
  background: #f3f8ff;
  color: #365978;
  border-radius: 6px;
  width: 34px;
  height: 24px;
  line-height: 1;
  cursor: grab;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0;
}

.settings-probe-order-handle:active {
  cursor: grabbing;
}

.settings-probe-order-handle:disabled {
  cursor: default;
  opacity: 0.55;
}

.settings-family-code-input {
  width: 100%;
  min-width: 0;
}

.settings-family-color-input {
  width: 30px;
  height: 24px;
  padding: 1px;
  border: 1px solid #b8cadd;
  border-radius: 6px;
  background: #fff;
}

.settings-family-table tbody tr.is-drop-target {
  outline: 2px dashed #4d84b3;
  outline-offset: -3px;
}

.settings-family-probe-table tbody tr.is-drop-target {
  outline: 2px dashed #4d84b3;
  outline-offset: -3px;
}

.settings-family-table th:nth-child(n + 5),
.settings-family-table td:nth-child(n + 5) {
  width: 78px;
  min-width: 78px;
  max-width: 78px;
}

.settings-family-probe-table .coating-col-fixed {
  width: calc(18ch + 40px);
  min-width: calc(18ch + 40px);
  max-width: calc(18ch + 40px);
}

.settings-family-probe-table .coating-col-compact,
.settings-family-probe-table .coating-col-wide {
  width: 78px;
  min-width: 78px;
  max-width: 78px;
}

.settings-probe-name-cell {
  padding: 3px 4px;
}

.settings-cell-name-visibility {
  display: grid;
  grid-template-columns: 18ch 22px;
  gap: 6px;
  align-items: center;
}

.settings-probe-name-input {
  width: 18ch;
  min-width: 18ch;
  max-width: 18ch;
  font-family: "Space Grotesk", sans-serif;
}

.settings-cell-name-visibility.is-compact {
  grid-template-columns: 20px;
  justify-content: center;
}

.settings-cell-name-visibility.is-compact .settings-probe-name-input {
  display: none;
}

.wafer-history-table.settings-family-table,
.wafer-history-table.settings-family-probe-table {
  width: max-content;
  min-width: 0;
}

.settings-family-probe-block {
  border: 1px solid #c9d6e6;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--family-bg, #f6faff), #ffffff);
  padding: 10px;
}

.settings-family-probe-block h4 {
  margin: 0 0 8px;
  color: #1e4d73;
}

.wafer-lane {
  border: 1px solid #c8d4e2;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--family-bg, #f8fbff), #ffffff);
  overflow: hidden;
}

.wafer-lane-head {
  padding: 8px 10px;
  border-bottom: 1px solid #c8d4e2;
  background: #eef5ff;
}

.wafer-lane-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #0d3b66;
}

.wafer-lane-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(200px, 1fr));
  gap: 10px;
  padding: 10px;
  overflow-x: auto;
}

.wafer-column {
  border: 1px solid #d0dae7;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.wafer-column-title {
  font-weight: 700;
  color: #0d3b66;
}

.wafer-column-note {
  border: 1px dashed #b5c5d7;
  border-radius: 8px;
  padding: 5px 7px;
  font-size: 0.8rem;
  background: #f7fbff;
}

.wafer-column-note:disabled {
  color: #6d8094;
  background: #eff4f8;
}

.wafer-column-zones {
  display: grid;
  gap: 6px;
}

.wafer-zone-group {
  display: grid;
  gap: 6px;
}

.wafer-column[data-column-key="step6"] .wafer-zone-group[data-temp],
.wafer-column[data-column-key="coating"] .wafer-zone-group[data-temp] {
  align-content: start;
}

.wafer-column-zones .wafer-zone-group + .wafer-zone-group {
  border-top: 1px dashed #c6d3e1;
  padding-top: 6px;
}

.wafer-zone-group-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #365877;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.wafer-zone-group[data-temp="950"] .wafer-zone-group-title,
.wafer-zone-group[data-temp="1100"] .wafer-zone-group-title {
  color: #1f557d;
}

.wafer-zone {
  border: 1px dashed #b8c8d9;
  border-radius: 8px;
  background: #f9fcff;
}

.wafer-zone.wafer-zone-coating {
  border: 2px solid var(--coating-accent, #b8c8d9);
  background: linear-gradient(180deg, var(--coating-tint, rgba(184, 200, 217, 0.12)), #ffffff);
}

.wafer-zone-title {
  padding: 5px 7px;
  border-bottom: 1px dashed #b8c8d9;
  font-size: 0.77rem;
  color: #46617e;
  font-weight: 700;
}

.wafer-zone.wafer-zone-coating .wafer-zone-title {
  border-bottom-color: var(--coating-accent, #b8c8d9);
}

.wafer-zone-body {
  min-height: 58px;
  padding: 6px;
}

.wafer-zone-body.is-drag-over {
  background: #ebf8f2;
  outline: 2px solid #74b88d;
  outline-offset: -2px;
}

.wafer-card {
  position: relative;
}

.wafer-card .meta {
  color: #20364f;
  font-weight: 700;
}

.wafer-card-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: 1px solid #d6919c;
  border-radius: 50%;
  background: #fff0f3;
  color: #8f1e33;
  font-size: 0.68rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.side-tab-switch {
  position: fixed;
  right: 0;
  top: 150px;
  bottom: 20px;
  width: 36px;
  border: 1px solid #7da9c8;
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, #f6fbff, #dcefff);
  color: #0d3b66;
  font-weight: 700;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: -3px 4px 10px rgba(16, 43, 66, 0.18);
  z-index: 20;
}

.side-tab-switch:hover {
  background: linear-gradient(180deg, #ffffff, #d2e7fb);
}

.column {
  border: 1px dashed #adbfd4;
  border-radius: 12px;
  min-height: 180px;
  background: #f7fafc;
}

.column-head {
  padding: 8px 10px;
  border-bottom: 1px dashed #adbfd4;
  font-weight: 700;
  font-size: 0.9rem;
}

.column-body {
  min-height: 120px;
  padding: 8px;
}

.card {
  border: 1px solid #c4d1df;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 4px 10px rgba(22, 32, 47, 0.08);
  padding: 10px;
  margin-bottom: 8px;
  cursor: grab;
}

.card strong {
  display: block;
  margin-bottom: 4px;
}

.card .meta {
  color: var(--subtle);
  font-size: 0.84rem;
}

.card[data-board-type="holder"] {
  border-left: 6px solid var(--holder-type-color, #7f93ab);
}

.card[data-board-type="holder"] .meta {
  color: var(--holder-type-color, #4a6078);
  font-weight: 700;
}

.card-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.card-add-stock {
  border: 1px solid #97cfaa;
  border-radius: 8px;
  background: #ebfbf0;
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
}

.card-delete {
  border: 1px solid #d9939d;
  border-radius: 8px;
  background: #fff0f3;
  color: #a62940;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
}

.column.drag-over {
  background: #eefaf7;
  border-color: var(--accent);
}

.holder-form-wrap .board-title {
  border-bottom: 0;
}

.holder-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 16px 14px;
}

.holder-summary-card {
  border: 1px solid var(--line);
  border-left: 6px solid var(--holder-type-color, #7f93ab);
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px 12px;
}

.holder-summary-card h3 {
  margin: 0 0 8px;
  color: var(--holder-type-color, #4a6078);
  font-size: 0.95rem;
}

.holder-summary-card p {
  margin: 4px 0;
  color: var(--subtle);
  font-size: 0.86rem;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-edit {
  border: 1px solid #87abc7;
  border-radius: 8px;
  background: #f4f9ff;
  color: #1f4f76;
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  margin-left: 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.wafer-stock-summary-card {
  border-left-color: var(--accent);
  background: #eefaf7;
}

.wafer-stock-summary-card h3 {
  color: var(--accent);
}

.wafer-stock-value {
  font-size: 1.2rem;
  color: var(--ink);
}

.wafer-stock-edit {
  border-color: #87abc7;
}

.wafer-stock-row {
  margin-bottom: 6px !important;
}

.holder-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 16px 14px;
}

.holder-form label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--subtle);
}

.holder-form input,
.holder-form select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.holder-form button {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), #117fbc);
  cursor: pointer;
  align-self: end;
}

.form-msg {
  min-height: 1.2rem;
  margin: 0;
  padding: 0 16px 2px;
  font-size: 0.85rem;
  color: var(--subtle);
}

.form-msg[data-status="success"] {
  color: #0f6f35;
}

.form-msg[data-status="error"] {
  color: var(--danger);
}

.muted-line {
  margin: 0;
  padding: 0 16px 14px;
  color: var(--subtle);
  font-size: 0.85rem;
}

.backend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 12px;
}

.backend-stack {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.backend-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
}

.backend-card h3 {
  margin: 0 0 6px;
}

.backend-card p {
  margin: 0;
  color: var(--subtle);
}

.backend-card .muted-line {
  padding: 0;
  margin: 0 0 8px;
}

.backend-card .settings-inline-form {
  margin-top: 8px;
}

.backend-table-compact {
  font-size: 0.8rem;
}

.backend-table-compact th,
.backend-table-compact td {
  padding: 6px;
  vertical-align: middle;
}

.backend-plate-block {
  border: 1px solid #cdd8e6;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px;
  margin-top: 8px;
}

.backend-plate-block h4 {
  margin: 0 0 8px;
  color: #1f4f76;
}

.backend-line-source,
.backend-line-holder {
  width: 100%;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  font: inherit;
  font-size: 0.8rem;
  background: #fff;
}

.backend-line-holder-qty {
  max-width: 72px;
}

.backend-meb-line + .backend-meb-line {
  margin-top: 8px;
}

.backend-meb-line-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #244a69;
  margin-bottom: 4px;
}

.backend-meb-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(44px, 1fr));
  gap: 4px;
}

.backend-meb-pos {
  border: 1px solid #a6bbcf;
  border-radius: 6px;
  background: #f6fbff;
  color: #1f4f76;
  padding: 4px 6px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.backend-meb-pos.is-rejected {
  border-color: #d27b88;
  background: #ffecef;
  color: #99263a;
}

.wafer-history-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wafer-history-title p {
  margin: 4px 0 0;
  color: var(--subtle);
}

.wafer-history-toggle {
  white-space: nowrap;
}

.wafer-history-content {
  padding: 10px 12px 12px;
}

.wafer-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.wafer-history-table th,
.wafer-history-table td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
}

.wafer-history-table th {
  background: #eef5ff;
  color: #1f4f76;
  font-weight: 700;
}

.wafer-history-table tbody tr:nth-child(even) {
  background: #f8fbff;
}

.wafer-history-empty td {
  color: var(--subtle);
  text-align: center;
}

.history-action-head {
  width: 120px;
  text-align: right;
}

.history-action-cell {
  text-align: right;
  width: 120px;
}

.holder-history-delete {
  padding: 4px 7px;
  font-size: 0.76rem;
}

.wafer-history-wrap.is-collapsed .wafer-history-content {
  display: none;
}

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

.login-card {
  width: 100%;
  max-width: 430px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffffea;
  backdrop-filter: blur(4px);
  padding: 24px;
}

.login-card h1 {
  margin: 0;
}

.login-card p {
  color: var(--subtle);
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 6px;
  font-size: 0.93rem;
  color: var(--subtle);
}

.login-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.login-form button {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), #117fbc);
  cursor: pointer;
}

.alert {
  border: 1px solid #e5a1ab;
  background: #ffeef2;
  color: var(--danger);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
}

@media (max-width: 760px) {
  .mode-tabs {
    grid-template-columns: 1fr;
    padding: 12px 12px 0;
  }

  .board-page {
    padding: 12px;
  }
}

@media (max-width: 820px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-tabs {
    padding-left: 12px;
    padding-right: 12px;
  }

  .board-page {
    padding: 12px;
  }

  .holder-form {
    grid-template-columns: 1fr;
  }

  .wafer-history-title {
    flex-direction: column;
    align-items: stretch;
  }

  .front-wafer-title {
    flex-direction: column;
    align-items: stretch;
  }

  .wafer-create-form {
    grid-template-columns: 1fr;
  }

  .wafer-lane-grid {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .settings-inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .backend-line-source,
  .backend-line-holder {
    min-width: 0;
  }

  .side-tab-switch {
    position: static;
    width: auto;
    writing-mode: horizontal-tb;
    transform: none;
    border-right: 1px solid #7da9c8;
    border-radius: 10px;
    margin: 0 12px 12px auto;
    padding: 8px 10px;
    height: auto;
  }
}
