:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --panel: #fffdfa;
  --panel-strong: #f0ece2;
  --line: #ddd6c8;
  --line-strong: #c7bca7;
  --text: #24211d;
  --muted: #746d61;
  --soft: #9b907e;
  --accent: #a27a2b;
  --accent-dark: #7c5b1c;
  --success: #28715a;
  --warning: #9a6526;
  --danger: #9b3d32;
  --shadow: 0 18px 42px rgba(44, 37, 25, 0.1);
  --radius: 8px;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background:
    linear-gradient(90deg, rgba(36, 33, 29, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 33, 29, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(36, 33, 29, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 33, 29, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
}

.auth-screen[hidden],
.app-shell[hidden],
[data-admin-only][hidden],
.runtime-pill[hidden],
.runtime-version-pill[hidden] {
  display: none;
}

.module-access-panel[hidden],
.content-grid[hidden] {
  display: none;
}

.auth-card {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.94);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 20px;
}

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

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

.auth-form input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
  font-weight: 750;
}

.auth-submit-button {
  width: 100%;
  min-height: 46px;
}

.auth-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.86);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--panel);
  background: #2a261f;
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  font-weight: 800;
}

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

h1 {
  font-size: 18px;
  line-height: 1.25;
}

h2 {
  font-size: 24px;
  line-height: 1.16;
}

h3 {
  font-size: 17px;
  line-height: 1.25;
}

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

.user-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.78);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-chip strong {
  min-width: 44px;
  border-radius: 999px;
  background: rgba(40, 113, 90, 0.1);
  color: var(--success);
  padding: 4px 8px;
  text-align: center;
  font-size: 11px;
}

.logout-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  padding: 0 11px;
  font-size: 13px;
  font-weight: 850;
}

.logout-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--text);
  background: #ffffff;
}

.runtime-pill,
.runtime-version-pill,
.module-stats,
.task-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.78);
  color: var(--muted);
  font-size: 13px;
}

.runtime-pill {
  gap: 4px;
  min-height: 38px;
  padding: 4px;
  transition: border-color 180ms ease, background 180ms ease;
}

.runtime-pill.api,
.runtime-version-pill {
  border-color: rgba(162, 122, 43, 0.36);
  background: rgba(255, 249, 236, 0.92);
}

.runtime-version-pill {
  min-height: 38px;
  padding: 7px 12px;
  color: var(--accent-dark);
  font-weight: 900;
}

.runtime-version-pill strong {
  font-size: 13px;
  line-height: 1;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(40, 113, 90, 0.12);
}

.runtime-pill .status-dot {
  margin: 0 5px 0 4px;
}

.runtime-pill.api .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(162, 122, 43, 0.14);
}

.runtime-option {
  position: relative;
  display: inline-flex;
}

.runtime-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.runtime-option span {
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.runtime-option input:checked + span {
  background: #fffdfa;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.runtime-pill.api .runtime-option input:checked + span {
  color: var(--accent-dark);
}

.icon-button {
  width: 38px;
  height: 38px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

.topbar-action-button {
  min-height: 38px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 850;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.topbar-action-button:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

.topbar-action-button.danger {
  color: var(--danger);
}

.topbar-action-button.danger:hover {
  border-color: rgba(155, 61, 50, 0.32);
  background: #fff7f4;
}

.topbar-action-button.admin:hover {
  border-color: rgba(40, 113, 90, 0.3);
  background: rgba(40, 113, 90, 0.08);
}

.topbar-action-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-guide-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  color: var(--accent-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.module-guide-button:hover {
  border-color: rgba(162, 122, 43, 0.45);
  background: #fff9ec;
}

.module-guide-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fffdfa;
  background: var(--accent);
  font-size: 11px;
  line-height: 1;
}

.topbar-count.alert {
  background: var(--danger);
}

.topbar-count.active {
  background: var(--success);
}

.icon-button:active,
.topbar-action-button:active,
.module-guide-button:active,
.primary-button:active,
.secondary-button:active,
.stepper button:active {
  transform: translateY(1px) scale(0.99);
}

.icon-button svg,
.upload-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.plain {
  background: transparent;
}

.task-count {
  position: absolute;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  top: -7px;
  right: -7px;
  color: #fffdfa;
  background: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

.module-rail {
  padding: 20px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.54);
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.rail-heading {
  margin-bottom: 16px;
}

.module-list {
  display: grid;
  gap: 8px;
}

.module-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 8px;
  color: var(--text);
  background: rgba(255, 253, 250, 0.76);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.module-item strong {
  display: block;
  font-size: 14px;
}

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

.module-item small {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--soft);
  font-size: 11px;
}

.module-item.active {
  border-color: rgba(162, 122, 43, 0.5);
  background: #fff9ec;
}

.module-item:not(.disabled):hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.module-item.disabled {
  opacity: 0.62;
}

.module-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.76);
  padding: 12px;
  display: grid;
  gap: 5px;
}

.module-empty strong {
  font-size: 14px;
}

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

.module-access-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  padding: 22px;
  display: grid;
  align-content: center;
  min-height: 320px;
  gap: 8px;
  box-shadow: var(--shadow);
}

.module-access-panel h3 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
}

.module-access-panel p {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.55;
}

.main-panel {
  padding: 22px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.module-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.module-stats {
  flex-wrap: wrap;
  border-radius: var(--radius);
}

.module-stats span + span {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 340px);
  grid-template-areas:
    "operation settings"
    "upload create";
  gap: 16px;
  align-items: stretch;
}

.work-column {
  display: contents;
}

.settings-panel {
  display: contents;
}

.tool-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.82);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tool-section.compact {
  padding: 16px;
}

.operation-section {
  grid-area: operation;
}

.upload-section {
  grid-area: upload;
}

.task-settings-section {
  grid-area: settings;
}

.task-create-section {
  grid-area: create;
}

.section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-title p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-top: 4px;
}

.step-index {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fffdfa;
  background: var(--text);
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}

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

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

.field-block > span,
.quality-field legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefa;
  color: var(--text);
  padding: 0 12px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

select:focus,
input[type="number"]:focus {
  border-color: rgba(162, 122, 43, 0.66);
  box-shadow: 0 0 0 4px rgba(162, 122, 43, 0.12);
}

.quality-field {
  border: 0;
  padding: 0;
  margin: 0;
  grid-column: 1 / -1;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.segment-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment-option span {
  min-height: 48px;
  border-radius: 6px;
  display: grid;
  gap: 2px;
  place-items: center;
  color: var(--muted);
  line-height: 1.15;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.segment-option b {
  font-size: 13px;
  font-weight: 850;
}

.segment-option small {
  font-size: 11px;
  font-weight: 700;
}

.segment-option input:checked + span {
  background: #fffdfa;
  color: var(--accent-dark);
  box-shadow: 0 5px 16px rgba(44, 37, 25, 0.1);
}

.segment-option.is-locked span {
  color: rgba(111, 105, 95, 0.68);
  background: rgba(246, 241, 232, 0.58);
}

.segment-option.is-locked input:checked + span {
  color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(161, 70, 56, 0.24);
}

.quality-permission-note {
  min-height: 13px;
  color: var(--danger);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
}

.quality-note {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(162, 122, 43, 0.22);
  border-radius: var(--radius);
  background: #fff9ec;
}

.quality-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quality-note strong {
  font-size: 14px;
}

.quality-note p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.quality-limit-list {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.quality-limit-list li {
  display: grid;
  grid-template-columns: minmax(64px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  min-height: 24px;
  padding: 6px 8px;
  border: 1px solid rgba(162, 122, 43, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
}

.quality-limit-list li span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quality-limit-list li strong {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 14px;
  flex: 1;
}

.upload-channel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.upload-zone {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fffefa;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.upload-zone:hover,
.upload-zone:focus-visible,
.upload-zone:focus-within,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: #fff9ec;
}

.upload-zone:focus-visible,
.upload-zone:focus-within {
  outline: 3px solid rgba(162, 122, 43, 0.18);
  outline-offset: 2px;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
}

.upload-zone > span {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.upload-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  background: rgba(162, 122, 43, 0.1);
}

.upload-title {
  font-weight: 800;
}

.upload-meta {
  color: var(--muted);
  font-size: 13px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-alert {
  margin-top: 12px;
  border: 1px solid rgba(154, 101, 38, 0.22);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--warning);
  background: rgba(154, 101, 38, 0.08);
  font-size: 13px;
  line-height: 1.5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
}

.inline-alert[hidden] {
  display: none;
}

.inline-alert strong,
.inline-alert span,
.inline-alert small {
  min-width: 0;
}

.inline-alert strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.inline-alert span {
  color: inherit;
}

.inline-alert small {
  grid-column: 1 / 2;
  color: var(--muted);
  font-size: 12px;
}

.inline-alert-action {
  grid-column: 2;
  grid-row: 1 / span 3;
  min-height: 32px;
  border: 1px solid rgba(154, 101, 38, 0.26);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--accent-dark);
  background: #fffdfa;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.inline-alert.info {
  grid-template-columns: minmax(0, 1fr);
  border-color: rgba(43, 122, 98, 0.22);
  color: #2f725d;
  background: rgba(43, 122, 98, 0.08);
}

.inline-alert.info small,
.inline-alert.info .inline-alert-action {
  display: none;
}

.upload-quality-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fffdfa;
}

.upload-quality-summary[hidden] {
  display: none;
}

.upload-quality-summary > strong {
  color: var(--ink);
  font-size: 13px;
}

.upload-quality-summary > div {
  display: grid;
  gap: 7px;
}

.upload-quality-row {
  display: grid;
  grid-template-columns: minmax(76px, 0.58fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.upload-quality-row span,
.upload-quality-row small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quality-chip {
  justify-self: end;
  border: 1px solid rgba(43, 122, 98, 0.2);
  border-radius: 999px;
  padding: 3px 7px;
  color: #2f725d;
  background: rgba(43, 122, 98, 0.08);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.quality-chip.warning {
  border-color: rgba(154, 101, 38, 0.22);
  color: var(--warning);
  background: rgba(154, 101, 38, 0.08);
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.upload-preview-grid.single {
  grid-template-columns: minmax(0, 164px);
}

.clear-channel-button {
  justify-self: start;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  color: var(--muted);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}

.clear-channel-button:hover {
  border-color: rgba(154, 60, 38, 0.3);
  color: var(--text);
  background: #fff8f2;
}

.clear-channel-button:active {
  transform: translateY(1px);
}

.preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fffdfa;
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.upload-preview-button {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: var(--panel-strong);
  padding: 0;
  cursor: zoom-in;
  overflow: hidden;
}

.upload-preview-button:focus-visible {
  outline: 2px solid rgba(162, 122, 43, 0.58);
  outline-offset: -2px;
}

.preview-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: var(--panel-strong);
  transition: transform 180ms ease, filter 180ms ease;
}

.upload-preview-button:hover img {
  transform: scale(1.025);
  filter: saturate(1.04);
}

.preview-card span {
  display: block;
  padding: 8px 8px 3px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-card small {
  display: block;
  padding: 0 8px 8px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-preview-meta {
  margin: 0;
  padding: 0 8px 9px;
  display: grid;
  gap: 4px;
}

.upload-preview-meta div {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.upload-preview-meta dt,
.upload-preview-meta dd {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
}

.upload-preview-meta dt {
  flex: 0 0 auto;
  color: var(--soft);
}

.upload-preview-meta dd {
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.preview-remove-button {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(42, 38, 32, 0.14);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.92);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(56, 47, 32, 0.12);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.preview-remove-button:hover {
  border-color: rgba(154, 60, 38, 0.34);
  background: #fff7f2;
}

.preview-remove-button:active {
  transform: translateY(1px) scale(0.98);
}

.stepper {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 6px;
}

.stepper button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  color: var(--text);
  font-size: 20px;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.summary-stack {
  display: grid;
  gap: 1px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.task-settings-section .summary-stack {
  margin-top: auto;
}

.summary-stack div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  background: rgba(255, 253, 250, 0.78);
}

.summary-stack span {
  color: var(--muted);
  font-size: 13px;
}

.summary-stack strong {
  font-size: 13px;
  text-align: right;
}

.summary-stack .cost-estimate-row {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  align-items: start;
  row-gap: 4px;
}

.cost-estimate-row strong {
  color: var(--accent-dark);
}

.cost-estimate-row small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.action-stack {
  display: grid;
  gap: 8px;
}

.task-create-section .action-stack {
  margin-top: auto;
}

.failure-test-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(162, 122, 43, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 248, 234, 0.58);
}

.failure-test-panel[hidden] {
  display: none;
}

.failure-test-panel span {
  display: block;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.failure-test-panel small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.debug-action-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(162, 122, 43, 0.34);
  border-radius: var(--radius-sm);
  color: var(--accent-dark);
  background: #fffdfa;
  font-weight: 800;
  white-space: nowrap;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.debug-action-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #fff3dc;
}

.debug-action-button:disabled {
  color: var(--soft);
  background: var(--panel-strong);
}

.create-checklist {
  display: grid;
  gap: 10px;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.62);
}

.create-checklist div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(218, 211, 196, 0.72);
}

.create-checklist div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.create-checklist span {
  color: var(--muted);
  font-size: 13px;
}

.create-checklist strong {
  font-size: 13px;
  text-align: right;
}

.api-create-warning {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(162, 122, 43, 0.32);
  border-radius: var(--radius-sm);
  background: #fff8ea;
}

.api-create-warning[hidden] {
  display: none;
}

.api-create-warning strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.api-create-warning span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.primary-button,
.secondary-button {
  width: 100%;
  min-height: 44px;
  border-radius: var(--radius);
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.primary-button {
  border: 1px solid var(--accent-dark);
  color: #fffdfa;
  background: var(--accent-dark);
}

.primary-button:hover:not(:disabled) {
  background: #644813;
}

.primary-button:disabled {
  border-color: var(--line);
  color: var(--soft);
  background: var(--panel-strong);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: #fffdfa;
  padding: 0 14px;
  width: auto;
}

.secondary-button.full {
  width: 100%;
}

.secondary-button:hover {
  border-color: var(--line-strong);
}

.bottom-bar {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  min-height: 66px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 250, 0.9);
  backdrop-filter: blur(18px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
}

.bottom-status {
  display: grid;
  gap: 3px;
  min-width: 0;
}

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

.bottom-actions .secondary-button {
  width: auto;
  white-space: nowrap;
}

.bottom-create-button {
  width: auto;
  min-width: 178px;
  padding: 0 18px;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(124, 91, 28, 0.16);
}

.bottom-create-button:disabled {
  box-shadow: none;
}

.bottom-next-button {
  min-width: 116px;
  border-color: rgba(162, 122, 43, 0.28);
  color: var(--accent-dark);
  background: #fff8ea;
  white-space: nowrap;
}

.bottom-next-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #fff3dc;
}

.bottom-next-button.clear-current-assets-button {
  border-color: rgba(124, 91, 28, 0.36);
  color: var(--text);
  background: #fffdfa;
}

.bottom-next-button.clear-current-assets-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #fff8ea;
}

.bottom-bar span {
  color: var(--muted);
  font-size: 13px;
}

.bottom-bar strong {
  font-size: 14px;
}

.bottom-status small {
  color: var(--accent-dark);
  font-size: 11px;
  line-height: 1.35;
}

.bottom-status small[hidden] {
  display: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 33, 29, 0.22);
  z-index: 50;
}

.drawer-backdrop[hidden],
.task-drawer[hidden] {
  display: none;
}

.task-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100dvh;
  z-index: 60;
  border-left: 1px solid var(--line);
  background: #fffdfa;
  box-shadow: -20px 0 48px rgba(44, 37, 25, 0.16);
  transform: translateX(104%);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
}

#taskDrawer {
  width: min(1080px, calc(100vw - 48px));
  grid-template-rows: auto minmax(0, 1fr);
}

.task-drawer.open {
  transform: translateX(0);
}

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

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

.task-drawer-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.task-drawer.is-admin-task-mode .task-drawer-body {
  grid-template-columns: minmax(0, 1fr);
}

.task-drawer.is-admin-task-mode .task-control-panel,
.task-drawer.is-admin-task-mode .task-list-panel {
  display: none;
}

.task-control-panel,
.task-list-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.86);
}

.task-control-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 12px;
}

.task-control-panel .task-toolbar {
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.task-control-panel .task-filter-bar {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.task-control-panel .task-filter-grid {
  grid-template-columns: 1fr;
}

.task-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding: 12px;
}

.admin-task-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.9);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.admin-task-panel[hidden] {
  display: none;
}

.admin-task-panel-header,
.admin-task-filter-actions,
.admin-task-card-topline,
.admin-task-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-task-panel-header h3,
.admin-task-detail-header h3 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.05;
}

.admin-task-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-task-filter-actions {
  align-items: end;
}

.admin-task-filter-actions .task-filter-summary {
  flex: 1;
}

.admin-task-filter-actions .task-reset-filter-button {
  width: auto;
  min-width: 120px;
}

.admin-task-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  overflow: hidden;
}

.admin-task-list-panel,
.admin-task-detail-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.74);
}

.admin-task-list-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.admin-task-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.admin-task-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--text);
  display: grid;
  gap: 7px;
  padding: 12px;
  text-align: left;
}

.admin-task-card:hover,
.admin-task-card.selected {
  border-color: rgba(162, 122, 43, 0.52);
  background: #fff9ec;
}

.admin-task-card-topline strong,
.admin-task-card-id {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-task-card-topline strong {
  font-size: 15px;
  line-height: 1.2;
}

.admin-task-card-id,
.admin-task-card-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.admin-task-card-meta {
  display: block;
}

.admin-task-detail-panel {
  overflow: auto;
  padding: 14px;
}

.admin-task-detail-empty {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.admin-task-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.admin-task-detail-grid > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  display: grid;
  gap: 5px;
  padding: 10px;
}

.admin-task-detail-grid span,
.admin-task-detail-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
}

.admin-task-detail-grid strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.task-list-panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.task-list-panel-header h3 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.05;
}

.task-list-panel .task-list {
  padding-right: 4px;
}

.task-summary {
  width: 100%;
  justify-content: space-between;
  border-radius: var(--radius);
}

.task-filter-bar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.78);
  padding: 10px;
  display: grid;
  gap: 10px;
}

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

.task-filter-field,
.task-search-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.task-filter-field span,
.task-search-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.task-filter-field select,
.task-search-input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdfa;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 0 10px;
}

.task-filter-field select:focus,
.task-search-input:focus {
  outline: 2px solid rgba(162, 122, 43, 0.18);
  border-color: rgba(162, 122, 43, 0.42);
}

.task-search-input::placeholder {
  color: var(--soft);
  font-weight: 700;
}

.task-filter-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.task-reset-filter-button {
  width: 100%;
}

.task-list-footer {
  display: flex;
  justify-content: stretch;
}

.task-load-more-button {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(162, 122, 43, 0.3);
  border-radius: 6px;
  background: #fff9ec;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.task-load-more-button:hover {
  border-color: rgba(162, 122, 43, 0.52);
  background: #ffffff;
}

.task-load-more-button[hidden] {
  display: none;
}

.drawer-primary-button,
.drawer-secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.drawer-primary-button {
  border-color: rgba(162, 122, 43, 0.42);
  background: #fff9ec;
  color: var(--accent-dark);
}

.drawer-primary-button:hover:not(:disabled) {
  border-color: rgba(162, 122, 43, 0.62);
  background: #ffffff;
}

.drawer-secondary-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #ffffff;
}

.drawer-primary-button:disabled,
.drawer-secondary-button:disabled {
  color: var(--soft);
  background: var(--panel-strong);
  border-color: var(--line);
}

.drawer-primary-button.compact {
  min-height: 32px;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 12px;
}

.error-drawer .task-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.78);
  padding: 9px;
}

.error-drawer .task-summary {
  width: auto;
  min-height: 32px;
  border-color: var(--line);
  background: rgba(255, 253, 250, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.error-drawer .task-summary.has-errors {
  border-color: rgba(155, 61, 50, 0.16);
  background: #fff7f4;
  color: var(--danger);
}

.error-drawer .drawer-secondary-button {
  width: auto;
  min-width: 112px;
  min-height: 34px;
  padding: 0 12px;
}

.error-log-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  display: grid;
  min-width: 0;
  min-height: 0;
}

.error-log-list {
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 10px;
  padding-right: 4px;
}

.error-drawer .error-log-panel {
  overflow: hidden;
}

.error-log-item,
.error-log-empty {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 9px;
}

.error-log-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.error-log-item {
  position: relative;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 12px;
  border-color: rgba(155, 61, 50, 0.16);
  background: linear-gradient(180deg, #fffdfa 0%, #fff9f6 100%);
  padding: 12px 12px 12px 0;
  box-shadow: 0 8px 22px rgba(44, 37, 25, 0.05);
}

.error-log-rail {
  width: 4px;
  min-height: 100%;
  border-radius: 999px;
  background: var(--danger);
}

.error-log-content {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.error-log-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.error-log-item strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.error-log-item time {
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.error-log-type {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--danger);
  background: rgba(155, 61, 50, 0.08);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.error-log-detail {
  margin: 0;
  border: 1px solid rgba(155, 61, 50, 0.08);
  border-radius: 6px;
  background: rgba(255, 253, 250, 0.76);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.error-log-guidance {
  border: 1px solid rgba(162, 122, 43, 0.14);
  border-radius: 6px;
  background: rgba(255, 249, 236, 0.7);
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}

.error-log-guidance span {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 900;
}

.error-log-guidance p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.error-log-task {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--soft);
  font-size: 11px;
}

.error-log-task span {
  flex: 0 0 auto;
  font-weight: 900;
}

.error-log-task code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(116, 109, 97, 0.16);
  border-radius: 999px;
  background: rgba(240, 236, 226, 0.52);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  padding: 3px 8px;
}

.error-log-item.upload_validation {
  border-color: rgba(154, 101, 38, 0.18);
  background: linear-gradient(180deg, #fffdfa 0%, #fff8ed 100%);
}

.error-log-item.upload_validation .error-log-rail,
.error-log-item.upload_validation .error-log-type {
  background: rgba(154, 101, 38, 0.12);
  color: var(--warning);
}

.error-log-item.upload_validation .error-log-rail {
  background: var(--warning);
}

.error-log-item.task_canceled {
  border-color: rgba(162, 122, 43, 0.2);
  background: linear-gradient(180deg, #fffdfa 0%, #fff9ec 100%);
}

.error-log-item.task_canceled .error-log-rail,
.error-log-item.task_canceled .error-log-type {
  background: rgba(162, 122, 43, 0.12);
  color: var(--accent-dark);
}

.error-log-item.task_canceled .error-log-rail {
  background: var(--accent);
}

.error-log-item.api_exception {
  border-color: rgba(40, 113, 90, 0.18);
  background: linear-gradient(180deg, #fffdfa 0%, rgba(40, 113, 90, 0.06) 100%);
}

.error-log-item.api_exception .error-log-rail,
.error-log-item.api_exception .error-log-type {
  background: rgba(40, 113, 90, 0.12);
  color: var(--success);
}

.error-log-item.api_exception .error-log-rail {
  background: var(--success);
}

.task-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 2px;
}

.empty-state,
.task-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.empty-state {
  min-height: 180px;
  display: grid;
  gap: 8px;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.empty-state strong {
  color: var(--text);
  font-size: 15px;
}

.empty-state span {
  max-width: 360px;
  font-size: 13px;
  line-height: 1.5;
}

.empty-state button {
  width: auto;
  min-height: 36px;
  margin-top: 2px;
  padding: 0 14px;
}

.task-card {
  padding: 0;
  display: grid;
  overflow: visible;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.task-card.expanded {
  border-color: rgba(162, 122, 43, 0.42);
  background: #fffdf8;
  box-shadow: 0 12px 28px rgba(44, 37, 25, 0.08);
}

.task-card.failed {
  border-color: rgba(155, 61, 50, 0.32);
  background: #fff4f2;
}

.task-card.failed.expanded {
  border-color: rgba(155, 61, 50, 0.46);
  background: #fff1ef;
  box-shadow: 0 12px 28px rgba(155, 61, 50, 0.08);
}

.task-card.failed.collapsed .task-card-summary:hover {
  background: #ffebe8;
}

.task-card.failed .progress-fill {
  background: var(--danger);
}

.task-card.completed .progress-fill {
  background: var(--success);
}

.task-card-summary {
  display: grid;
  gap: 8px;
  padding: 11px 13px;
  cursor: pointer;
}

.task-card-toggle {
  border-radius: calc(var(--radius) - 1px);
}

.task-card-toggle:focus-visible {
  outline: 2px solid rgba(162, 122, 43, 0.3);
  outline-offset: -3px;
}

.task-card.collapsed .task-card-summary:hover {
  background: #fff9ec;
}

.task-card.expanded .task-card-summary {
  border-bottom: 1px solid var(--line);
}

.task-card.expanded .task-card-summary:hover {
  background: rgba(255, 249, 236, 0.56);
}

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

.task-badges {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
  margin-left: auto;
}

.task-expand-icon {
  position: relative;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(162, 122, 43, 0.24);
  border-radius: 999px;
  background: #fffdfa;
  color: var(--accent-dark);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.task-expand-icon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.task-card.expanded .task-expand-icon {
  transform: rotate(180deg);
  border-color: rgba(162, 122, 43, 0.42);
  background: #fff9ec;
}

.task-title-block {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.task-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
}

.task-card h3 {
  font-size: 15px;
  margin: 0;
}

.task-id {
  color: var(--muted);
  font-size: 12px;
}

.task-result-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.task-result-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.task-result-summary i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--soft);
}

.task-result-summary .summary-done i {
  background: var(--success);
}

.task-result-summary .summary-failed {
  color: var(--danger);
}

.task-result-summary .summary-failed i {
  background: var(--danger);
}

.status-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--panel-strong);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.processing {
  color: var(--warning);
  background: rgba(154, 101, 38, 0.1);
}

.status-badge.waiting {
  color: var(--accent-dark);
  background: rgba(162, 122, 43, 0.1);
}

.status-badge.completed {
  color: var(--success);
  background: rgba(40, 113, 90, 0.1);
}

.status-badge.failed,
.status-badge.canceled {
  color: var(--danger);
  background: rgba(155, 61, 50, 0.1);
}

.download-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: var(--panel);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.download-badge.not-downloaded {
  color: var(--warning);
  background: rgba(154, 101, 38, 0.08);
  border-color: rgba(154, 101, 38, 0.22);
}

.download-badge.partial-downloaded {
  color: var(--accent-dark);
  background: #fff9ec;
  border-color: rgba(162, 122, 43, 0.28);
}

.download-badge.downloaded {
  color: var(--success);
  background: rgba(40, 113, 90, 0.08);
  border-color: rgba(40, 113, 90, 0.22);
}

.task-card.ready-to-download {
  border-color: rgba(40, 113, 90, 0.24);
  box-shadow: inset 0 0 0 1px rgba(40, 113, 90, 0.08);
}

.task-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(42px, auto);
  gap: 10px;
  align-items: center;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--panel-strong);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 260ms ease;
}

.task-progress-percent {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.task-card.completed .task-progress-percent {
  color: var(--success);
}

.task-card.failed .task-progress-percent {
  color: var(--danger);
}

.task-progress-detail {
  display: grid;
  gap: 3px;
  align-items: baseline;
}

.task-progress-detail span {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.task-progress-detail small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.task-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-progress-step {
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--soft);
  background: rgba(240, 236, 226, 0.48);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-progress-step.done {
  color: var(--success);
  border-color: rgba(40, 113, 90, 0.18);
  background: rgba(40, 113, 90, 0.07);
}

.task-current-step {
  color: var(--accent-dark);
  border-color: rgba(162, 122, 43, 0.36);
  background: #fff9ec;
}

.task-card.failed .task-current-step {
  color: var(--danger);
  border-color: rgba(155, 61, 50, 0.28);
  background: rgba(155, 61, 50, 0.08);
}

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

.task-meta span {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
  padding: 10px 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.task-prompt {
  border: 1px solid rgba(162, 122, 43, 0.18);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--accent-dark);
  background: #fff9ec;
  font-size: 13px;
  font-weight: 700;
}

.task-prompt.api-note {
  border-color: rgba(40, 113, 90, 0.2);
  color: var(--success);
  background: rgba(40, 113, 90, 0.07);
}

.task-completion-hint {
  border: 1px solid rgba(40, 113, 90, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--success);
  background: rgba(40, 113, 90, 0.07);
  font-size: 13px;
  font-weight: 800;
}

.task-issue-panel {
  border: 1px solid rgba(155, 61, 50, 0.18);
  border-radius: 6px;
  padding: 10px 12px;
  display: grid;
  gap: 5px;
  background: rgba(255, 244, 242, 0.72);
}

.task-issue-panel strong {
  color: var(--danger);
  font-size: 13px;
  font-weight: 900;
}

.task-issue-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.task-retry-hint {
  border: 1px solid rgba(185, 94, 38, 0.24);
  border-radius: 6px;
  padding: 10px 12px;
  color: #8f431c;
  background: rgba(185, 94, 38, 0.08);
  font-size: 13px;
  font-weight: 800;
}

.task-details {
  display: grid;
  gap: 12px;
  padding: 2px 13px 15px;
}

.task-details[hidden] {
  display: none;
}

.task-footer {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-action-button {
  min-height: 38px;
  border: 1px solid rgba(162, 122, 43, 0.28);
  border-radius: 6px;
  background: #fff9ec;
  color: var(--accent-dark);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  flex: 0 1 128px;
}

.preview-action-button:disabled {
  border-color: var(--line);
  color: var(--soft);
  background: var(--panel-strong);
}

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

.task-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdfa;
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.task-actions button:disabled {
  color: var(--soft);
  background: var(--panel-strong);
}

.retry-action-button {
  border-color: rgba(185, 94, 38, 0.36) !important;
  color: #8f431c !important;
  background: rgba(185, 94, 38, 0.1) !important;
}

.retry-action-button:hover:not(:disabled) {
  border-color: rgba(185, 94, 38, 0.56) !important;
  background: #fff8ef !important;
}

.archive-action-button {
  border-color: rgba(40, 113, 90, 0.24) !important;
  color: var(--success) !important;
  background: rgba(40, 113, 90, 0.07) !important;
}

.archive-action-button:hover:not(:disabled) {
  border-color: rgba(40, 113, 90, 0.42) !important;
  background: #ffffff !important;
}

.archive-action-button.primary-ready {
  color: #fffdfa !important;
  background: var(--success) !important;
  border-color: var(--success) !important;
}

.archive-action-button.primary-ready:hover:not(:disabled) {
  color: #fffdfa !important;
  background: #1f604c !important;
}

.archive-action-button:disabled {
  color: var(--soft) !important;
  background: var(--panel-strong) !important;
  border-color: var(--line) !important;
}

.error-text {
  color: var(--danger);
  font-size: 12px;
}

.task-notice {
  position: fixed;
  right: 20px;
  bottom: 82px;
  z-index: 90;
  width: min(440px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto auto;
  align-items: stretch;
  gap: 12px;
  border: 1px solid rgba(40, 113, 90, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 250, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: taskNoticeIn 180ms ease-out;
}

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

.task-notice-rail {
  border-radius: 999px;
  background: var(--success);
}

.task-notice.created {
  border-color: rgba(162, 122, 43, 0.28);
}

.task-notice.created .task-notice-rail {
  background: var(--accent);
}

.task-notice.failed {
  border-color: rgba(155, 61, 50, 0.26);
}

.task-notice.failed .task-notice-rail {
  background: var(--danger);
}

.task-notice-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.task-notice-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.task-notice-copy strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.task-notice-copy p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.task-notice-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 190px;
}

.task-notice-actions button,
.task-notice-close {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.task-notice-actions button:disabled {
  color: var(--soft);
  background: var(--panel-strong);
}

.task-notice.completed #taskNoticeArchiveButton {
  border-color: var(--success);
  color: #fffdfa;
  background: var(--success);
}

.task-notice.failed #taskNoticeArchiveButton {
  display: none;
}

.task-notice-close {
  width: 32px;
  padding: 0;
  display: grid;
  place-items: center;
}

.task-notice-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

@keyframes taskNoticeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(36, 33, 29, 0.3);
  backdrop-filter: blur(2px);
}

.result-preview-modal {
  position: fixed;
  inset: 32px;
  z-index: 80;
  max-width: 1120px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdfa;
  box-shadow: 0 24px 64px rgba(44, 37, 25, 0.22);
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.result-preview-modal[hidden],
.modal-backdrop[hidden],
.result-feedback-overlay[hidden],
.quality-feedback-drawer[hidden],
.feedback-admin-panel[hidden],
.image-lightbox[hidden] {
  display: none;
}

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

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

.modal-download-button {
  min-height: 40px;
  border: 1px solid rgba(162, 122, 43, 0.32);
  border-radius: 8px;
  background: #fff9ec;
  color: var(--accent-dark);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.modal-download-button:hover:not(:disabled) {
  border-color: rgba(162, 122, 43, 0.58);
  background: #ffffff;
}

.modal-download-button:disabled {
  border-color: var(--line);
  color: var(--soft);
  background: var(--panel-strong);
}

.modal-feedback-button {
  min-height: 40px;
  border: 1px solid rgba(40, 113, 90, 0.26);
  border-radius: 8px;
  background: #f1fbf6;
  color: var(--success);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.modal-feedback-button:hover:not(:disabled) {
  border-color: rgba(40, 113, 90, 0.48);
  background: #ffffff;
}

.modal-feedback-button:disabled {
  border-color: var(--line);
  color: var(--soft);
  background: var(--panel-strong);
}

.modal-header p:last-child {
  color: var(--muted);
  font-size: 13px;
}

.result-preview-warning {
  border: 1px solid rgba(162, 122, 43, 0.24);
  border-radius: var(--radius);
  background: #fff9ec;
  color: var(--accent-dark);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.result-preview-context {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.result-preview-context .result-preview-status {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.82);
  padding: 8px 10px;
  display: grid;
  gap: 3px;
}

.result-preview-context .result-preview-status.downloaded {
  border-color: rgba(40, 113, 90, 0.22);
  background: rgba(40, 113, 90, 0.06);
}

.result-preview-context .result-preview-status.not-downloaded {
  border-color: rgba(162, 122, 43, 0.26);
  background: rgba(255, 249, 236, 0.9);
}

.result-preview-context .result-preview-status span {
  color: var(--soft);
  font-size: 11px;
  font-weight: 800;
}

.result-preview-context .result-preview-status strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-preview-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  overflow: hidden;
}

.result-preview-list {
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 2px;
}

.result-preview-list button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  padding: 9px 10px;
  display: grid;
  gap: 3px;
}

.result-preview-list button.active {
  border-color: rgba(162, 122, 43, 0.52);
  background: #fff9ec;
}

.result-preview-list span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-download-state {
  width: fit-content;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
  color: var(--warning);
  background: rgba(154, 101, 38, 0.08);
}

.result-download-state.downloaded {
  color: var(--success);
  background: rgba(40, 113, 90, 0.08);
}

.result-preview-image-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.result-preview-panel {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto;
}

.result-preview-panel.simulated {
  border-color: rgba(162, 122, 43, 0.42);
}

.result-preview-panel button {
  min-height: 220px;
  border: 0;
  background: var(--panel-strong);
  padding: 0;
}

.result-preview-panel img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.result-preview-panel figcaption {
  min-height: 92px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.result-preview-panel figcaption span,
.result-preview-panel figcaption small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.result-feedback-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: rgba(36, 33, 29, 0.18);
}

.quality-feedback-panel,
.feedback-admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.quality-feedback-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  width: min(410px, calc(100% - 24px));
  align-content: start;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #fffdfa;
  padding: 18px;
  overflow: auto;
  box-shadow: -18px 0 42px rgba(44, 37, 25, 0.18);
}

.quality-feedback-panel[data-active="false"] {
  background: var(--panel-strong);
}

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

.feedback-panel-header h3 {
  margin: 2px 0 0;
  font-size: 15px;
}

.feedback-result-meta {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.feedback-context-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.required-mark {
  color: var(--danger);
  font-weight: 950;
}

.feedback-context-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-weight: 850;
}

.feedback-rating-control {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-rating-control legend,
.feedback-field-label {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.feedback-rating-control label {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.feedback-rating-control input {
  accent-color: var(--accent);
}

#feedbackCommentInput,
#feedbackAdminTokenInput {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 10px;
  font: inherit;
  resize: vertical;
}

.feedback-attachment-dropzone {
  border: 1px dashed rgba(96, 111, 123, 0.52);
  border-radius: 8px;
  background: #f7fbfd;
  padding: 12px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.feedback-attachment-dropzone[data-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.62;
}

.feedback-attachment-dropzone span {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.feedback-attachment-dropzone small,
.feedbackSubmitStatus {
  color: var(--muted);
  font-size: 12px;
}

.feedback-attachment-list {
  min-height: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-attachment-chip {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 4px 6px 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-attachment-chip button,
.feedback-admin-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.feedback-attachment-chip button {
  width: 22px;
  height: 22px;
}

.feedback-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.feedback-submit-help {
  flex-basis: 100%;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

#feedbackSubmitStatus {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.feedback-admin-panel {
  background: #fbfcff;
}

.module-guide-drawer {
  width: min(620px, 100vw);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.module-guide-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 2px;
}

.module-guide-card,
.module-guide-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

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

.module-guide-card h3,
.module-guide-note strong {
  margin: 0;
  font-size: 17px;
}

.module-guide-step-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  counter-reset: guide-step;
}

.module-guide-step-list li {
  min-width: 0;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px 10px 10px 44px;
  display: grid;
  gap: 3px;
  counter-increment: guide-step;
}

.module-guide-step-list li::before {
  content: counter(guide-step, decimal-leading-zero);
  position: absolute;
  left: 10px;
  top: 10px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--text);
  color: #fffdfa;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 950;
}

.module-guide-step-list strong,
.module-guide-grid strong {
  color: var(--text);
  font-size: 13px;
}

.module-guide-step-list span,
.module-guide-grid p,
.module-guide-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.module-guide-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.module-guide-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.module-guide-note {
  border-left: 4px solid rgba(162, 122, 43, 0.42);
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.feedback-admin-drawer {
  width: min(1180px, calc(100vw - 28px));
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.user-admin-drawer {
  width: min(1120px, calc(100vw - 28px));
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.user-admin-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.user-admin-create-panel,
.user-admin-list-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 10px;
  overflow: hidden;
}

.user-admin-create-panel {
  align-content: start;
  overflow: auto;
}

.admin-system-status-panel {
  display: grid;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.admin-system-status-panel .feedback-panel-header {
  align-items: center;
}

.system-status-grid {
  display: grid;
  gap: 6px;
}

.system-status-empty,
.system-status-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 8px;
}

.system-status-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.system-status-item {
  display: grid;
  gap: 3px;
  border-left-width: 4px;
}

.system-status-item.is-safe {
  border-left-color: #3f7f68;
  background: #f6fbf8;
}

.system-status-item.is-danger {
  border-left-color: #b34a3f;
  background: #fff5f3;
}

.system-status-item.is-neutral {
  border-left-color: rgba(162, 122, 43, 0.7);
}

.system-status-item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.system-status-item strong {
  color: var(--text);
  font-size: 13px;
}

.system-status-item small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  word-break: break-word;
}

.system-status-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.user-admin-list-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

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

.user-admin-create-panel .admin-user-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-user-form label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.admin-user-form input,
.admin-user-form select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.admin-user-form .admin-user-checkbox {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 0 9px;
}

.admin-user-checkbox input {
  width: 15px;
  min-height: auto;
  accent-color: var(--accent);
}

.admin-user-form .admin-user-quality-fieldset,
.admin-user-form .admin-user-module-fieldset,
.admin-user-form button {
  grid-column: 1 / -1;
}

.admin-user-quality-fieldset,
.admin-user-module-fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 8px;
}

.admin-user-quality-fieldset legend,
.admin-user-module-fieldset legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.admin-user-quality-list,
.admin-user-module-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.user-admin-create-panel .admin-user-quality-list,
.user-admin-create-panel .admin-user-module-list {
  grid-template-columns: 1fr;
}

.admin-user-quality-option,
.admin-user-module-option {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 7px 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.admin-user-quality-option input,
.admin-user-module-option input {
  width: 15px;
  min-height: auto;
  accent-color: var(--accent);
}

.admin-user-quality-option strong,
.admin-user-module-option strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.admin-user-quality-option small,
.admin-user-module-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.admin-user-module-option.is-disabled {
  opacity: 0.58;
}

.user-admin-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.user-admin-list {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  gap: 8px;
  padding-right: 2px;
  padding-bottom: 10px;
}

.user-admin-empty,
.user-admin-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.user-admin-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.user-admin-item {
  display: grid;
  overflow: hidden;
}

.user-admin-item.expanded {
  overflow: visible;
}

.user-admin-item-toggle {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 12px;
  display: grid;
  gap: 9px;
  cursor: pointer;
}

.user-admin-item-toggle:hover {
  background: #fffaf0;
}

.user-admin-item-toggle:focus-visible {
  outline: 3px solid rgba(162, 122, 43, 0.32);
  outline-offset: -3px;
}

.user-admin-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.user-admin-item-head div {
  min-width: 0;
}

.user-admin-item strong {
  display: block;
  font-size: 15px;
}

.user-admin-item span {
  color: var(--muted);
  font-size: 12px;
}

.user-admin-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-admin-badges span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 4px 8px;
  color: var(--muted);
  font-weight: 800;
}

.user-admin-item.expanded .task-expand-icon {
  transform: rotate(180deg);
  border-color: rgba(162, 122, 43, 0.42);
  background: #fff9ec;
}

.user-admin-item-details {
  min-width: 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 12px;
}

.user-admin-item.expanded .user-admin-item-details {
  overflow: visible;
}

.user-admin-item-details[hidden] {
  display: none;
}

.user-lifecycle-panel {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.user-lifecycle-panel strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.user-lifecycle-panel small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.user-lifecycle-actions {
  display: flex;
  justify-content: flex-end;
}

.user-password-reset-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.user-password-reset-form label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.user-password-reset-form input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.user-admin-item dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.user-admin-item dl div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 8px;
}

.user-admin-item dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.user-admin-item dd {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

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

.user-edit-form label {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.user-edit-form input,
.user-edit-form select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.user-edit-form .admin-user-checkbox {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 0 9px;
}

.user-edit-form .admin-user-quality-fieldset,
.user-edit-form .admin-user-module-fieldset {
  grid-column: 1 / -1;
}

.user-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.feedback-admin-drawer .feedback-admin-panel {
  min-width: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
  overflow: hidden;
  align-content: start;
  grid-template-rows: minmax(0, 1fr);
}

.feedback-admin-layout {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(320px, 410px) minmax(0, 1fr);
  gap: 10px;
}

.feedback-admin-filter-column {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: start;
  gap: 10px;
}

.feedback-admin-filter-column .feedback-panel-header {
  display: grid;
  gap: 8px;
}

.feedback-admin-filter-column .drawer-primary-button {
  width: 100%;
}

.feedback-admin-filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.feedback-admin-filter-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.feedback-admin-filter-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.feedback-admin-filter-grid select,
.feedback-admin-filter-grid input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.feedback-admin-filter-actions {
  display: flex;
  align-items: end;
  min-width: 0;
}

.feedback-admin-filter-actions .drawer-secondary-button {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  font-size: 12px;
}

.feedback-admin-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.feedback-admin-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 10px;
}

.feedback-admin-list-column {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.feedback-admin-column-header {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.feedback-admin-column-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
}

.feedback-admin-list {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.feedback-admin-load-more {
  width: 100%;
  min-height: 38px;
}

.feedback-admin-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.feedback-admin-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  overflow: visible;
}

.feedback-admin-item.active {
  border-color: rgba(162, 122, 43, 0.48);
  box-shadow: inset 3px 0 0 var(--accent);
}

.feedback-admin-item-main {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  width: 100%;
  min-width: 0;
  padding: 12px;
  display: grid;
  align-items: start;
  gap: 7px;
}

.feedback-admin-item-main:hover {
  background: #fffaf0;
}

.feedback-admin-item-main span,
.feedback-admin-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.feedback-admin-item-main strong {
  min-width: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.feedback-admin-item-main em,
.feedback-admin-detail-header > span {
  color: var(--accent-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.feedback-admin-item p,
.feedback-admin-item small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.feedback-admin-item-summary {
  display: block;
  overflow: visible;
  color: var(--text-soft);
}

.feedback-admin-item-account,
.feedback-admin-item-meta,
.feedback-admin-item-context {
  display: block;
}

.feedback-admin-item-account {
  color: var(--text);
  font-weight: 900;
}

.feedback-admin-item-context {
  color: var(--accent-dark);
  font-weight: 850;
}

.feedback-admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 10px 10px;
}

.feedback-admin-actions button {
  min-height: 30px;
  padding: 0 10px;
}

.feedback-admin-detail {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.feedback-admin-detail-header {
  align-items: flex-start;
}

.feedback-admin-detail-header h3 {
  margin: 2px 0 0;
  font-size: 17px;
}

.feedback-admin-triptych {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.feedback-admin-preview-tile {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f4ea;
  overflow: hidden;
}

.feedback-admin-preview-tile button,
.feedback-admin-preview-tile div {
  height: 150px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.feedback-admin-preview-tile button {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  padding: 0;
}

.feedback-admin-preview-tile button:hover {
  background: #fffaf0;
}

.feedback-admin-preview-tile img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  display: block;
}

.feedback-admin-preview-tile figcaption {
  border-top: 1px solid var(--line);
  padding: 7px 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

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

.feedback-admin-meta-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px;
  display: grid;
  gap: 4px;
}

.feedback-admin-meta-grid span,
.feedback-admin-comment span,
.feedback-admin-attachments > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.feedback-admin-meta-grid strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.feedback-admin-comment,
.feedback-admin-attachments {
  display: grid;
  gap: 7px;
}

.feedback-admin-comment p {
  margin: 0;
  border-left: 3px solid rgba(162, 122, 43, 0.34);
  padding: 8px 10px;
  background: #fffaf0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.feedback-admin-attachments div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-admin-attachments button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.feedback-admin-attachments span,
.feedback-admin-detail-status {
  color: var(--muted);
  font-size: 12px;
}

.feedback-admin-actions.detail-actions {
  padding: 0;
}

.feedback-admin-image-modal {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 26px;
}

.feedback-admin-image-modal[hidden] {
  display: none;
}

.feedback-admin-image-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(24, 22, 19, 0.58);
  cursor: zoom-out;
}

.feedback-admin-image-stage {
  position: relative;
  z-index: 1;
  width: min(980px, 92%);
  max-height: min(760px, 88%);
  border: 1px solid rgba(255, 253, 250, 0.7);
  border-radius: 10px;
  background: #fffdfa;
  box-shadow: 0 24px 70px rgba(24, 22, 19, 0.32);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.feedback-admin-image-toolbar {
  min-width: 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.feedback-admin-image-toolbar > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.feedback-admin-image-toolbar span {
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
}

.feedback-admin-image-toolbar small {
  color: var(--muted);
  font-size: 12px;
}

.feedback-admin-image-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-admin-image-actions .drawer-secondary-button {
  width: auto;
  min-height: 34px;
  text-decoration: none;
}

.feedback-admin-image-stage img {
  width: 100%;
  height: min(680px, 72vh);
  object-fit: contain;
  background: #f4f0e7;
  display: block;
}

.feedback-admin-image-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 54px;
  border: 1px solid rgba(255, 253, 250, 0.8);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.92);
  color: var(--accent-dark);
  box-shadow: 0 12px 28px rgba(24, 22, 19, 0.18);
  display: grid;
  place-items: center;
  cursor: pointer;
  transform: translateY(-50%);
}

.feedback-admin-image-nav.prev {
  left: 12px;
}

.feedback-admin-image-nav.next {
  right: 12px;
}

.feedback-admin-image-nav:hover:not(:disabled) {
  background: #fffdfa;
}

.feedback-admin-image-nav:disabled {
  opacity: 0.4;
  cursor: default;
}

.feedback-admin-image-nav svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2.4;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(24, 22, 19, 0.84);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 54px 20px 34px;
  cursor: zoom-out;
}

.image-lightbox-close {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 91;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 253, 250, 0.74);
  border-radius: 16px;
  background: rgba(255, 253, 250, 0.94);
  color: var(--text);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.image-lightbox-close:hover {
  background: #fffdfa;
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.image-lightbox-close:active {
  transform: scale(0.97);
}

.image-lightbox-close svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2.4;
}

.image-lightbox img {
  max-width: min(94vw, 1080px);
  max-height: 82vh;
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
  cursor: default;
}

.image-lightbox span {
  margin-top: 12px;
  color: #fffdfa;
  font-size: 13px;
  font-weight: 700;
  cursor: default;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .module-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: min(240px, 30dvh);
  }

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

  .content-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "operation"
      "upload"
      "settings"
      "create";
  }

  .result-preview-modal {
    inset: 16px;
  }

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

  .result-preview-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .result-preview-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(160px, 1fr);
    overflow-x: auto;
  }

  .result-preview-image-grid {
    grid-template-columns: 1fr;
  }

  .module-guide-grid {
    grid-template-columns: 1fr;
  }

  .feedback-admin-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(170px, 260px) minmax(0, 1fr);
  }

  .feedback-admin-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 260px;
  }

  .feedback-admin-image-stage {
    width: 96%;
  }

  #taskDrawer {
    width: 100vw;
  }

  .user-admin-drawer {
    width: min(100vw, calc(100vw - 16px));
  }

  .user-admin-panel {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .user-admin-list-panel {
    min-height: min(620px, 70dvh);
  }

  .task-drawer-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: auto;
  }

  .admin-task-panel {
    min-height: min(720px, 76dvh);
  }

  .admin-task-filter-grid,
  .admin-task-grid {
    grid-template-columns: 1fr;
  }

  .admin-task-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-task-filter-actions .task-reset-filter-button {
    width: 100%;
  }

  .task-control-panel {
    min-height: auto;
    overflow: visible;
  }

  .task-list-panel {
    min-height: min(520px, 60dvh);
  }

  .quality-feedback-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 78%;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -18px 42px rgba(44, 37, 25, 0.2);
  }

  .task-notice {
    left: 16px;
    right: 16px;
    bottom: 96px;
    width: auto;
    grid-template-columns: 4px minmax(0, 1fr) auto;
  }

  .task-notice-actions {
    grid-column: 2 / 4;
    max-width: none;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .topbar,
  .module-header,
  .bottom-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .module-list,
  .control-grid,
  .upload-grid,
  .admin-user-form,
  .admin-user-quality-list,
  .admin-user-module-list,
  .user-edit-form,
  .task-filter-grid,
  .task-meta {
    grid-template-columns: 1fr;
  }

  .main-panel {
    padding: 16px 14px;
  }

  .module-rail {
    padding: 14px;
  }

  .bottom-bar {
    padding: 12px 14px;
  }

  .bottom-actions {
    width: 100%;
  }

  .bottom-actions .secondary-button,
  .bottom-next-button,
  .bottom-create-button {
    flex: 1 1 160px;
  }

  .modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-actions {
    width: 100%;
    justify-content: space-between;
  }

  .modal-download-button {
    flex: 1;
  }

  .modal-feedback-button {
    flex: 1;
  }

  .module-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .module-stats {
    flex: 1 1 220px;
  }

  .module-guide-button {
    flex: 0 0 auto;
  }

  .module-guide-drawer {
    width: 100vw;
    padding: 14px;
  }

  .feedback-admin-drawer {
    width: 100vw;
    padding: 14px;
  }

  #taskDrawer {
    padding: 14px;
  }

  .task-drawer-body {
    gap: 12px;
  }

  .task-list-panel-header h3 {
    font-size: 20px;
  }

  .feedback-admin-filter-grid,
  .feedback-admin-meta-grid,
  .feedback-admin-triptych {
    grid-template-columns: 1fr;
  }

  .feedback-admin-preview-tile button,
  .feedback-admin-preview-tile div,
  .feedback-admin-preview-tile img {
    height: 180px;
  }

  .feedback-admin-image-modal {
    padding: 12px;
  }

  .feedback-admin-image-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .feedback-admin-image-actions {
    justify-content: space-between;
  }

  .secondary-button {
    width: 100%;
  }

  .task-notice {
    bottom: 112px;
  }

  .task-notice-actions button {
    flex: 1 1 92px;
  }
}
