:root {
  --ink: #17343d;
  --ink-soft: #58727a;
  --forest: #103f4b;
  --forest-2: #176878;
  --mint: #dceff0;
  --mint-strong: #87c5c8;
  --cream: #f3f2e9;
  --paper: #fffef9;
  --white: #ffffff;
  --coral: #f07a45;
  --amber: #e7b153;
  --sky: #7fb7c7;
  --line: #d9e5e4;
  --danger: #b84e3b;
  --shadow: 0 18px 45px rgba(15, 63, 75, 0.11);
  --shadow-soft: 0 8px 24px rgba(15, 63, 75, 0.07);
  font-family:
    "Noto Sans Thai", "Leelawadee UI", "Tahoma", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--cream);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--ink-soft);
}

.eyebrow {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.eyebrow--green {
  color: #4b8576;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px 12px 12px 4px;
  background: var(--mint);
  color: var(--forest);
  font-family: Georgia, serif;
  font-size: 0.9rem;
  font-weight: 800;
}

.brand-mark svg {
  width: 27px;
  fill: currentColor;
}

.brand-mark svg circle {
  fill: var(--coral);
}

.brand--light .brand-mark {
  background: rgba(255, 255, 255, 0.12);
  color: #f7b16d;
}

.brand > span:last-child {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand small {
  color: #78918d;
  font-size: 0.67rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand--light strong {
  color: white;
}

.brand--light small {
  color: rgba(255, 255, 255, 0.54);
}

.login-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 1.1fr) minmax(420px, 0.9fr);
}

.login-story {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(30px, 5vw, 72px);
  background:
    radial-gradient(circle at 72% 24%, rgba(88, 174, 184, 0.18), transparent 28%),
    linear-gradient(145deg, #0b3440 0%, var(--forest) 50%, #155b68 100%);
  isolation: isolate;
}

.login-story::before {
  position: absolute;
  z-index: -1;
  top: 12%;
  left: 54%;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(220, 239, 240, 0.13);
  box-shadow:
    0 0 0 46px rgba(220, 239, 240, 0.025),
    0 0 0 92px rgba(220, 239, 240, 0.018);
  border-radius: 50%;
  content: "";
}

.login-story::after {
  position: absolute;
  z-index: -1;
  right: -110px;
  bottom: -160px;
  width: 470px;
  height: 470px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 0%, transparent 0 31px, rgba(255, 255, 255, 0.035) 32px 33px),
    #175664;
  content: "";
}

.login-story__copy {
  position: relative;
  z-index: 2;
  max-width: 590px;
  margin: auto 0;
}

.login-story h1 {
  max-width: 560px;
  margin: 0;
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 5.1vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.login-story__copy > p:last-child {
  max-width: 510px;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
  line-height: 1.85;
}

.login-story__foot {
  z-index: 2;
  margin: 0;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-orbit {
  position: absolute;
  right: -5%;
  bottom: 8%;
  width: 330px;
  height: 330px;
  opacity: 0.94;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(220, 239, 240, 0.2);
  border-radius: 50%;
  inset: 0;
}

.orbit--two {
  inset: 48px;
  border-style: dashed;
}

.medaka-hero {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  transform: translate(-52%, -50%) rotate(-4deg);
  filter: drop-shadow(0 14px 16px rgba(4, 30, 36, 0.25));
  animation: medaka-swim 5.5s ease-in-out infinite;
}

.medaka-body {
  fill: #f38a4e;
}

.medaka-belly {
  fill: #ffc28c;
  opacity: 0.82;
}

.medaka-tail,
.medaka-fin {
  fill: #f2ad6f;
  opacity: 0.82;
}

.medaka-eye-ring {
  fill: #f8d2a4;
}

.medaka-eye {
  fill: #132e35;
}

.medaka-eye-glint {
  fill: white;
}

.medaka-gill,
.medaka-scales,
.medaka-lateral {
  fill: none;
  stroke: rgba(111, 54, 35, 0.38);
  stroke-linecap: round;
}

.medaka-gill {
  stroke-width: 3;
}

.medaka-scales {
  stroke-width: 2;
}

.medaka-lateral {
  stroke: rgba(255, 244, 219, 0.62);
  stroke-width: 2;
}

.water-bubble {
  position: absolute;
  border: 1px solid rgba(220, 239, 240, 0.4);
  border-radius: 50%;
  animation: bubble-rise 4.8s ease-in-out infinite;
}

.water-bubble--one {
  top: 56px;
  left: 58px;
  width: 12px;
  height: 12px;
}

.water-bubble--two {
  top: 34px;
  left: 87px;
  width: 7px;
  height: 7px;
  animation-delay: -1.8s;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 42px;
  background: var(--paper);
}

.login-card {
  width: min(100%, 410px);
}

.login-card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.7rem;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.login-card > .muted {
  margin: 8px 0 34px;
  font-size: 0.9rem;
}

.login-card__mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  color: var(--ink);
  font-size: 0.79rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 52px;
  border: 1px solid #ccd9d3;
  border-radius: 10px;
  outline: none;
  padding: 0 15px;
  background: white;
  color: var(--ink);
  transition: border-color 160ms, box-shadow 160ms;
}

.field input:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 4px rgba(30, 90, 84, 0.1);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 750;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.button--primary {
  background: var(--forest);
  color: white;
}

.button--primary:hover {
  background: #0c302e;
}

.button--wide {
  width: 100%;
  margin-top: 9px;
}

.form-error {
  min-height: 20px;
  margin: 4px 0;
  color: var(--danger);
  font-size: 0.78rem;
}

.login-help {
  margin: 25px 0 0;
  color: #7d918e;
  font-size: 0.75rem;
  text-align: center;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 242px minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 242px;
  flex-direction: column;
  padding: 24px 17px 18px;
  border-right: 1px solid #d8e1dc;
  background: #f9f7f0;
}

.sidebar .brand {
  padding: 0 8px 23px;
}

.nav {
  overflow-y: auto;
  padding-right: 4px;
}

.nav-label {
  margin: 22px 10px 8px;
  color: #8da09d;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  width: 100%;
  height: 40px;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 9px;
  padding: 0 11px;
  background: transparent;
  color: #52706c;
  cursor: pointer;
  font-size: 0.82rem;
  text-align: left;
}

.nav-item:hover {
  background: #edf0e9;
  color: var(--ink);
}

.nav-item.is-active {
  background: var(--forest);
  color: white;
  box-shadow: 0 8px 18px rgba(18, 61, 58, 0.18);
}

.nav-item svg,
.icon-button svg,
.global-search svg,
.user-chip svg,
.user-popover svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 18px 8px 0;
}

.sidebar-footer div {
  display: grid;
}

.sidebar-footer strong {
  font-size: 0.7rem;
}

.sidebar-footer small {
  color: #81938f;
  font-size: 0.64rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ea574;
  box-shadow: 0 0 0 5px rgba(62, 165, 116, 0.12);
}

.workspace {
  position: relative;
  min-width: 0;
  grid-column: 2;
  background:
    radial-gradient(circle at 91% 9%, rgba(127, 183, 199, 0.12), transparent 21rem),
    var(--cream);
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #d8e1dc;
  padding: 14px clamp(22px, 3vw, 46px);
  background: rgba(243, 242, 233, 0.93);
  backdrop-filter: blur(12px);
}

.topbar-title h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.topbar-title .eyebrow {
  margin-bottom: 1px;
  font-size: 0.57rem;
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
}

.global-search {
  display: flex;
  width: min(28vw, 300px);
  height: 40px;
  align-items: center;
  gap: 9px;
  border: 1px solid #d5ddd9;
  border-radius: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.7);
  color: #8ba09c;
}

.global-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.78rem;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #d5ddd9;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.icon-button:hover {
  background: white;
}

.icon-button.is-spinning svg {
  animation: spin 700ms linear infinite;
}

.user-chip {
  display: flex;
  height: 43px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-left: 1px solid #d5ddd9;
  padding: 0 0 0 13px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.user-chip > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #d7a452;
  color: white;
  font-family: Georgia, serif;
  font-size: 0.75rem;
}

.user-chip > span:nth-child(2) {
  display: grid;
  min-width: 90px;
}

.user-chip strong {
  overflow: hidden;
  max-width: 150px;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  color: #78908d;
  font-size: 0.59rem;
  letter-spacing: 0.05em;
}

.user-popover {
  position: absolute;
  top: 52px;
  right: 0;
  width: 235px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: white;
  box-shadow: var(--shadow);
}

.user-popover p {
  overflow: hidden;
  margin: 5px 7px 12px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-overflow: ellipsis;
}

.user-popover button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  padding: 9px;
  background: #f7eee9;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.76rem;
}

.content {
  width: min(100%, 1600px);
  min-height: calc(100vh - 88px);
  margin: 0 auto;
  padding: clamp(22px, 3vw, 42px) clamp(22px, 3vw, 46px) 55px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 19px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.date-pill,
.outline-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  border: 1px solid #cfdbd5;
  border-radius: 9px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.7);
  color: #55716d;
  font-size: 0.7rem;
  font-weight: 700;
}

.outline-button {
  cursor: pointer;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.kpi-card::before {
  position: absolute;
  top: 0;
  right: 20px;
  left: 20px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--coral);
  content: "";
  opacity: 0.78;
}

.kpi-card:nth-child(2)::before {
  background: var(--sky);
}

.kpi-card:nth-child(3)::before {
  background: var(--amber);
}

.kpi-card:nth-child(4)::before {
  background: var(--ink);
}

.kpi-card::after {
  position: absolute;
  right: -20px;
  bottom: -27px;
  width: 86px;
  height: 86px;
  border: 18px solid rgba(16, 63, 75, 0.045);
  border-radius: 50%;
  content: "";
}

.kpi-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #69817d;
  font-size: 0.72rem;
  font-weight: 700;
}

.kpi-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: var(--mint);
  color: var(--forest);
}

.kpi-icon svg {
  width: 17px;
}

.kpi-card__value {
  margin: 17px 0 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.15rem;
  line-height: 1;
}

.kpi-card__note {
  color: #81938f;
  font-size: 0.65rem;
}

.dashboard-grid {
  display: grid;
  margin-top: 15px;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.75fr);
  gap: 15px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.panel-header {
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e4e9e5;
  padding: 14px 19px;
}

.panel-header h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 600;
}

.panel-header p {
  margin: 3px 0 0;
  color: #80928f;
  font-size: 0.64rem;
}

.text-button {
  border: 0;
  background: transparent;
  color: #397466;
  cursor: pointer;
  font-size: 0.67rem;
  font-weight: 800;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding: 21px 18px 25px;
}

.workflow-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.workflow-step:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 17px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 1px;
  background: #cedbd5;
  content: "";
}

.workflow-step__dot {
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #c7d8d0;
  border-radius: 50%;
  background: white;
  color: #66827d;
  font-size: 0.65rem;
  font-weight: 800;
}

.workflow-step.is-complete .workflow-step__dot {
  border-color: var(--forest-2);
  background: var(--forest-2);
  color: white;
}

.workflow-step.is-current .workflow-step__dot {
  border: 5px solid var(--mint);
  background: var(--coral);
  color: white;
  box-shadow: 0 0 0 1px var(--coral);
}

.workflow-step strong {
  font-size: 0.66rem;
}

.workflow-step small {
  color: #839592;
  font-size: 0.58rem;
}

.health-card {
  display: grid;
  min-height: 100%;
  align-content: start;
  padding: 21px;
}

.health-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.health-card__top h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1rem;
}

.health-badge {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--mint);
  color: #277458;
  font-size: 0.59rem;
  font-weight: 800;
}

.health-ring {
  position: relative;
  display: grid;
  width: 134px;
  height: 134px;
  place-items: center;
  margin: 24px auto 18px;
  border-radius: 50%;
  background: conic-gradient(var(--forest-2) var(--health-progress, 0%), #e3e9e5 0);
}

.health-ring::before {
  position: absolute;
  border-radius: 50%;
  background: var(--paper);
  content: "";
  inset: 11px;
}

.health-ring__value {
  z-index: 1;
  display: grid;
  text-align: center;
}

.health-ring strong {
  font-family: Georgia, serif;
  font-size: 1.65rem;
  font-weight: 500;
}

.health-ring small {
  color: #829490;
  font-size: 0.58rem;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.mini-stat {
  border-radius: 9px;
  padding: 10px 7px;
  background: #f0f2ed;
  text-align: center;
}

.mini-stat strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 1rem;
}

.mini-stat small {
  color: #81928f;
  font-size: 0.56rem;
}

.tables-grid {
  display: grid;
  margin-top: 15px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.sgi-panel {
  grid-column: 1 / -1;
  overflow: hidden;
}

.sgi-panel .panel-header {
  background:
    linear-gradient(90deg, rgba(220, 239, 240, 0.72), transparent 68%),
    var(--paper);
}

.sgi-score {
  color: var(--coral);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  border-bottom: 1px solid #e4e9e5;
  padding: 10px 18px;
  color: #81928f;
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  border-bottom: 1px solid #edf0ed;
  padding: 12px 18px;
  font-size: 0.7rem;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fafaf6;
}

.record-code {
  color: var(--forest-2);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #e8eeea;
  color: #5b736f;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.badge--green {
  background: var(--mint);
  color: #267157;
}

.badge--coral {
  background: #f7e4de;
  color: #ad533d;
}

.badge--amber {
  background: #f7edd4;
  color: #9a6c1c;
}

.badge--blue {
  background: #e2eff2;
  color: #467986;
}

.record-view .panel {
  overflow: hidden;
}

.record-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.operation-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(9, 45, 54, 0.28);
}

.operation-dialog::backdrop {
  background: rgba(8, 37, 44, 0.58);
  backdrop-filter: blur(4px);
}

.line-detail-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  border: 0;
  border-radius: 22px;
  padding: 0;
  overflow: hidden auto;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(9, 45, 54, 0.3);
}

.line-detail-dialog::backdrop {
  background: rgba(8, 37, 44, 0.64);
  backdrop-filter: blur(5px);
}

.line-detail-dialog > article {
  padding: 25px;
}

.line-detail-dialog .dialog-header {
  margin-bottom: 18px;
}

.line-detail-dialog .dialog-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 500;
}

.image-zoom-button {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 50%;
  padding: 0;
  background: rgba(5, 38, 44, 0.76);
  color: white;
  box-shadow: 0 6px 16px rgba(3, 24, 29, 0.22);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 160ms ease, background 160ms ease;
}

.image-zoom-button svg {
  width: 17px;
  height: 17px;
}

.image-zoom-button:hover {
  transform: scale(1.08);
  background: rgba(195, 105, 72, 0.92);
}

.image-zoom-button:focus-visible {
  outline: 3px solid rgba(255, 184, 143, 0.7);
  outline-offset: 2px;
}

.fish-view .image-zoom-button {
  top: 7px;
  right: 7px;
  width: 29px;
  height: 29px;
}

.fish-view .image-zoom-button svg {
  width: 14px;
  height: 14px;
}

.image-lightbox {
  width: min(1180px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100vh - 28px);
  border: 0;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  background: #071f25;
  box-shadow: 0 34px 100px rgba(0, 15, 20, 0.58);
}

.image-lightbox::backdrop {
  background: rgba(2, 17, 22, 0.86);
  backdrop-filter: blur(9px);
}

.image-lightbox > article {
  position: relative;
  min-height: min(78vh, 760px);
}

.image-lightbox figure {
  position: relative;
  display: grid;
  min-height: min(78vh, 760px);
  margin: 0;
  place-items: center;
}

.image-lightbox img {
  display: block;
  width: 100%;
  height: min(78vh, 760px);
  object-fit: contain;
}

.image-lightbox figcaption {
  position: absolute;
  right: 70px;
  bottom: 18px;
  left: 22px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.7rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.image-lightbox__close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 50%;
  background: rgba(5, 38, 44, 0.78);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  backdrop-filter: blur(7px);
}

.image-lightbox__close:hover {
  background: var(--coral);
}

.line-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  gap: 22px;
}

.line-detail-photo {
  position: relative;
  min-height: 350px;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #0b333a;
}

.line-detail-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 350px;
  object-fit: cover;
}

.line-detail-photo::after {
  position: absolute;
  background: linear-gradient(180deg, transparent 55%, rgba(4, 28, 32, 0.72));
  content: "";
  inset: 0;
  pointer-events: none;
}

.line-detail-photo figcaption {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 15px;
  left: 18px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.66rem;
}

.line-detail-summary {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 25px;
  background:
    radial-gradient(circle at top right, rgba(94, 174, 171, 0.16), transparent 42%),
    white;
}

.line-detail-summary h3 {
  margin: 14px 0 9px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  font-weight: 500;
  line-height: 1.05;
}

.line-detail-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.7;
}

.line-detail-stats {
  display: grid;
  margin-top: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.line-detail-stats span {
  display: grid;
  min-width: 0;
  border-radius: 10px;
  padding: 12px 8px;
  background: var(--mist);
  text-align: center;
}

.line-detail-stats strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 500;
}

.line-detail-stats small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.55rem;
}

.line-traits {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  background: white;
}

.line-traits ul {
  display: grid;
  margin: 18px 0 0;
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
}

.line-traits li {
  position: relative;
  border-radius: 10px;
  padding: 13px 13px 13px 34px;
  background: #f2f7f5;
  color: var(--ink);
  font-size: 0.68rem;
  line-height: 1.55;
}

.line-traits li::before {
  position: absolute;
  top: 15px;
  left: 14px;
  width: 9px;
  height: 9px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 1px rgba(195, 105, 72, 0.25);
  content: "";
}

.line-detail-meta {
  display: flex;
  align-items: center;
  margin-top: 18px;
  gap: 10px;
  color: var(--muted);
  font-size: 0.58rem;
}

.line-detail-meta code {
  overflow: hidden;
  color: var(--forest-2);
  text-overflow: ellipsis;
}

.line-detail-meta span:last-child {
  margin-left: auto;
}

.family-detail-dialog {
  width: min(1040px, calc(100vw - 32px));
}

.family-detail-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: 20px;
}

.family-detail-photo {
  position: relative;
  min-height: 310px;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #0b333a;
}

.family-detail-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 310px;
  object-fit: cover;
}

.family-detail-photo::after {
  position: absolute;
  background: linear-gradient(180deg, transparent 50%, rgba(4, 28, 32, 0.78));
  content: "";
  inset: 0;
  pointer-events: none;
}

.family-detail-photo figcaption {
  position: absolute;
  z-index: 1;
  right: 17px;
  bottom: 14px;
  left: 17px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.64rem;
}

.family-detail-summary {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 25px;
  background:
    radial-gradient(circle at top right, rgba(215, 160, 57, 0.16), transparent 38%),
    white;
}

.family-detail-path {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 8px;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 700;
}

.family-detail-path span {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--mist);
  color: var(--forest-2);
}

.family-detail-path b {
  color: var(--coral);
}

.family-detail-summary h3 {
  margin: 13px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 500;
  line-height: 1.08;
}

.family-detail-summary > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.7;
}

.family-detail-stats {
  display: grid;
  margin-top: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.family-detail-stats span {
  display: grid;
  border-radius: 10px;
  padding: 12px 7px;
  background: var(--mist);
  text-align: center;
}

.family-detail-stats strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  font-weight: 500;
}

.family-detail-stats small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.54rem;
}

.family-parentage,
.family-history,
.family-fish-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  background: white;
}

.fish-top-view-grid {
  display: grid;
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.fish-top-view-grid--line {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fish-view-pair {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.fish-top-view-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fbfdfc;
  box-shadow: 0 10px 24px rgba(12, 58, 63, 0.06);
}

.fish-top-view-card figure {
  position: relative;
  aspect-ratio: 3 / 2;
  margin: 0;
  overflow: hidden;
  background: #102f3b;
}

.fish-top-view-card figure::after {
  position: absolute;
  background: linear-gradient(180deg, transparent 55%, rgba(3, 24, 31, 0.78));
  content: "";
  inset: 0;
  pointer-events: none;
}

.fish-top-view-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.fish-top-view-card:hover img {
  transform: scale(1.025);
}

.fish-top-view-card figcaption {
  position: absolute;
  z-index: 1;
  right: 11px;
  bottom: 9px;
  left: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.52rem;
}

.fish-top-view-card figcaption span {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 4px 7px;
  color: white;
  font-size: 0.46rem;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.fish-top-view-card .fish-view-pair figcaption {
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
}

.fish-top-view-card__body {
  padding: 13px;
}

.fish-top-view-card__body > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fish-top-view-card__metrics {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.fish-top-view-card__metrics > span {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 5px;
}

.fish-top-view-card__metrics small {
  color: var(--muted);
  font-size: 0.48rem;
}

.fish-top-view-card__metrics strong {
  overflow: hidden;
  color: var(--forest-2);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fish-detail-link {
  width: 100%;
  margin-top: 12px;
  border: 1px solid #c8dcd6;
  border-radius: 9px;
  padding: 8px 10px;
  background: white;
  color: var(--forest-2);
  cursor: pointer;
  font: inherit;
  font-size: 0.55rem;
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease;
}

.fish-detail-link:hover {
  border-color: var(--forest);
  background: var(--mist);
}

.passport-management { margin-top: 18px; }
.passport-qr-preview { width: 160px; margin: 14px 0; border: 1px solid #d7e7e2; border-radius: 14px; padding: 8px; background: white; }
.passport-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.passport-actions .fish-detail-link { width: auto; min-width: 180px; }
.passport-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.passport-danger { border-color: #e4b8b8; color: #9b3030; }
.certificate-version-list { display: grid; gap: 8px; margin-top: 16px; }
.certificate-version-list > div { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid #d7e7e2; border-radius: 10px; }
.certificate-version-list span { display: grid; }
.certificate-version-list small { color: var(--muted); }
.certificate-version-list code { font-size: .55rem; }
.certificate-version-list button { border: 1px solid #e4b8b8; border-radius: 8px; padding: 6px 8px; background: white; color: #9b3030; cursor: pointer; }
.passport-expansion-management { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.passport-expansion-management > div { min-width: 0; }
.passport-expansion-management h4 { margin: 0 0 10px; }
.passport-expansion-record { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid #d7e7e2; }
.passport-expansion-record:has(img) { grid-template-columns: 58px minmax(0, 1fr) auto; }
.passport-expansion-record img { width: 58px; height: 44px; object-fit: cover; border-radius: 8px; }
.passport-expansion-record div { display: grid; gap: 2px; min-width: 0; }
.passport-expansion-record small { color: var(--muted); overflow-wrap: anywhere; }
.passport-expansion-record .private-health { color: #8a5c33; }
.passport-expansion-record button { border: 1px solid #9ccabb; border-radius: 8px; padding: 6px 8px; background: white; cursor: pointer; }
.passport-expansion-management form { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #b8d5cc; }
.passport-expansion-management form input, .passport-expansion-management form select, .passport-expansion-management form textarea { width: 100%; border: 1px solid #c8d9d4; border-radius: 8px; padding: 9px; font: inherit; }
.passport-expansion-management form button { border: 0; border-radius: 9px; padding: 10px; background: var(--primary); color: white; cursor: pointer; }
@media (max-width: 980px) { .passport-expansion-management { grid-template-columns: 1fr; } }

.record-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(18, 85, 77, 0.28);
  text-underline-offset: 3px;
}

.record-link:hover {
  color: var(--coral);
  text-decoration-color: currentColor;
}

.fish-detail-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.fish-detail-hero {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  background: white;
}

.fish-detail-visuals {
  min-width: 0;
  background: #12383f;
}

.fish-detail-visuals .fish-view-pair {
  height: 100%;
}

.fish-detail-visuals figure {
  position: relative;
  min-height: 310px;
  margin: 0;
  overflow: hidden;
  background: #102f3b;
}

.fish-detail-visuals img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 310px;
  object-fit: cover;
}

.fish-detail-visuals figcaption {
  position: absolute;
  z-index: 1;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(7, 41, 45, 0.76);
  color: white;
  font-size: 0.53rem;
}

.fish-detail-visuals figcaption span {
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.fish-detail-summary {
  display: flex;
  min-width: 0;
  padding: 26px;
  flex-direction: column;
  justify-content: center;
}

.fish-detail-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.fish-detail-summary h3 {
  margin: 18px 0 7px;
  color: var(--forest-2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

.fish-detail-summary > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

.fish-detail-kpis {
  display: grid;
  margin-top: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fish-detail-kpis > span {
  display: grid;
  min-height: 66px;
  align-content: center;
  border-radius: 11px;
  padding: 9px;
  gap: 5px;
  background: var(--mist);
  text-align: center;
}

.fish-detail-kpis small,
.fish-grading-components small {
  color: var(--muted);
  font-size: 0.5rem;
}

.fish-detail-kpis strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
}

.fish-detail-kpis .badge {
  justify-self: center;
}

.fish-detail-grid {
  display: grid;
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.fish-detail-panel,
.fish-detail-pedigree {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  background: white;
}

.fish-detail-pedigree {
  margin-top: 18px;
}

.fish-detail-facts {
  display: grid;
  margin: 16px 0 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.fish-detail-facts > div {
  min-width: 0;
  padding: 11px 12px;
  background: #fbfdfc;
}

.fish-detail-facts dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.5rem;
}

.fish-detail-facts dd {
  margin: 0;
  overflow: hidden;
  color: var(--forest-2);
  font-size: 0.62rem;
  font-weight: 700;
  text-overflow: ellipsis;
}

.fish-detail-facts code {
  font-size: 0.5rem;
}

.fish-detail-notes {
  margin-top: 14px;
  border-radius: 11px;
  padding: 12px 14px;
  background: #f7faf9;
}

.fish-detail-notes strong {
  color: var(--forest-2);
  font-size: 0.57rem;
}

.fish-detail-notes p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.6;
}

.fish-grading-score {
  display: grid;
  align-items: center;
  margin-top: 18px;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
}

.fish-grading-score > strong {
  grid-row: span 2;
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.4rem;
}

.fish-grading-score > span {
  justify-self: start;
}

.fish-grading-score > small {
  color: var(--muted);
  font-size: 0.53rem;
}

.fish-grading-components {
  display: grid;
  margin-top: 17px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.fish-grading-components > span {
  display: grid;
  border-radius: 9px;
  padding: 9px;
  gap: 4px;
  background: var(--mist);
}

.fish-grading-components strong {
  color: var(--forest-2);
  font-size: 0.61rem;
}

.pairing-detail-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.pairing-detail-summary {
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 24px;
  background:
    radial-gradient(circle at top right, rgba(240, 122, 90, 0.12), transparent 36%),
    white;
}

.pairing-detail-summary h3 {
  margin: 14px 0 7px;
  color: var(--forest-2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}

.pairing-detail-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.6;
}

.pairing-detail-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pairing-detail-kpis > span {
  display: grid;
  min-height: 68px;
  align-content: center;
  border-radius: 11px;
  padding: 9px;
  gap: 5px;
  background: var(--mist);
  text-align: center;
}

.pairing-detail-kpis small {
  color: var(--muted);
  font-size: 0.49rem;
}

.pairing-detail-kpis strong {
  color: var(--forest);
  font-size: 0.68rem;
}

.pairing-fish-section {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  background: white;
}

.pairing-fish-grid {
  margin-top: 16px;
}

.egg-batch-detail-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.egg-batch-hero {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  background: white;
}

.egg-batch-photo {
  position: relative;
  min-height: 360px;
  margin: 0;
  overflow: hidden;
  background: #082e36;
}

.egg-batch-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.egg-batch-photo::after {
  position: absolute;
  background: linear-gradient(180deg, transparent 58%, rgba(2, 28, 34, 0.82));
  content: "";
  inset: 0;
  pointer-events: none;
}

.egg-batch-photo figcaption {
  position: absolute;
  z-index: 1;
  right: 16px;
  bottom: 14px;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.55rem;
}

.egg-batch-photo figcaption span {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 5px 8px;
  color: white;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.egg-batch-summary {
  display: flex;
  padding: 28px;
  flex-direction: column;
  justify-content: center;
}

.egg-batch-summary h3 {
  margin: 18px 0 7px;
  color: var(--forest-2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.egg-batch-summary > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.63rem;
  line-height: 1.6;
}

.egg-batch-counts {
  display: grid;
  margin-top: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.egg-batch-counts > span {
  display: grid;
  min-height: 68px;
  align-content: center;
  border-radius: 11px;
  padding: 9px;
  gap: 5px;
  background: var(--mist);
  text-align: center;
}

.egg-batch-counts small,
.egg-batch-metrics small {
  color: var(--muted);
  font-size: 0.5rem;
}

.egg-batch-counts strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
}

.egg-batch-metrics {
  display: grid;
  margin-top: 15px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.egg-batch-metrics article {
  display: grid;
  min-height: 105px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  gap: 6px;
  background: white;
  text-align: center;
}

.egg-batch-metrics strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
}

.egg-batch-metrics span {
  color: var(--muted);
  font-size: 0.46rem;
}

.egg-batch-notes {
  margin-top: 18px;
}

.egg-batch-notes > p {
  margin: 15px 0 0;
  border-radius: 11px;
  padding: 13px 15px;
  background: var(--mist);
  color: var(--muted);
  font-size: 0.59rem;
  line-height: 1.7;
}

.fry-group-detail-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.fry-group-hero {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  background: white;
}

.fry-group-photo {
  position: relative;
  min-height: 360px;
  margin: 0;
  overflow: hidden;
  background: #082e36;
}

.fry-group-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.fry-group-photo::after {
  position: absolute;
  background: linear-gradient(180deg, transparent 58%, rgba(2, 28, 34, 0.82));
  content: "";
  inset: 0;
  pointer-events: none;
}

.fry-group-photo figcaption {
  position: absolute;
  z-index: 1;
  right: 16px;
  bottom: 14px;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.55rem;
}

.fry-group-photo figcaption span {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 5px 8px;
  color: white;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.fry-group-summary {
  display: flex;
  padding: 28px;
  flex-direction: column;
  justify-content: center;
}

.fry-group-summary h3 {
  margin: 18px 0 7px;
  color: var(--forest-2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.fry-group-summary > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.63rem;
  line-height: 1.6;
}

.fry-group-kpis {
  display: grid;
  margin-top: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fry-group-kpis > span {
  display: grid;
  min-height: 68px;
  align-content: center;
  border-radius: 11px;
  padding: 9px;
  gap: 5px;
  background: var(--mist);
  text-align: center;
}

.fry-group-kpis small {
  color: var(--muted);
  font-size: 0.5rem;
}

.fry-group-kpis strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
}

.fry-survival-section {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  background: white;
}

.fry-survival-track {
  display: grid;
  margin-top: 17px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.fry-survival-track article {
  position: relative;
  display: grid;
  min-height: 102px;
  align-content: center;
  border: 1px solid #d8e6e2;
  border-radius: 12px;
  padding: 12px;
  gap: 5px;
  background: var(--mist);
  text-align: center;
}

.fry-survival-track article:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: -10px;
  width: 11px;
  height: 2px;
  background: var(--coral);
  content: "";
}

.fry-survival-track article.is-pending {
  border-style: dashed;
  background: #fbfcfc;
}

.fry-survival-track span {
  color: var(--coral);
  font-size: 0.52rem;
  font-weight: 800;
}

.fry-survival-track strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
}

.fry-survival-track small {
  color: var(--muted);
  font-size: 0.45rem;
}

.fry-grade-grid {
  display: grid;
  margin-top: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.fry-grade-grid article {
  display: grid;
  min-height: 98px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  gap: 5px;
  background: white;
  text-align: center;
}

.fry-grade-grid article > span {
  justify-self: center;
}

.fry-grade-grid strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.fry-grade-grid small {
  color: var(--muted);
  font-size: 0.49rem;
}

.fry-origin-grid {
  display: grid;
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.family-parent-pairs {
  display: grid;
  margin-top: 16px;
  gap: 15px;
}

.family-parent-pair {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fbfdfc;
}

.family-parent-pair__heading {
  display: flex;
  align-items: center;
  margin-bottom: 13px;
  justify-content: space-between;
  color: var(--forest-2);
  font-size: 0.61rem;
  font-weight: 800;
}

.family-parent-pair__heading small {
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 500;
}

.family-parent-grid {
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
  gap: 10px;
}

.family-parent-cross {
  display: grid;
  align-self: center;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: #fff0e9;
  color: var(--coral);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
}

.family-parent-card {
  display: grid;
  min-width: 0;
  border: 1px solid #dce7e4;
  border-radius: 12px;
  overflow: hidden;
  grid-template-columns: minmax(230px, 1.2fr) minmax(170px, 0.8fr);
  background: white;
}

.family-parent-card figure {
  position: relative;
  min-height: 175px;
  margin: 0;
  overflow: hidden;
  background: #153f43;
}

.family-parent-card figure img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 175px;
  object-fit: cover;
}

.family-parent-card figcaption {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  border-radius: 999px;
  padding: 4px 6px;
  background: rgba(7, 41, 45, 0.72);
  color: white;
  font-size: 0.48rem;
  text-align: center;
}

.family-parent-card figcaption span {
  display: inline-block;
  margin-right: 4px;
  font-size: 0.43rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.family-parent-card > div {
  min-width: 0;
  padding: 15px;
}

.family-parent-card > .fish-view-pair {
  padding: 0;
}

.family-parent-role {
  color: var(--coral);
  font-size: 0.53rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.family-parent-card h4 {
  margin: 8px 0 4px;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  text-overflow: ellipsis;
}

.family-parent-card > div > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.55rem;
}

.family-parent-metrics {
  display: grid;
  margin-top: 13px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.family-parent-metrics > span {
  display: grid;
  align-content: center;
  min-height: 50px;
  border-radius: 8px;
  padding: 6px;
  gap: 4px;
  background: var(--mist);
  text-align: center;
}

.family-parent-metrics small {
  color: var(--muted);
  font-size: 0.48rem;
}

.family-parent-metrics strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
}

.family-parent-metrics .badge {
  justify-self: center;
  padding: 3px 5px;
  font-size: 0.46rem;
}

.family-parent-card.is-missing {
  display: grid;
  min-height: 175px;
  place-content: center;
  padding: 15px;
  color: var(--muted);
  text-align: center;
}

.family-pairing-evidence {
  display: grid;
  margin-top: 12px;
  border-radius: 10px;
  padding: 12px;
  gap: 7px;
  background: #eef5f3;
}

.family-pairing-evidence > strong {
  color: var(--ink);
  font-size: 0.58rem;
}

.family-pairing-evidence > div {
  display: grid;
  align-items: center;
  grid-template-columns: auto auto auto 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 0.55rem;
}

.family-pairing-evidence > div small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-pairing-evidence > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.57rem;
}

.family-generation-list {
  display: grid;
  margin-top: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.family-generation-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: #fbfdfc;
}

.family-generation-card figure {
  position: relative;
  height: 145px;
  margin: 0;
  overflow: hidden;
  background: #153f43;
}

.family-generation-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.family-generation-card figcaption {
  position: absolute;
  right: 9px;
  bottom: 8px;
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(7, 41, 45, 0.74);
  color: white;
  font-size: 0.52rem;
}

.family-generation-card > div {
  padding: 14px;
}

.family-generation-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff0e9;
  color: var(--coral);
  font-size: 0.56rem;
  font-weight: 800;
}

.family-generation-card h4 {
  margin: 10px 0 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.94rem;
}

.family-generation-card code {
  color: var(--forest-2);
  font-size: 0.56rem;
}

.family-generation-card p {
  min-height: 36px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.6rem;
  line-height: 1.5;
}

.family-generation-card small {
  color: #81938f;
  font-size: 0.54rem;
}

.family-history-empty {
  display: flex;
  align-items: center;
  margin-top: 16px;
  border-radius: 12px;
  padding: 18px;
  gap: 14px;
  background: var(--mist);
}

.family-history-empty > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--forest);
}

.family-history-empty svg {
  width: 20px;
}

.family-history-empty strong {
  color: var(--ink);
  font-size: 0.68rem;
}

.family-history-empty p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.6rem;
}

.line-related-grid {
  display: grid;
  margin-top: 18px;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
}

.line-related-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  background: white;
}

.line-family-list {
  display: grid;
  margin-top: 15px;
  gap: 8px;
}

.line-family-list > span {
  display: grid;
  border-radius: 9px;
  padding: 11px 12px;
  gap: 3px;
  background: var(--mist);
}

.line-family-list strong {
  color: var(--forest-2);
  font-size: 0.68rem;
}

.line-family-list small {
  color: var(--muted);
  font-size: 0.58rem;
}

.line-fish-table {
  margin-top: 10px;
}

.line-admin-tools {
  margin-top: 18px;
  border: 1px solid rgba(188, 139, 26, 0.25);
  border-radius: 16px;
  overflow: hidden;
  background: #fffdf7;
}

.line-admin-tools summary {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  justify-content: space-between;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
  list-style: none;
}

.line-admin-tools summary::-webkit-details-marker {
  display: none;
}

.line-admin-tools summary span {
  color: #9a6c1c;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
}

.line-admin-grid {
  display: grid;
  border-top: 1px solid rgba(188, 139, 26, 0.18);
  padding: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.line-admin-grid form {
  display: grid;
  align-content: start;
  border-radius: 12px;
  padding: 17px;
  gap: 12px;
  background: white;
  box-shadow: 0 5px 18px rgba(16, 52, 54, 0.06);
}

.line-admin-grid h3 {
  margin: 0 0 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 500;
}

.line-admin-grid label {
  display: grid;
  gap: 6px;
}

.line-admin-grid label > span {
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 700;
}

.line-admin-grid input,
.line-admin-grid textarea {
  width: 100%;
  border: 1px solid #cfdbd8;
  border-radius: 9px;
  outline: 0;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.68rem;
}

.line-admin-grid textarea {
  min-height: 74px;
  resize: vertical;
}

.line-admin-inline {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 10px;
}

.line-admin-grid .line-check {
  display: flex;
  align-items: center;
  flex-direction: row;
}

.line-check input {
  width: auto;
}

.line-admin-grid input:focus,
.line-admin-grid textarea:focus,
.line-admin-tools summary:focus-visible,
.line-detail-dialog button:focus-visible {
  border-color: var(--forest-2);
  outline: 3px solid rgba(23, 104, 120, 0.2);
  outline-offset: 2px;
}

.operation-dialog form {
  padding: 25px;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 500;
}

.dialog-header .eyebrow {
  margin-bottom: 2px;
}

.dialog-fields {
  display: grid;
  margin-top: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.dialog-field {
  display: grid;
  gap: 6px;
}

.dialog-field--wide {
  grid-column: 1 / -1;
}

.dialog-field span {
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
}

.dialog-field input,
.dialog-field select,
.dialog-field textarea {
  width: 100%;
  border: 1px solid #cfdbd8;
  border-radius: 9px;
  outline: 0;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 0.76rem;
}

.dialog-field textarea {
  min-height: 82px;
  resize: vertical;
}

.dialog-field input:focus,
.dialog-field select:focus,
.dialog-field textarea:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(23, 104, 120, 0.1);
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.row-action {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 7px;
  background: white;
  color: var(--forest-2);
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 800;
}

.row-action:hover {
  border-color: var(--forest-2);
}

.row-action--danger {
  color: var(--danger);
}

.operation-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 25px;
  padding: 28px;
}

@media (max-width: 620px) {
  .dialog-fields {
    grid-template-columns: 1fr;
  }

  .dialog-field--wide {
    grid-column: auto;
  }
}

.record-toolbar input {
  width: 240px;
  height: 36px;
  border: 1px solid #cfdbd5;
  border-radius: 9px;
  outline: none;
  padding: 0 12px;
  background: white;
  font-size: 0.72rem;
}

.table-wrap {
  overflow-x: auto;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e4e9e5;
  padding: 13px 18px;
  color: #718682;
  font-size: 0.65rem;
}

.pagination__buttons {
  display: flex;
  gap: 6px;
}

.pagination button {
  min-width: 32px;
  height: 30px;
  border: 1px solid #d4ddd9;
  border-radius: 7px;
  background: white;
  cursor: pointer;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 40px;
  text-align: center;
}

.empty-state__icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  margin: 0 auto 13px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--forest-2);
}

.empty-state h3 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.15rem;
}

.empty-state p {
  max-width: 350px;
  margin: 6px auto;
  color: #7d918d;
  font-size: 0.7rem;
}

.workflow-page {
  display: grid;
  gap: 12px;
}

.workflow-guide {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: #607873;
  font-size: 0.66rem;
}

.workflow-guide span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.workflow-guide i {
  width: 19px;
  height: 3px;
  border-radius: 999px;
  background: var(--forest);
}

.workflow-guide i.is-return {
  background: var(--coral);
}

.workflow-guide small {
  margin-left: auto;
  color: #82938f;
}

.workflow-scroll {
  overflow-x: auto;
  padding: 12px 10px 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    radial-gradient(circle at 8% 20%, rgba(129, 191, 178, 0.11), transparent 28%),
    linear-gradient(180deg, #fbfdfc 0%, #f4f8f7 100%);
  box-shadow: var(--shadow-soft);
  scrollbar-color: #94b7af transparent;
  scrollbar-width: thin;
}

.workflow-scroll:focus-visible {
  outline: 3px solid rgba(50, 119, 104, 0.22);
  outline-offset: 3px;
}

.workflow-canvas {
  position: relative;
  width: 2320px;
  min-height: 265px;
  padding: 22px 20px 88px;
}

.workflow-map {
  display: grid;
  grid-template-columns: repeat(11, 180px);
  gap: 29px;
}

.flow-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.flow-card:not(:last-child)::after {
  position: absolute;
  top: 50%;
  left: calc(100% + 6px);
  width: 23px;
  height: 2px;
  background: var(--forest);
  content: "";
}

.flow-card:not(:last-child)::before {
  position: absolute;
  z-index: 1;
  top: calc(50% - 4px);
  left: calc(100% + 25px);
  border-width: 5px 0 5px 7px;
  border-style: solid;
  border-color: transparent transparent transparent var(--forest);
  content: "";
}

.flow-card:hover {
  transform: translateY(-3px);
  border-color: #9bc3b9;
  box-shadow: 0 14px 25px rgba(29, 72, 63, 0.11);
}

.flow-card:focus-visible {
  outline: 3px solid rgba(50, 119, 104, 0.22);
  outline-offset: 3px;
}

.flow-card__number {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--forest);
  color: white;
  font-family: Georgia, serif;
  font-size: 0.82rem;
}

.flow-card__content {
  display: grid;
  align-content: start;
  gap: 7px;
  padding-top: 2px;
}

.flow-card__content strong {
  font-family: Georgia, serif;
  font-size: 0.88rem;
  line-height: 1.2;
}

.flow-card__content small {
  color: #7c8f8c;
  font-size: 0.62rem;
  line-height: 1.55;
}

.flow-card__metric {
  grid-column: 1 / -1;
  align-self: end;
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--forest-2);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.flow-card.is-accent {
  border-color: #d89f8e;
  background: #fff7f3;
}

.flow-card.is-accent .flow-card__number,
.flow-card.is-accent .flow-card__metric {
  background: var(--coral);
  color: white;
}

.workflow-return {
  position: absolute;
  right: 110px;
  bottom: 29px;
  left: 757px;
  height: 51px;
  border-right: 3px solid var(--coral);
  border-bottom: 3px solid var(--coral);
  border-left: 3px solid var(--coral);
  border-radius: 0 0 17px 17px;
}

.workflow-return::after {
  position: absolute;
  right: -3px;
  bottom: 48px;
  width: 3px;
  height: 36px;
  background: var(--coral);
  content: "";
}

.workflow-return__arrow {
  position: absolute;
  bottom: 47px;
  left: -7px;
  border-width: 0 6px 9px;
  border-style: solid;
  border-color: transparent transparent var(--coral);
}

.workflow-return__label {
  position: absolute;
  top: 19px;
  left: 50%;
  display: flex;
  align-items: baseline;
  gap: 9px;
  transform: translateX(-50%);
  padding: 2px 10px;
  background: #f4f8f7;
  color: #8b6258;
  font-size: 0.6rem;
  white-space: nowrap;
}

.workflow-return__label strong {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 0.68rem;
}

.workflow-mobile-return {
  display: none;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.system-card {
  min-height: 170px;
  padding: 20px;
}

.system-card h3 {
  margin: 0 0 22px;
  font-family: Georgia, serif;
  font-size: 1rem;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 13px;
}

.system-status__icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  background: var(--mint);
  color: #2c7b5d;
}

.system-status strong,
.system-status small {
  display: block;
}

.system-status small {
  margin-top: 3px;
  color: #80928f;
  font-size: 0.65rem;
}

.loading-state {
  display: grid;
  min-height: 440px;
  place-items: center;
  align-content: center;
  color: #78908c;
  font-size: 0.75rem;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #d4dfd9;
  border-top-color: var(--forest-2);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.error-state {
  border: 1px solid #edd1c9;
  border-radius: 13px;
  padding: 24px;
  background: #fff8f5;
  color: var(--danger);
  text-align: center;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 250px;
  border-left: 4px solid var(--forest-2);
  border-radius: 9px;
  padding: 12px 15px;
  background: white;
  box-shadow: var(--shadow);
  font-size: 0.72rem;
  animation: toast-in 220ms ease-out;
}

.toast--error {
  border-left-color: var(--danger);
}

.sidebar-scrim,
.mobile-only {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes medaka-swim {
  0%,
  100% { transform: translate(-52%, -50%) rotate(-4deg); }
  50% { transform: translate(-48%, -54%) rotate(1deg); }
}

@keyframes bubble-rise {
  0%,
  100% { transform: translateY(8px) scale(0.85); opacity: 0.25; }
  50% { transform: translateY(-15px) scale(1); opacity: 0.8; }
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .medaka-hero,
  .water-bubble {
    animation: none;
  }
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .global-search {
    display: none;
  }
}

@media (max-width: 900px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-story {
    display: none;
  }

  .login-card__mobile-brand {
    display: flex;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-column: 1;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 19;
    background: rgba(11, 31, 29, 0.42);
    inset: 0;
  }

  .sidebar-scrim.is-open {
    display: block;
  }

  .mobile-only {
    display: grid;
  }

  .topbar {
    justify-content: flex-start;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .dashboard-grid,
  .tables-grid {
    grid-template-columns: 1fr;
  }

  .fish-top-view-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 620px) {
  .image-lightbox {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 15px;
  }

  .image-lightbox > article,
  .image-lightbox figure {
    min-height: 72vh;
  }

  .image-lightbox img {
    height: 72vh;
  }

  .image-lightbox__close {
    top: 11px;
    right: 11px;
    width: 38px;
    height: 38px;
  }

  .login-panel {
    align-items: start;
    padding: 30px 22px;
  }

  .login-card h2 {
    font-size: 2.2rem;
  }

  .topbar {
    min-height: 74px;
    padding: 12px 16px;
  }

  .topbar-title h1 {
    font-size: 1.22rem;
  }

  .topbar-title .eyebrow,
  .user-chip > span:nth-child(2),
  .user-chip > svg,
  #refresh-button {
    display: none;
  }

  .user-chip {
    border-left: 0;
    padding-left: 0;
  }

  .content {
    padding: 20px 15px 45px;
  }

  .section-heading {
    align-items: start;
  }

  .date-pill {
    display: none;
  }

  .kpi-grid,
  .system-grid {
    grid-template-columns: 1fr;
  }

  .workflow-guide {
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .workflow-guide small {
    flex-basis: 100%;
    margin-left: 0;
  }

  .workflow-scroll {
    padding-right: 4px;
    padding-left: 4px;
  }

  .workflow-mobile-return {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 12px;
    border: 1px solid #e8c0b4;
    border-radius: 11px;
    background: #fff7f3;
    color: #825e54;
    font-size: 0.62rem;
  }

  .workflow-mobile-return strong {
    color: var(--coral);
  }

  .kpi-card {
    min-height: 125px;
  }

  .workflow-strip {
    overflow-x: auto;
    grid-template-columns: repeat(6, 100px);
  }

  .record-toolbar input {
    width: 150px;
  }

  .data-table th,
  .data-table td {
    padding-right: 12px;
    padding-left: 12px;
    white-space: nowrap;
  }

  .line-detail-dialog > article {
    padding: 18px;
  }

  .line-detail-hero {
    grid-template-columns: 1fr;
  }

  .family-detail-hero,
  .family-generation-list {
    grid-template-columns: 1fr;
  }

  .fish-detail-hero,
  .fish-detail-grid,
  .pairing-detail-summary,
  .egg-batch-hero,
  .fry-group-hero,
  .fry-origin-grid {
    grid-template-columns: 1fr;
  }

  .fish-detail-visuals figure,
  .fish-detail-visuals img {
    min-height: 220px;
  }

  .family-parent-grid {
    grid-template-columns: 1fr;
  }

  .fish-top-view-grid,
  .fish-top-view-grid--line {
    grid-template-columns: 1fr;
  }

  .family-parent-cross {
    justify-self: center;
  }

  .family-parent-card {
    grid-template-columns: 1fr;
  }

  .family-parent-card figure,
  .family-parent-card figure img {
    min-height: 210px;
  }

  .fish-detail-summary {
    padding: 20px;
  }

  .fish-detail-facts,
  .fish-grading-components,
  .pairing-detail-kpis,
  .egg-batch-metrics,
  .fry-grade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .egg-batch-photo,
  .egg-batch-photo img,
  .fry-group-photo,
  .fry-group-photo img {
    min-height: 260px;
  }

  .fry-survival-track {
    overflow-x: auto;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
  }

  .family-pairing-evidence > div {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .family-pairing-evidence > div small {
    white-space: normal;
  }

  .line-detail-photo,
  .line-detail-photo img,
  .family-detail-photo,
  .family-detail-photo img {
    min-height: 245px;
  }

  .line-detail-summary {
    padding: 19px;
  }

  .line-traits ul {
    grid-template-columns: 1fr;
  }

  .line-related-grid,
  .line-admin-grid {
    grid-template-columns: 1fr;
  }

  .line-admin-inline {
    grid-template-columns: 1fr;
  }

  .line-admin-tools summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .line-detail-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .line-detail-meta span:last-child {
    margin-left: 0;
  }
}
