:root {
  --bg: #fbf3dd;
  --paper: #fff9e9;
  --paper-strong: #fffdf4;
  --paper-soft: #f6eac8;
  --ink: #243038;
  --muted: #5f6258;
  --line: #243038;
  --green: #7aa874;
  --green-soft: #dcebcf;
  --green-deep: #3f6f64;
  --blue-soft: #d9edf5;
  --yellow-soft: #fff1ad;
  --red-soft: #f4cbbf;
  --purple-soft: #e8dbf0;
  --panel-bg: rgba(255, 249, 233, 0.9);
  --sidebar-bg: #fff6dc;
  --surface-bg: rgba(255, 253, 245, 0.9);
  --subtle-surface-bg: rgba(255, 253, 245, 0.62);
  --body-glow: rgba(122, 168, 116, 0.15);
  --grid-line: rgba(36, 48, 56, 0.045);
  --grid-line-soft: rgba(36, 48, 56, 0.04);
  --sketch-line: rgba(36, 48, 56, 0.38);
  --menu-grid-line: rgba(36, 48, 56, 0.035);
  --menu-grid-line-soft: rgba(36, 48, 56, 0.03);
  --menu-hover-border: rgba(36, 48, 56, 0.42);
  --menu-hover-bg: rgba(217, 237, 245, 0.48);
  --primary-bg: #bfe1bd;
  --secondary-bg: #e9f4f8;
  --ghost-bg: #fff7d2;
  --nav-dot: #f0bf58;
  --danger-ink: #7f3f38;
  --focus-ring: rgba(122, 168, 116, 0.24);
  --field-shadow: 2px 3px 0 rgba(54, 44, 31, 0.07);
  --button-shadow: 3px 4px 0 rgba(54, 44, 31, 0.14);
  --button-shadow-hover: 2px 3px 0 rgba(54, 44, 31, 0.12);
  --button-shadow-soft: 1px 2px 0 rgba(54, 44, 31, 0.08);
  --download-gradient: linear-gradient(135deg, rgba(191, 225, 189, 0.96), rgba(217, 237, 245, 0.92));
  --file-picker-bg: linear-gradient(120deg, rgba(217, 237, 245, 0.92), rgba(255, 253, 245, 0.96));
  --file-picker-hover-bg: linear-gradient(120deg, rgba(203, 231, 242, 1), rgba(255, 249, 225, 0.98));
  --file-picker-selected-bg: linear-gradient(120deg, rgba(220, 235, 207, 0.95), rgba(255, 253, 245, 0.98));
  --file-picker-selected-hover-bg: linear-gradient(120deg, rgba(205, 228, 199, 1), rgba(255, 249, 225, 0.98));
  --soft-chip-bg: rgba(217, 237, 245, 0.42);
  --soft-chip-bg-light: rgba(217, 237, 245, 0.36);
  --soft-note-bg: rgba(255, 247, 210, 0.48);
  --summary-bg: rgba(249, 246, 234, 0.62);
  --submission-bg: rgba(231, 238, 230, 0.42);
  --return-form-bg: rgba(217, 237, 245, 0.28);
  --shadow: 5px 7px 0 rgba(54, 44, 31, 0.17);
  --shadow-soft: 3px 4px 0 rgba(54, 44, 31, 0.12);
}

html[data-theme="mint"] {
  --bg: #eefbf6;
  --paper: #f6fffb;
  --paper-strong: #fbfffd;
  --paper-soft: #d8f3ec;
  --ink: #21383b;
  --muted: #60756f;
  --line: #21383b;
  --green: #4ab7a5;
  --green-soft: #d8f3ec;
  --green-deep: #287970;
  --blue-soft: #dceff7;
  --yellow-soft: #f2eab6;
  --red-soft: #f1c7c2;
  --purple-soft: #e2e3f3;
  --panel-bg: rgba(246, 255, 251, 0.9);
  --sidebar-bg: #effbf7;
  --surface-bg: rgba(252, 255, 254, 0.92);
  --subtle-surface-bg: rgba(252, 255, 254, 0.64);
  --body-glow: rgba(74, 183, 165, 0.14);
  --grid-line: rgba(33, 56, 59, 0.04);
  --grid-line-soft: rgba(33, 56, 59, 0.034);
  --sketch-line: rgba(33, 56, 59, 0.34);
  --menu-grid-line: rgba(33, 56, 59, 0.03);
  --menu-grid-line-soft: rgba(33, 56, 59, 0.026);
  --menu-hover-border: rgba(33, 56, 59, 0.38);
  --menu-hover-bg: rgba(216, 243, 236, 0.62);
  --primary-bg: #b9eadf;
  --secondary-bg: #e0f3f7;
  --ghost-bg: #eefbf4;
  --nav-dot: #f2d76f;
  --danger-ink: #8a433d;
  --focus-ring: rgba(74, 183, 165, 0.25);
  --field-shadow: 2px 3px 0 rgba(33, 56, 59, 0.07);
  --button-shadow: 3px 4px 0 rgba(33, 56, 59, 0.13);
  --button-shadow-hover: 2px 3px 0 rgba(33, 56, 59, 0.11);
  --button-shadow-soft: 1px 2px 0 rgba(33, 56, 59, 0.08);
  --download-gradient: linear-gradient(135deg, rgba(185, 234, 223, 0.98), rgba(220, 239, 247, 0.9));
  --file-picker-bg: linear-gradient(120deg, rgba(220, 239, 247, 0.84), rgba(251, 255, 253, 0.96));
  --file-picker-hover-bg: linear-gradient(120deg, rgba(204, 237, 242, 0.96), rgba(239, 251, 247, 0.98));
  --file-picker-selected-bg: linear-gradient(120deg, rgba(216, 243, 236, 0.96), rgba(251, 255, 253, 0.98));
  --file-picker-selected-hover-bg: linear-gradient(120deg, rgba(192, 235, 224, 1), rgba(239, 251, 247, 0.98));
  --soft-chip-bg: rgba(216, 243, 236, 0.5);
  --soft-chip-bg-light: rgba(216, 243, 236, 0.42);
  --soft-note-bg: rgba(242, 234, 182, 0.5);
  --summary-bg: rgba(242, 250, 245, 0.68);
  --submission-bg: rgba(224, 240, 232, 0.5);
  --return-form-bg: rgba(220, 239, 247, 0.34);
  --shadow: 5px 7px 0 rgba(33, 56, 59, 0.14);
  --shadow-soft: 3px 4px 0 rgba(33, 56, 59, 0.11);
}

html[data-theme="inkwhite"] {
  --bg: #f6f6f2;
  --paper: #fbfbf8;
  --paper-strong: #ffffff;
  --paper-soft: #eeeeea;
  --ink: #171717;
  --muted: #626262;
  --line: #171717;
  --green: #171717;
  --green-soft: #eeeeea;
  --green-deep: #171717;
  --blue-soft: #f1f1ed;
  --yellow-soft: #f6f3df;
  --red-soft: #ece0dc;
  --purple-soft: #eceaf1;
  --panel-bg: rgba(255, 255, 255, 0.92);
  --sidebar-bg: #ffffff;
  --surface-bg: rgba(255, 255, 255, 0.94);
  --subtle-surface-bg: rgba(255, 255, 255, 0.68);
  --body-glow: rgba(0, 0, 0, 0.045);
  --grid-line: rgba(0, 0, 0, 0.035);
  --grid-line-soft: rgba(0, 0, 0, 0.03);
  --sketch-line: rgba(0, 0, 0, 0.32);
  --menu-grid-line: rgba(0, 0, 0, 0.028);
  --menu-grid-line-soft: rgba(0, 0, 0, 0.024);
  --menu-hover-border: rgba(0, 0, 0, 0.42);
  --menu-hover-bg: rgba(241, 241, 237, 0.9);
  --primary-bg: #e9e9e4;
  --secondary-bg: #f5f5f1;
  --ghost-bg: #ffffff;
  --nav-dot: #ffffff;
  --danger-ink: #5f2d2a;
  --focus-ring: rgba(0, 0, 0, 0.14);
  --field-shadow: 2px 3px 0 rgba(0, 0, 0, 0.07);
  --button-shadow: 3px 4px 0 rgba(0, 0, 0, 0.13);
  --button-shadow-hover: 2px 3px 0 rgba(0, 0, 0, 0.11);
  --button-shadow-soft: 1px 2px 0 rgba(0, 0, 0, 0.08);
  --download-gradient: linear-gradient(135deg, rgba(245, 245, 241, 1), rgba(233, 233, 228, 0.96));
  --file-picker-bg: linear-gradient(120deg, rgba(245, 245, 241, 0.92), rgba(255, 255, 255, 0.96));
  --file-picker-hover-bg: linear-gradient(120deg, rgba(237, 237, 232, 1), rgba(255, 255, 255, 0.98));
  --file-picker-selected-bg: linear-gradient(120deg, rgba(238, 238, 234, 1), rgba(255, 255, 255, 0.98));
  --file-picker-selected-hover-bg: linear-gradient(120deg, rgba(229, 229, 224, 1), rgba(255, 255, 255, 0.98));
  --soft-chip-bg: rgba(241, 241, 237, 0.72);
  --soft-chip-bg-light: rgba(241, 241, 237, 0.62);
  --soft-note-bg: rgba(246, 243, 223, 0.62);
  --summary-bg: rgba(246, 246, 242, 0.78);
  --submission-bg: rgba(241, 241, 237, 0.72);
  --return-form-bg: rgba(241, 241, 237, 0.54);
  --shadow: 5px 7px 0 rgba(0, 0, 0, 0.13);
  --shadow-soft: 3px 4px 0 rgba(0, 0, 0, 0.1);
}

html[data-theme="fogblue"] {
  --bg: #eff5f7;
  --paper: #f7fbfd;
  --paper-strong: #fbfdff;
  --paper-soft: #dcecf1;
  --ink: #22313a;
  --muted: #62707a;
  --line: #22313a;
  --green: #6ea6b7;
  --green-soft: #dcecf1;
  --green-deep: #3d7385;
  --blue-soft: #e7f0f4;
  --yellow-soft: #efe6c6;
  --red-soft: #edcbc9;
  --purple-soft: #e8e2f0;
  --panel-bg: rgba(247, 251, 253, 0.9);
  --sidebar-bg: #f2f7f9;
  --surface-bg: rgba(252, 254, 255, 0.92);
  --subtle-surface-bg: rgba(252, 254, 255, 0.64);
  --body-glow: rgba(110, 166, 183, 0.16);
  --grid-line: rgba(34, 49, 58, 0.04);
  --grid-line-soft: rgba(34, 49, 58, 0.034);
  --sketch-line: rgba(34, 49, 58, 0.34);
  --menu-grid-line: rgba(34, 49, 58, 0.03);
  --menu-grid-line-soft: rgba(34, 49, 58, 0.026);
  --menu-hover-border: rgba(34, 49, 58, 0.38);
  --menu-hover-bg: rgba(231, 240, 244, 0.68);
  --primary-bg: #c5e0e8;
  --secondary-bg: #e7f0f4;
  --ghost-bg: #f3f7f9;
  --nav-dot: #efe6c6;
  --danger-ink: #7e3f3a;
  --focus-ring: rgba(110, 166, 183, 0.25);
  --field-shadow: 2px 3px 0 rgba(34, 49, 58, 0.07);
  --button-shadow: 3px 4px 0 rgba(34, 49, 58, 0.13);
  --button-shadow-hover: 2px 3px 0 rgba(34, 49, 58, 0.11);
  --button-shadow-soft: 1px 2px 0 rgba(34, 49, 58, 0.08);
  --download-gradient: linear-gradient(135deg, rgba(197, 224, 232, 0.98), rgba(231, 240, 244, 0.94));
  --file-picker-bg: linear-gradient(120deg, rgba(231, 240, 244, 0.9), rgba(252, 254, 255, 0.96));
  --file-picker-hover-bg: linear-gradient(120deg, rgba(216, 234, 240, 0.98), rgba(247, 251, 253, 0.98));
  --file-picker-selected-bg: linear-gradient(120deg, rgba(220, 236, 241, 0.96), rgba(252, 254, 255, 0.98));
  --file-picker-selected-hover-bg: linear-gradient(120deg, rgba(202, 226, 233, 1), rgba(247, 251, 253, 0.98));
  --soft-chip-bg: rgba(220, 236, 241, 0.52);
  --soft-chip-bg-light: rgba(220, 236, 241, 0.44);
  --soft-note-bg: rgba(239, 230, 198, 0.52);
  --summary-bg: rgba(241, 247, 249, 0.72);
  --submission-bg: rgba(229, 238, 235, 0.48);
  --return-form-bg: rgba(231, 240, 244, 0.36);
  --shadow: 5px 7px 0 rgba(34, 49, 58, 0.14);
  --shadow-soft: 3px 4px 0 rgba(34, 49, 58, 0.11);
}

html[data-theme="woodcut"] {
  --bg: #f2f7ef;
  --paper: #f7fff4;
  --paper-strong: #fbfff8;
  --paper-soft: #deecd8;
  --ink: #20322b;
  --muted: #667064;
  --line: #20322b;
  --green: #5d8f68;
  --green-soft: #deecd8;
  --green-deep: #315f43;
  --blue-soft: #ddeee9;
  --yellow-soft: #f0e4b9;
  --red-soft: #efc9c1;
  --purple-soft: #e5dfed;
  --panel-bg: rgba(247, 255, 244, 0.9);
  --sidebar-bg: #f6fbf1;
  --surface-bg: rgba(252, 255, 249, 0.92);
  --subtle-surface-bg: rgba(252, 255, 249, 0.64);
  --body-glow: rgba(93, 143, 104, 0.14);
  --grid-line: rgba(32, 50, 43, 0.04);
  --grid-line-soft: rgba(32, 50, 43, 0.034);
  --sketch-line: rgba(32, 50, 43, 0.36);
  --menu-grid-line: rgba(32, 50, 43, 0.03);
  --menu-grid-line-soft: rgba(32, 50, 43, 0.026);
  --menu-hover-border: rgba(32, 50, 43, 0.38);
  --menu-hover-bg: rgba(222, 236, 216, 0.64);
  --primary-bg: #cde6cd;
  --secondary-bg: #ddeee9;
  --ghost-bg: #f4f8e8;
  --nav-dot: #efe4a5;
  --danger-ink: #80433b;
  --focus-ring: rgba(93, 143, 104, 0.25);
  --field-shadow: 2px 3px 0 rgba(32, 50, 43, 0.07);
  --button-shadow: 3px 4px 0 rgba(32, 50, 43, 0.14);
  --button-shadow-hover: 2px 3px 0 rgba(32, 50, 43, 0.12);
  --button-shadow-soft: 1px 2px 0 rgba(32, 50, 43, 0.08);
  --download-gradient: linear-gradient(135deg, rgba(205, 230, 205, 0.98), rgba(221, 238, 233, 0.92));
  --file-picker-bg: linear-gradient(120deg, rgba(221, 238, 233, 0.88), rgba(252, 255, 249, 0.96));
  --file-picker-hover-bg: linear-gradient(120deg, rgba(210, 233, 225, 0.98), rgba(246, 251, 241, 0.98));
  --file-picker-selected-bg: linear-gradient(120deg, rgba(222, 236, 216, 0.96), rgba(252, 255, 249, 0.98));
  --file-picker-selected-hover-bg: linear-gradient(120deg, rgba(207, 230, 198, 1), rgba(246, 251, 241, 0.98));
  --soft-chip-bg: rgba(222, 236, 216, 0.52);
  --soft-chip-bg-light: rgba(222, 236, 216, 0.44);
  --soft-note-bg: rgba(240, 228, 185, 0.52);
  --summary-bg: rgba(244, 250, 239, 0.72);
  --submission-bg: rgba(229, 238, 222, 0.5);
  --return-form-bg: rgba(221, 238, 233, 0.34);
  --shadow: 5px 7px 0 rgba(32, 50, 43, 0.15);
  --shadow-soft: 3px 4px 0 rgba(32, 50, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Comic Sans MS", "Segoe Print", "Microsoft YaHei", "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.64), transparent 18%),
    radial-gradient(circle at 86% 18%, var(--body-glow), transparent 19%),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-soft) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 28px 28px, 28px 28px, auto;
}

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

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

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

.login-panel,
.metric,
.panel,
.topbar,
.sidebar {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 13px 10px 15px 9px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.login-panel::before,
.metric::before,
.panel::before,
.topbar::before,
.sidebar::before {
  content: "";
  position: absolute;
  inset: 3px -4px -3px 4px;
  pointer-events: none;
  border: 1.5px solid var(--sketch-line);
  border-radius: 10px 14px 9px 12px;
  transform: rotate(-0.2deg);
}

.login-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 18px;
  padding: 30px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
}

h2 {
  margin-bottom: 0;
  font-size: 32px;
}

h3 {
  margin-bottom: 0;
  font-size: 19px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 2px solid var(--line);
  border-radius: 9px 7px 11px 8px;
  background: var(--paper-strong);
  color: var(--ink);
  outline: none;
  box-shadow: var(--field-shadow);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 36px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: transparent;
  opacity: 0.72;
  transform: translateY(-50%);
}

.password-toggle:focus-visible {
  outline: 3px solid var(--focus-ring);
}

.eye-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--line);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.eye-pupil {
  fill: var(--line);
  stroke: none;
}

.eye-slash {
  opacity: 0;
  stroke: var(--danger-ink);
  stroke-width: 2.2;
}

.password-toggle.is-hidden .eye-slash {
  opacity: 1;
}

.native-select {
  position: absolute;
  width: 1px;
  min-height: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
  box-shadow: none;
}

.custom-select {
  position: relative;
  z-index: 2;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.custom-select.is-open {
  z-index: 120;
}

.custom-select-trigger {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 8px 13px;
  border: 2px solid var(--line);
  border-radius: 10px 7px 12px 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), var(--return-form-bg)),
    var(--paper-strong);
  color: var(--ink);
  box-shadow: var(--field-shadow);
  text-align: left;
  transition: box-shadow 0.12s ease, background 0.12s ease;
}

.custom-select-trigger:hover {
  background:
    linear-gradient(135deg, var(--green-soft), var(--return-form-bg)),
    var(--paper-strong);
  box-shadow: var(--button-shadow-soft);
}

.custom-select.is-open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring), var(--button-shadow-soft);
}

.custom-select-value {
  min-width: 0;
  display: block;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-arrow {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

.custom-select-arrow::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  transform: translateY(-2px) rotate(45deg);
  transform-origin: 50% 50%;
  transition: transform 0.12s ease;
}

.custom-select.is-open .custom-select-arrow::after {
  transform: translateY(2px) rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 130;
  top: calc(100% + 7px);
  left: 0;
  right: auto;
  display: none;
  width: max-content;
  min-width: 100%;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  padding: 7px;
  border: 2px solid var(--line);
  border-radius: 12px 8px 14px 9px;
  background:
    linear-gradient(90deg, var(--menu-grid-line) 1px, transparent 1px),
    linear-gradient(var(--menu-grid-line-soft) 1px, transparent 1px),
    var(--paper-strong);
  background-size: 18px 18px, 18px 18px, auto;
  box-shadow: var(--shadow-soft);
}

.has-open-select {
  position: relative;
  z-index: 90;
}

.custom-select.open-left .custom-select-menu {
  left: auto;
  right: 0;
}

.custom-select.is-open .custom-select-menu {
  display: grid;
  gap: 5px;
}

.custom-select-option {
  width: auto;
  min-width: 100%;
  min-height: 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1.5px solid transparent;
  border-radius: 9px 7px 11px 8px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
}

.custom-select-option span {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-option:hover {
  border-color: var(--menu-hover-border);
  background: var(--menu-hover-bg);
}

.custom-select-option.is-selected {
  border-color: var(--line);
  background: var(--green-soft);
  box-shadow: var(--button-shadow-soft);
}

.custom-select-option.is-selected::after {
  content: "";
  width: 11px;
  height: 6px;
  flex: 0 0 auto;
  border-left: 3px solid var(--green-deep);
  border-bottom: 3px solid var(--green-deep);
  transform: rotate(-45deg) translate(1px, -1px);
}

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

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  box-shadow: 0 0 0 3px var(--focus-ring), var(--button-shadow-soft);
}

.primary,
.secondary,
.ghost {
  min-height: 40px;
  padding: 0 15px;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
  box-shadow: var(--button-shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.row-actions button:hover,
.row-actions a:hover {
  transform: translate(1px, 1px);
  box-shadow: var(--button-shadow-hover);
}

.primary:disabled,
.secondary:disabled,
.ghost:disabled {
  cursor: not-allowed;
  opacity: 0.66;
  transform: none;
  box-shadow: var(--button-shadow-soft);
}

.primary {
  color: var(--ink);
  background: var(--primary-bg);
}

.secondary {
  color: var(--ink);
  background: var(--secondary-bg);
}

.secondary.is-refreshing {
  background: var(--green-soft);
}

.ghost {
  color: var(--ink);
  background: var(--ghost-bg);
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(var(--sketch-line), var(--sketch-line)),
    rgba(18, 16, 12, 0.28);
}

.confirm-dialog {
  position: relative;
  width: min(520px, 100%);
  display: grid;
  gap: 18px;
  padding: 25px 24px 20px;
  border: 2px solid var(--line);
  border-radius: 17px 12px 19px 13px;
  background:
    linear-gradient(135deg, var(--paper-strong), var(--return-form-bg)),
    var(--paper-strong);
  box-shadow: 7px 9px 0 rgba(15, 20, 23, 0.24);
}

.confirm-copy {
  min-width: 0;
  padding-right: 94px;
}

.confirm-dialog::before {
  content: "";
  position: absolute;
  inset: 5px -5px -5px 5px;
  pointer-events: none;
  border: 1.5px solid var(--sketch-line);
  border-radius: 13px 18px 12px 16px;
  transform: rotate(-0.35deg);
}

.confirm-dialog[data-tone="danger"],
.confirm-dialog[data-tone="delete"] {
  background:
    linear-gradient(130deg, var(--paper-strong), var(--red-soft)),
    var(--paper-strong);
}

.confirm-stamp {
  position: absolute;
  right: 22px;
  top: 18px;
  display: inline-grid;
  place-items: center;
  min-width: 56px;
  min-height: 34px;
  padding: 0 12px 2px;
  border: 2px solid rgba(63, 111, 100, 0.58);
  border-radius: 10px 7px 12px 8px;
  color: rgba(63, 111, 100, 0.58);
  font-size: 18px;
  font-weight: 900;
  transform: rotate(7deg);
}

.confirm-dialog[data-tone="danger"] .confirm-stamp,
.confirm-dialog[data-tone="delete"] .confirm-stamp {
  border-color: rgba(127, 63, 56, 0.56);
  color: rgba(127, 63, 56, 0.56);
}

.confirm-dialog h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.confirm-dialog p {
  margin: 0;
}

#confirmMessage {
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-line;
}

.confirm-subject {
  margin: 9px 0 7px !important;
  padding: 8px 11px 9px;
  border: 1.5px dashed var(--sketch-line);
  border-radius: 10px 8px 12px 7px;
  background: var(--panel-bg);
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-actions .primary {
  background: var(--primary-bg);
}

.confirm-dialog[data-tone="danger"] .confirm-actions .primary,
.confirm-dialog[data-tone="delete"] .confirm-actions .primary {
  background: #f4cbbf;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger-ink);
  font-size: 13px;
  font-weight: 900;
}

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

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  height: calc(100vh - 44px);
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  padding: 22px 16px;
  background: var(--sidebar-bg);
  color: var(--ink);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark-frame {
  position: relative;
  width: 58px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  padding: 3px;
  border: 2px solid var(--line);
  border-radius: 10px 7px 12px 8px;
  background: #19110c;
  transform: rotate(-2deg);
  filter: drop-shadow(3px 4px 0 rgba(54, 44, 31, 0.12));
}

.brand-mark-frame::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(240, 201, 130, 0.42);
  border-radius: 7px 5px 9px 6px;
  pointer-events: none;
}

.brand-mark {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 7px 5px 9px 6px;
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.18;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

nav {
  display: grid;
  gap: 9px;
  overflow-y: auto;
  overflow-x: visible;
  padding-right: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.nav-item {
  position: relative;
  min-height: 42px;
  padding: 0 12px 0 36px;
  border: 2px solid transparent;
  border-radius: 10px 8px 12px 7px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 900;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--nav-dot);
  transform: translateY(-50%);
}

.nav-item.active,
.nav-item:hover {
  border-color: var(--line);
  background: var(--green-soft);
  box-shadow: var(--button-shadow);
  transform: rotate(-0.25deg);
}

.account-menu {
  position: relative;
  margin-top: auto;
}

.account-menu > .ghost {
  width: 100%;
}

.account-menu-popover {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 25;
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 12px 8px 14px 9px;
  background:
    linear-gradient(90deg, var(--menu-grid-line) 1px, transparent 1px),
    linear-gradient(var(--menu-grid-line-soft) 1px, transparent 1px),
    var(--paper-strong);
  background-size: 18px 18px, 18px 18px, auto;
  box-shadow: var(--shadow-soft);
}

.account-menu-popover button {
  min-height: 38px;
  padding: 0 12px;
  border: 1.5px solid transparent;
  border-radius: 9px 7px 11px 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 900;
}

.account-menu-popover button:hover {
  border-color: var(--menu-hover-border);
  background: var(--menu-hover-bg);
}

.theme-menu-group {
  display: grid;
  gap: 5px;
}

.theme-menu-title {
  padding: 2px 8px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-option.is-active {
  border-color: var(--line);
  background: var(--green-soft);
}

.theme-option.is-active::after {
  content: "";
  width: 10px;
  height: 6px;
  margin-left: auto;
  border-left: 3px solid var(--green-deep);
  border-bottom: 3px solid var(--green-deep);
  transform: rotate(-45deg) translate(1px, -1px);
}

.theme-swatch {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  border-radius: 7px 5px 8px 5px;
  box-shadow: var(--button-shadow-soft);
}

.theme-swatch.paper {
  background: linear-gradient(135deg, #fff9e9 0 48%, #dcebcf 48% 100%);
}

.theme-swatch.mint {
  background: linear-gradient(135deg, #fbfffd 0 48%, #4ab7a5 48% 100%);
}

.theme-swatch.inkwhite {
  background: linear-gradient(135deg, #ffffff 0 48%, #171717 48% 100%);
}

.theme-swatch.fogblue {
  background: linear-gradient(135deg, #fbfdff 0 48%, #6ea6b7 48% 100%);
}

.theme-swatch.woodcut {
  background: linear-gradient(135deg, #fbfff8 0 48%, #5d8f68 48% 100%);
}

.account-menu-divider {
  height: 1px;
  margin: 3px 4px;
  border-top: 1.5px dashed var(--sketch-line);
}

#logoutBtn {
  color: var(--danger-ink);
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 86px;
  margin-bottom: 22px;
  padding: 16px 20px;
}

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

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.title-row h2 {
  margin: 0;
}

.title-filter {
  display: flex;
  align-items: center;
  margin: 0;
}

.title-filter .custom-select {
  width: 136px;
}

.title-filter .custom-select-trigger {
  min-height: 38px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

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

.metric {
  min-height: 126px;
  padding: 17px 16px 14px;
}

.metric:nth-child(2) {
  transform: rotate(0.35deg);
}

.metric:nth-child(3) {
  transform: rotate(-0.25deg);
}

.metric span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 34px;
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 18px;
}

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

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audit-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.filters select,
.filters .custom-select,
.filters input,
.audit-controls select,
.audit-controls .custom-select {
  min-width: 132px;
}

.audit-controls select,
.audit-controls .custom-select {
  width: 138px;
}

.audit-controls .secondary {
  min-height: 36px;
  padding-inline: 12px;
}

.audit-controls .secondary:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: var(--button-shadow-soft);
}

.page-info {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

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

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

.package-form {
  grid-template-columns: minmax(180px, 280px) minmax(240px, 300px) minmax(300px, 1fr) minmax(150px, 190px);
  align-items: stretch;
  gap: 12px 14px;
}

.package-form-side {
  display: grid;
  gap: 14px;
  grid-template-rows: 1fr 1fr;
}

.package-changelog-field textarea {
  height: 100%;
  min-height: 0;
}

.package-upload-box {
  display: grid;
  align-self: stretch;
}

.package-upload-box .file-field {
  display: grid;
  min-height: 0;
}

.package-upload-box .field-label,
.package-changelog-field > span {
  position: absolute;
  top: 0;
  left: 0;
  transform: none;
}

.package-upload-box,
.package-changelog-field {
  position: relative;
  padding-top: 24px;
}

.package-submit-box {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 52px 28px;
  align-content: stretch;
  justify-items: stretch;
  gap: 8px;
  padding-top: 24px;
}

.package-submit-box .primary {
  width: 100%;
  height: 52px;
  min-height: 52px;
  align-self: end;
  border-radius: 14px 10px 16px 11px;
  background:
    var(--download-gradient),
    var(--green);
  font-size: 17px;
  letter-spacing: 0;
  box-shadow: var(--button-shadow);
}

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

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.choice-card {
  position: relative;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 11px 8px 13px 9px;
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.choice-card:hover {
  transform: translate(1px, 1px);
  box-shadow: var(--button-shadow-hover);
}

.choice-card:has(input:checked) {
  background: var(--green-soft);
}

.choice-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-card input:focus-visible + .choice-dot {
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.choice-dot {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--ghost-bg);
}

.choice-dot::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green-deep);
  opacity: 0;
  transform: scale(0.7);
}

.choice-card input:checked + .choice-dot::after {
  opacity: 1;
}

.choice-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.15;
}

.choice-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.file-field {
  display: grid;
  gap: 8px;
}

.file-picker {
  position: relative;
  min-height: 92px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 2px dashed var(--line);
  border-radius: 14px 10px 16px 9px;
  background:
    var(--file-picker-bg),
    var(--paper-strong);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.file-picker.compact {
  height: 100%;
  min-height: 0;
  gap: 12px;
  padding: 11px 12px;
}

.file-picker:hover {
  background:
    var(--file-picker-hover-bg),
    var(--paper-strong);
  transform: translate(1px, 1px);
  box-shadow: var(--button-shadow-hover);
}

.file-picker.is-selected {
  border-style: solid;
  background:
    var(--file-picker-selected-bg),
    var(--paper-strong);
  box-shadow: var(--shadow-soft);
}

.file-picker.is-selected:hover {
  background:
    var(--file-picker-selected-hover-bg),
    var(--paper-strong);
}

.file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-picker:has(input:focus-visible) {
  box-shadow: 0 0 0 4px var(--focus-ring), var(--shadow-soft);
}

.file-picker-badge {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 16px 11px 18px 10px;
  background: var(--blue-soft);
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  transform: rotate(-3deg);
  box-shadow: var(--shadow-soft);
}

.file-picker.compact .file-picker-badge {
  width: 46px;
  height: 46px;
  font-size: 14px;
}

.file-picker.is-selected .file-picker-badge {
  background: var(--green);
  color: #fffdf5;
}

.file-picker-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.file-picker-copy strong {
  font-size: 18px;
  line-height: 1.15;
}

.file-picker-copy small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker.is-selected .file-picker-copy small {
  color: var(--green-deep);
}

#uploadHint {
  width: 100%;
  height: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1.5px solid transparent;
  border-radius: 8px 6px 9px 7px;
  color: var(--green-deep);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  visibility: hidden;
}

#uploadHint:not(:empty) {
  visibility: visible;
  border-color: rgba(63, 111, 100, 0.28);
  background: rgba(220, 235, 207, 0.58);
}

#uploadHint.is-busy {
  color: #465d6b;
  border-color: rgba(86, 123, 142, 0.28);
  background: var(--blue-soft);
}

#uploadHint.is-error {
  color: var(--danger-ink);
  border-color: rgba(127, 63, 56, 0.28);
  background: var(--red-soft);
}

.form-hint {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
}

.form-hint:empty {
  display: none;
}

.form-hint.is-busy {
  color: #465d6b;
  border-color: rgba(86, 123, 142, 0.28);
  background: var(--blue-soft);
}

.form-hint.is-success {
  color: var(--green-deep);
  border-color: rgba(63, 111, 100, 0.28);
  background: rgba(220, 235, 207, 0.58);
}

.form-hint.is-error {
  color: var(--danger-ink);
  border-color: rgba(127, 63, 56, 0.28);
  background: var(--red-soft);
}

#sourceImportHint,
#taskCreateHint,
.task-form-hint {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0 10px;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

td {
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  background: var(--surface-bg);
  font-weight: 800;
  vertical-align: top;
}

td:first-child {
  border-left: 2px solid var(--line);
  border-radius: 10px 0 0 10px;
}

td:last-child {
  border-right: 2px solid var(--line);
  border-radius: 0 10px 10px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.tag.published {
  background: var(--green-soft);
}

.tag.testing,
.tag.pending_review {
  background: var(--yellow-soft);
}

.tag.uploaded,
.tag.validating {
  background: var(--blue-soft);
}

.tag.user-active {
  background: var(--green-soft);
}

.tag.user-inactive {
  background: var(--red-soft);
}

.tag.archived,
.tag.deprecated {
  background: var(--red-soft);
}

.user-status-action {
  min-height: 32px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--button-shadow-soft);
}

.user-status-action.danger {
  background: var(--red-soft);
}

.user-status-action:hover {
  transform: translate(1px, 1px);
  box-shadow: var(--button-shadow-soft);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.row-actions button,
.row-actions a {
  min-height: 31px;
  padding: 0 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--secondary-bg);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  box-shadow: var(--button-shadow-soft);
}

.row-actions a.package-download {
  min-height: 36px;
  padding: 0 16px;
  background:
    var(--download-gradient),
    var(--green-soft);
  font-size: 14px;
  box-shadow: 3px 4px 0 rgba(63, 111, 100, 0.2);
}

.row-actions .package-download-disabled {
  min-height: 36px;
  padding: 0 14px;
  border: 2px dashed rgba(127, 63, 56, 0.48);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: rgba(127, 63, 56, 0.78);
  background: rgba(255, 246, 231, 0.7);
  font-size: 14px;
  font-weight: 900;
  box-shadow: none;
  cursor: not-allowed;
}

.package-danger-action {
  background: rgba(244, 203, 191, 0.84) !important;
}

.package-delete-action {
  background: rgba(127, 63, 56, 0.9) !important;
  color: #fffdf5 !important;
}

.package-publish-action {
  background: rgba(220, 235, 207, 0.86) !important;
}

.task-delete-action {
  background: rgba(244, 203, 191, 0.84) !important;
}

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

.package-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
  padding: 11px 14px 12px;
  border: 2px solid var(--line);
  border-radius: 11px 8px 13px 9px;
  background: var(--surface-bg);
  box-shadow: var(--shadow-soft);
}

.package-card.deprecated {
  border-color: var(--danger-ink);
  background:
    linear-gradient(115deg, var(--red-soft), var(--panel-bg) 52%, var(--red-soft)),
    var(--paper-strong);
  box-shadow: 3px 4px 0 rgba(127, 63, 56, 0.16);
}

.package-watermark {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 0;
  padding: 3px 14px 5px;
  border: 2px solid rgba(127, 63, 56, 0.2);
  border-radius: 10px 7px 12px 8px;
  color: rgba(127, 63, 56, 0.22);
  font-size: clamp(26px, 3vw, 46px);
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-7deg);
  pointer-events: none;
}

.package-card > *:not(.package-watermark) {
  position: relative;
  z-index: 1;
}

.package-card.deprecated .changelog-note {
  border-color: rgba(127, 63, 56, 0.42);
  background: rgba(255, 246, 231, 0.62);
}

.package-card:nth-child(2n) {
  transform: rotate(-0.08deg);
}

.package-card:nth-child(2n + 1) {
  transform: rotate(0.08deg);
}

.package-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.package-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.package-title-row,
.package-file-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.package-title strong {
  min-width: 0;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

.package-title small {
  min-width: 0;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}

.package-inline-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.package-inline-meta > span:not(.tag) {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1.5px solid var(--sketch-line);
  border-radius: 999px;
  background: var(--soft-chip-bg-light);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.package-inline-meta .tag {
  min-height: 23px;
  padding: 0 8px;
  border-width: 1.5px;
  font-size: 12px;
}

.package-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.package-meta {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1.5px solid var(--sketch-line);
  border-radius: 999px;
  background: var(--soft-chip-bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.package-meta b {
  color: var(--muted);
  font-size: 12px;
}

.package-meta em {
  font-style: normal;
}

.package-meta-status {
  background: var(--panel-bg);
  padding-right: 5px;
}

.package-meta-status .tag {
  min-height: 22px;
  padding: 0 8px;
  border-width: 1.5px;
  font-size: 12px;
}

.changelog-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 8px 10px;
  border: 1.5px dashed var(--sketch-line);
  border-radius: 9px 7px 11px 8px;
  background: rgba(255, 241, 173, 0.32);
}

.changelog-note span {
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.changelog-note p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
  word-break: break-word;
}

.changelog-note.empty {
  background: rgba(246, 234, 200, 0.34);
  border-style: solid;
}

.changelog-note.empty p,
.changelog-note.empty span {
  color: var(--muted);
}

.empty-list {
  padding: 18px 4px 6px;
}

.task-workbench {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(260px, 330px) minmax(320px, 360px);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.tree-panel,
.task-create-panel {
  align-self: start;
}

.tree-panel,
.selected-preview-panel {
  max-height: min(720px, calc(100vh - 220px));
  overflow: hidden;
}

.selected-preview-panel {
  min-height: 420px;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

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

.task-create-panel .is-muted-field {
  opacity: 0.58;
}

.task-create-panel .is-muted-field .custom-select-trigger,
.task-create-panel .is-muted-field select {
  cursor: not-allowed;
}

.task-distribution-preview {
  display: grid;
  gap: 8px;
}

.task-distribution-preview:empty {
  display: none;
}

.task-distribution-note {
  margin: 0;
  padding: 8px 10px;
  border: 1.5px dashed rgba(63, 111, 100, 0.36);
  border-radius: 8px;
  background: rgba(220, 235, 207, 0.44);
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.45;
}

.task-distribution-note.danger {
  border-color: rgba(127, 63, 56, 0.34);
  background: rgba(244, 203, 191, 0.5);
  color: var(--danger-ink);
}

.task-distribution-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border: 1.5px solid var(--sketch-line);
  border-radius: 8px 7px 9px 7px;
  background: var(--surface-bg);
}

.task-distribution-head strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.task-distribution-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.task-distribution-grid {
  max-height: 224px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.task-distribution-group {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border: 1.5px dashed var(--sketch-line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--paper-strong), var(--submission-bg)),
    var(--surface-bg);
}

.task-distribution-group strong,
.task-distribution-group span,
.task-distribution-group small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-distribution-group strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.task-distribution-group span {
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 900;
}

.task-distribution-group small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.source-import-form {
  align-items: end;
}

.tree-panel {
  min-height: 420px;
}

.tree-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
}

.tree-search input {
  min-height: 38px;
  padding: 8px 12px;
  border: 1.5px solid var(--sketch-line);
  border-radius: 8px 7px 9px 7px;
  background: rgba(255, 255, 251, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.tree-search input:focus {
  border-color: var(--green-deep);
  outline: 2px solid var(--focus-ring);
}

.tree-search span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.source-tree {
  max-height: min(620px, calc(100vh - 360px));
  overflow: auto;
  padding: 0;
  border: 1.5px solid var(--sketch-line);
  border-radius: 8px;
  background: rgba(255, 255, 251, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.source-tree.is-empty {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 16px;
}

.source-tree-empty {
  width: min(430px, 100%);
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border: 1.5px dashed var(--sketch-line);
  border-radius: 10px 8px 12px 9px;
  background:
    linear-gradient(135deg, var(--paper-strong), var(--submission-bg)),
    var(--surface-bg);
  box-shadow: var(--button-shadow-soft);
}

.source-tree-empty.is-compact {
  width: calc(100% - 22px);
  min-height: 64px;
  margin: 11px;
  padding: 11px 13px;
}

.source-tree-empty-icon {
  position: relative;
  width: 42px;
  height: 32px;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-radius: 5px 5px 7px 6px;
  background: #f7d97d;
  transform: rotate(-1deg);
}

.source-tree-empty-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -9px;
  width: 17px;
  height: 10px;
  border: 2px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #f7d97d;
}

.source-tree-empty-icon::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 9px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  transform: rotate(45deg);
}

.source-tree-empty strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.source-tree-empty span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
}

.selected-files-preview {
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1.5px solid var(--sketch-line);
  border-radius: 9px 7px 11px 8px;
  background:
    linear-gradient(135deg, var(--paper-strong), var(--submission-bg)),
    var(--surface-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.selected-preview-empty,
.selected-preview-head {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
}

.selected-preview-empty {
  justify-content: flex-start;
}

.selected-preview-empty strong,
.selected-preview-head strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.selected-preview-empty span,
.selected-preview-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.selected-preview-list {
  min-height: 0;
  flex: 1;
  max-height: none;
  overflow: auto;
  display: grid;
  align-content: start;
  border-top: 1px dashed var(--sketch-line);
}

.selected-preview-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--sketch-line);
}

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

.selected-preview-item:hover {
  background: rgba(219, 236, 247, 0.34);
}

.selected-preview-item div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.selected-preview-item strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-preview-item small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-preview-item button {
  min-height: 28px;
  padding: 0 9px;
  border: 1.5px solid rgba(127, 63, 56, 0.48);
  border-radius: 999px;
  background: rgba(244, 203, 191, 0.55);
  color: var(--danger-ink);
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--button-shadow-soft);
}

.selected-preview-item button:hover {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.tree-head,
.tree-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 72px 72px 66px;
  align-items: center;
  column-gap: 10px;
}

.tree-children {
  display: grid;
}

.tree-group {
  display: grid;
}

.tree-row {
  min-height: 31px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid var(--sketch-line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: default;
  box-shadow: none;
}

.tree-row:hover {
  background: var(--menu-hover-bg);
}

.tree-row.branch {
  cursor: pointer;
}

.tree-row.file .tree-main {
  cursor: pointer;
}

.tree-row.file .tree-main:hover strong {
  color: var(--green-deep);
  text-decoration: underline;
  text-decoration-color: var(--sketch-line);
  text-underline-offset: 3px;
}

.tree-row.is-open {
  background: var(--submission-bg);
}

.tree-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 28px;
  padding: 0 10px;
  border-bottom: 1.5px solid var(--sketch-line);
  background: var(--paper-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tree-head span:first-child {
  padding-left: 64px;
}

.tree-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: calc(var(--depth) * 18px);
}

.tree-toggle,
.tree-toggle-spacer {
  width: 16px;
  height: 22px;
  flex: 0 0 auto;
}

.tree-toggle {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.tree-toggle::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  transform: rotate(-45deg);
  transition: transform 0.12s ease;
}

.tree-row.is-open .tree-toggle::before {
  top: 5px;
  transform: rotate(45deg);
}

.tree-row input {
  width: 15px;
  min-height: 15px;
  padding: 0;
  box-shadow: none;
}

.tree-row:has(input:checked) {
  background: rgba(205, 226, 241, 0.5);
}

.tree-row.is-match .tree-main strong {
  color: #0f3444;
  text-decoration: underline;
  text-decoration-color: rgba(15, 52, 68, 0.35);
  text-underline-offset: 3px;
}

.tree-icon {
  width: 22px;
  height: 18px;
  flex: 0 0 auto;
  position: relative;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
}

.tree-icon.folder,
.tree-icon.root {
  height: 15px;
  margin-top: 2px;
  border: 1.5px solid var(--line);
  border-radius: 3px 3px 4px 4px;
  background: #f7d97d;
}

.tree-icon.folder::before,
.tree-icon.root::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -5px;
  width: 10px;
  height: 6px;
  border: 1.5px solid var(--line);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: #f7d97d;
}

.tree-icon.root {
  background: #cfe0ca;
}

.tree-icon.root::before {
  background: #cfe0ca;
}

.tree-icon.file {
  width: 18px;
  height: 22px;
  border: 1.5px solid var(--line);
  border-radius: 4px 3px 5px 3px;
  background: #fffefa;
}

.tree-icon.file::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -1px;
  width: 7px;
  height: 7px;
  border-left: 1.5px solid var(--line);
  border-bottom: 1.5px solid var(--line);
  border-radius: 0 3px 0 3px;
  background: #eef4f4;
}

.tree-main strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
  font-size: 14px;
}

.tree-row small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.tree-type,
.tree-size,
.tree-detail {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-empty {
  margin: 0;
  padding: 18px 12px;
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-card {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 11px 8px 13px 9px;
  background: var(--surface-bg);
  box-shadow: var(--shadow-soft);
}

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

.task-title-stack {
  min-width: 0;
  display: grid;
  gap: 4px;
}

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

.task-kicker,
.task-instructions {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.task-kicker {
  max-width: min(72ch, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card .row-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  white-space: normal;
}

.task-card .row-actions a.task-download-action {
  min-height: 36px;
  padding: 0 15px;
  background:
    var(--download-gradient),
    var(--green-soft);
  box-shadow: var(--button-shadow);
}

.task-card .row-actions .task-delete-action {
  background: rgba(255, 236, 229, 0.78);
}

.task-summary {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 9px 11px;
  border: 1.5px dashed var(--sketch-line);
  border-radius: 9px 7px 11px 8px;
  background: var(--summary-bg);
}

.task-summary-item {
  min-width: 92px;
  display: grid;
  gap: 2px;
}

.task-summary-item b {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.task-summary-item em {
  color: var(--ink);
  font-size: 15px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.25;
}

.task-submission {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1.5px dashed var(--sketch-line);
  border-radius: 9px 7px 11px 8px;
  background: var(--submission-bg);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.task-submission-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

.task-submission-line b {
  color: var(--ink);
  font-size: 14px;
}

.task-submission-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-submission-line small {
  color: var(--muted);
  white-space: nowrap;
}

.task-submission-note {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-instructions,
.task-review-note,
.task-submission,
.task-validation {
  margin: 0;
}

.task-instructions,
.task-review-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  padding: 8px 10px;
  border: 1.5px dashed var(--sketch-line);
  border-radius: 9px 7px 11px 8px;
  background: var(--soft-note-bg);
}

.task-review-note {
  background: rgba(244, 203, 191, 0.42);
}

.task-instructions b,
.task-review-note b {
  color: var(--ink);
}

.task-review-note span {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-validation {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px 7px 11px 8px;
  font-size: 14px;
  font-weight: 900;
}

.task-validation b {
  color: var(--ink);
}

.task-validation.ok {
  background: var(--green-soft);
}

.task-validation.warn {
  background: var(--red-soft);
}

.task-state-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 9px 7px 11px 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.task-state-note.waiting {
  background: var(--yellow-soft);
}

.task-state-note.fix {
  background: var(--red-soft);
}

.task-return-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1.5px solid var(--sketch-line);
  border-radius: 9px 7px 11px 8px;
  background: var(--return-form-bg);
}

.task-return-form input[type="file"] {
  min-height: 38px;
  padding: 7px 10px;
}

.task-form-hint {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.task-review-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.submission-download {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--download-gradient);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: var(--button-shadow-hover);
}

.submission-download:hover {
  transform: translate(1px, 1px);
  box-shadow: var(--button-shadow-soft);
}

.secondary.danger {
  background: var(--red-soft);
}

.tag.task-draft {
  background: var(--paper-soft);
}

.tag.task-assigned {
  background: var(--blue-soft);
}

.tag.task-submitted {
  background: var(--yellow-soft);
}

.tag.task-needs_fix,
.tag.task-rejected {
  background: var(--red-soft);
}

.tag.task-approved {
  background: var(--green-soft);
}

.tag.workflow-pending {
  background: var(--paper-soft);
}

.tag.workflow-active {
  background: var(--blue-soft);
}

.tag.workflow-done {
  background: var(--green-soft);
}

.tag.workflow-warning {
  background: var(--yellow-soft);
}

.tag.workflow-failed,
.tag.workflow-blocked {
  background: var(--red-soft);
}

.workflow-list {
  display: grid;
  gap: 16px;
}

.workflow-card,
.workflow-empty {
  border: 2px solid var(--line);
  border-radius: 11px 8px 13px 9px;
  background:
    linear-gradient(135deg, var(--paper-strong), var(--return-form-bg)),
    var(--surface-bg);
  box-shadow: var(--shadow-soft);
}

.workflow-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.workflow-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
}

.workflow-empty strong {
  color: var(--ink);
  font-size: 17px;
}

.workflow-empty span {
  color: var(--muted);
  font-weight: 900;
}

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

.workflow-card-copy {
  min-width: 0;
}

.workflow-card-head strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.workflow-card-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.workflow-card-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workflow-card-status {
  min-width: 104px;
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.workflow-card-status b {
  color: var(--green-deep);
  font-size: 22px;
  line-height: 1;
}

.workflow-tree-toggle {
  min-width: 96px;
  min-height: 36px;
  padding: 8px 14px;
  white-space: nowrap;
}

.workflow-tree-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}

.workflow-card.is-open .workflow-tree-toggle::after {
  transform: translateY(2px) rotate(225deg);
}

.workflow-progress {
  height: 13px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.workflow-progress span {
  height: 100%;
  display: block;
  border-right: 2px solid rgba(36, 48, 56, 0.18);
  background:
    linear-gradient(90deg, var(--green-soft), var(--green)),
    var(--green-soft);
}

.workflow-node-tree {
  display: grid;
  gap: 9px;
}

.workflow-node {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(86px, auto) minmax(260px, 360px);
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1.5px solid var(--sketch-line);
  border-radius: 9px 7px 11px 8px;
  background: rgba(255, 255, 251, 0.72);
}

.workflow-node::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 48px;
  bottom: -17px;
  width: 2px;
  background: var(--sketch-line);
}

.workflow-node:last-child::before {
  display: none;
}

.workflow-node.active {
  background: rgba(217, 237, 245, 0.5);
}

.workflow-node.pending {
  background: rgba(255, 255, 251, 0.84);
}

.workflow-node.pending .workflow-node-copy,
.workflow-node.pending .workflow-node-meta {
  color: rgba(36, 48, 56, 0.72);
}

.workflow-node.done {
  background: rgba(220, 235, 207, 0.58);
}

.workflow-node.warning {
  background: rgba(255, 241, 173, 0.52);
}

.workflow-node.failed,
.workflow-node.blocked {
  background: rgba(244, 203, 191, 0.58);
}

.workflow-node-marker {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--button-shadow-soft);
}

.workflow-node.done .workflow-node-marker {
  background: var(--green-soft);
}

.workflow-node.active .workflow-node-marker {
  background: var(--blue-soft);
}

.workflow-node.warning .workflow-node-marker {
  background: var(--yellow-soft);
}

.workflow-node.failed .workflow-node-marker,
.workflow-node.blocked .workflow-node-marker {
  background: var(--red-soft);
}

.workflow-node-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.workflow-node-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workflow-node-title strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.25;
}

.workflow-node-copy p,
.workflow-node-copy small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.workflow-note {
  color: var(--danger-ink) !important;
}

.workflow-node-meta {
  display: grid;
  justify-items: end;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.workflow-node-meta span {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1.5px dashed var(--sketch-line);
  border-radius: 999px;
  background: var(--subtle-surface-bg);
  color: var(--ink);
}

.workflow-node-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(120px, 0.85fr) minmax(110px, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.workflow-node-controls .custom-select {
  min-width: 0;
  width: 100%;
}

.workflow-node-controls .custom-select-trigger,
.workflow-node-controls input,
.workflow-node-controls button {
  min-height: 34px;
}

.workflow-node-controls input {
  padding: 7px 10px;
  border-width: 1.5px;
  border-radius: 8px 6px 9px 7px;
  box-shadow: var(--button-shadow-soft);
}

.workflow-node-controls button {
  padding-inline: 11px;
}

.task-review-workbench-action {
  background: var(--blue-soft) !important;
}

.review-workspace-panel {
  min-height: 520px;
}

.review-workspace-head {
  align-items: center;
}

.review-toolbar {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.review-picker-group {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 10px;
}

.review-picker-group .custom-select {
  min-width: 0;
  width: 100%;
}

.review-action-group {
  min-width: max-content;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.review-action-group .secondary {
  min-height: 38px;
  padding-inline: 12px;
}

.sync-toggle {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--button-shadow-soft);
  white-space: nowrap;
}

.sync-toggle input {
  flex: 0 0 auto;
  width: 16px;
  min-height: 16px;
  padding: 0;
  box-shadow: none;
}

.sync-toggle span {
  white-space: nowrap;
  writing-mode: horizontal-tb;
}

body.review-fullscreen-open {
  overflow: hidden;
}

.review-workspace-panel.is-fullscreen {
  position: fixed;
  inset: 10px;
  z-index: 80;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 0 9999px rgba(36, 48, 56, 0.24), var(--shadow);
}

.review-workspace-panel.is-fullscreen .review-workbench {
  min-height: 0;
  overflow: hidden;
}

.review-workspace-panel.is-fullscreen .review-pane-grid {
  min-height: 0;
}

.review-workspace-panel.is-fullscreen .review-pane {
  grid-template-rows: auto minmax(0, 1fr);
}

.review-workbench-empty,
.review-workbench {
  border: 1.5px solid var(--sketch-line);
  border-radius: 9px 7px 11px 8px;
  background:
    linear-gradient(135deg, var(--paper-strong), var(--submission-bg)),
    var(--surface-bg);
}

.review-workbench-empty {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}

.review-workbench-empty strong {
  color: var(--ink);
  font-size: 18px;
}

.review-workbench-empty span {
  max-width: 56ch;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.45;
}

.review-workbench {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.review-workbench-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 10px;
  border-bottom: 1px dashed var(--sketch-line);
}

.review-workbench-file {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.review-workbench-file strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-workbench-file span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.review-edit-state {
  flex: 0 0 auto;
  max-width: min(460px, 48%);
  padding: 5px 9px;
  border: 1.5px solid var(--sketch-line);
  border-radius: 999px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-edit-state.editable {
  border-color: rgba(63, 111, 100, 0.38);
  background: rgba(220, 235, 207, 0.72);
  color: var(--green-deep);
}

.review-edit-state.readonly {
  border-color: rgba(127, 63, 56, 0.24);
  background: rgba(244, 203, 191, 0.42);
  color: var(--danger-ink);
}

.review-pane-grid {
  display: grid;
  grid-template-columns: repeat(var(--pane-count), minmax(250px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.review-pane {
  min-width: 250px;
  display: grid;
  grid-template-rows: auto minmax(260px, 62vh);
  border: 1.5px solid var(--sketch-line);
  border-radius: 8px 6px 10px 7px;
  background: rgba(255, 255, 251, 0.88);
  overflow: hidden;
}

.review-pane.missing {
  background: rgba(244, 203, 191, 0.28);
}

.review-pane-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1.5px solid var(--sketch-line);
  background: var(--paper-strong);
}

.review-pane-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.review-pane-head strong,
.review-pane-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-pane-head strong {
  color: var(--ink);
  font-size: 14px;
}

.review-pane-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.review-offset-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.review-offset-control input {
  width: 58px;
  min-height: 30px;
  padding: 5px 6px;
  border-width: 1.5px;
  border-radius: 7px 5px 8px 6px;
  text-align: center;
  box-shadow: var(--button-shadow-soft);
}

.review-line-list {
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(36, 48, 56, 0.025) 1px, transparent 1px),
    var(--paper-strong);
  background-size: 34px 34px, auto;
}

.review-line {
  min-height: 28px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  border-bottom: 1px solid rgba(36, 48, 56, 0.12);
  color: var(--ink);
  font-family: "Consolas", "SFMono-Regular", "Menlo", monospace;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.review-line-number {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 5px 7px 5px 4px;
  border-right: 1px solid rgba(36, 48, 56, 0.14);
  background: rgba(217, 237, 245, 0.28);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  user-select: none;
}

.review-line-text {
  min-width: 0;
  padding: 5px 8px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.review-line.is-editable {
  cursor: text;
}

.review-line-edit {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(46px, auto);
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
}

.review-line-input {
  min-width: 0;
  width: 100%;
  min-height: 24px;
  height: 24px;
  padding: 2px 7px;
  border: 1.5px solid rgba(36, 48, 56, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 251, 0.92);
  color: var(--ink);
  font: inherit;
  line-height: 1.25;
  box-shadow: none;
}

.review-line-input:focus {
  border-color: var(--green-deep);
  outline: none;
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.review-line-save {
  min-height: 24px;
  padding: 0 8px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--secondary-bg);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--button-shadow-soft);
}

.review-line-save:hover {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.review-line-save:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.review-line-save-status {
  min-width: 46px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.review-line-save-status.is-success {
  color: var(--green-deep);
}

.review-line-save-status.is-error {
  color: var(--danger-ink);
}

.review-line.is-empty .review-line-text {
  background: rgba(244, 203, 191, 0.18);
}

.review-line.is-active {
  background: rgba(255, 241, 173, 0.62);
}

.review-line.is-active .review-line-number {
  background: var(--yellow-soft);
  color: var(--ink);
}

.review-line.is-active .review-line-text {
  box-shadow: inset 3px 0 0 var(--green-deep);
}

.review-line.is-changed {
  background: rgba(244, 203, 191, 0.42);
}

.review-line.is-changed .review-line-number {
  background: rgba(244, 203, 191, 0.68);
  color: var(--danger-ink);
}

.review-line.is-changed .review-line-text {
  color: var(--danger-ink);
  box-shadow: inset 3px 0 0 var(--danger-ink);
}

.review-line-diff {
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(127, 63, 56, 0.16);
  color: var(--danger-ink);
  font-weight: 900;
}

.review-line.is-changed.is-active {
  background: linear-gradient(90deg, rgba(244, 203, 191, 0.74), rgba(255, 241, 173, 0.58));
}

.compact-list {
  display: grid;
  gap: 10px;
}

.recent-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.recent-controls button {
  min-height: 31px;
  padding: 0 10px;
}

.compact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px 8px 12px 8px;
  background: var(--paper-strong);
  box-shadow: var(--shadow-soft);
}

.compact-item strong {
  display: block;
}

.compact-item small {
  color: var(--muted);
  font-size: 14px;
}

.compact-item .recent-changelog {
  display: block;
  max-width: 520px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 7px;
}

.bar-row span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.bar-row em {
  font-style: normal;
}

.bar-track {
  height: 14px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper-strong);
}

.bar-fill {
  height: 100%;
  background: var(--green);
}

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

small,
small.muted {
  font-size: 14px;
  line-height: 1.35;
}

.matrix-table {
  border-spacing: 0 12px;
}

.matrix-table th {
  padding: 6px 8px 8px;
}

.matrix-table td,
.matrix-table td:first-child,
.matrix-table td:last-child {
  padding: 5px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.matrix-version-cell,
.matrix-package-cell {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 11px 13px;
  border: 2px solid var(--line);
  border-radius: 10px 8px 12px 8px;
  background: var(--paper-strong);
  box-shadow: var(--button-shadow-soft);
}

.matrix-version-cell {
  background: var(--paper-soft);
}

.matrix-version-cell strong,
.matrix-package-cell strong {
  font-size: 16px;
  line-height: 1.15;
}

.matrix-version-cell small {
  color: var(--muted);
}

.matrix-package-cell.published {
  background: #f6fbef;
}

.matrix-package-cell.testing,
.matrix-package-cell.pending_review {
  background: #fff8dc;
}

.matrix-package-cell.uploaded,
.matrix-package-cell.validating {
  background: #f0f9fc;
}

.matrix-package-cell.archived,
.matrix-package-cell.deprecated {
  background: #fff2ef;
}

.matrix-package-cell.empty {
  color: var(--muted);
  border-style: dashed;
  background: var(--subtle-surface-bg);
}

.matrix-status-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.matrix-status-line i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--paper-soft);
}

.matrix-status-line.published i {
  background: var(--green);
}

.matrix-status-line.testing i,
.matrix-status-line.pending_review i {
  background: #e3b45b;
}

.matrix-status-line.uploaded i,
.matrix-status-line.validating i {
  background: #8bb9ce;
}

.matrix-status-line.archived i,
.matrix-status-line.deprecated i {
  background: #c87562;
}

.matrix-status-line.empty i {
  background: #c9c0aa;
}

@media (max-width: 980px) {
  .confirm-copy {
    padding-right: 0;
  }

  .confirm-stamp {
    position: static;
    justify-self: start;
    transform: rotate(-3deg);
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .sidebar {
    height: auto;
    max-height: none;
    min-height: auto;
    position: sticky;
    top: 0;
    z-index: 5;
  }

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

  .metric-grid,
  .content-grid,
  .form-grid,
  .form-grid.compact,
  .choice-group,
  .task-workbench,
  .task-return-form {
    grid-template-columns: 1fr;
  }

  .file-picker {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar,
  .panel-head,
  .filters,
  .audit-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .title-row {
    align-items: flex-start;
  }

  .package-card-main {
    flex-direction: column;
  }

  .task-card-head {
    flex-direction: column;
  }

  .tree-panel,
  .selected-preview-panel {
    max-height: none;
    overflow: visible;
  }

  .source-tree {
    max-height: 54vh;
  }

  .selected-preview-panel {
    min-height: 280px;
  }

  .selected-files-preview {
    max-height: 54vh;
  }

  .workflow-card-head,
  .review-workbench-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .review-workspace-head {
    align-items: stretch;
  }

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

  .review-picker-group {
    grid-template-columns: 1fr;
  }

  .review-action-group {
    min-width: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .sync-toggle {
    min-width: max-content;
  }

  .workflow-card-status {
    justify-items: start;
  }

  .workflow-card-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  .workflow-node {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .workflow-node-meta,
  .workflow-node-controls {
    grid-column: 2;
    justify-items: start;
  }

  .workflow-node-controls {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .review-pane-grid {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .review-pane {
    min-width: 0;
    grid-template-rows: auto minmax(260px, 54vh);
  }

  .task-card .row-actions {
    justify-content: flex-start;
  }

  .task-summary-item {
    min-width: 118px;
  }

  .task-submission-line,
  .task-instructions {
    grid-template-columns: 1fr;
  }

  .task-submission-line small {
    white-space: normal;
  }

  .package-card-main .row-actions {
    white-space: normal;
  }

  .changelog-note {
    grid-template-columns: 1fr;
  }

  .tree-head,
  .tree-row {
    grid-template-columns: minmax(180px, 1fr) 58px 62px;
  }

  .tree-head span:first-child {
    padding-left: 58px;
  }

  .tree-search {
    grid-template-columns: 1fr;
  }

  .tree-search span {
    justify-self: start;
  }

  .tree-detail {
    display: none;
  }

  h2 {
    font-size: 28px;
  }
}
