:root {
  --ink: #071a33;
  --muted: #5d7088;
  --line: #cadceb;
  --soft-line: #e3edf5;
  --panel: #f3f7fa;
  --page: #edf5fa;
  --surface: #fff;
  --surface-tint: #f7fbfe;
  --brand-soft: #e7f5fb;
  --brand-soft-strong: #cde8f5;
  --blue: #006cae;
  --blue-dark: #08376b;
  --blue-deep: #061f42;
  --cyan: #1687d9;
  --cyan-dark: #0f68ad;
  --accent: #d71920;
  --green: #15965c;
  --amber: #c87800;
  --red: #d71920;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

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

.workspace,
.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  grid-template-columns: 1fr;
}

.case-nav,
.app-sidebar,
.export-sidebar,
.inspector {
  min-width: 0;
  height: 100dvh;
  overflow: auto;
  background: #fff;
  border-right: 1px solid var(--line);
}

.case-nav,
.app-sidebar {
  background: linear-gradient(180deg, var(--blue-deep), var(--blue-dark));
  color: #fff;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.app-topbar {
  min-width: 0;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(6, 31, 66, 0.06);
  z-index: 6;
}

.app-topbar .brand {
  color: var(--ink);
}

.app-topbar .mark {
  border-color: rgba(22, 135, 217, 0.42);
}

.app-topbar .brand p {
  color: var(--muted);
}

.page-view {
  min-width: 0;
  height: calc(100dvh - 72px);
  overflow: auto;
  display: none;
}

.page-view.active {
  display: block;
}

.export-layout.active {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: calc(100dvh - 72px);
  min-height: 0;
  overflow: hidden;
}

.page-nav {
  grid-column: 2;
  justify-self: center;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.nav-link {
  width: auto;
  min-width: 94px;
  padding: 10px 14px;
  color: var(--blue-dark);
  background: transparent;
  border: 1px solid transparent;
  text-align: center;
  font-weight: 800;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.auth-required .page-nav,
.auth-required .top-source {
  display: none;
}

.auth-required .app-topbar {
  display: none;
}

.login-page.active {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 40px 20px 72px;
  background: #f8fbfd;
}

.login-card {
  width: min(420px, 100%);
  padding: 36px 40px 34px;
  border: 1px solid var(--soft-line);
  background: #fff;
  box-shadow: 0 14px 36px rgba(6, 31, 66, 0.08);
  text-align: center;
}

.login-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}

.login-card h2 {
  margin: 0 0 12px;
  color: var(--blue-deep);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.login-lead {
  font-size: 17px;
  font-weight: 400;
}

.login-actions {
  width: min(320px, 100%);
  margin: 24px auto 0;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.login-btn img {
  width: 22px;
  height: 22px;
  padding: 2px;
  background: #fff;
  border-radius: 6px;
}

.login-access-note,
.login-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(320px, 100%);
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.login-rule {
  flex: 1;
  height: 1px;
  background: var(--soft-line);
}

.login-lock {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: currentColor;
  color: var(--muted);
  font-size: 0;
  -webkit-mask: url("/assets/icon-lock.svg") center / contain no-repeat;
  mask: url("/assets/icon-lock.svg") center / contain no-repeat;
}

.login-actions > span {
  display: block;
  margin-top: 0;
  color: #7690a8;
  font-size: 13px;
  text-align: center;
}

.login-actions > span:empty {
  display: none;
}

.login-actions > span.login-error {
  width: 100%;
  margin: 26px auto 0;
  padding: 12px 14px;
  color: #a23b3b;
  background: #fff2f2;
  border: 1px solid #f3caca;
  font-weight: 700;
  line-height: 1.5;
}

.login-actions > span.login-error::before {
  content: "!";
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  place-items: center;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.login-footer-note {
  margin-top: 98px;
  color: #9aa9ba;
  font-weight: 700;
}

.top-source {
  justify-self: end;
  width: auto;
  min-width: 0;
  min-height: 58px;
  height: auto;
  padding: 6px 10px;
  padding-right: 2px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0;
  border: 1px solid var(--soft-line);
  background: var(--surface-tint);
  color: var(--ink);
  overflow: visible;
}

.source-meta {
  min-width: 0;
}

.source-meta strong,
.source-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-source span {
  color: var(--muted);
}

.login-summary {
  display: inline-grid;
  position: relative;
  gap: 0;
  min-width: 152px;
  max-width: 220px;
  cursor: pointer;
}

.login-summary.open {
  z-index: 30;
}

.login-summary:hover strong {
  color: var(--blue-dark);
}

.login-user-meta {
  min-width: 0;
}

.login-summary-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  position: relative;
  z-index: 2;
  min-height: 42px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

.login-summary-main::after {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-left: 2px;
  border-right: 1.8px solid var(--muted);
  border-bottom: 1.8px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.login-summary:hover .login-summary-main,
.login-summary.open .login-summary-main {
  background: #fff;
  box-shadow: 0 0 0 1px var(--soft-line);
}

.login-summary.open .login-summary-main::after {
  transform: translateY(2px) rotate(225deg);
  border-color: var(--blue-dark);
}

.login-summary-actions {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 2px;
  min-width: 178px;
  width: max-content;
  padding: 8px;
  margin: 0;
  border: 1px solid var(--soft-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(6, 31, 66, 0.18);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  z-index: 20;
}

.login-summary-actions::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 22px;
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--soft-line);
  border-left: 1px solid var(--soft-line);
  background: #fff;
  transform: rotate(45deg);
}

.login-summary.open .login-summary-actions {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0s linear;
  pointer-events: auto;
}

.login-summary-btn {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  justify-content: flex-start;
  white-space: nowrap;
  border-radius: 8px;
}

.login-summary-btn:hover,
.login-summary-btn:focus-visible {
  color: var(--blue-dark);
  background: var(--brand-soft);
  outline: none;
}

.login-summary-btn[data-logout]:hover,
.login-summary-btn[data-logout]:focus-visible {
  color: var(--red);
  background: rgba(215, 25, 32, 0.08);
}

.login-summary strong {
  display: block;
  max-width: 104px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-summary span {
  display: block;
  max-width: 104px;
  overflow: hidden;
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--soft-line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.logout-button:hover,
.logout-button:focus-visible {
  border-color: var(--red);
  color: var(--red);
  outline: none;
}

.login-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--brand-soft-strong);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
}

.login-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.export-sidebar {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
}

.export-sidebar input,
.export-sidebar select {
  min-height: 34px;
  padding: 7px 10px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.export-sidebar .multi-filter > button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.export-sidebar .ghost.dark {
  min-height: 38px;
  padding: 7px 10px;
  background: var(--surface-tint);
  color: var(--blue-dark);
  border-color: var(--line);
}

.export-sidebar .list-head {
  color: var(--muted);
}

.export-sidebar .case-list.empty {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-tint);
}

.export-sidebar .case-row {
  background: #fff;
  color: var(--ink);
  border-color: var(--soft-line);
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.export-sidebar .case-row.selected {
  background: linear-gradient(90deg, #eaf5fe, #fff);
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(0, 108, 174, 0.14);
}

.export-sidebar .case-row:hover:not(.selected) {
  background: #f4f9fd;
  border-color: #b8d9f3;
  box-shadow: 0 4px 14px rgba(6, 31, 66, 0.08);
  transform: translateY(-1px);
}

.export-sidebar .case-row:not(.selected):not(:hover) .chip {
  background: var(--brand-soft);
  color: var(--blue-dark);
}

.export-sidebar .case-row h3 {
  color: var(--ink);
}

.is-hidden {
  display: none !important;
}

.inspector {
  border-right: 0;
  border-left: 1px solid var(--line);
  padding: 22px;
}

.brand,
.inspector-head,
.stage-header,
.drawer-header,
.modal-header,
.modal-footer,
.drawer-footer,
.filmstrip-head,
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  justify-content: flex-start;
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  font-weight: 800;
}

.brand-icon {
  display: block;
  object-fit: cover;
  border-radius: 4px;
}

h1 {
  font-size: 21px;
  line-height: 1.2;
}

.brand p {
  margin-top: 4px;
  color: #c7e8f2;
  font-size: 13px;
}

.eyebrow {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-nav .eyebrow,
.app-sidebar .eyebrow {
  color: #aeeef7;
}

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

h3 {
  font-size: 15px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.case-nav input,
.case-nav select,
.app-sidebar input,
.app-sidebar select {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.case-nav option,
.app-sidebar option {
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(22, 135, 217, 0.12);
}

.primary,
.secondary,
.ghost {
  padding: 10px 12px;
  font-weight: 750;
}

.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(6, 31, 66, 0.22);
}

.primary:hover {
  background: var(--blue-dark);
  color: #fff;
}

.secondary {
  background: var(--brand-soft);
  color: var(--blue-dark);
  border: 1px solid var(--brand-soft-strong);
}

.secondary:hover,
.ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.ghost {
  background: #fff;
  color: var(--blue-dark);
  border: 1px solid var(--line);
}

.ghost.dark,
.case-nav .secondary,
.app-sidebar .secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.wide {
  width: 100%;
}

.source-panel,
.source-summary,
.filters {
  display: grid;
  gap: 8px;
}

.source-summary {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.source-summary strong {
  font-size: 14px;
}

.source-summary span {
  color: #c7e8f2;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.export-selection-note {
  padding: 7px 10px;
  border: 1px solid #b8d9f3;
  background: linear-gradient(90deg, #eaf5fe, #f7fbfe);
  box-shadow: inset 4px 0 0 var(--cyan);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.section-toggle {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 10px 12px;
  text-align: left;
  font-weight: 750;
}

.source-body {
  display: grid;
  gap: 12px;
}

.source-body.collapsed {
  display: none;
}

.filter-grid,
.form-grid,
.modal-grid,
.drawer-grid {
  display: grid;
  gap: 8px;
}

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

.multi-filter {
  position: relative;
  min-width: 0;
}

.multi-filter > button {
  width: 100%;
  max-width: 100%;
  min-height: 34px;
  padding: 7px 30px 7px 10px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-filter > button::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
}

.multi-menu {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  max-height: 240px;
  overflow: auto;
  display: none;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 16px 32px rgba(6, 31, 66, 0.18);
}

.multi-filter.open .multi-menu {
  display: grid;
  gap: 2px;
}

.multi-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  color: var(--ink);
  font-size: 13px;
}

.multi-option:hover {
  background: var(--brand-soft);
}

.multi-option input {
  width: 15px;
  height: 15px;
  accent-color: var(--cyan);
}

.hidden-control {
  display: none;
}

.check-row.hidden-control {
  display: none;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--cyan);
}

.check-row.light {
  color: var(--ink);
}

.nav-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.list-head {
  color: #d8edf6;
  font-size: 13px;
}

.select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.select-all input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
}

.case-picker {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.case-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.case-list.empty {
  padding: 16px;
  color: #d8edf6;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.case-row {
  position: relative;
  display: block;
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  min-height: 122px;
}

.case-row:hover {
  overflow: visible;
  z-index: 3;
}

.case-row:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

.case-row.selected::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--blue);
}

.case-card-head {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 24px;
  gap: 9px;
  align-items: center;
  min-height: 32px;
}

.case-card-body {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 8px;
}

.case-check {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--cyan);
}

.case-thumb {
  width: 92px;
  height: 58px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
}

.case-thumb.empty {
  display: grid;
  place-items: center;
  color: #d8edf6;
  font-size: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
}

.case-row.selected {
  background: linear-gradient(90deg, #e7f7fb, #ffffff);
  color: var(--ink);
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(0, 108, 174, 0.18);
}

.case-row:hover:not(.selected) {
  background: #f4f9fd;
  color: var(--ink);
  border-color: #b8d9f3;
}

.case-row:hover .case-thumb,
.case-row.selected .case-thumb {
  border-color: var(--soft-line);
  background: var(--surface-tint);
}

.case-row:hover .case-thumb.empty,
.case-row.selected .case-thumb.empty {
  color: var(--muted);
  border-color: #cbd5e1;
}

.case-row h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.22;
  font-weight: 850;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
}

.case-card-tags {
  align-content: start;
  max-height: 58px;
  overflow: hidden;
}

.case-owner-avatar {
  position: relative;
  width: 24px;
  height: 24px;
  margin: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.26);
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
  overflow: hidden;
}

.case-owner-avatar::after {
  content: attr(data-owner);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 8;
  width: max-content;
  max-width: 160px;
  padding: 6px 8px;
  border: 1px solid var(--blue);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(6, 31, 66, 0.14);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.case-owner-avatar::before {
  content: "";
  position: absolute;
  right: 7px;
  top: calc(100% + 3px);
  z-index: 9;
  width: 8px;
  height: 8px;
  border-left: 1px solid var(--blue);
  border-top: 1px solid var(--blue);
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px) rotate(45deg);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.case-owner-avatar:hover {
  overflow: visible;
}

.case-owner-avatar:hover::after,
.case-owner-avatar:hover::before {
  opacity: 1;
  transform: translateY(0);
}

.case-owner-avatar:hover::before {
  transform: translateY(0) rotate(45deg);
}

.case-owner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  overflow: hidden;
}

.case-owner-avatar > span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.case-owner-avatar.missing {
  opacity: 0.68;
  background: rgba(255, 255, 255, 0.1);
  border-style: dashed;
}

.chip {
  background: var(--brand-soft);
  color: var(--blue-dark);
  padding: 3px 7px;
  font-size: 12px;
  line-height: 1.35;
}

.case-row:not(.selected):not(:hover) .chip {
  background: rgba(255, 255, 255, 0.14);
  color: #d8edf6;
}

.row-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.row-score b.ok,
.ok {
  color: var(--green);
}

.row-score b.warn,
.warn {
  color: var(--amber);
}

.row-score b.bad,
.bad {
  color: var(--red);
}

.preview-stage {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 18px 24px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.stage-header {
  display: none;
}

.stage-tools {
  display: grid;
  grid-template-columns: 32px minmax(150px, 220px) 88px 32px 64px;
  align-items: center;
  gap: 6px;
  justify-content: center;
  justify-self: center;
  min-width: 0;
}

.zoom-range {
  width: 100%;
  height: 32px;
  padding: 0;
  accent-color: var(--blue);
}

.zoom-value-field {
  position: relative;
  display: block;
  min-width: 0;
  color: var(--ink);
}

.zoom-value-field input {
  height: 40px;
  padding: 0 24px 0 9px;
  text-align: right;
  font-weight: 750;
}

.zoom-value-field span {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.stage-tools .zoom-step,
.stage-tools .zoom-fit-btn {
  height: 40px;
  min-height: 0;
  padding: 0;
}

.stage-tools .zoom-step {
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.stage-tools .zoom-fit-btn {
  width: 64px;
}

.canvas-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 0;
  display: grid;
  place-items: center;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  padding: 16px 18px;
  overflow: hidden;
}

.slide-preview {
  position: relative;
  width: min(100%, 1040px, calc((100dvh - 72px - 270px) * 16 / 9));
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  background: #fff;
  border: 1px solid var(--soft-line);
  box-shadow:
    0 16px 40px rgba(6, 31, 66, 0.12),
    0 0 0 1px rgba(0, 108, 174, 0.04);
  overflow: hidden;
  flex: 0 0 auto;
}

.slide-preview.zoom-fixed {
  max-width: none;
}

.model-slide {
  position: absolute;
  inset: 0;
  container-type: inline-size;
  background: #fff;
}

.model-text,
.model-section,
.model-section-icon,
.model-section-title,
.model-section-body,
.model-image,
.model-metrics,
.model-metric-row,
.model-arrow,
.model-brand-logo {
  position: absolute;
}

.model-text.title {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  overflow: hidden;
  padding: 0 1.6%;
}

.model-section {
  background: var(--panel);
  overflow: hidden;
  border-radius: 0.45cqw;
}

.model-section-icon {
  object-fit: contain;
}

.model-section-title {
  display: flex;
  align-items: center;
  color: var(--blue);
  font-size: 1.875cqw;
  line-height: 1.1;
  font-weight: 850;
  overflow: hidden;
}

.model-section-body {
  color: var(--ink);
  font-size: 1.2cqw;
  line-height: 1.65;
  overflow: hidden;
  padding: 0 0.2%;
  overflow-wrap: anywhere;
}

.model-text.placeholder-text,
.model-section-body.placeholder-text {
  color: var(--muted);
}

.model-section-body p,
.model-section-body ul {
  margin: 0;
}

.model-section-body ul {
  padding-left: 1.15em;
}

.model-section-body li + li {
  margin-top: 0.35em;
}

.model-image {
  display: grid;
  place-items: center;
  background: var(--surface-tint);
  border: 1px dashed #b9cddb;
  color: var(--muted);
  text-align: center;
  padding: 0.8%;
  font-size: 1.4cqw;
  overflow: hidden;
}

.model-image.has-image {
  border: 0;
  background: transparent;
  padding: 2%;
}

.model-image.blank-image {
  border: 0;
  background: #fff;
  padding: 0;
}

.model-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.model-metrics {
  background: var(--panel);
  overflow: hidden;
}

.model-metric-row {
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.32em;
  white-space: nowrap;
}

.model-metric-icon {
  position: absolute;
  object-fit: contain;
  display: block;
}

.model-metric-row b {
  display: inline;
  color: var(--ink);
  font-size: 1.875cqw;
  line-height: 1;
  min-width: 0;
}

.model-metric-row span {
  display: inline;
  color: var(--ink);
  font-size: 1.04cqw;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-metric-row.text-only b {
  font-size: 1.35cqw;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-metric-row.placeholder-text b,
.model-metric-row.placeholder-text span {
  color: var(--muted);
}

.model-metric-row.placeholder-text {
  align-items: flex-start;
  white-space: normal;
}

.model-metric-row.placeholder-text b {
  display: block;
  line-height: 1.3;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: keep-all;
}

.model-arrow {
  overflow: visible;
  object-fit: contain;
}

.model-arrow path {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.model-brand-logo {
  object-fit: contain;
  display: block;
  z-index: 3;
}

.model-page-number {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #898989;
  line-height: 1;
  z-index: 3;
}

.slide-logo {
  display: none;
}

.slide-title {
  position: absolute;
  left: 2.54%;
  top: 8.45%;
  width: 94.92%;
  text-align: center;
  font-size: clamp(18px, 4.2cqw, 34px);
  font-weight: 850;
}

.section-card {
  position: absolute;
  top: 20.29%;
  width: 30.71%;
  height: 29.4%;
  background: var(--panel);
  padding: 3.75% 3.65% 2.6%;
  overflow: hidden;
}

.section-card.need {
  left: 2.71%;
}

.section-card.hard {
  left: 34.64%;
}

.section-card.gain {
  left: 66.59%;
}

.section-card strong {
  display: flex;
  align-items: center;
  gap: 1.1cqw;
  color: var(--blue);
  font-size: clamp(12px, 2.55cqw, 20px);
  margin-bottom: 0.7cqw;
}

.section-card strong::before {
  content: "";
  flex: 0 0 auto;
  width: 2.25cqw;
  height: 2.25cqw;
  background: center / contain no-repeat;
}

.section-card.need strong::before {
  background-image: url("/assets/icon-need.svg");
}

.section-card.hard strong::before {
  background-image: url("/assets/icon-hard.svg");
}

.section-card.gain strong::before {
  background-image: url("/assets/icon-gain.svg");
}

.section-card p {
  font-size: clamp(7px, 1.3cqw, 12px);
  line-height: 1.38;
  max-height: 52%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
}

.section-card ul {
  margin: 0;
  padding-left: 1.2em;
  font-size: clamp(7px, 1.3cqw, 12px);
  line-height: 1.35;
  max-height: 52%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
}

.image-slot {
  position: absolute;
  top: 55.2%;
  display: grid;
  place-items: center;
  background: var(--surface-tint);
  border: 1px dashed #b9cddb;
  color: var(--muted);
  text-align: center;
  padding: 8px;
  font-size: clamp(8px, 1.4cqw, 12px);
}

.image-slot.has-image {
  border-style: solid;
  background: #fff;
  padding: 0;
  overflow: hidden;
}

.image-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.image-slot span {
  display: none;
}

.image-slot.left {
  left: 2.71%;
  width: 22.13%;
  height: 33.03%;
}

.image-slot.mid {
  left: 26.62%;
  width: 21.38%;
  height: 33.03%;
}

.image-slot.right {
  left: 76.13%;
  top: 55.2%;
  width: 21.15%;
  height: 33.03%;
}

.slide-arrow {
  position: absolute;
  left: 49.35%;
  top: 69.07%;
  width: 3.6%;
  height: 5.2%;
  overflow: visible;
}

.slide-arrow path {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.metric-slot {
  position: absolute;
  left: 54%;
  top: 55.2%;
  width: 18.75%;
  height: 33.03%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: var(--panel);
  padding: 3% 4%;
  overflow: hidden;
}

.metric-row b {
  display: block;
  font-size: clamp(11px, 2.35cqw, 21px);
  line-height: 1.05;
}

.metric-row span {
  display: block;
  color: var(--muted);
  font-size: clamp(7px, 1.25cqw, 11px);
  line-height: 1.2;
}

.metric-row.long b {
  font-size: clamp(7px, 1.22cqw, 12px);
  line-height: 1.24;
}

.filmstrip-head {
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.filmstrip-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 72px;
  margin-top: 0;
  padding: 0 8px 6px 0;
}

.filmstrip-count {
  position: absolute;
  right: 10px;
  top: -30px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.filmstrip {
  display: flex;
  gap: 8px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  padding-bottom: 0;
}

.film-item {
  position: relative;
  flex: 0 0 170px;
  width: 170px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.film-item span {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--blue);
  font-weight: 800;
}

.film-item img {
  width: 42px;
  height: 28px;
  object-fit: cover;
  border: 1px solid var(--soft-line);
  background: var(--surface-tint);
}

.film-item b {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 13px;
}

.film-item.active {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.film-remove {
  position: absolute;
  top: 0;
  right: 0;
  width: 52px;
  height: 100%;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--brand-soft-strong);
  background: rgba(255, 255, 255, 0.96);
  color: #5d7188;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transform: translateX(4px);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease, color 0.14s ease, background 0.14s ease;
  cursor: pointer;
}

.film-item:hover .film-remove,
.film-item:focus-within .film-remove {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.film-remove:hover,
.film-remove:focus-visible {
  background: #fff0f1;
  color: var(--red);
  outline: none;
}

.inspector-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.inspector-head h2 {
  margin-top: 5px;
  font-size: 21px;
}

.qa-section {
  border-top: 1px solid var(--soft-line);
  padding: 16px 0;
  display: grid;
  gap: 12px;
}

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

.qa-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.qa-item span {
  color: var(--muted);
}

.export-panel {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--soft-line);
  background: #fff;
}

.export-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  position: relative;
  margin-bottom: 6px;
  min-height: 64px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
}

.export-current {
  grid-area: 1 / 1;
  justify-self: start;
  display: flex;
  align-items: center;
  min-height: 40px;
  min-width: 0;
  max-width: calc(50% - 260px);
}

.export-toolbar .stage-tools {
  grid-area: 1 / 1;
  justify-self: center;
}

.export-toolbar .export-actions {
  grid-area: 1 / 1;
  justify-self: end;
}

.export-current h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.hidden-export-scope {
  display: none;
}

.export-actions {
  display: grid;
  grid-template-columns: 1fr;
  width: 116px;
  align-items: center;
}

.export-actions .primary {
  height: 40px;
  min-height: 0;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}

.export-options {
  display: grid;
  gap: 12px;
  padding-top: 16px;
}

.export-toolbar label {
  gap: 5px;
}

.export-toolbar select {
  height: 40px;
  min-height: 0;
  padding: 0 10px;
}

.status,
.downloads {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.downloads a {
  display: block;
  color: var(--blue);
  margin-top: 5px;
}

.mobile-export-bar {
  display: none;
}

.export-toolbar .downloads {
  grid-column: 1 / -1;
}

.export-toolbar .downloads:empty {
  display: none;
}

.wide-header,
.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.wide-header span,
.admin-header span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.cases-page,
.editor-page,
.admin-page-view {
  background: var(--surface-tint);
}

.management-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1fr);
  gap: 24px;
  padding: 20px 24px 72px;
}

.case-table-panel,
.live-preview-card {
  background: var(--surface);
  border: 1px solid var(--line);
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--soft-line);
}

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

.manage-list {
  display: grid;
}

.manage-list.empty {
  padding: 22px;
  color: var(--muted);
}

.manage-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 104px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--soft-line);
}

.manage-row:hover {
  background: var(--surface-tint);
}

.manage-row .case-thumb {
  width: 118px;
  height: 68px;
  border-color: var(--soft-line);
}

.manage-primary {
  min-width: 0;
}

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

.manage-actions button {
  min-width: 70px;
}

.ghost.danger {
  color: var(--red);
  border-color: #f4b8bc;
  background: #fff5f5;
}

.ghost.danger:hover {
  background: #ffe4e6;
}

.manage-row h3 {
  margin-bottom: 5px;
  font-size: 17px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.manage-row p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(500px, 1.08fr) minmax(540px, 1fr);
  gap: 18px;
  padding: 18px 24px 86px;
}

.editor-page .case-form {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 22px;
}

.editor-page .case-form section {
  scroll-margin-top: 18px;
}

.editor-preview {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 10px;
}

.live-preview-card {
  padding: 10px;
}

.editor-live-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--soft-line);
  overflow: hidden;
}

.editor-preview-title {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 8%;
  text-align: center;
  font-size: clamp(20px, 2.45vw, 34px);
  font-weight: 850;
}

.editor-preview-sections {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 22%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2%;
}

.editor-text-box {
  min-height: 102px;
  padding: 14px;
  background: var(--panel);
  overflow: hidden;
}

.editor-text-box strong {
  display: block;
  color: var(--blue);
  font-size: clamp(13px, 1.35vw, 18px);
  margin-bottom: 6px;
}

.editor-text-box p,
.editor-text-box li {
  font-size: clamp(8px, 0.78vw, 12px);
  line-height: 1.35;
}

.editor-text-box ul {
  margin: 0;
  padding-left: 1.2em;
}

.editor-preview-bottom {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 8%;
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 40px 0.9fr 1.1fr;
  gap: 10px;
  align-items: center;
}

.editor-image-box,
.editor-metric-box {
  height: clamp(112px, 9.4vw, 150px);
  display: grid;
  place-items: center;
  background: var(--surface-tint);
  border: 1px dashed #b9cddb;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.editor-metric-box {
  border-style: solid;
  background: var(--panel);
  justify-items: start;
  padding: 12px;
}

.editor-image-box.has-image {
  border-style: solid;
  background: #fff;
  padding: 0;
  overflow: hidden;
}

.editor-image-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.editor-preview-bottom svg {
  width: 40px;
  height: 28px;
}

.editor-preview-bottom svg path {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.editor-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  z-index: 5;
}

.editor-saving-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  background: rgba(237, 245, 250, 0.72);
  backdrop-filter: blur(1.5px);
  cursor: wait;
}

.editor-page.is-saving .editor-saving-overlay {
  display: grid;
}

.editor-saving-overlay div {
  display: grid;
  gap: 6px;
  min-width: 260px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(6, 31, 66, 0.16);
  text-align: center;
}

.editor-saving-overlay strong {
  color: var(--ink);
  font-size: 18px;
}

.editor-saving-overlay span {
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 84px;
  z-index: 30;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 12px 16px;
  color: #ffffff;
  background: var(--green);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 34px rgba(6, 31, 66, 0.18);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--red);
}

.drawer,
.modal,
.admin-page {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
}

.drawer.open,
.modal.open,
.admin-page.open {
  display: block;
}

.drawer-backdrop,
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 31, 66, 0.46);
}

.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: min(980px, 94vw);
  height: 100%;
  overflow: auto;
  background: var(--surface);
  padding: 24px;
  box-shadow: -20px 0 50px rgba(6, 31, 66, 0.18);
}

.drawer-header span,
.modal-header span {
  color: var(--muted);
  font-size: 13px;
}

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

.case-form {
  display: grid;
  gap: 18px;
}

.case-form section {
  display: grid;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--soft-line);
}

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

.tag-field,
.choice-field {
  min-width: 0;
}

.tag-picker,
.choice-picker {
  position: relative;
  min-height: 38px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--brand-soft-strong);
  background: var(--brand-soft);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 750;
}

.tag-chip span {
  color: var(--muted);
}

.tag-picker input,
.choice-picker input {
  width: 100%;
}

.tag-picker .tag-list:not(:empty) + input {
  min-width: 120px;
  width: auto;
  flex: 1 1 120px;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 5px 7px;
  gap: 6px;
}

.tag-picker .tag-list {
  display: contents;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.tag-picker > input {
  margin-top: 0;
  min-height: 28px;
  padding: 0;
  border: 0;
  outline: 0;
}

.tag-options,
.choice-options {
  position: absolute;
  z-index: 12;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow: auto;
  display: none;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 28px rgba(6, 31, 66, 0.16);
}

.tag-picker.open .tag-options,
.choice-picker.open .choice-options {
  display: grid;
}

.tag-options:empty,
.choice-options:empty {
  display: none;
}

.tag-options button,
.choice-options button {
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid var(--soft-line);
  background: var(--surface-tint);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.tag-options button:hover,
.choice-options button:hover {
  color: var(--blue-dark);
  border-color: var(--brand-soft-strong);
  background: var(--brand-soft);
}

small {
  color: var(--muted);
}

.case-form .field-invalid input,
.case-form .field-invalid textarea,
.case-form .field-invalid select,
.case-form .field-invalid .tag-picker,
.case-form .field-invalid .choice-picker {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(215, 25, 32, 0.08);
}

.case-form .field-invalid.upload-slot {
  border-color: var(--red);
  background-color: #fff5f5;
}

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

.editor-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.editor-section-title-row h3 {
  margin: 0;
}

.confidential-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--soft-line);
  background: var(--surface);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.confidential-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.upload-slot {
  position: relative;
  min-height: 112px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px dashed #b9cddb;
  background: var(--surface-tint);
  color: var(--blue-dark);
  font-weight: 750;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
}

.upload-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--upload-preview);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
}

.upload-slot.has-image::before {
  opacity: 1;
}

.upload-slot.has-image::after {
  content: none;
}

.upload-slot input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

.upload-slot strong,
.upload-slot span {
  position: relative;
  z-index: 2;
}

.upload-slot.has-image strong,
.upload-slot.has-image span {
  display: none;
}

.upload-slot span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.drawer-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.drawer-preview h3 {
  margin: 0;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.drawer-preview .qa-list {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.drawer-preview .qa-item {
  min-width: 0;
  justify-content: center;
  gap: 6px;
  padding: 4px 6px;
  background: var(--surface-tint);
  border: 1px solid var(--soft-line);
  font-size: 12px;
}

.drawer-preview .qa-item span,
.drawer-preview .qa-item b {
  white-space: nowrap;
}

.mini-slide {
  aspect-ratio: 16 / 9;
  display: grid;
  gap: 8px;
  align-content: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.mini-slide span {
  color: var(--muted);
  font-size: 12px;
}

.mini-slide div {
  height: 44px;
  border: 1px dashed #b9cddb;
  background: var(--surface-tint);
}

.drawer-footer {
  position: sticky;
  bottom: -24px;
  margin: 22px -24px -24px;
  padding: 14px 24px;
  background: #fff;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(1328px, 96vw);
  height: min(560px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  transform: translate(-50%, -50%);
  background: var(--surface);
  padding: 0;
  box-shadow: 0 24px 70px rgba(6, 31, 66, 0.24);
}

.modal.export-locked .modal-card > :not(.export-lock-overlay) {
  pointer-events: none;
  user-select: none;
}

.export-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: rgba(247, 251, 254, 0.72);
  backdrop-filter: blur(1px);
}

.export-lock-overlay[hidden] {
  display: none;
}

.export-lock-panel {
  display: grid;
  gap: 8px;
  min-width: 260px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 18px 42px rgba(6, 31, 66, 0.16);
  text-align: center;
}

.export-lock-panel strong {
  color: var(--blue-dark);
  font-size: 20px;
}

.export-lock-panel span {
  color: var(--muted);
  font-size: 13px;
}

.modal-header {
  padding: 18px 26px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  font-size: 25px;
  line-height: 1.15;
}

.modal-close {
  min-width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  box-shadow: none;
}

.modal-close:hover {
  color: var(--blue);
}

.export-modal-count {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 12px 18px;
  padding: 16px 26px 12px;
  color: var(--ink);
  line-height: 1.2;
}

.export-count-main {
  white-space: nowrap;
  font-size: 18px;
  font-weight: 850;
  line-height: 26px;
}

.export-modal-count strong {
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
}

.export-industry-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: flex-end;
  max-height: 66px;
  min-width: 0;
  overflow: auto;
  padding: 4px 0 2px;
}

.export-industry-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 6px 3px 9px;
  background: #fff;
  border: 1px solid var(--soft-line);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
}

.export-industry-summary strong {
  min-width: 22px;
  padding: 3px 6px;
  background: var(--brand-soft);
  color: var(--blue);
  font-size: 13px;
  line-height: 1;
  text-align: center;
}

.export-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 28px;
  padding: 0 26px 12px;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.export-case-panel,
.export-settings-panel {
  border: 1px solid var(--line);
  background: #fff;
}

.export-case-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.export-case-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--soft-line);
}

.export-case-head h3,
.export-format-field h3 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.export-case-head span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.export-case-table-wrap {
  min-height: 0;
  overflow: auto;
}

.export-case-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.export-case-table th,
.export-case-table td {
  padding: 11px 18px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: middle;
}

.export-case-table th {
  color: var(--muted);
  background: var(--surface-tint);
  font-weight: 750;
}

.export-case-table th:first-child,
.export-case-table td:first-child {
  width: 64px;
  text-align: center;
}

.export-case-table th:nth-child(3),
.export-case-table td:nth-child(3) {
  width: 150px;
}

.export-case-table th:nth-child(2),
.export-case-table td:nth-child(2) {
  width: auto;
}

.export-case-table td {
  color: var(--ink);
}

.export-case-table td span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-strong);
  color: var(--blue);
  font-size: 13px;
  font-weight: 750;
}

.export-settings-panel {
  display: grid;
  gap: 16px;
  padding: 18px 20px 14px;
  min-height: 0;
  overflow: auto;
}

.export-settings-panel label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 750;
}

.export-format-field {
  display: grid;
  gap: 10px;
}

.format-toggle {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.format-toggle .secondary {
  min-height: 42px;
  text-align: left;
  background: #fff;
  border-color: var(--line);
}

.format-toggle .active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #fff;
}

.export-total-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  gap: 3px;
  min-height: 66px;
  border: 1px solid var(--line);
  background: var(--surface-tint);
}

.export-total-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.export-total-box strong {
  color: var(--blue);
  font-size: 27px;
  line-height: 1;
}

.modal-footer {
  margin-top: 0;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.modal-footer span {
  margin-right: auto;
  color: var(--muted);
  font-size: 13px;
}

.modal-footer-actions {
  display: flex;
  gap: 14px;
}

.admin-page {
  background: var(--page);
  overflow: auto;
}

.admin-shell {
  width: min(1040px, calc(100vw - 48px));
  min-height: calc(100dvh - 48px);
  margin: 24px auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(6, 31, 66, 0.14);
}

.admin-header,
.admin-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px;
}

.admin-header {
  border-bottom: 1px solid var(--line);
}

.admin-header span,
.admin-footer span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-content: start;
  padding: 24px;
}

.admin-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--surface-tint);
  border: 1px solid var(--soft-line);
}

.admin-card h3 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--blue-dark);
}

.admin-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--soft-line);
}

.admin-card-title-row h3 {
  padding-bottom: 0;
  border-bottom: 0;
}

.admin-card-title-row span {
  max-width: 52%;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.admin-note {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-strong);
  color: var(--blue-dark);
}

.admin-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.admin-user-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--soft-line);
}

.admin-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--brand-soft);
  color: var(--blue-dark);
  font-weight: 850;
}

.admin-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-user-row strong,
.admin-user-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-user-row b {
  padding: 4px 8px;
  background: var(--brand-soft);
  color: var(--blue-dark);
  font-size: 12px;
}

.admin-user-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.admin-add-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 6px;
}

.admin-search-box {
  position: relative;
  display: block;
}

.admin-user-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(12, 39, 66, 0.14);
}

.admin-user-option {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.admin-user-option:hover,
.admin-user-option:focus-visible {
  background: #e8f4fb;
  outline: none;
}

.admin-user-option.disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.admin-user-option.muted {
  display: block;
  min-height: auto;
  color: var(--muted);
  cursor: default;
}

.admin-user-option-main {
  min-width: 0;
}

.admin-user-option strong,
.admin-user-option span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-option .admin-user-option-main > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-user-option b {
  color: var(--blue-dark);
  font-size: 12px;
}

.admin-empty {
  margin: 0;
  color: var(--muted);
}

.admin-activity-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(280px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-activity-toolbar label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
}

.admin-activity-toolbar input,
.admin-activity-toolbar select,
.admin-date-range > button {
  width: 100%;
}

.admin-date-range {
  position: relative;
  display: block;
}

.admin-date-range > button {
  position: relative;
  height: 38px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 700;
}

.admin-date-range > button::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-65%) rotate(45deg);
}

.admin-date-range-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(520px, calc(100vw - 64px));
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 28px rgba(12, 39, 66, 0.14);
}

.admin-date-range-popover[hidden] {
  display: none;
}

.admin-date-range-field {
  display: grid;
  gap: 6px;
}

.admin-date-range-field span {
  font-size: 12px;
  color: var(--muted);
}

.admin-activity-actions {
  display: flex;
  gap: 10px;
}

.admin-activity-table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--soft-line);
  background: var(--surface);
}

.admin-activity-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
  table-layout: fixed;
}

.admin-activity-table th,
.admin-activity-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.admin-activity-table th {
  position: sticky;
  top: 0;
  background: var(--brand-soft);
  font-size: 12px;
  color: var(--muted);
}

.admin-activity-table td {
  color: var(--ink);
}

@media (max-width: 1340px) {
  .admin-activity-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-activity-toolbar {
    grid-template-columns: 1fr;
  }
}

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

.template-readonly-grid div {
  min-width: 0;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--soft-line);
}

.template-readonly-grid span,
.template-readonly-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-readonly-grid span {
  color: var(--muted);
  font-size: 12px;
}

.template-readonly-grid strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 14px;
}

.admin-footer {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.admin-footer span {
  margin-right: auto;
}

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

  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-topbar {
    grid-template-columns: 1fr auto 1fr;
    height: auto;
    min-height: 72px;
    padding: 12px 18px;
    align-items: start;
  }

  .top-source {
    grid-column: 1 / -1;
    justify-self: stretch;
    max-width: none;
  }

  .page-view,
  .export-sidebar {
    height: calc(100dvh - 118px);
  }

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

  .export-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage-tools {
    width: min(100%, 520px);
    justify-self: center;
    grid-template-columns: 32px minmax(100px, 1fr) 88px 32px 64px;
  }

  .export-toolbar .export-actions {
    width: min(360px, 100%);
    justify-self: end;
  }

  .export-current {
    max-width: none;
  }

  .export-sidebar {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .inspector {
    grid-column: 1 / -1;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .manage-row {
    grid-template-columns: 104px minmax(0, 1fr) auto;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  :root {
    --ipad-action-height: 86px;
    --ipad-preview-height: clamp(300px, 38dvh, 430px);
  }

  .app-shell {
    grid-template-rows: 88px minmax(0, 1fr);
  }

  .app-topbar {
    height: 88px;
    min-height: 88px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 14px 28px;
    gap: 18px;
    box-shadow: none;
  }

  .app-topbar .brand {
    align-self: start;
  }

  .app-topbar .mark {
    width: 48px;
    height: 48px;
  }

  .app-topbar h1 {
    font-size: 25px;
    line-height: 1.12;
  }

  .app-topbar .brand p {
    margin-top: 4px;
    font-size: 14px;
  }

  .page-nav {
    display: none;
  }

  .top-source {
    grid-column: 2;
    align-self: center;
    justify-self: end;
    width: auto;
    max-width: 220px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .login-summary {
    min-width: 150px;
  }

  .login-summary-main {
    min-height: 46px;
    padding: 0;
    gap: 10px;
  }

  .login-avatar {
    width: 40px;
    height: 40px;
  }

  .page-view {
    height: calc(100dvh - 88px);
  }

  .export-layout.active {
    display: block;
    height: calc(100dvh - 88px);
    padding-bottom: calc(var(--ipad-preview-height) + var(--ipad-action-height));
    overflow: hidden;
    background: var(--page);
  }

  .export-sidebar {
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 88px - var(--ipad-preview-height) - var(--ipad-action-height));
    overflow: auto;
    padding: 12px 28px 14px;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .export-selection-note {
    padding: 8px 12px;
    font-size: 12px;
  }

  .export-sidebar label {
    gap: 5px;
    font-size: 13px;
    font-weight: 650;
  }

  .export-sidebar input,
  .export-sidebar .multi-filter > button {
    min-height: 34px;
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: 13px;
  }

  .export-sidebar .ghost.dark {
    min-height: 40px;
    padding: 7px 12px;
    color: var(--blue-dark);
    background: var(--surface-tint);
    border-color: #b8d9f3;
    font-size: 15px;
    font-weight: 850;
  }

  .case-picker {
    gap: 8px;
  }

  .export-layout.ipad-filters-collapsed #exportFilters {
    display: none;
  }

  .export-sidebar .list-head {
    padding: 2px 4px;
    background: transparent;
  }

  .case-list {
    max-height: 330px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .export-layout.ipad-filters-collapsed .case-list {
    max-height: calc(100dvh - 88px - var(--ipad-preview-height) - var(--ipad-action-height) - 54px);
  }

  .case-row {
    min-height: 94px;
    padding: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid var(--soft-line);
    background: #fff;
    transition: none;
  }

  .case-row:hover {
    overflow: hidden;
    z-index: auto;
  }

  .case-row:hover:not(.selected) {
    transform: none;
    box-shadow: none;
  }

  .case-row.checked,
  .case-row.selected {
    background: #fff;
    border-color: var(--line);
    box-shadow: none;
  }

  .case-row.checked {
    box-shadow: inset 4px 0 0 var(--blue);
  }

  .case-card-head {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 36px;
    gap: 10px;
    align-items: center;
  }

  .case-check {
    width: 22px;
    height: 22px;
  }

  .case-row h3 {
    font-size: 17px;
  }

  .case-card-body {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }

  .case-card-body .case-thumb {
    display: block;
    width: 108px;
    height: 70px;
    border: 1px solid var(--soft-line);
    background: var(--surface-tint);
  }

  .case-card-body .case-thumb.empty {
    display: grid;
    color: var(--muted);
  }

  .chips {
    gap: 8px;
  }

  .chip {
    padding: 5px 9px;
    font-size: 13px;
  }

  .preview-stage {
    position: fixed;
    z-index: 11;
    left: 0;
    right: 0;
    bottom: var(--ipad-action-height);
    height: var(--ipad-preview-height);
    min-height: 0;
    overflow: hidden;
    padding: 12px 28px;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    background: var(--page);
    border-top: 1px solid var(--line);
  }

  .export-toolbar {
    display: none;
  }

  .canvas-wrap {
    min-height: 0;
    height: 100%;
    padding: 12px 16px;
    background: #fff;
  }

  .slide-preview {
    width: min(100%, calc((var(--ipad-preview-height) - 24px) * 16 / 9), 920px);
    box-shadow: none;
  }

  .filmstrip-wrap {
    display: none;
  }

  .mobile-export-bar {
    position: fixed;
    z-index: 12;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 180px;
    align-items: center;
    gap: 12px;
    min-height: var(--ipad-action-height);
    padding: 14px 34px calc(14px + env(safe-area-inset-bottom));
    background: rgba(238, 246, 251, 0.98);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 28px rgba(6, 31, 66, 0.1);
  }

  .mobile-export-bar div {
    min-width: 0;
    padding-left: 14px;
    border-left: 4px solid var(--blue);
    color: var(--muted);
    font-size: 16px;
    white-space: nowrap;
  }

  .mobile-export-bar strong {
    color: var(--blue-dark);
    font-size: 24px;
    line-height: 1;
  }

  .mobile-export-bar button {
    min-height: 52px;
    padding: 0 18px;
    font-size: 18px;
    white-space: nowrap;
  }
}

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

  .case-nav,
  .inspector,
  .preview-stage {
    height: auto;
  }

  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 72px;
    padding: 10px 12px;
    gap: 10px;
    align-items: center;
  }

  .app-topbar .brand {
    min-width: 0;
  }

  .app-topbar .mark {
    width: 44px;
    height: 44px;
  }

  .app-topbar h1 {
    font-size: 21px;
    line-height: 1.15;
  }

  .app-topbar .brand p {
    margin-top: 3px;
    font-size: 12px;
    white-space: nowrap;
  }

  .top-source {
    grid-column: auto;
    justify-self: end;
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .login-summary {
    min-width: 0;
    max-width: 132px;
  }

  .login-summary-main {
    min-height: 42px;
    padding: 2px 4px 2px 2px;
    gap: 6px;
  }

  .login-avatar {
    width: 34px;
    height: 34px;
    font-size: 11px;
  }

  .login-summary strong {
    max-width: 70px;
    font-size: 13px;
  }

  .login-summary span {
    max-width: 70px;
    font-size: 11px;
  }

  .page-nav {
    display: none;
  }

  .nav-link {
    min-width: 0;
  }

  .page-view {
    height: auto;
  }

  .export-layout.active {
    display: block;
    min-height: calc(100dvh - 124px);
    padding-bottom: 92px;
    overflow: visible;
  }

  .export-sidebar {
    height: auto;
    min-height: calc(100dvh - 216px);
    padding: 14px;
    overflow: visible;
    border-bottom: 0;
    gap: 12px;
  }

  .export-selection-note {
    display: none;
  }

  .filter-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .case-picker {
    gap: 8px;
  }

  .export-sidebar .list-head {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 8px 0;
    background: #fff;
  }

  .case-list {
    overflow: visible;
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
  }

  .case-row {
    min-height: 0;
    padding: 12px;
    overflow: hidden;
    isolation: isolate;
    transition: none;
  }

  .case-row:hover {
    overflow: hidden;
    z-index: auto;
  }

  .case-row:hover:not(.selected) {
    transform: none;
    box-shadow: none;
  }

  .case-row.selected {
    background: #fff;
    border-color: var(--soft-line);
    box-shadow: none;
  }

  .case-row.selected::before {
    display: none;
  }

  .case-row.checked {
    background: linear-gradient(90deg, #eaf5fe, #fff);
    border-color: var(--blue);
    box-shadow: inset 0 0 0 1px rgba(0, 108, 174, 0.14);
  }

  .case-row.checked::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--blue);
  }

  .case-card-head {
    grid-template-columns: 24px minmax(0, 1fr) 28px;
  }

  .case-card-body {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin-top: 8px;
  }

  .case-card-body .case-thumb {
    display: block;
    width: 72px;
    height: 52px;
    border-color: var(--soft-line);
    background: var(--surface-tint);
  }

  .case-card-body .case-thumb.empty {
    display: grid;
    color: var(--muted);
    border-color: #cbd5e1;
  }

  .case-row h3 {
    font-size: 15px;
  }

  .chips {
    gap: 6px;
  }

  .chip {
    max-width: 100%;
  }

  .preview-stage {
    display: none;
  }

  .mobile-export-bar {
    position: fixed;
    z-index: 10;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(6, 31, 66, 0.12);
  }

  .mobile-export-bar div {
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
  }

  .mobile-export-bar strong {
    color: var(--blue-dark);
    font-size: 22px;
    line-height: 1;
  }

  .mobile-export-bar button {
    min-width: 92px;
    min-height: 44px;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .management-grid,
  .editor-grid {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .manage-row {
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    min-height: 0;
    padding: 14px;
  }

  .manage-row .case-thumb {
    width: 86px;
    height: 58px;
  }

  .manage-actions {
    grid-column: 1 / -1;
  }

  .manage-actions {
    justify-content: stretch;
  }

  .manage-actions button {
    flex: 1;
  }

  .editor-preview {
    position: static;
  }

  .editor-footer {
    left: 0;
    flex-wrap: wrap;
  }

  .wide-header {
    align-items: stretch;
    flex-direction: column;
    padding: 20px 18px;
  }

  .stage-header,
  .admin-header,
  .admin-footer,
  .drawer-header,
  .modal-header,
  .modal-footer,
  .drawer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .drawer-grid,
  .admin-grid,
  .modal-grid,
  .form-grid,
  .upload-grid,
  .field-contracts,
  .template-readonly-grid {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    width: calc(100vw - 20px);
    min-height: calc(100dvh - 20px);
    margin: 10px auto;
  }

  .canvas-wrap {
    min-height: auto;
    padding: 10px;
  }
}
