:root {
  --color-brand-primary: #ff405f;
  --color-brand-strong: #f23455;
  --color-brand-action: #ee4866;
  --color-brand-soft: #ffe8ed;
  --color-brand-readable: #c93658;
  --color-danger-action: #c93649;
  --color-danger-strong: #b4233f;
  --color-bg-blush: #fbf0f3;
  --color-text-primary: #171719;
  --color-text-strong: #101010;
  --color-text-secondary: #625a5e;
  --color-text-muted: #6f666a;
  --color-line-subtle: #ececee;
  --color-surface-solid: #ffffff;
  --color-surface-card: rgba(255, 255, 255, 0.5);
  --color-surface-soft: rgba(255, 250, 251, 0.76);
  --color-surface-flow: rgba(252, 253, 255, 0.8);
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --space-9: 64px;
  --radius-card: 15px;
  --radius-control: 12px;
  --radius-pill: 999px;
  --canvas: #f7ede8;
  --surface: #ffffff;
  --surface-raised: #fffdfd;
  --surface-tint: #fdecef;
  --ink: #2a1f26;
  --ink-strong: #1b1116;
  --muted: #7a626a;
  --faint: #ad929a;
  --line: #ebd3d9;
  --line-strong: #ddb6c0;
  --accent: #c93649;
  --accent-deep: #bd0e2b;
  --accent-hot: #e94136;
  --accent-soft: #fdecef;
  --accent-wash: #fff3f5;
  --blush: #f6acb9;
  --rose: #d4606d;
  --tone-1: #fdecef;
  --tone-2: #ffe1e4;
  --tone-3: #f9c7d0;
  --tone-4: #fff0e8;
  --tone-5: #f8d5dc;
  --sage: #9d5966;
  --sage-soft: #fff0f2;
  --amber: #e94136;
  --nav: #f7ede8;
  --nav-soft: #fff7f4;
  --nav-muted: #9d5966;
  --blue-select: #f6acb9;
  --shadow: 0 14px 30px rgba(74, 18, 31, 0.08);
  --shadow-soft: 0 2px 10px rgba(74, 18, 31, 0.05);
  --font-sans: "Inter UI", "Source Han Sans CN UI", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei UI", sans-serif;
  --header-h: 0px;
  --side-w: 224px;
  --side-collapsed-w: 64px;
  --radius: 12px;
}

body[data-theme="berry-apricot"] {
  --canvas: #f7ede8;
  --surface: #ffffff;
  --surface-raised: #fffaf8;
  --surface-tint: #fde5dc;
  --ink: #35232b;
  --ink-strong: #231318;
  --muted: #84606d;
  --faint: #b88d9a;
  --line: #ecd1ca;
  --line-strong: #e2b5ab;
  --accent: #ee4866;
  --accent-deep: #c93658;
  --accent-hot: #dd6b4f;
  --accent-soft: #fde8ec;
  --accent-wash: #fff1f4;
  --blush: #f091a0;
  --rose: #ee4866;
  --tone-1: #fde8ec;
  --tone-2: #f7c9d1;
  --tone-3: #f0c2a2;
  --tone-4: #ffe7d5;
  --tone-5: #ead1df;
  --sage: #b47096;
  --sage-soft: #f8e8f1;
  --amber: #dd6b4f;
  --nav: #f7ede8;
  --nav-soft: #fff7f4;
  --nav-muted: #9d5966;
  --blue-select: #f091a0;
  --shadow: 0 14px 30px rgba(86, 24, 41, 0.08);
  --shadow-soft: 0 2px 10px rgba(86, 24, 41, 0.05);
}

body[data-theme="apple-mono"] {
  --canvas: #f5f5f7;
  --surface: #ffffff;
  --surface-raised: #fbfbfd;
  --surface-tint: #f5f5f7;
  --ink: #424245;
  --ink-strong: #1d1d1f;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --line: #d8d8dd;
  --line-strong: #c6c6cc;
  --accent: #1d1d1f;
  --accent-deep: #000000;
  --accent-hot: #6e6e73;
  --accent-soft: #f2f2f4;
  --accent-wash: #fbfbfd;
  --blush: #e8e8ed;
  --rose: #86868b;
  --tone-1: #fbfbfd;
  --tone-2: #f5f5f7;
  --tone-3: #e8e8ed;
  --tone-4: #f2f2f4;
  --tone-5: #d8d8dd;
  --sage: #86868b;
  --sage-soft: #f5f5f7;
  --amber: #6e6e73;
  --nav: #f5f5f7;
  --nav-soft: #ffffff;
  --nav-muted: #6e6e73;
  --blue-select: #c6c6cc;
  --shadow: 0 14px 30px rgba(29, 29, 31, 0.06);
  --shadow-soft: 0 2px 10px rgba(29, 29, 31, 0.04);
}

body[data-appearance="deep-dark"] {
  --canvas: #12100f;
  --surface: #1b1716;
  --surface-raised: #211d1b;
  --surface-tint: #2a2020;
  --ink: #efe7df;
  --ink-strong: #fff8f0;
  --muted: #bcaea4;
  --faint: #897a72;
  --line: #3b302d;
  --line-strong: #5d4a43;
  --accent: #e8696d;
  --accent-deep: #ff8b83;
  --accent-hot: #f0a35d;
  --accent-soft: #342323;
  --accent-wash: #251b1a;
  --blush: #8a4d51;
  --rose: #e8696d;
  --tone-1: #251b1a;
  --tone-2: #33211f;
  --tone-3: #51352f;
  --tone-4: #2d261e;
  --tone-5: #3b2a2b;
  --sage: #d0a06f;
  --sage-soft: #2a221a;
  --amber: #f0a35d;
  --nav: #161312;
  --nav-soft: #211d1b;
  --nav-muted: #bcaea4;
  --blue-select: #e8696d;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 2px 14px rgba(0, 0, 0, 0.24);
}

body[data-appearance="deep-dark"] .sidebar,
body[data-appearance="deep-dark"] .account-popover {
  background: color-mix(in srgb, var(--nav) 88%, #000 12%);
}

body[data-appearance="deep-dark"] .sidebar-brand,
body[data-appearance="deep-dark"] .sidebar-title {
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"] .sidebar-item:hover,
body[data-appearance="deep-dark"] .sidebar-item.is-active,
body[data-appearance="deep-dark"] .account-entry[aria-expanded="true"] {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"] .sidebar-item.is-active::before,
body[data-appearance="deep-dark"] .rb-mark {
  background: var(--accent);
}

body[data-appearance="deep-dark"] .primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #1a1110;
  box-shadow: 0 10px 24px rgba(232, 105, 109, 0.18);
}

body[data-appearance="deep-dark"] .primary:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: #1a1110;
}

body[data-appearance="deep-dark"] input,
body[data-appearance="deep-dark"] select,
body[data-appearance="deep-dark"] textarea,
body[data-appearance="deep-dark"] .themed-select-trigger {
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.is-hidden {
  display: none !important;
}

html {
  height: 100%;
  min-width: 360px;
}

body {
  margin: 0;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 1.55;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 14px;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  font-weight: var(--font-weight-medium);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
  color: var(--accent);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.56;
  transform: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 9px 12px;
  font-weight: var(--font-weight-regular);
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.02);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  padding-right: 34px;
}

select:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  background-color: var(--accent-wash);
}

select:disabled {
  color: var(--faint);
  background-color: var(--surface-raised);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--faint) 50%),
    linear-gradient(135deg, var(--faint) 50%, transparent 50%);
}

select option,
select optgroup {
  background: var(--surface);
  color: var(--ink);
}

select option:checked {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.themed-select-native {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

.themed-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.themed-select-trigger {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px 0 12px;
  text-align: left;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.02);
}

.themed-select-trigger:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  background: var(--accent-wash);
  color: var(--ink-strong);
}

.themed-select.is-open .themed-select-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
}

.themed-select-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.themed-select-trigger::after {
  content: "";
  width: 9px;
  height: 9px;
  justify-self: center;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 140ms ease;
}

.themed-select.is-open .themed-select-trigger::after {
  transform: rotate(225deg) translateY(-1px);
}

.themed-select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  max-height: min(320px, 52vh);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent-wash));
  padding: 6px;
  box-shadow: 0 18px 42px rgba(74, 18, 31, 0.18);
}

.themed-select-option {
  min-height: 36px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  text-align: left;
  box-shadow: none;
}

.themed-select-option:hover,
.themed-select-option.is-active {
  background: var(--accent-wash);
  color: var(--accent-deep);
}

.themed-select-option::before {
  content: "";
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.themed-select-option.is-selected::before {
  background: currentColor;
  mask: url("/assets/icons/ui-check.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/icons/ui-check.svg") center / contain no-repeat;
}

.themed-select-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.themed-select-option:disabled,
.themed-select.is-disabled .themed-select-trigger {
  cursor: not-allowed;
  opacity: 0.54;
}

input::placeholder,
textarea::placeholder {
  color: #b99aa4;
}

input,
select {
  min-height: 42px;
}

textarea {
  resize: vertical;
  line-height: 1.68;
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 72%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.15;
}

h2 {
  color: var(--ink-strong);
  font-size: 21px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
}

h3 {
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.45;
}

.admin-shell {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.menu-toggle {
  --menu-toggle-icon-color: #d7dee9;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0 12px;
}

.menu-toggle-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 20px;
  background: var(--menu-toggle-icon-color);
  mask: url("/assets/icons/ui-sidebar-collapse.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/icons/ui-sidebar-collapse.svg") center / contain no-repeat;
  transition: background 160ms ease;
}

body.sidebar-collapsed .menu-toggle-icon {
  mask-image: url("/assets/icons/ui-sidebar-expand.svg");
  -webkit-mask-image: url("/assets/icons/ui-sidebar-expand.svg");
}

.menu-toggle-label {
  white-space: nowrap;
}

.rb-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 10px;
  background: url("/assets/icons/brand-mark.svg") center / cover no-repeat;
  box-shadow:
    0 8px 18px rgba(74, 18, 31, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  transition: grid-template-columns 180ms ease;
}

body.sidebar-collapsed .workspace {
  grid-template-columns: var(--side-collapsed-w) minmax(0, 1fr);
}

.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(157, 89, 102, 0.16);
  background: var(--nav);
  padding: 14px 12px;
}

.sidebar-brand {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 2px 2px 12px;
  border-bottom: 1px solid rgba(157, 89, 102, 0.16);
}

.sidebar-main {
  min-height: 0;
  padding-top: 56px;
}

.sidebar-footer {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
}

.sidebar-brand-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 9px;
}

.sidebar-brand-lockup {
  display: block;
  width: min(126px, 100%);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: left center;
  opacity: 0.9;
}

.sidebar-brand-copy strong {
  color: #4a121f;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.15;
  white-space: nowrap;
}

body.sidebar-collapsed .sidebar {
  padding-inline: 10px;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .sidebar-brand-copy,
body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .menu-toggle-label,
body.sidebar-collapsed .sidebar-item span:not(.nav-icon),
body.sidebar-collapsed .account-popover {
  display: none;
}

.sidebar-brand-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.operator-notification-shell {
  flex: 0 0 auto;
}

body button.operator-notification-bell,
body button.operator-notification-bell:hover,
body button.operator-notification-bell:focus-visible,
body button.operator-notification-bell:active {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line-strong) 72%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--nav-muted);
  padding: 0;
  box-shadow: none;
}

body button.operator-notification-bell:hover,
body button.operator-notification-bell:focus-visible,
body button.operator-notification-bell[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent-deep);
}

.operator-notification-bell svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.operator-notification-bell.is-running::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 6px;
  height: 6px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--accent);
  content: "";
  animation: operator-notification-pulse 1.7s ease-in-out infinite;
}

.operator-notification-badge {
  position: absolute;
  top: -6px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--nav);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 0 4px;
  font-size: 9px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  letter-spacing: -0.02em;
  box-shadow: 0 3px 9px color-mix(in srgb, var(--accent) 28%, transparent);
}

.operator-notification-badge.is-hidden,
.operator-notification-panel.is-hidden,
.operator-notification-peek.is-hidden {
  display: none;
}

.operator-notification-panel,
.operator-notification-peek {
  position: fixed;
  z-index: 120;
  left: calc(var(--side-w) + 12px);
  width: min(360px, calc(100vw - var(--side-w) - 30px));
  border: 1px solid color-mix(in srgb, var(--line-strong) 72%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-raised) 96%, transparent);
  color: var(--ink);
  box-shadow: 0 20px 46px color-mix(in srgb, var(--ink-strong) 18%, transparent);
  backdrop-filter: blur(18px);
}

.operator-notification-panel {
  top: 14px;
  max-height: min(620px, calc(100dvh - 28px));
  overflow: hidden;
}

.operator-notification-panel > header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 13px 15px;
}

.operator-notification-panel > header div,
.operator-notification-panel > header strong,
.operator-notification-panel > header span {
  display: block;
}

.operator-notification-panel > header span {
  margin-bottom: 4px;
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.16em;
}

.operator-notification-panel > header strong {
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
}

body .operator-notification-panel > header button,
body .operator-notification-panel > header button:hover,
body .operator-notification-panel > header button:focus-visible {
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  box-shadow: none;
}

body .operator-notification-panel > header button:hover,
body .operator-notification-panel > header button:focus-visible {
  background: var(--accent-wash);
  color: var(--accent-deep);
}

.operator-notification-list {
  max-height: min(540px, calc(100dvh - 110px));
  display: grid;
  gap: 2px;
  overflow-y: auto;
  padding: 7px;
}

.operator-notification-item {
  width: 100%;
  min-height: 84px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  padding: 11px 10px;
  text-align: left;
}

.operator-notification-item:hover,
.operator-notification-item:focus-visible {
  border-color: var(--line);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.operator-notification-item.is-unread {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.operator-notification-item-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
}

.operator-notification-item.is-running .operator-notification-item-icon,
.operator-notification-peek.is-running .operator-notification-item-icon {
  color: transparent;
}

.operator-notification-item.is-running .operator-notification-item-icon::before,
.operator-notification-peek.is-running .operator-notification-item-icon::before {
  width: 13px;
  height: 13px;
  border: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-top-color: var(--accent);
  border-radius: 999px;
  content: "";
  animation: operator-notification-spin 0.9s linear infinite;
}

.operator-notification-item.is-error .operator-notification-item-icon,
.operator-notification-peek.is-error .operator-notification-item-icon {
  background: color-mix(in srgb, var(--accent-hot) 12%, var(--surface));
  color: var(--accent-hot);
}

.operator-notification-copy {
  min-width: 0;
}

.operator-notification-category {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--accent-deep);
  padding: 2px 6px;
  font-size: 9px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  line-height: 1;
  letter-spacing: 0.04em;
}

.operator-notification-category.is-operator-action {
  background: color-mix(in srgb, #d98732 12%, transparent);
  color: color-mix(in srgb, #a85e16 86%, var(--ink));
}

.operator-notification-category.is-system {
  background: color-mix(in srgb, var(--accent-hot) 11%, transparent);
  color: var(--accent-hot);
}

.operator-notification-copy strong,
.operator-notification-copy span,
.operator-notification-copy small,
.operator-notification-copy time {
  display: block;
}

.operator-notification-copy strong {
  margin: 5px 0;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.operator-notification-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.operator-notification-copy small,
.operator-notification-item-time {
  margin-top: 6px;
  color: var(--faint);
  font-size: 10px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  white-space: nowrap;
}

.operator-notification-copy small {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.operator-notification-unread-dot {
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.operator-notification-empty {
  display: grid;
  place-items: center;
  min-height: 170px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.operator-notification-empty strong,
.operator-notification-empty span {
  display: block;
}

.operator-notification-empty strong {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
}

.operator-notification-empty span {
  font-size: 11px;
  line-height: 1.55;
}

.operator-notification-peek {
  top: 14px;
  min-height: 88px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 24px;
  align-items: start;
  gap: 10px;
  padding: 13px;
  overflow: hidden;
  animation: operator-notification-peek-in 180ms ease-out;
}

.operator-notification-peek .operator-notification-copy {
  width: 100%;
  overflow: hidden;
}

.operator-notification-peek .operator-notification-item-icon {
  margin-top: 1px;
}

.operator-notification-peek button {
  min-width: 24px;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: var(--faint);
  padding: 0;
  box-shadow: none;
}

.operator-notification-peek button:hover,
.operator-notification-peek button:focus-visible {
  background: var(--accent-wash);
  color: var(--accent-deep);
}

body.sidebar-collapsed .operator-notification-panel,
body.sidebar-collapsed .operator-notification-peek {
  left: calc(var(--side-collapsed-w) + 12px);
}

body.sidebar-collapsed .sidebar-brand-row {
  width: auto;
  justify-content: center;
}

@keyframes operator-notification-spin {
  to { transform: rotate(360deg); }
}

@keyframes operator-notification-pulse {
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent); }
}

@keyframes operator-notification-peek-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.sidebar-title {
  margin: 0 8px 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(157, 89, 102, 0.16);
  color: var(--nav-muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.08em;
}

.sidebar-item {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--nav-muted);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  text-align: left;
  padding: 0 12px;
}

body.sidebar-collapsed .sidebar-item {
  justify-content: center;
  padding-inline: 0;
}

.sidebar-item:hover {
  border-color: rgba(201, 54, 73, 0.18);
  background: rgba(201, 54, 73, 0.07);
  color: #4a121f;
}

.sidebar-control {
  width: 100%;
  color: var(--nav-muted);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  text-align: left;
}

body.sidebar-collapsed .sidebar-control {
  justify-content: center;
  padding-inline: 0;
}

.sidebar-control:hover {
  border-color: rgba(201, 54, 73, 0.18);
  background: rgba(201, 54, 73, 0.07);
  color: #4a121f;
}

.sidebar-item.is-active {
  border-color: rgba(201, 54, 73, 0.45);
  background: linear-gradient(90deg, #7b2538, #641827);
  color: #fff;
}

.sidebar-item.is-active::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 99px;
  background: var(--accent);
}

.account-entry[aria-expanded="true"] {
  border-color: rgba(201, 54, 73, 0.28);
  background: rgba(201, 54, 73, 0.1);
  color: #4a121f;
}

.account-popover {
  margin: 8px 0 10px;
  border: 1px solid rgba(157, 89, 102, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
  padding: 12px;
  color: #4a121f;
}

.account-popover-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.account-count {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.account-popover strong,
.account-popover em {
  display: block;
  font-style: normal;
  line-height: 1.2;
}

.account-popover-head strong {
  color: #4a121f;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
}

.account-popover-head em,
.account-popover-meta span {
  color: #9d5966;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.account-popover-meta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  border-top: 1px solid rgba(157, 89, 102, 0.16);
  padding-top: 10px;
}

.account-popover-meta strong {
  color: #4a121f;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.logout-button {
  width: 100%;
  margin-top: 12px;
}

.nav-icon {
  --nav-icon-url: url("/assets/icons/nav-account.svg");
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: currentColor;
  opacity: 0.9;
  background: currentColor;
  mask: var(--nav-icon-url) center / contain no-repeat;
  -webkit-mask: var(--nav-icon-url) center / contain no-repeat;
  transition: opacity 160ms ease, transform 160ms ease;
}

.sidebar-item:hover .nav-icon,
.sidebar-item.is-active .nav-icon,
.account-entry[aria-expanded="true"] .nav-icon {
  opacity: 1;
  transform: translateX(1px);
}

.nav-icon-user {
  --nav-icon-url: url("/assets/icons/nav-account.svg");
}

.nav-icon-home {
  --nav-icon-url: url("/assets/icons/nav-home.svg");
}

.nav-icon-file {
  --nav-icon-url: url("/assets/icons/nav-benchmark.svg");
}

.nav-icon-pen {
  --nav-icon-url: url("/assets/icons/nav-create.svg");
}

.nav-icon-draft {
  --nav-icon-url: url("/assets/icons/nav-draft.svg");
}

.nav-icon-mic {
  --nav-icon-url: url("/assets/icons/nav-speech.svg");
}

.nav-icon-calendar {
  --nav-icon-url: url("/assets/icons/nav-calendar.svg");
}

.nav-icon-message {
  --nav-icon-url: url("/assets/icons/nav-final.svg");
}

.nav-icon-gear {
  --nav-icon-url: url("/assets/icons/nav-settings-generated.png");
}

.nav-icon-box {
  --nav-icon-url: url("/assets/icons/nav-material.svg");
}

.nav-icon-book {
  --nav-icon-url: url("/assets/icons/nav-knowledge.svg");
}

.nav-icon-radar {
  --nav-icon-url: url("/assets/icons/ui-search.svg");
}

.nav-icon-search {
  --nav-icon-url: url("/assets/icons/ui-search.svg");
}

.nav-icon-library {
  --nav-icon-url: url("/assets/icons/nav-benchmark.svg");
}

body[data-theme="apple-mono"] .sidebar {
  border-right-color: #e8e8ed;
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
}

body[data-theme="apple-mono"] .sidebar-brand,
body[data-theme="apple-mono"] .sidebar-title {
  border-bottom-color: #e8e8ed;
}

body[data-theme="apple-mono"] .menu-toggle {
  --menu-toggle-icon-color: #6e6e73;
  border-color: #d8d8dd;
  background: #ffffff;
}

body[data-theme="apple-mono"] .rb-mark {
  border-color: #d8d8dd;
  filter: grayscale(1);
  box-shadow: 0 8px 18px rgba(29, 29, 31, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

body[data-theme="apple-mono"] .sidebar-brand-copy strong,
body[data-theme="apple-mono"] .account-entry[aria-expanded="true"],
body[data-theme="apple-mono"] .account-popover,
body[data-theme="apple-mono"] .account-popover-head strong,
body[data-theme="apple-mono"] .account-popover-meta strong {
  color: #1d1d1f;
}

body[data-theme="apple-mono"] .sidebar-item {
  color: #6e6e73;
}

body[data-theme="apple-mono"] .sidebar-item:hover {
  border-color: #d8d8dd;
  background: rgba(255, 255, 255, 0.86);
  color: #1d1d1f;
}

body[data-theme="apple-mono"] .sidebar-item.is-active {
  border-color: #d8d8dd;
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 10px 22px rgba(29, 29, 31, 0.06);
}

body[data-theme="apple-mono"] .sidebar-item.is-active::before {
  background: #1d1d1f;
}

body[data-theme="apple-mono"] .account-entry[aria-expanded="true"] {
  border-color: #d8d8dd;
  background: #ffffff;
}

body[data-theme="apple-mono"] .account-popover {
  border-color: #d8d8dd;
  background: rgba(255, 255, 255, 0.82);
}

body[data-theme="apple-mono"] .account-popover-head em,
body[data-theme="apple-mono"] .account-popover-meta span {
  color: #86868b;
}

body[data-theme="apple-mono"] .primary {
  border-color: #1d1d1f;
  background: #1d1d1f;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(29, 29, 31, 0.12);
}

body[data-theme="apple-mono"] .primary:hover {
  border-color: #000000;
  background: #000000;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(29, 29, 31, 0.14);
}

body[data-theme="apple-mono"] .color-theme-card.is-active,
body[data-theme="apple-mono"] .themed-select.is-open .themed-select-trigger,
body[data-theme="apple-mono"] .asset-item-card.is-selected {
  box-shadow: 0 0 0 3px rgba(29, 29, 31, 0.08);
}

.ui-icon {
  --ui-icon-url: url("/assets/icons/ui-add.svg");
  width: 18px;
  height: 18px;
  min-width: 0 !important;
  min-height: 0 !important;
  display: inline-block !important;
  flex: 0 0 auto;
  background: currentColor !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  mask: var(--ui-icon-url) center / contain no-repeat;
  -webkit-mask: var(--ui-icon-url) center / contain no-repeat;
}

.ui-icon-add {
  --ui-icon-url: url("/assets/icons/ui-add.svg");
}

.ui-icon-edit {
  --ui-icon-url: url("/assets/icons/ui-edit.svg");
}

.ui-icon-delete {
  --ui-icon-url: url("/assets/icons/ui-delete.svg");
}

.ui-icon-download {
  --ui-icon-url: url("/assets/icons/ui-download.svg");
}

.ui-icon-close {
  --ui-icon-url: url("/assets/icons/ui-close.svg");
}

.ui-icon-drag {
  --ui-icon-url: url("/assets/icons/ui-drag.svg");
}

.ui-icon-chevron-right {
  --ui-icon-url: url("/assets/icons/ui-chevron-right.svg");
}

.ui-icon-chevron-left {
  --ui-icon-url: url("/assets/icons/ui-chevron-right.svg");
  transform: rotate(180deg);
}

.ui-icon-chevron-down {
  --ui-icon-url: url("/assets/icons/ui-chevron-down.svg");
}

.ui-icon-arrow-up {
  --ui-icon-url: url("/assets/icons/ui-arrow-up.svg");
}

.ui-icon-arrow-down {
  --ui-icon-url: url("/assets/icons/ui-arrow-down.svg");
}

.ui-icon-check {
  --ui-icon-url: url("/assets/icons/ui-check.svg");
}

.ui-icon-comment {
  --ui-icon-url: url("/assets/icons/ui-comment.svg");
}

.ui-icon-heart {
  --ui-icon-url: url("/assets/icons/ui-heart.svg");
}

.ui-icon-star {
  --ui-icon-url: url("/assets/icons/ui-star.svg");
}

.ui-icon-share {
  --ui-icon-url: url("/assets/icons/ui-share.svg");
}

.ui-icon-search {
  --ui-icon-url: url("/assets/icons/ui-search.svg");
}

.ui-icon-hourglass {
  --ui-icon-url: url("/assets/icons/ui-hourglass.svg");
}

.ui-icon-expand {
  --ui-icon-url: url("/assets/icons/ui-expand.svg");
}

.shell {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 22px 32px;
}

.workflow-context {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

body[data-current-view="calendar"] .workflow-context,
body[data-current-view="create"] .workflow-context,
body[data-current-view="imageCompose"] .workflow-context,
body[data-current-view="final"] .workflow-context {
  display: grid;
}

.workflow-bar {
  min-width: 0;
  min-height: 40px;
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 4px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.035);
}

.step-tab {
  position: relative;
  min-width: 0;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-color: transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  padding: 0 8px;
}

.step-tab.is-active {
  border-color: rgba(201, 54, 73, 0.24);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  border-radius: 999px;
  color: var(--faint);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.step-tab.is-active .step-badge {
  min-width: 46px;
  padding: 0 7px;
  background: var(--accent);
  color: #fff;
}

.workflow-action-menu {
  position: relative;
}

.workflow-action-menu summary {
  min-width: 64px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.035);
}

.workflow-action-menu summary::-webkit-details-marker {
  display: none;
}

.workflow-action-menu[open] summary {
  border-color: rgba(201, 54, 73, 0.28);
  color: var(--accent-deep);
}

.workflow-actions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  min-width: 214px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px;
  box-shadow: var(--shadow);
}

.pill-button {
  min-width: 62px;
  min-height: 32px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.undo-pill {
  min-width: 56px;
}

.undo-pill:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 16px rgba(201, 54, 73, 0.18);
}

.primary:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: #fff;
  box-shadow: 0 10px 18px rgba(201, 54, 73, 0.22);
}

.secondary,
.ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.025);
}

.secondary:hover,
.ghost:hover {
  border-color: rgba(201, 54, 73, 0.28);
  background: #fff8f9;
  color: var(--accent-deep);
}

.compact {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12px;
}

.global-notice {
  margin: 10px 0 0;
  border: 1px solid rgba(201, 54, 73, 0.16);
  border-radius: 10px;
  background: var(--accent-wash);
  color: #8f3445;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.title-limit-notice {
  position: fixed;
  z-index: 1000;
  top: 24px;
  left: 50%;
  max-width: calc(100vw - 32px);
  transform: translate(-50%, -10px);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  padding: 9px 16px;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(12, 18, 28, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(14px);
}

.title-limit-notice.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.published-confetti {
  position: fixed;
  z-index: 2000;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.published-confetti-piece {
  position: absolute;
  top: -24px;
  left: var(--confetti-left);
  width: 7px;
  height: 15px;
  border-radius: 2px;
  opacity: 0;
  animation: published-confetti-fall var(--confetti-duration) var(--confetti-delay) cubic-bezier(0.18, 0.66, 0.38, 1) forwards;
  will-change: transform, opacity;
}

.published-confetti-piece.is-square {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

@keyframes published-confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -8vh, 0) rotate(var(--confetti-start));
  }

  8%,
  78% {
    opacity: 0.92;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--confetti-drift), 112vh, 0) rotate(var(--confetti-end));
  }
}

@media (prefers-reduced-motion: reduce) {
  .title-limit-notice {
    transition: none;
  }

  .published-confetti {
    display: none;
  }
}

.status-undo {
  min-height: 26px;
  margin-left: 10px;
  border-color: rgba(201, 54, 73, 0.24);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
}

.shell > .global-notice,
.calendar-status-pill {
  display: none !important;
}

body[data-current-view="material"] #materialView > .section-heading {
  display: none;
}

body[data-current-view="material"] .shell {
  padding: 14px 18px 24px;
}

body[data-current-view="material"] #materialView {
  margin-top: 0;
}

body[data-current-view="material"] #materialView > .settings-card {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

body[data-current-view="material"] .asset-studio {
  gap: 12px;
}

body[data-current-view="material"] .asset-toolbar {
  position: sticky;
  top: 0;
  z-index: 55;
  isolation: isolate;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  background: var(--canvas);
  margin-top: -14px;
  padding: 3px 0 12px;
}

body[data-current-view="material"] .asset-toolbar::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -96px;
  right: -18px;
  bottom: 0;
  left: -18px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  background: var(--canvas);
  box-shadow: 0 12px 18px color-mix(in srgb, var(--canvas) 86%, transparent);
}

body[data-current-view="material"] .asset-toolbar .section-kicker {
  margin: 0;
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
}

body[data-current-view="material"] .asset-toolbar-actions {
  width: 100%;
  gap: 8px;
  justify-content: flex-start;
}

body[data-current-view="material"] .asset-toolbar-actions button,
body[data-current-view="material"] .asset-shooting-list-link {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: #f3f3f4;
  color: var(--ink);
  box-shadow: none;
}

body[data-current-view="material"] .asset-toolbar-actions button:hover,
body[data-current-view="material"] .asset-toolbar-actions button:focus-visible,
body[data-current-view="material"] .asset-shooting-list-link:hover,
body[data-current-view="material"] .asset-shooting-list-link:focus-visible {
  border: 0;
  background: #ececef;
  color: var(--ink-strong);
  box-shadow: none;
}

body[data-current-view="material"] .asset-toolbar-actions button.is-active,
body[data-current-view="material"] #assetTrashBtn.is-active,
body[data-current-view="material"] #assetCollapseAllBtn.is-active {
  border: 0;
  background: #f8e7ec;
  color: var(--accent-deep);
  box-shadow: none;
}

body[data-current-view="material"] .asset-shooting-list-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0 14px;
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

body[data-current-view="material"] .asset-workspace {
  gap: 0;
  min-height: 0;
}

body[data-current-view="material"] .asset-browser-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

body[data-current-view="material"] .asset-browser-head {
  min-height: 0;
  border: 0;
  padding: 0;
}

body[data-current-view="material"] .asset-browser-head:has(#assetTrashActions.is-hidden) {
  display: none;
}

body[data-current-view="material"] #assetBrowserTitle {
  display: none;
}

body[data-current-view="material"] .asset-ai-progress-panel {
  grid-template-columns: minmax(0, 1fr);
  gap: 11px;
  border: 1px solid color-mix(in srgb, var(--vision-live) 14%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 96%, var(--vision-live-soft));
  padding: 14px 16px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink-strong) 6%, transparent);
}

body[data-current-view="material"] .asset-ai-progress-top,
body[data-current-view="material"] .asset-ai-progress-stats {
  gap: 10px;
}

body[data-current-view="material"] .asset-ai-progress-top {
  display: flex;
}

body[data-current-view="material"] .asset-ai-progress-top strong {
  font-size: 14px;
}

body[data-current-view="material"] .asset-ai-progress-top span {
  font-size: 12px;
}

body[data-current-view="material"] .asset-ai-progress-bar {
  height: 8px;
}

body[data-current-view="material"] .asset-ai-progress-stats {
  justify-content: flex-start;
  font-size: 12px;
}

body[data-current-view="material"] .asset-ai-progress-errors {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
}

body[data-current-view="material"] .asset-ai-progress-hint {
  grid-column: 1 / -1;
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  padding-top: 9px;
}

body[data-current-view="material"] .asset-item-list {
  gap: 20px;
  padding: 20px;
}

body[data-current-view="material"] .asset-item-card {
  gap: 9px;
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 94%, var(--canvas));
  padding: 0;
  box-shadow: none;
}

body[data-current-view="material"] .asset-item-card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: 0 8px 20px rgba(74, 18, 31, 0.06);
}

body[data-current-view="material"] .asset-item-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 14%, transparent);
}

body[data-current-view="material"] .asset-preview-thumb {
  border: 0;
  border-radius: 10px 10px 8px 8px;
  background: var(--surface-raised);
}

body[data-current-view="material"] .asset-item-content {
  padding: 0 12px 10px;
}

.view {
  display: none;
  margin-top: 12px;
}

.view.is-active {
  display: block;
}

body[data-current-view="account"] .workflow-context,
body[data-current-view="account"] .shell > .global-notice {
  display: none;
}

body[data-current-view="account"] #accountView {
  margin-top: 0;
}

body[data-current-view="calendar"] #calendarView {
  margin-top: 0;
  --calendar-sticky-top: 0px;
  --calendar-controlbar-height: 56px;
}

body[data-current-view="radar"] #radarView {
  margin-top: 0;
  min-height: 0;
  height: calc(100dvh - 14px);
  overflow: hidden;
}

body[data-current-view="radar"] .shell {
  overflow: hidden;
  padding-bottom: 0;
}

body[data-current-view="create"] .shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

body[data-current-view="create"] #createView {
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

body[data-current-view="create"] .create-mode-panel {
  min-height: 0;
  overflow: hidden;
}

/* Graphic creation uses the remaining viewport, so both columns grow and shrink with the screen. */
body[data-current-view="create"] .create-mode-panel.is-active[data-create-mode-panel="graphic"] {
  height: 100%;
  min-height: 0;
}

body[data-current-view="create"] .create-mode-panel:not(.is-active) {
  display: none;
}

body[data-current-view="create"] .create-grid {
  height: 100%;
  min-height: 0;
}

body[data-current-view="speech"] .shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

body[data-current-view="speech"] #speechView {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

body[data-current-view="create"][data-create-mode="speech"] .speech-view.is-active {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.eyebrow,
.summary-label,
.field > span,
.mini-field span,
.status-pill,
.type-chip,
summary,
.section-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(260px, 1fr);
  gap: 24px;
  align-items: end;
  padding: 4px 2px 12px;
}

.section-heading p:last-child {
  max-width: 680px;
  color: var(--muted);
  font-weight: var(--font-weight-regular);
  line-height: 1.65;
}

.section-heading-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.compact-heading {
  margin-bottom: 10px;
}

.command-strip,
.file-drawer,
.calendar-table,
.pool-workspace,
.settings-card,
.create-grid {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.calendar-controlbar {
  position: sticky;
  top: var(--calendar-sticky-top);
  z-index: 90;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 42px;
  margin: -2px 0 8px;
  padding: 2px 0 8px;
  background: var(--surface);
}

.calendar-controlbar::before {
  content: "";
  position: absolute;
  inset: -18px 0 -10px;
  z-index: -1;
  background: var(--surface);
}

.calendar-controlbar .compact-heading {
  min-width: 112px;
  margin: 0;
  padding: 0;
  display: block;
}

.calendar-controlbar .compact-heading h2 {
  font-size: 18px;
  line-height: 1.15;
}

.calendar-title-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.calendar-rule-info-btn {
  min-height: 34px;
  padding-inline: 12px;
  color: var(--ink-strong);
}

.calendar-rule-info-btn:hover,
.calendar-rule-info-btn[aria-expanded="true"] {
  color: var(--accent-deep);
}

.calendar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.calendar-actions > .primary {
  min-width: 104px;
  min-height: 36px;
  border-radius: 10px;
}

.calendar-actions > .calendar-clear-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.calendar-clear-lock {
  position: relative;
  width: 12px;
  height: 10px;
  display: none;
  flex: 0 0 auto;
  margin-top: 3px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.calendar-clear-lock::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -7px;
  width: 5px;
  height: 6px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
}

.calendar-clear-trigger.is-restricted .calendar-clear-lock {
  display: block;
}

body:not([data-appearance="deep-dark"]) .calendar-actions > .calendar-clear-trigger,
body[data-appearance="deep-dark"] .calendar-actions > .calendar-clear-trigger {
  border: 0;
  background: var(--surface-tint);
  color: var(--nav-muted);
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .calendar-actions > .calendar-clear-trigger:hover:not(:disabled),
body[data-appearance="deep-dark"] .calendar-actions > .calendar-clear-trigger:hover:not(:disabled) {
  border: 0;
  background: color-mix(in srgb, var(--nav-muted) 12%, var(--surface));
  color: var(--ink-strong);
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .calendar-actions > .calendar-clear-trigger.is-restricted,
body[data-appearance="deep-dark"] .calendar-actions > .calendar-clear-trigger.is-restricted {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-tint));
  color: var(--accent-deep);
}

body:not([data-appearance="deep-dark"]) .calendar-actions > .calendar-clear-trigger.is-restricted:hover,
body[data-appearance="deep-dark"] .calendar-actions > .calendar-clear-trigger.is-restricted:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent-deep);
}

.calendar-actions > .calendar-clear-trigger:disabled {
  cursor: not-allowed;
}

.calendar-actions > .calendar-clear-trigger[data-clear-state="busy"]:disabled {
  cursor: wait;
}

.calendar-actions > .schedule-settings-trigger {
  min-width: 96px;
  min-height: 36px;
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 86%, var(--accent-soft));
  color: var(--ink-strong);
  box-shadow: none;
}

.calendar-actions > .schedule-settings-trigger:hover {
  border-color: color-mix(in srgb, var(--accent) 46%, transparent);
  background: var(--accent-wash);
  color: var(--accent-deep);
}

.creation-mode-tabs {
  min-height: 54px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  padding: 7px 12px 9px;
  border-bottom: 0;
  overflow: visible;
}

.creation-mode-tabs .creation-mode-tab {
  position: relative;
  min-width: max-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  background: #f1f1f1;
  color: var(--muted);
  padding: 0 16px;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.creation-mode-tab::after {
  display: none;
}

.creation-mode-tabs .creation-mode-tab:hover,
.creation-mode-tabs .creation-mode-tab:focus-visible {
  border: 0;
  background: #e9e9e9;
  color: var(--ink-strong);
  transform: translateY(-1px);
}

.creation-mode-tabs .creation-mode-tab.is-active,
.creation-mode-tabs .creation-mode-tab.is-active:hover,
.creation-mode-tabs .creation-mode-tab.is-active:focus-visible {
  border: 0;
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.creation-mode-count {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--muted);
  padding: 0 6px;
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.creation-mode-tab.is-active .creation-mode-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.calendar-status-pill {
  min-height: 36px;
  max-width: 280px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(201, 54, 73, 0.16);
  border-radius: 999px;
  background: var(--accent-wash);
  color: #8f3445;
  padding: 0 12px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-status-pill.is-idle {
  color: #8f3445;
}

.command-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 220px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
}

.calendar-topline .command-strip {
  grid-template-columns: minmax(140px, 1fr) minmax(94px, 110px) auto;
  gap: 6px;
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.calendar-topline .field {
  gap: 5px;
}

.calendar-topline .field > span,
.calendar-topline summary {
  font-size: 12px;
}

.calendar-topline .command-strip input,
.calendar-topline .command-strip select {
  min-height: 38px;
  padding: 7px 9px;
}

.calendar-topline .command-strip select {
  padding-right: 32px;
}

.calendar-topline .strip-actions button {
  min-height: 38px;
  padding-inline: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.calendar-topline .strip-actions {
  gap: 6px;
  min-width: max-content;
}

.progress-strip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  overflow: hidden;
}

.progress-copy {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--font-weight-regular);
  line-height: 1.2;
}

.progress-copy strong {
  color: var(--muted);
  font-size: inherit;
  font-weight: var(--font-weight-medium);
}

.account-view {
  min-height: 0;
}

.account-hero,
.account-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: 78px;
  padding: 12px 20px;
}

.account-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
}

.account-identity-main {
  min-width: 0;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-identity-main > div {
  min-width: 0;
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-identity-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

#logoutAccountBtn {
  width: 92px;
  min-width: 92px;
  border-radius: 10px;
  border-color: transparent;
  background: color-mix(in srgb, var(--ink-strong) 5%, var(--surface));
  color: var(--ink-strong);
  font-weight: var(--font-weight-medium);
  box-shadow: none;
  white-space: nowrap;
}

#logoutAccountBtn:hover {
  border-color: transparent;
  background: color-mix(in srgb, var(--ink-strong) 8%, var(--surface));
  color: var(--ink-strong);
}

.account-service-managed-note {
  width: auto;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-align: right;
  white-space: nowrap;
}

.account-avatar {
  border: 0;
  padding: 0;
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-wash) 72%, var(--surface));
  color: var(--accent-deep);
  font-size: 18px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.account-avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(201, 54, 73, 0.18);
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-avatar.has-image {
  background: var(--surface);
}

.account-identity h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.account-name-row {
  min-width: 0;
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px 9px;
  margin-bottom: 0;
}

.account-name-row .account-name {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name-display,
.account-name-form {
  min-width: 0;
  flex: 0 1 auto;
  align-items: center;
}

.account-identity p {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

.account-name-display {
  display: flex;
  gap: 5px;
}

.account-name-row .account-name-display .account-name {
  flex: 0 1 auto;
}

.account-name-edit,
.account-name-form-action {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  box-shadow: none;
}

.account-name-edit .ui-icon,
.account-name-form-action .ui-icon {
  width: 14px;
  height: 14px;
}

.account-name-edit:hover,
.account-name-edit:focus-visible,
.account-name-form-action:hover,
.account-name-form-action:focus-visible {
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  color: var(--accent-deep);
  box-shadow: none;
}

.account-name-edit:focus-visible,
.account-name-form-action:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
}

.account-name-form {
  display: flex;
  gap: 5px;
}

.account-name-form[hidden],
.account-name-display[hidden] {
  display: none;
}

.account-name-form input {
  width: min(220px, 100%);
  min-width: 120px;
  min-height: 32px;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
}

.account-name-form-action.is-save {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent-deep);
}

.account-terminal-badge {
  min-height: 23px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.account-identity p,
.account-creation-summary p,
.account-service-row {
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--font-weight-regular);
}

.account-identity p strong,
.account-creation-summary strong,
.account-service-row strong {
  color: var(--ink-strong);
  font-weight: var(--font-weight-medium);
}

.account-divider {
  width: 1px;
  height: 62px;
  background: var(--line);
}

.account-creation-summary {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.account-creation-summary p {
  font-size: 16px;
  line-height: 1.5;
}

.account-progress-panel {
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
  grid-template-areas:
    "head service"
    "heatmap heatmap";
  column-gap: 14px;
  row-gap: 8px;
  align-items: center;
}

.account-progress-head {
  grid-area: head;
  display: grid;
  gap: 4px;
}

.account-progress-head strong {
  color: var(--ink-strong);
  font-size: 22px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.account-progress-track {
  grid-area: heatmap;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-strong) 10%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-strong) 4%, transparent);
}

.account-progress-fill {
  display: block;
  width: var(--account-creation-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #f5a8b6));
  transition: width 0.35s ease;
}

.account-service-row {
  grid-area: service;
  align-self: start;
  min-width: 0;
  display: grid;
  gap: 4px;
  text-align: right;
}

.account-section {
  margin-top: 10px;
  padding: 14px;
}

.account-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.account-section-head h2 {
  font-size: 18px;
}

.account-cycle-head {
  align-items: flex-start;
  margin-bottom: 12px;
}

.account-cycle-head h2 {
  margin: 0;
}

.account-cycle-card {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(220px, 0.9fr) minmax(130px, auto);
  gap: 22px;
  align-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 4%, var(--surface-raised));
  padding: 15px 16px;
}

.account-cycle-summary {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.account-cycle-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.account-cycle-summary p strong {
  color: var(--ink-strong);
  font-weight: var(--font-weight-medium);
}

.account-cycle-action {
  display: grid;
  justify-items: end;
  gap: 6px;
  text-align: right;
}

.account-cycle-action button {
  min-width: 104px;
}


.account-file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.account-file-card {
  min-height: 72px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  padding: 11px 12px;
  text-align: left;
}

.account-file-card .nav-icon {
  grid-row: 1 / span 2;
  width: 24px;
  height: 24px;
  opacity: 0.82;
}

.account-file-card strong,
.account-file-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-source-modal-card {
  width: min(760px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 40px));
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  padding: 22px;
  overflow: hidden;
}

.account-source-modal-lead {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.account-source-panel {
  min-height: 0;
  display: grid;
  gap: 12px;
}

#accountDocumentPanel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

#accountDiaryPanel {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
}

.account-document-upload {
  min-height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-raised));
  color: var(--ink);
}

.account-document-upload:hover {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-raised));
}

.account-document-upload .nav-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-deep);
}

.account-document-upload strong {
  font-size: 15px;
}

.account-document-upload em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.account-source-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.account-source-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.account-source-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
}

.account-source-entry strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-source-entry time,
.account-source-entry span,
.account-source-empty {
  color: var(--muted);
  font-size: 12px;
}

.account-source-entry-actions,
.account-diary-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-source-entry-actions {
  justify-content: flex-end;
}

.account-source-entry-actions .compact {
  min-height: 28px;
  padding: 4px 10px;
}

.account-source-delete-btn {
  width: 28px;
  height: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.account-source-delete-btn:hover,
.account-source-delete-btn:focus-visible {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent-deep);
}

.account-source-delete-btn .ui-icon {
  width: 14px;
  height: 14px;
}

.account-source-delete-btn[aria-busy="true"] {
  opacity: 0.48;
}

.account-source-entry p {
  grid-column: 1 / -1;
  max-height: 4.8em;
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.account-source-empty {
  padding: 28px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}

.account-diary-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.account-diary-workspace {
  min-height: 0;
  height: 100%;
  padding: 18px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-raised) 76%, var(--surface));
}

.account-diary-tabs button {
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.account-diary-tabs button.is-active {
  background: var(--surface-raised);
  color: var(--ink-strong);
  box-shadow: var(--shadow-soft);
}

.account-diary-form {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.account-diary-form label {
  min-height: 0;
  display: grid;
  gap: 7px;
}

.account-diary-form label:last-of-type {
  grid-template-rows: auto minmax(0, 1fr);
}

.account-diary-form label > span {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.account-diary-form label > span em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-regular);
}

.account-diary-form textarea {
  width: 100%;
  height: 100%;
  min-height: 180px;
  resize: none;
  line-height: 1.65;
}

.account-diary-workspace > .account-source-list {
  height: 100%;
}

.account-diary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-diary-action-buttons {
  justify-content: flex-end;
}

@media (max-width: 560px) {
  .account-source-modal-card {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    gap: 12px;
    padding: 16px;
  }

  .account-diary-workspace {
    padding: 12px;
  }

  .account-diary-actions {
    align-items: flex-end;
  }
}

.settings-account-source-field strong {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--ink-strong);
  font-size: 13px;
}

.account-file-card strong {
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
}

.account-file-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: var(--font-weight-regular);
}

.account-list-tools {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 120px 120px;
  gap: 8px;
}

.account-list-tools input,
.account-list-tools select {
  min-height: 38px;
}

.account-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.account-table-head,
.account-table-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(110px, 0.8fr) minmax(150px, 1fr) minmax(92px, 0.6fr);
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
}

.account-table-head {
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.account-table-row {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.account-table-row strong {
  color: var(--ink-strong);
}

.account-table-row em {
  color: var(--ink-strong);
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.account-ornament {
  position: relative;
  min-height: clamp(20px, 3vh, 36px);
  margin-top: 0;
  pointer-events: none;
}

.account-ornament::before,
.account-ornament::after {
  position: absolute;
  width: clamp(180px, 24vw, 360px);
  height: clamp(180px, 24vw, 360px);
  content: "";
  border-radius: 50%;
  filter: blur(clamp(44px, 4vw, 68px));
}

.account-ornament::before {
  top: clamp(-140px, -10vw, -80px);
  left: 14%;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.account-ornament::after {
  right: 16%;
  bottom: clamp(-120px, -8vw, -60px);
  background: color-mix(in srgb, var(--blush) 9%, transparent);
}

.speech-view {
  display: none;
}

.speech-view.is-active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.speech-topbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 12px 14px;
}

.speech-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.speech-generate-action,
.speech-deai-action,
.speech-save-action {
  flex: 0 0 auto;
  width: 96px;
  min-width: 96px;
  min-height: 40px;
  height: 40px;
  border-radius: 9px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.speech-deai-action {
  width: 132px;
  min-width: 132px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--accent-wash));
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 6%, transparent);
}

.speech-deai-action:hover,
.speech-deai-action:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line));
  background: color-mix(in srgb, var(--accent-wash) 76%, var(--surface-raised));
  color: var(--ink-strong);
}

.speech-deai-action:disabled {
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
  color: color-mix(in srgb, var(--muted) 68%, transparent);
  box-shadow: none;
}

.speech-save-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: transparent;
  box-shadow: none;
}

.speech-save-action.is-draft {
  background: #f0f2f5;
  color: #4c5565;
}

.speech-save-action.is-draft:hover {
  border-color: transparent;
  background: #e6e9ee;
  color: #2f3745;
}

.speech-save-action.is-final {
  background: #f8e2e6;
  color: var(--accent-deep);
}

.speech-save-action.is-final:hover {
  border-color: transparent;
  background: #f4cbd2;
}

body[data-appearance="deep-dark"] .speech-save-action.is-draft {
  background: color-mix(in srgb, var(--surface-raised) 82%, var(--muted));
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
}

body[data-appearance="deep-dark"] .speech-save-action.is-draft:hover {
  background: color-mix(in srgb, var(--surface-raised) 74%, var(--muted));
  color: var(--ink);
}

body[data-appearance="deep-dark"] .speech-save-action.is-final {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

body[data-appearance="deep-dark"] .speech-save-action.is-final:hover {
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--accent));
  color: var(--ink-strong);
}

.speech-board {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.speech-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  overflow: hidden;
}

.speech-context-panel,
.speech-prompt-panel {
  display: grid;
  gap: 10px;
}

.speech-context-panel {
  grid-template-rows: 32px minmax(0, 1fr);
}

.speech-context-fields {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  border-radius: 10px;
  background: var(--surface);
  padding: 12px 14px;
  overflow: hidden;
}

.speech-context-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  border: 0;
  border-radius: 0;
  padding: 8px 0 14px;
  background: transparent;
}

.speech-context-field.is-title {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.speech-context-field.is-body {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  padding-top: 14px;
}

.speech-context-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.speech-context-title-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.speech-title-hotword-trigger {
  min-height: 24px;
  padding: 2px 9px;
}

.speech-title-hotword-panel {
  position: absolute;
  z-index: 9;
  top: 104px;
  right: 14px;
  width: min(320px, calc(100% - 28px));
}

@media (max-width: 760px) {
  .speech-title-hotword-panel {
    right: 10px;
    left: 10px;
    width: auto;
  }
}

.speech-context-field input,
.speech-context-field textarea {
  width: 100%;
  min-height: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink);
  padding: 0;
  font: inherit;
  outline: none;
}

.speech-context-field input {
  height: 30px;
  font-weight: var(--font-weight-semibold);
}

.speech-context-field textarea {
  height: 100%;
  resize: none;
  line-height: 1.72;
}

.speech-context-field:focus-within {
  box-shadow: none;
}

.speech-context-field:focus-within > span {
  color: var(--accent);
}

.speech-prompt-panel {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.speech-panel.field {
  grid-template-rows: auto minmax(0, 1fr);
}

.speech-panel-head,
.speech-result-head {
  min-height: 32px;
}

.speech-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.speech-material-toggle {
  min-width: 94px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-raised) 82%, transparent);
  color: var(--muted);
  padding: 0 9px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.speech-material-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  color: var(--ink);
}

.speech-material-toggle-track {
  width: 28px;
  height: 16px;
  position: relative;
  flex: 0 0 auto;
  border-radius: 999px;
  background: color-mix(in srgb, var(--faint) 55%, var(--surface));
  transition: background 160ms ease;
}

.speech-material-toggle-track b {
  width: 12px;
  height: 12px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease;
}

.speech-material-toggle.is-active {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--accent-wash) 72%, var(--surface-raised));
  color: var(--accent-deep);
}

.speech-material-toggle.is-active .speech-material-toggle-track {
  background: var(--accent);
}

.speech-material-toggle.is-active .speech-material-toggle-track b {
  transform: translateX(12px);
}

.speech-panel-head > span,
.speech-result-head > span {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.speech-result-head small {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent);
  padding: 0 8px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  vertical-align: middle;
}

.speech-panel-head em,
.speech-result-head em {
  color: var(--muted);
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.speech-textarea,
.speech-result {
  min-height: 0;
  height: 100%;
  border-radius: 10px;
}

.speech-textarea {
  resize: none;
}

.speech-prompt-list {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.speech-prompt-item {
  min-width: 0;
  min-height: 50px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
}

.speech-prompt-item:hover {
  border-color: rgba(157, 89, 102, 0.42);
  background: var(--accent-wash);
}

.speech-prompt-item.is-active {
  border-color: rgba(157, 89, 102, 0.7);
  background: var(--sage-soft);
  box-shadow: inset 0 0 0 1px rgba(157, 89, 102, 0.08);
}

.speech-prompt-item strong,
.speech-prompt-item em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speech-prompt-item strong {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.speech-prompt-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.speech-prompt-editor {
  display: grid;
  gap: 6px;
}

.speech-prompt-editor span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.speech-prompt-editor input {
  min-height: 38px;
}

.speech-prompt-textarea,
.speech-result {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 13px;
}

.speech-result-panel {
  display: grid;
  grid-template-rows: 32px minmax(0, 1fr);
  gap: 10px;
}

.speech-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.speech-result {
  margin: 0;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-raised), #ffffff);
  color: #263244;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.72;
  resize: none;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.speech-result:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}

.speech-result:focus {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

.speech-result::placeholder {
  color: var(--muted);
}

.settings-source-panel {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.settings-source-panel > div:first-child p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.settings-command-strip {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 220px) auto;
  box-shadow: none;
}

.settings-file-drawer {
  margin-top: 0;
  box-shadow: none;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.field em {
  color: var(--sage);
  font-style: normal;
  font-weight: var(--font-weight-semibold);
}

.grow-field {
  min-width: 0;
}

.small-field {
  max-width: 260px;
}

.strip-actions,
.form-actions,
.settings-actions,
.stack-actions,
.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.summary-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(128px, 0.72fr) minmax(128px, 0.72fr) minmax(120px, 0.64fr) minmax(360px, 1.8fr) minmax(160px, 0.9fr);
  overflow: hidden;
}

.calendar-topline .summary-grid {
  margin-top: 0;
  min-width: 0;
  grid-template-columns: minmax(74px, 0.58fr) minmax(74px, 0.58fr) minmax(70px, 0.52fr) minmax(220px, 1.28fr) minmax(104px, 0.76fr);
}

.summary-grid > div {
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface-raised);
}

.calendar-topline .summary-grid > div {
  min-width: 0;
  min-height: 66px;
  padding: 10px 12px;
}

.summary-grid > div:last-child {
  border-right: 0;
}

.summary-grid strong {
  color: var(--ink-strong);
  font-size: 23px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.calendar-topline .summary-grid strong {
  font-size: 20px;
}

.summary-progress-cell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.progress-panel-head {
  display: grid;
  gap: 6px;
}

.progress-panel-head strong {
  color: var(--ink-strong);
  font-size: 22px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.calendar-progress-heatmap {
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  overflow: hidden;
}

.calendar-topline .calendar-progress-heatmap {
  gap: 5px;
}

.calendar-progress-cell {
  width: 16px;
  height: 16px;
  flex: 0 1 16px;
  min-width: 8px;
  border-radius: 5px;
  background: #e8eaec;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.02);
}

.calendar-topline .calendar-progress-cell {
  width: 16px;
  height: 16px;
  min-width: 8px;
  flex-basis: 16px;
  border-radius: 5px;
}

.calendar-progress-cell.is-done {
  background: #f8d5dc;
  box-shadow: inset 0 0 0 1px rgba(157, 89, 102, 0.08);
}

.progress-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--font-weight-regular);
}

.file-drawer {
  margin-top: 12px;
  padding: 12px 14px;
}

.calendar-topline .file-drawer {
  margin-top: 0;
  min-height: 66px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 7px 0;
  overflow: auto;
}

.calendar-topline .file-drawer[open] {
  max-height: 96px;
}

summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

li {
  color: var(--muted);
  font-weight: var(--font-weight-regular);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.calendar-table {
  margin-top: 12px;
  overflow: visible;
}

.calendar-round-section {
  margin: 18px 0 28px;
  padding: 0 0 4px;
  border: 0;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
  overflow: hidden;
}

.calendar-round-section.is-current {
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 8%, transparent);
}

.calendar-round-section.is-frozen {
  background: color-mix(in srgb, var(--surface-raised) 58%, var(--surface));
}

.calendar-round-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background: var(--surface-raised);
}

.calendar-round-section.is-frozen .calendar-round-heading {
  background: color-mix(in srgb, var(--muted) 3%, var(--surface-raised));
}

.calendar-round-heading-main {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.calendar-round-heading h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
}

.calendar-round-index {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 10px;
  border-left: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  color: var(--accent-deep);
  padding-left: 10px;
  font-size: 13px;
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
  white-space: nowrap;
}

.calendar-round-section.is-frozen .calendar-round-index {
  color: var(--muted);
}

.calendar-round-heading p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.calendar-round-state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--surface));
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.calendar-round-state.is-frozen {
  background: color-mix(in srgb, var(--muted) 10%, var(--surface));
  color: var(--muted);
}

.calendar-round-body {
  padding: 2px 12px 14px;
}

.calendar-round-empty {
  padding: 34px 18px 38px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.calendar-rule-summary {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 120;
  width: min(560px, calc(100vw - 42px));
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 10px;
  background: var(--surface-raised);
  box-shadow: 0 16px 42px rgba(28, 22, 23, 0.14);
}

.calendar-rule-summary[hidden] {
  display: none;
}

.rule-summary-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--text);
}

.rule-summary-main strong {
  font-size: 14px;
}

.rule-summary-main span,
.rule-summary-issues span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.rule-summary-chips,
.rule-summary-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rule-summary-chips span,
.rule-summary-issues span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface);
}

.rule-summary-issues span {
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent-soft) 84%, var(--surface));
}

.table-head {
  display: grid;
  grid-template-columns: 132px 180px minmax(260px, 1fr) 132px 124px 112px;
  gap: 8px;
  align-items: center;
}

.table-head {
  position: sticky;
  top: calc(var(--calendar-sticky-top) + var(--calendar-controlbar-height));
  z-index: 85;
  isolation: isolate;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  background: color-mix(in srgb, var(--surface-raised) 78%, var(--accent-soft));
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  border-radius: 10px;
}

.table-head::before {
  content: "";
  position: absolute;
  inset: -14px 0 -4px;
  z-index: -1;
  border-radius: 10px;
  background: var(--surface);
}

.calendar-action-heading {
  grid-column: 5 / 7;
  text-align: center;
}

.calendar-status-filter {
  min-width: 0;
  display: block;
}

.calendar-status-filter .themed-select-trigger {
  min-height: 34px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
}

.calendar-status-filter .themed-select-trigger:hover,
.calendar-status-filter .themed-select.is-open .themed-select-trigger {
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 52%, transparent);
}

.calendar-status-filter .themed-select-menu {
  min-width: 156px;
  right: auto;
}

.calendar-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: var(--font-weight-regular);
}

.calendar-date-section {
  display: grid;
  grid-template-columns: 132px 180px minmax(260px, 1fr) 132px 124px 112px;
  gap: 8px;
  align-items: start;
  margin-top: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 82%, var(--surface));
  transition: background 160ms ease;
}

.calendar-date-section + .calendar-date-section {
  margin-top: 18px;
}

.calendar-date-section:nth-child(even) {
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
}

.calendar-date-section.is-done {
  background: color-mix(in srgb, var(--sage-soft) 72%, var(--surface));
}

.calendar-date-section.is-pinned {
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface-raised));
}

.calendar-date-group-list {
  grid-column: 2 / -1;
  display: grid;
  gap: 8px;
}

.calendar-row:last-child {
  border-bottom: 0;
}

.calendar-topic-row.is-done {
  background: color-mix(in srgb, var(--sage-soft) 72%, var(--surface));
}

.mini-field {
  display: grid;
  gap: 4px;
}

.mini-field input {
  min-height: 32px;
  padding: 6px 8px;
}

.calendar-date-field,
.calendar-topic-cell,
.calendar-count-field {
  align-self: start;
}

.calendar-date-rail {
  align-self: start;
  margin-top: 6px;
}

.calendar-count-field input,
.calendar-topic-select select,
.calendar-topic-select .themed-select-trigger {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background-color: var(--surface);
  box-shadow: none;
}

.calendar-count-field input {
  padding: 6px 8px;
  text-align: center;
}

.calendar-date-field {
  position: relative;
}

.calendar-date-display {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: var(--font-weight-regular);
  box-shadow: none;
}

.calendar-date-display:hover {
  background: var(--accent-wash);
}

.calendar-date-display-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  -webkit-mask: url("/assets/icons/nav-calendar.svg") center / contain no-repeat;
  mask: url("/assets/icons/nav-calendar.svg") center / contain no-repeat;
}

.calendar-date-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 38px;
  opacity: 0;
  pointer-events: none;
}

.calendar-topic-select .themed-select {
  width: 100%;
}

.calendar-topic-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.type-chip,
.template-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid rgba(201, 54, 73, 0.18);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 0 10px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

button.template-token {
  cursor: pointer;
}

button.template-token:hover {
  border-color: rgba(201, 54, 73, 0.34);
  background: #fff8f9;
  color: var(--accent-deep);
}

.type-chip.is-pinned,
.template-token.is-pinned {
  border-color: rgba(233, 65, 54, 0.24);
  background: #fff0e8;
  color: var(--amber);
}

.status-pill {
  color: var(--muted);
}

.title-link {
  min-width: 0;
  min-height: 38px;
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-strong);
  font-weight: var(--font-weight-medium);
  text-align: left;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.title-link.is-empty {
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  background: var(--surface);
  cursor: default;
  pointer-events: none;
}

.title-link:hover {
  border-color: transparent;
  color: var(--accent-deep);
}

.calendar-title-stack {
  grid-column: 3 / -1;
  display: grid;
  gap: 6px;
}

.calendar-title-row {
  display: grid;
  grid-template-columns: 180px minmax(260px, 1fr) 132px 124px 112px;
  gap: 8px;
  align-items: center;
  min-height: 38px;
}

.calendar-title-row[draggable="true"] {
  cursor: grab;
}

.calendar-title-row.is-dragging {
  opacity: 0.46;
}

.calendar-title-row.is-drop-target {
  outline: 2px solid color-mix(in srgb, var(--accent) 76%, transparent);
  outline-offset: 2px;
  border-radius: 8px;
}

.calendar-title-row.is-locked {
  cursor: default;
}

.calendar-title-row.is-round-frozen {
  opacity: 0.88;
}

.calendar-title-row.is-round-frozen .title-link {
  color: color-mix(in srgb, var(--ink-strong) 78%, var(--muted));
}

.calendar-title-spacer {
  min-height: 38px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: 100%;
  padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 62%, var(--surface));
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.topic-chip.is-pinned {
  background: var(--surface);
}

.calendar-date-display.is-static {
  cursor: default;
}

.calendar-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  border-radius: 8px;
  padding: 0 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.calendar-status:hover,
.calendar-status:focus-visible {
  background: color-mix(in srgb, var(--accent-soft) 64%, transparent);
  color: var(--accent-deep);
}

.calendar-status:active {
  transform: translateY(1px);
}

.calendar-status.is-final,
.calendar-status.is-published {
  color: var(--sage);
}

.calendar-inline-action {
  min-height: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  justify-content: flex-start;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}

.calendar-inline-action:hover:not(:disabled),
.calendar-inline-action:focus-visible:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.calendar-inline-action:disabled {
  cursor: not-allowed;
  color: color-mix(in srgb, var(--muted) 62%, transparent);
  opacity: 0.48;
}

.benchmark-name {
  grid-column: 4 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
}

.empty-state {
  padding: 44px 18px;
  color: var(--muted);
  font-weight: var(--font-weight-regular);
  text-align: center;
  line-height: 1.7;
}

.knowledge-workspace {
  min-height: 620px;
  display: grid;
  grid-template-columns: 220px minmax(340px, 1fr) minmax(340px, 1fr);
  gap: 0;
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.knowledge-category-panel,
.knowledge-library-panel,
.knowledge-asset-editor-panel {
  min-width: 0;
}

.knowledge-category-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 14px 14px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 78%, white);
}

.knowledge-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.knowledge-toolbar strong {
  display: block;
  margin-top: 3px;
  color: var(--ink-strong);
  font-size: 15px;
  line-height: 1.45;
}

.knowledge-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.knowledge-stat {
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-raised));
  padding: 14px;
}

.knowledge-stat span,
.knowledge-stat em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.6;
}

.knowledge-stat strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--accent-deep);
  font-size: 34px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.knowledge-category-list {
  display: grid;
  gap: 7px;
}

.knowledge-category-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 10px 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.knowledge-category-item:hover {
  transform: translateX(2px);
  border-color: var(--line);
  background: var(--surface-raised);
}

.knowledge-category-item.is-active {
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-raised));
  box-shadow: inset 3px 0 0 var(--accent);
}

.knowledge-category-item span {
  display: grid;
  gap: 2px;
}

.knowledge-category-item strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.knowledge-category-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.knowledge-category-item b {
  min-width: 24px;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.knowledge-reset {
  margin-top: auto;
  align-self: flex-start;
}

.knowledge-library-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: var(--surface-raised);
}

.knowledge-library-head {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.knowledge-library-head strong {
  display: block;
  margin-top: 5px;
  color: var(--ink-strong);
  font-size: 13px;
  line-height: 1.5;
}

.knowledge-actions input {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.knowledge-library-head .knowledge-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.knowledge-legacy-notice {
  margin: 12px 14px 0;
  padding: 9px 11px;
  border: 1px solid #ead9ac;
  border-radius: 9px;
  background: #fff9e9;
  color: #806b34;
  font-size: 11px;
  line-height: 1.55;
}

.knowledge-legacy-notice strong {
  display: block;
  color: #6f5b27;
  font-size: 11px;
}

.knowledge-legacy-notice details {
  margin-top: 7px;
}

.knowledge-legacy-notice summary {
  width: max-content;
  color: var(--accent-deep);
  cursor: pointer;
  font-weight: var(--font-weight-medium);
}

.knowledge-legacy-notice pre {
  max-height: 240px;
  margin: 9px 0 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid color-mix(in srgb, #c9ad68 34%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.knowledge-asset-list {
  min-height: 0;
  padding: 10px 12px;
  overflow: auto;
}

.knowledge-asset-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  margin-bottom: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.knowledge-asset-card:hover {
  transform: translateX(2px);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  box-shadow: 0 4px 12px rgba(38, 26, 31, 0.05);
}

.knowledge-asset-card.is-active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 4%, var(--surface-raised));
  box-shadow: inset 3px 0 0 var(--accent);
}

.knowledge-asset-type {
  width: max-content;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-soft));
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

.knowledge-asset-card strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-asset-card > i {
  color: var(--muted);
  font-size: 20px;
  font-style: normal;
  line-height: 1;
  text-align: center;
  transition: color 150ms ease, transform 150ms ease;
}

.knowledge-asset-card:hover > i,
.knowledge-asset-card.is-active > i {
  color: var(--accent);
  transform: translateX(2px);
}

.knowledge-asset-editor-panel {
  position: relative;
  padding: 22px;
  background: color-mix(in srgb, var(--surface-soft) 38%, var(--surface-raised));
}

.knowledge-empty-editor {
  display: none;
  min-height: 520px;
  align-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.knowledge-asset-editor-panel.is-empty .knowledge-empty-editor {
  display: grid;
}

.knowledge-empty-editor .nav-icon {
  width: 42px;
  height: 42px;
  opacity: 0.34;
}

.knowledge-empty-editor strong {
  color: var(--ink-strong);
  font-size: 15px;
}

.knowledge-empty-editor p {
  max-width: 260px;
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
}

.knowledge-asset-form {
  display: grid;
  gap: 14px;
}

.knowledge-asset-editor-panel.is-empty .knowledge-asset-form {
  display: none;
}

.knowledge-content-field {
  min-height: 300px;
}

.knowledge-editor {
  min-height: 300px;
  height: 100%;
  resize: vertical;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.72;
}

.knowledge-editor-meta {
  min-height: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.knowledge-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.keyword-strategy-shell {
  min-height: 0;
  display: grid;
  gap: 14px;
}

.keyword-strategy-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 94%, var(--accent-wash)), var(--surface-raised));
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.keyword-strategy-hero h2 {
  font-size: 22px;
}

.keyword-strategy-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.keyword-strategy-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.keyword-strategy-summary > div {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, var(--canvas));
  padding: 12px;
}

.keyword-strategy-summary span,
.keyword-strategy-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.keyword-strategy-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink-strong);
  font-size: 24px;
  line-height: 1;
}

.keyword-strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.keyword-card {
  min-width: 0;
  min-height: 220px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.keyword-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
}

.keyword-card-head span {
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
}

.keyword-card-head strong {
  min-width: 34px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12px;
}

.keyword-pill-list {
  align-content: start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-pill {
  max-width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-wash) 76%, var(--surface));
  color: var(--ink-strong);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.keyword-strategy-status {
  min-height: 34px;
  display: flex;
  align-items: center;
  border: 1px dashed color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: 8px 12px;
}

.pool-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.82fr) minmax(460px, 1.18fr);
  min-height: 620px;
  overflow: hidden;
}

.pool-form {
  min-width: 0;
  align-self: stretch;
  padding: 18px;
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(150px, 0.72fr) minmax(220px, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
  align-content: stretch;
}

.pool-form-title {
  grid-column: 1 / -1;
  min-width: 0;
}

.pool-form-title h2 {
  margin: 0 0 4px;
  color: var(--ink-strong);
  font-size: 22px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
}

.pool-type-field {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: max-content minmax(220px, 300px);
  align-items: center;
  gap: 16px;
}

.pool-type-field > span {
  justify-content: flex-start;
}

.pool-type-field .themed-select-trigger {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.pool-title-field {
  grid-column: 1 / -1;
}

.pool-title-field,
.pool-form .wide-field {
  gap: 0;
}

.pool-form input::placeholder,
.pool-form textarea::placeholder {
  color: #a8a8ad;
}

.wide-field {
  grid-column: 1 / -1;
  min-height: 0;
}

.pool-form .wide-field {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
}

.pool-form .wide-field textarea {
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  resize: none;
}

.form-actions {
  grid-column: 1 / -1;
}

.pool-form .form-actions {
  align-self: end;
}

.pool-list-panel {
  min-width: 0;
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface-raised);
}

.pool-list-head {
  min-height: 106px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(168px, 220px);
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 16px 16px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.pool-list-head strong {
  display: block;
  margin-bottom: 12px;
  color: var(--ink-strong);
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
}

.pool-list-head strong span {
  color: var(--ink);
  font-weight: var(--font-weight-semibold);
}

.pool-search {
  position: relative;
  min-width: 0;
  display: block;
  margin-top: -5px;
}

.pool-search::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  background: var(--muted);
  transform: translateY(-50%);
  mask: url("/assets/icons/ui-search.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/icons/ui-search.svg") center / contain no-repeat;
  pointer-events: none;
}

.pool-search input {
  width: 100%;
  min-height: 38px;
  border-radius: 999px;
  padding: 8px 38px 8px 14px;
  background: var(--surface);
}

.pool-usage-strip {
  grid-column: 1 / -1;
  min-width: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  background: transparent;
  padding: 13px 0 0;
}

.pool-usage-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pool-usage-mark {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
}

.pool-usage-copy > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.pool-usage-copy strong {
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.pool-usage-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.pool-usage-strip > .secondary {
  min-width: 108px;
  flex: 0 0 auto;
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  background: var(--surface-raised);
  color: var(--muted);
  box-shadow: none;
}

.pool-usage-strip > .secondary:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-wash);
}

.pool-type-tabs {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pool-type-tab {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
}

.pool-type-tab em {
  color: var(--muted);
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.pool-type-tab:hover,
.pool-type-tab.is-active {
  border-color: rgba(201, 54, 73, 0.24);
  background: var(--accent-wash);
  color: var(--accent-deep);
}

.pool-type-tab.is-pinned {
  color: var(--ink);
}

.pool-list {
  min-height: 0;
  overflow: hidden;
  padding: 14px 16px 8px;
  display: grid;
  align-content: start;
  gap: 0;
}

.pool-pagination {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid color-mix(in srgb, var(--line) 66%, transparent);
  padding: 8px 16px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.pool-pagination[hidden] {
  display: none !important;
}

.pool-pagination .icon-button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-color: color-mix(in srgb, var(--line) 66%, transparent);
  background: var(--surface);
  color: var(--ink);
}

.pool-pagination .icon-button:disabled {
  cursor: default;
  opacity: 0.34;
}

.pool-type-group {
  display: grid;
  gap: 5px;
}

.pool-type-head {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(37, 47, 65, 0.08);
  border-radius: 8px;
  background: rgba(37, 47, 65, 0.035);
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.pool-type-head.is-pinned {
  border-color: rgba(233, 65, 54, 0.18);
  background: #fff0e8;
  color: var(--amber);
}

.pool-type-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pool-type-head em {
  min-width: 22px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-deep);
  font-style: normal;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.pool-type-items {
  display: grid;
  gap: 1px;
}

.pool-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 36px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 0;
  background: transparent;
  padding: 4px 0;
  box-shadow: none;
}

.pool-card-index {
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.pool-card-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pool-card h3 {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pool-card .type-chip {
  flex: 0 0 auto;
  max-width: 132px;
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pool-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pool-card-actions .icon-button {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

.pool-card-actions .icon-button:hover {
  border-color: rgba(201, 54, 73, 0.24);
  background: var(--accent-wash);
  color: var(--accent-deep);
}

.pool-card-actions .icon-button.danger:hover {
  color: var(--accent-hot);
}

.radar-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.68fr) minmax(560px, 1.32fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.radar-command-panel {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px 20px 28px 0;
}

.radar-panel-head,
.radar-results-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.radar-panel-head h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.22;
}

.radar-status {
  max-width: 180px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  padding: 0 10px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radar-form {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.radar-form textarea {
  min-height: 168px;
  resize: vertical;
}

.radar-keyword-field {
  min-height: 0;
}

.radar-keyword-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.radar-keyword-label-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.radar-keyword-picker {
  min-height: 168px;
  max-height: min(248px, 28dvh);
  display: grid;
  align-content: start;
  gap: 4px;
  overflow: auto;
  border-radius: 0;
  background: transparent;
  padding: 4px 4px 4px 0;
}

.radar-keyword-option {
  min-width: 0;
  min-height: 38px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  background: transparent;
  padding: 7px 6px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.radar-keyword-option:hover {
  background: color-mix(in srgb, var(--accent-wash) 70%, transparent);
}

.radar-keyword-option.is-selected {
  background: color-mix(in srgb, var(--accent-wash) 86%, var(--surface));
}

.radar-keyword-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.radar-keyword-option input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.radar-keyword-text {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radar-keyword-history-badge {
  grid-column: 3;
  justify-self: start;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 6%, var(--surface));
  color: color-mix(in srgb, var(--muted) 82%, var(--ink));
  padding: 2px 7px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  white-space: nowrap;
}

.radar-keyword-option em {
  grid-column: 4;
  justify-self: end;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 6%, var(--surface));
  color: color-mix(in srgb, var(--muted) 82%, var(--ink));
  padding: 2px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  white-space: nowrap;
}

.radar-settings-drawer {
  min-width: 0;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
}

.radar-settings-drawer summary {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 0 11px;
  list-style: none;
}

.radar-settings-drawer summary::-webkit-details-marker {
  display: none;
}

.radar-settings-drawer summary::after {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: url("/assets/icons/ui-chevron-down.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/icons/ui-chevron-down.svg") center / contain no-repeat;
  transition: transform 160ms ease;
}

.radar-settings-drawer[open] summary::after {
  transform: rotate(180deg);
}

.radar-settings-drawer summary span {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.radar-settings-drawer summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: var(--font-weight-regular);
}

.radar-settings-body {
  display: grid;
  gap: 8px;
  padding: 4px 0 8px;
}

.radar-settings-drawer:not([open]) .radar-settings-body {
  display: none;
}

.radar-key-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.radar-key-grid .field {
  gap: 5px;
}

.radar-key-grid .field > span {
  font-size: 12px;
}

.radar-key-grid input {
  min-height: 34px;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.radar-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 8px;
}

.radar-rule-card,
.radar-guardrails span,
.radar-force-full,
.radar-run-summary span,
.radar-metrics span {
  min-width: 0;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 62%, transparent);
}

.radar-rule-card {
  display: grid;
  grid-template-columns: 44px max-content 72px;
  gap: 6px;
  align-items: center;
  justify-content: start;
  min-height: 40px;
  padding: 6px 7px 6px 9px;
  background: color-mix(in srgb, var(--surface-raised) 76%, transparent);
}

.radar-rule-card strong {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.radar-rule-card span,
.radar-guardrails span,
.radar-force-full span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.radar-rule-card input {
  width: 72px;
  min-height: 30px;
  border-radius: 6px;
  border: 0;
  background: color-mix(in srgb, var(--surface-raised) 72%, var(--accent-wash));
  padding: 3px 7px;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.radar-rule-card input::-webkit-outer-spin-button,
.radar-rule-card input::-webkit-inner-spin-button {
  margin: 0;
}

.radar-rule-card:focus-within {
  background: color-mix(in srgb, var(--accent-wash) 72%, var(--surface));
}

.radar-settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.radar-guardrails {
  display: grid;
  gap: 7px;
}

.radar-command-row {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.radar-command-row .primary {
  min-width: 104px;
  min-height: 38px;
  padding: 0 18px;
}

.radar-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.radar-info-btn i {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.radar-info-popover {
  position: absolute;
  left: 0;
  right: 20px;
  bottom: 210px;
  z-index: 8;
  display: grid;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--ink-strong) 12%, var(--line));
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.14);
  padding: 14px 38px 14px 14px;
}

.radar-info-popover[hidden] {
  display: none !important;
}

.radar-info-popover > .icon-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
}

.radar-info-popover strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.radar-info-popover p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.45;
}

.radar-wordcloud-panel {
  min-height: 248px;
  display: grid;
  grid-template-columns: minmax(118px, 190px) minmax(220px, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-raised) 70%, transparent);
  padding: 10px;
}

.radar-wordcloud-head {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.radar-wordcloud-controls {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
}

.radar-wordcloud-head > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 7px;
}

.radar-wordcloud-head strong {
  grid-column: 1;
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
  white-space: nowrap;
}

.radar-wordcloud-head span {
  display: contents;
  margin-top: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  line-height: 1.45;
}

.radar-wordcloud-head span span {
  grid-column: 2;
  color: var(--muted);
  white-space: nowrap;
}

.radar-wordcloud-head span time {
  grid-column: 1 / -1;
  color: var(--muted);
  white-space: nowrap;
}

.radar-wordcloud-spacing {
  --spacing-fill: 0%;
  width: 100%;
  min-width: 0;
  min-height: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.radar-wordcloud-spacing span,
.radar-wordcloud-spacing em {
  display: none;
}

.radar-wordcloud-spacing em {
  color: var(--ink-strong);
  font-style: normal;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.radar-wordcloud-spacing input {
  width: 100%;
  min-width: 0;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: ew-resize;
  appearance: none;
  -webkit-appearance: none;
}

.radar-wordcloud-spacing input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #202124 0 var(--spacing-fill),
    rgba(32, 33, 36, 0.14) var(--spacing-fill) 100%
  );
}

.radar-wordcloud-spacing input::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.14);
}

.radar-wordcloud-spacing input::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: #202124;
}

.radar-wordcloud-spacing input::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #202124;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.18);
  margin-top: -5px;
  appearance: none;
  -webkit-appearance: none;
}

.radar-wordcloud-spacing input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #202124;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.18);
}

.radar-wordcloud-spacing input:focus-visible {
  outline: 2px solid color-mix(in srgb, #202124 18%, transparent);
  outline-offset: 3px;
}

.radar-stopword-field {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.radar-stopword-field input {
  width: 100%;
  min-height: 30px;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 12px;
}

.radar-stopword-list {
  min-height: 0;
  max-height: 54px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  overflow: auto;
}

.radar-stopword-list:empty {
  display: none;
}

.radar-stopword-list button,
.radar-stopword-empty {
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 7%, var(--surface));
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.radar-stopword-empty {
  font-weight: var(--font-weight-regular);
}

.radar-stopword-list button span {
  margin-left: 5px;
}

.radar-wordcloud-viewport {
  display: contents;
}

.radar-wordcloud-body {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 196px;
  height: clamp(196px, 24dvh, 286px);
  overflow: hidden;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  padding: 6px;
}

.radar-wordcloud-actions {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 4px;
}

.radar-wordcloud-action {
  min-width: 116px;
  min-height: 34px;
  padding-inline: 16px;
  white-space: nowrap;
}

.radar-wordcloud-cloud {
  position: relative;
  width: min(var(--cloud-w), 100%);
  min-height: var(--cloud-h);
  height: var(--cloud-h);
  overflow: hidden;
  border-radius: 3px;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.13), transparent 28%),
    radial-gradient(circle at 72% 68%, rgba(122, 64, 14, 0.11), transparent 32%),
    linear-gradient(135deg, #f6dc36 0%, #f2cf26 48%, #efbd25 100%);
  box-shadow: inset 0 0 0 1px rgba(62, 38, 10, 0.16);
  cursor: zoom-in;
  font-family: var(--font-sans);
  font-synthesis-weight: none;
  transform: translateZ(0);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.radar-wordcloud-cloud:hover {
  box-shadow: inset 0 0 0 1px rgba(62, 38, 10, 0.18), 0 10px 24px rgba(16, 24, 40, 0.08);
}

.radar-wordcloud-word {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: var(--z);
  width: var(--w);
  height: var(--h);
  display: block;
  overflow: visible;
  color: var(--token-ink);
  font-size: var(--s);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0;
  line-height: 0.98;
  text-shadow: 0 1px 0 rgba(255, 225, 84, 0.32);
  transform: rotate(var(--r));
  transform-origin: left top;
  white-space: nowrap;
}

.radar-wordcloud-word[data-orient="vertical"] {
  width: var(--w);
  height: var(--h);
  line-height: 1;
  text-orientation: upright;
  white-space: normal;
  writing-mode: vertical-rl;
}

.radar-wordcloud-word[data-tone="ink"] {
  --token-ink: #170d18;
}

.radar-wordcloud-word[data-tone="paper"] {
  --token-ink: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 0 rgba(84, 43, 0, 0.12);
}

.radar-wordcloud-word[data-tone="ochre"] {
  --token-ink: rgba(190, 117, 44, 0.78);
}

.radar-wordcloud-word[data-tone="rust"] {
  --token-ink: rgba(167, 73, 54, 0.78);
}

.radar-wordcloud-hidden {
  position: absolute;
  right: 12px;
  bottom: 9px;
  color: rgba(23, 13, 24, 0.5);
  font-family: var(--font-sans);
  font-size: 12px;
  font-style: normal;
  font-weight: var(--font-weight-regular);
}

.radar-wordcloud-list {
  max-height: 100%;
  display: grid;
  gap: 5px;
  overflow-y: auto;
  padding-right: 4px;
}

.radar-wordcloud-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.radar-wordcloud-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radar-wordcloud-row em {
  justify-self: end;
  color: var(--accent-deep);
  font-style: normal;
  font-weight: var(--font-weight-semibold);
}

.radar-wordcloud-modal[hidden] {
  display: none !important;
}

.radar-wordcloud-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
}

.radar-wordcloud-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 31, 0.42);
  backdrop-filter: blur(12px);
}

.radar-wordcloud-dialog {
  position: relative;
  z-index: 1;
  width: min(650px, calc(100vw - 56px));
  max-height: calc(100dvh - 56px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, white);
  box-shadow: 0 28px 72px rgba(16, 24, 40, 0.26);
  padding: 16px;
  font-family: var(--font-sans);
  font-synthesis-weight: none;
}

.radar-wordcloud-dialog-head {
  position: relative;
  min-width: 0;
  min-height: 46px;
  display: block;
}

.radar-wordcloud-dialog-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.radar-wordcloud-dialog-head strong {
  display: block;
  color: var(--ink-strong);
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
}

.radar-wordcloud-dialog-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-regular);
}

.radar-wordcloud-spacing.is-dialog {
  position: absolute;
  top: 0;
  right: 42px;
  width: min(260px, 54vw);
  max-width: 260px;
  min-height: 18px;
  margin-top: 0;
}

.radar-wordcloud-dialog-head .radar-wordcloud-spacing.is-dialog span,
.radar-wordcloud-dialog-head .radar-wordcloud-spacing.is-dialog em {
  display: none;
}

.radar-wordcloud-dialog-head > .icon-button {
  position: absolute;
  top: 0;
  right: 0;
}

.radar-wordcloud-dialog-body {
  min-height: min(640px, calc(100dvh - 160px));
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #f3ca2d;
  padding: 0;
}

.radar-wordcloud-cloud.is-modal {
  width: min(var(--cloud-w), 100%);
  height: var(--cloud-h);
  min-height: 0;
  cursor: default;
}

.radar-wordcloud-cloud.is-modal:hover {
  box-shadow: none;
}

.has-radar-wordcloud-modal {
  overflow: hidden;
}

@media (max-height: 860px) {
  .radar-command-panel {
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 10px;
  }

  .radar-panel-head h2,
  .radar-results-head strong {
    font-size: 18px;
  }

  .radar-form {
    gap: 8px;
  }

  .radar-keyword-picker {
    min-height: 132px;
    max-height: 190px;
  }

  .radar-keyword-option {
    min-height: 32px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .radar-settings-drawer summary {
    min-height: 34px;
  }

  .radar-command-row {
    min-height: 38px;
  }

  .radar-wordcloud-panel {
    min-height: 226px;
    padding: 8px;
  }

  .radar-wordcloud-controls {
    gap: 7px;
  }

  .radar-stopword-list {
    max-height: 42px;
  }

  .radar-wordcloud-body {
    min-height: 210px;
    height: clamp(210px, 30dvh, 270px);
    padding: 6px;
  }

  .radar-wordcloud-cloud {
    min-height: var(--cloud-h);
  }

  .radar-results-head {
    min-height: 58px;
    padding-top: 9px;
    padding-bottom: 8px;
  }

  .radar-card {
    padding-top: 5px;
    padding-bottom: 5px;
  }
}

.radar-guardrails > span,
.radar-force-full {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.radar-force-full {
  gap: 8px;
  cursor: pointer;
  min-height: 30px;
}

.radar-force-full input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.radar-results-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 78%, var(--canvas));
}

.radar-results-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 12px 20px 10px 22px;
}

.radar-results-head > div:first-child {
  min-width: 0;
}

.radar-results-head strong {
  flex: 0 0 auto;
  color: var(--ink-strong);
  font-size: 19px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.22;
  white-space: nowrap;
}

.radar-results-title-row {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.radar-result-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  white-space: nowrap;
}

.radar-result-info-popover {
  left: 22px;
  right: auto;
  top: 54px;
  bottom: auto;
  width: 240px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.55;
}

.radar-run-summary {
  max-width: 320px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex-basis: 100%;
}

.radar-results-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.radar-tool-button {
  min-width: 104px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding-inline: 9px;
  white-space: nowrap;
}

.radar-tool-button .ui-icon {
  width: 14px;
  height: 14px;
}

.radar-search-field {
  position: relative;
  width: 168px;
  min-width: 168px;
  height: 32px;
  display: flex;
  align-items: center;
}

.radar-search-field::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  background: color-mix(in srgb, var(--muted) 88%, #202124);
  transform: translateY(-50%);
  mask: url("/assets/icons/ui-search.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/icons/ui-search.svg") center / contain no-repeat;
  pointer-events: none;
}

.radar-search-field input {
  width: 100%;
  height: 32px;
  min-height: 32px;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--line) 82%, #dfe3e8);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-strong);
  font: inherit;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
  padding: 0 10px 0 36px;
  outline: none;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.04);
}

.radar-search-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 82%, #202124);
}

.radar-search-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 14%, transparent), 0 8px 18px rgba(16, 24, 40, 0.04);
}

body[data-current-view="radar"] .radar-search-field input,
body[data-current-view="radar"] .radar-search-field input:hover,
body[data-current-view="radar"] .radar-search-field input:focus {
  background: #fff;
  background-color: #fff;
}

.radar-results-tools .danger {
  border-color: color-mix(in srgb, #b42318 22%, var(--line));
  background: color-mix(in srgb, #b42318 10%, var(--surface));
  color: #b42318;
}

.radar-results-tools .danger:not(:disabled):hover {
  border-color: color-mix(in srgb, #b42318 40%, var(--line));
  background: color-mix(in srgb, #b42318 16%, var(--surface));
}

.radar-run-summary span,
.radar-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.radar-run-summary strong {
  display: inline;
  margin-left: 4px;
  color: var(--accent-deep);
  font-size: 12px;
}

.radar-progress-panel {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  padding: 12px 20px 12px 22px;
  background: color-mix(in srgb, var(--surface) 72%, var(--accent-wash));
  transition: opacity 180ms ease, padding 180ms ease, max-height 180ms ease;
}

.radar-progress-panel.is-collapsed {
  max-height: 0;
  overflow: hidden;
  border-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

.radar-progress-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.radar-progress-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radar-progress-head span {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.radar-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 56%, var(--surface));
}

.radar-progress-track span {
  width: 0%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.radar-progress-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.45;
}

.radar-results-main {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(460px, 0.76fr) minmax(240px, 0.24fr);
  gap: 32px;
  overflow: hidden;
  padding: 0 8px 0 22px;
}

.radar-results-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.radar-results {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  padding: 0;
}

.radar-semantic-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  border-left: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  padding: 8px 0 18px 14px;
}

.radar-semantic-head {
  width: 100%;
  min-height: 42px;
  display: block;
  align-items: center;
}

.radar-semantic-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.radar-semantic-head > .radar-semantic-actions {
  width: 100%;
  display: grid;
}

.radar-semantic-head strong {
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
}

.radar-semantic-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.radar-semantic-action {
  min-width: 118px;
  min-height: 30px;
  padding-inline: 14px;
  white-space: nowrap;
}

.radar-hotword-groups {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-right: 0;
}

.radar-hotword-chip {
  min-height: 22px;
  max-width: 100%;
  font-size: 13px;
  line-height: 1.32;
}

.radar-result-list {
  min-width: 0;
  overflow: visible;
  display: grid;
  align-content: start;
  background: transparent;
  padding: 0;
}

.radar-pagination {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 0;
  padding: 10px 0 18px;
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  background: color-mix(in srgb, var(--surface-raised) 78%, var(--canvas));
}

.radar-pagination[hidden] {
  display: none !important;
}

.radar-page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.radar-pagination .radar-page-arrow,
.radar-pagination .radar-page-number {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #4f4f52;
  font: inherit;
  box-shadow: none;
}

.radar-pagination .radar-page-arrow {
  color: #8d8d91;
}

.radar-pagination .radar-page-arrow:hover:not(:disabled),
.radar-pagination .radar-page-number:hover:not(.is-active) {
  background: #f6f6f7;
  color: #242427;
}

.radar-pagination .radar-page-number.is-active {
  background: #fff0f0;
  color: #ff4d52;
  font-weight: var(--font-weight-medium);
}

.radar-pagination .radar-page-arrow .ui-icon {
  width: 15px;
  height: 15px;
}

.radar-pagination .radar-page-arrow:disabled {
  cursor: default;
  opacity: 0.3;
  box-shadow: none;
}

.radar-page-ellipsis {
  width: 24px;
  min-width: 24px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a3a3a7;
}

.radar-result-column {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--accent-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 62%, transparent);
}

.radar-result-column-head {
  min-width: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  padding: 10px;
}

.radar-result-column-head strong {
  display: block;
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
}

.radar-result-column-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.radar-result-column-head em {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-deep);
  font-size: 13px;
  font-style: normal;
  font-weight: var(--font-weight-semibold);
}

.radar-result-column-list {
  min-width: 0;
  display: grid;
  align-content: start;
  padding: 6px 10px 10px;
}

.radar-column-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--font-weight-regular);
}

.radar-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px 62px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  padding: 5px 0;
}

.radar-card:last-child {
  border-bottom: 0;
}

.radar-select {
  display: grid;
  place-items: center;
  background: transparent;
}

.radar-select input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  display: grid;
  place-items: center;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  border: 1.5px solid color-mix(in srgb, var(--ink-strong) 48%, transparent);
  border-radius: 3px;
  background: transparent;
  margin: 0;
  cursor: pointer;
  box-shadow: none;
}

.radar-select input:checked {
  border-color: #202124;
  background: #202124;
}

.radar-select input:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}

.radar-select input:focus-visible {
  outline: 2px solid color-mix(in srgb, #202124 18%, transparent);
  outline-offset: 2px;
}

.radar-cover {
  width: 62px;
  aspect-ratio: 3 / 4;
  display: block;
  overflow: hidden;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 80%, var(--accent-soft));
}

.radar-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.radar-cover-fallback {
  width: 100%;
  height: 100%;
  display: block;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface) 64%, var(--accent-soft));
}

.radar-card-main {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
}

.radar-card h3 {
  margin: 0;
  min-width: 0;
  color: var(--ink-strong);
  font-size: 14.5px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.36;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.radar-ocr-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  line-height: 1.45;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radar-ocr-state.is-running {
  color: #7c5a12;
}

.radar-ocr-state.is-done {
  color: #26735a;
}

.radar-ocr-state.is-error {
  color: #b42318;
}

.radar-cover-text {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: var(--font-weight-medium);
  line-height: 1.42;
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.radar-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-regular);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radar-metrics,
.radar-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.radar-card-actions {
  justify-content: flex-end;
  min-width: 0;
}

.radar-card-actions a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, #fff 92%, var(--surface-raised));
  color: var(--ink);
  padding: 0 11px;
  text-decoration: none;
  box-shadow: none;
}

.radar-card-actions a:hover {
  border-color: color-mix(in srgb, var(--ink-strong) 14%, var(--line));
  background: #fff;
  color: var(--ink-strong);
  box-shadow: none;
}

.radar-track-button,
.radar-speech-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #9b9698;
  padding: 0;
  box-shadow: none;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.radar-track-button:hover,
.radar-track-button:focus-visible {
  background: #fff8dc;
  color: #d39a00;
  transform: translateY(-1px) scale(1.04);
}

.radar-track-button.is-tracked {
  background: #fff7d1;
  color: #f2b705;
}

.radar-track-button.is-tracked:hover,
.radar-track-button.is-tracked:focus-visible {
  background: #fff1aa;
  color: #e6a900;
}

.radar-speech-button:hover,
.radar-speech-button:focus-visible {
  background: color-mix(in srgb, var(--accent-wash) 82%, transparent);
  color: var(--accent);
  transform: translateY(-1px) scale(1.04);
}

.radar-speech-button.is-tracked {
  background: color-mix(in srgb, var(--accent-wash) 72%, var(--surface));
  color: var(--accent);
}

.radar-speech-button.is-tracked:hover,
.radar-speech-button.is-tracked:focus-visible {
  background: color-mix(in srgb, var(--accent-wash) 88%, var(--surface));
  color: var(--accent-deep);
}

.speech-mic-icon {
  width: 19px;
  height: 19px;
  display: block;
  overflow: visible;
}

.speech-mic-icon rect,
.speech-mic-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .18s ease, transform .18s ease;
  transform-origin: 12px 12px;
}

.speech-mic-icon.is-lit rect,
.speech-mic-icon.is-lit path {
  transform: scale(1.03);
}

.chase-hit-star-icon {
  width: 18px;
  height: 18px;
  display: block;
  overflow: visible;
}

.chase-hit-star-icon path {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill .18s ease, stroke .18s ease, transform .18s ease;
  transform-origin: 12px 12px;
}

.chase-hit-star-icon.is-lit path {
  fill: currentColor;
  stroke: currentColor;
  transform: scale(1.03);
}

body[data-current-view="chaseHit"] #chaseHitView {
  margin-top: 0;
}

body[data-current-view="chaseHit"] #chaseHitView > .creation-mode-tabs {
  margin-top: 0;
}

.chase-hit-workspace {
  min-height: calc(100dvh - 42px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 3%, color-mix(in srgb, var(--accent-wash) 88%, transparent) 0, transparent 30%),
    var(--surface);
  padding: 28px;
}

.chase-hit-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.chase-hit-header .eyebrow {
  margin: 0 0 8px;
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: .18em;
}

.chase-hit-header h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -.04em;
}

.chase-hit-header p:last-child {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.chase-hit-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.chase-hit-search {
  min-width: 250px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 0 12px;
}

.chase-hit-search input {
  width: 100%;
  min-height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0;
}

.chase-hit-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 2px 12px;
  color: var(--muted);
  font-size: 13px;
}

.chase-hit-summary strong {
  color: var(--ink-strong);
  font-size: 15px;
}

.chase-hit-list {
  display: grid;
  gap: 10px;
}

.chase-hit-card {
  display: grid;
  grid-template-columns: 42px 78px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, #fff 94%, var(--surface-raised));
  padding: 12px 14px;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.chase-hit-card:hover,
.chase-hit-card.is-creating {
  border-color: color-mix(in srgb, var(--accent-deep) 30%, var(--line));
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(35, 25, 28, .07);
}

.chase-hit-index {
  color: color-mix(in srgb, var(--muted) 65%, transparent);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: .08em;
  text-align: center;
}

.chase-hit-cover {
  width: 78px;
  height: auto;
  aspect-ratio: 3 / 4;
  display: block;
  overflow: hidden;
  border-radius: 11px;
  background: var(--surface-raised);
}

.chase-hit-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.chase-hit-source-link {
  cursor: pointer;
}

.chase-hit-cover.chase-hit-source-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-deep) 35%, transparent);
  outline-offset: 2px;
}

.chase-hit-cover-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--accent-deep);
  font-size: 24px;
  background: linear-gradient(145deg, var(--accent-wash), #fff);
}

.chase-hit-copy {
  min-width: 0;
}

.chase-hit-copy h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 17px;
  line-height: 1.45;
}

.chase-hit-title-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.chase-hit-title-link:hover {
  color: var(--accent-deep);
}

.chase-hit-title-link:focus-visible {
  border-radius: 4px;
  outline: 3px solid color-mix(in srgb, var(--accent-deep) 28%, transparent);
  outline-offset: 2px;
}

.chase-hit-title-editor {
  display: grid;
  gap: 6px;
}

.chase-hit-title-editor input {
  width: 100%;
  min-height: 40px;
  border: 1px solid color-mix(in srgb, var(--accent-deep) 36%, var(--line));
  border-radius: 9px;
  outline: 0;
  background: #fff;
  color: var(--ink-strong);
  padding: 7px 10px;
  font: inherit;
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-wash) 72%, transparent);
}

.chase-hit-title-editor input:focus {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-wash) 96%, transparent);
}

.chase-hit-title-editor span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.chase-hit-copy p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.chase-hit-edited-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  padding: 0 7px;
  font-size: 10px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.chase-hit-running {
  display: inline-block;
  margin-top: 7px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.chase-hit-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chase-hit-card-actions .primary {
  min-width: 76px;
}

.chase-hit-card-actions .secondary,
.chase-hit-card-actions .ghost {
  min-width: 62px;
}

.speech-daily-schedule-card {
  grid-template-columns: 88px minmax(0, 1fr) auto;
}

.speech-daily-date {
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  text-align: center;
}

.chase-hit-remove {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #fff7d1;
  color: #f2b705;
  padding: 0;
  box-shadow: none;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.chase-hit-remove:hover,
.chase-hit-remove:focus-visible {
  background: #fff1aa;
  color: #e6a900;
  transform: scale(1.05);
}

@media (max-width: 860px) {
  .chase-hit-workspace {
    padding: 18px;
  }

  .chase-hit-header,
  .chase-hit-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .chase-hit-search {
    min-width: 0;
  }

  .chase-hit-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .chase-hit-index {
    display: none;
  }

  .chase-hit-cover {
    width: 58px;
    height: auto;
  }

  .chase-hit-card-actions {
    grid-column: 2;
    justify-content: flex-end;
  }

  .speech-daily-schedule-card {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .speech-daily-schedule-card .chase-hit-card-actions {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .radar-key-grid {
    grid-template-columns: 1fr;
  }

  .radar-rule-grid {
    grid-template-columns: 1fr;
  }

  .radar-results {
    grid-template-columns: 1fr;
  }

  .radar-card {
    grid-template-columns: 22px 72px minmax(0, 1fr);
    align-items: start;
  }

  .radar-cover {
    width: 72px;
  }

  .radar-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .radar-keyword-option {
    grid-template-columns: 18px minmax(0, 1fr) auto auto;
  }

  .radar-keyword-history-badge {
    grid-column: 3;
  }

  .radar-keyword-option em {
    grid-column: 4;
    justify-self: end;
  }

  .radar-wordcloud-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(210px, auto) auto;
  }

  .radar-wordcloud-head,
  .radar-wordcloud-controls,
  .radar-wordcloud-body,
  .radar-wordcloud-actions {
    grid-column: 1;
  }

  .radar-wordcloud-head {
    grid-row: 1;
  }

  .radar-wordcloud-controls {
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .radar-wordcloud-spacing,
  .radar-stopword-field,
  .radar-stopword-list {
    grid-column: 1 / -1;
  }

  .radar-wordcloud-body {
    grid-row: 3;
    height: 220px;
  }

  .radar-wordcloud-actions {
    grid-row: 4;
    flex-wrap: nowrap;
  }

  .radar-results-head,
  .radar-panel-head {
    display: grid;
  }

  .radar-run-summary {
    justify-content: flex-start;
  }

  .pool-list-head {
    grid-template-columns: 1fr;
  }

  .pool-list-head strong {
    font-size: 18px;
  }
}

.empty-state.is-compact {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
}

.settings-card {
  margin-top: 12px;
  padding: 16px;
}

.asset-studio,
.recipe-studio,
.system-settings {
  display: grid;
  gap: 12px;
}

.recipe-studio {
  margin-top: 0;
  width: min(1120px, 100%);
  margin-inline: auto;
}

.asset-toolbar,
.recipe-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.asset-toolbar p,
.recipe-toolbar p {
  color: var(--muted);
  line-height: 1.62;
}

.asset-toolbar-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.asset-toolbar-actions > button {
  position: relative;
  z-index: 45;
}

.asset-annotation-search {
  position: relative;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 220px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #f3f3f4;
  padding: 0 12px;
  color: var(--ink);
  box-shadow: none;
}

.asset-annotation-search:focus-within {
  background: #f8e7ec;
  box-shadow: 0 0 0 3px rgba(239, 74, 111, 0.12);
}

.asset-annotation-search .ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.asset-annotation-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: var(--font-weight-semibold);
}

.asset-annotation-search input::placeholder {
  color: var(--ink);
  opacity: 1;
  font-weight: var(--font-weight-semibold);
}

.asset-annotation-search.is-disabled {
  opacity: 0.52;
}

.asset-upload-menu {
  position: relative;
  z-index: 48;
  display: flex;
  align-items: stretch;
}

.asset-upload-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 6px;
}

.asset-upload-trigger {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(201, 54, 73, 0.18);
}

.asset-upload-trigger:hover,
.asset-upload-menu:focus-within .asset-upload-trigger,
.asset-upload-menu:hover .asset-upload-trigger {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: #fff;
}

.asset-upload-trigger .ui-icon {
  width: 14px;
  height: 14px;
}

.asset-upload-chevron {
  transition: transform 140ms ease;
}

.asset-upload-menu:hover .asset-upload-chevron,
.asset-upload-menu:focus-within .asset-upload-chevron {
  transform: rotate(180deg);
}

.asset-upload-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 100%;
  min-width: 128px;
  display: grid;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 14px 28px rgba(16, 24, 40, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.asset-upload-menu:hover .asset-upload-dropdown,
.asset-upload-menu:focus-within .asset-upload-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.asset-upload-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 0 8px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}

.asset-upload-option:hover,
.asset-upload-option:focus-visible {
  background: #eeeeef;
  color: var(--ink-strong);
}

.asset-upload-option .ui-icon {
  width: 14px;
  height: 14px;
  color: currentColor;
}

.asset-upload-progress {
  display: inline-flex;
  min-width: min(280px, 40vw);
  height: 36px;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  background: var(--accent-wash);
  padding: 0 12px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-upload-progress.is-hidden {
  display: none;
}

.asset-upload-progress span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-upload-progress progress {
  width: 92px;
  height: 6px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  accent-color: var(--accent);
}

.asset-upload-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.asset-upload-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
}

.asset-upload-menu.is-uploading .asset-upload-trigger,
.asset-upload-option:disabled {
  cursor: wait;
  opacity: 0.64;
}

.recipe-toolbar-actions {
  display: grid;
  grid-template-columns: minmax(170px, 240px) auto;
  align-items: end;
  gap: 8px;
}

.asset-collapse-all-btn {
  max-width: 180px;
  min-width: 64px;
  overflow: hidden;
  padding-inline: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#assetCollapseAllBtn.is-active {
  border-color: rgba(201, 54, 73, 0.36);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

#toggleAssetGridViewBtn.is-active {
  border-color: rgba(201, 54, 73, 0.36);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.asset-move-menu {
  position: relative;
  z-index: 44;
  display: flex;
}

.asset-move-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 35;
  width: min(320px, 82vw);
  max-height: min(440px, 70vh);
  display: grid;
  gap: 6px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 8px;
  box-shadow: var(--shadow);
}

.asset-move-option {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  padding: 7px 9px;
  text-align: left;
}

.asset-move-option:hover {
  background: var(--accent-soft);
}

.asset-move-option:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.asset-move-option span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-weight: var(--font-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-move-option em,
.asset-move-empty {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.asset-move-option em {
  min-width: 28px;
  border-radius: 999px;
  background: var(--surface-raised);
  padding: 2px 7px;
  text-align: center;
}

.asset-move-empty {
  padding: 10px;
}

#assetTrashBtn.is-active {
  border-color: rgba(233, 65, 54, 0.32);
  background: #fff0e8;
  color: var(--amber);
}

#deleteAssetItemsBtn.is-danger {
  border-color: rgba(201, 54, 73, 0.4);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

#selectAssetItemsBtn[aria-pressed="true"] {
  border-color: rgba(201, 54, 73, 0.32);
  background: rgba(201, 54, 73, 0.08);
  color: var(--accent-deep);
}

.asset-workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-height: 420px;
}

.asset-group-drawer-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .asset-group-drawer-backdrop,
body:not([data-appearance="deep-dark"]) .asset-group-drawer-backdrop:hover,
body:not([data-appearance="deep-dark"]) .asset-group-drawer-backdrop:active,
body:not([data-appearance="deep-dark"]) .asset-group-drawer-backdrop:focus-visible {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit;
  transform: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.asset-group-tree,
.asset-browser-panel,
.asset-item-form,
.recipe-slots-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
}

.asset-group-tree {
  position: fixed;
  z-index: 70;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, calc(100vw - 28px));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 8px;
  max-height: none;
  overflow: hidden;
  padding: 16px;
  border-radius: 16px 0 0 16px;
  box-shadow: -18px 0 42px rgba(16, 24, 40, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateX(105%);
  transition: opacity 180ms ease, transform 180ms ease;
}

body.asset-group-drawer-open .asset-group-tree {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.asset-group-tree-body {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.asset-group-tree-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  background: var(--surface-raised);
  padding-top: 12px;
}

.asset-group-tree-footer button {
  min-width: 0;
  min-height: 38px;
}

.asset-group {
  display: grid;
  gap: 6px;
}

.asset-all-group {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(37, 47, 65, 0.1);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 10px;
  text-align: left;
}

.asset-all-group.is-active {
  border-color: rgba(201, 54, 73, 0.36);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.asset-all-group span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--font-weight-semibold);
}

.asset-all-group em {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.asset-group.is-collapsed {
  gap: 0;
}

.asset-group-head,
.asset-subgroup {
  display: grid;
  align-items: center;
  gap: 7px;
}

.asset-group-head {
  grid-template-columns: 28px minmax(0, 1fr) auto 28px 28px 28px;
  min-height: 38px;
  border: 1px solid rgba(37, 47, 65, 0.1);
  border-radius: 9px;
  background: var(--surface);
  padding: 4px;
}

.asset-group.is-active > .asset-group-head {
  border-color: rgba(201, 54, 73, 0.28);
  box-shadow: 0 0 0 2px rgba(201, 54, 73, 0.08);
}

.asset-subgroup-list {
  display: grid;
  gap: 5px;
  padding-left: 20px;
}

.asset-subgroup-list[hidden],
.asset-group.is-collapsed .asset-subgroup-list {
  display: none;
}

.asset-subgroup {
  grid-template-columns: 26px minmax(0, 1fr) auto 28px 28px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 4px;
}

.asset-subgroup.is-active {
  border-color: rgba(201, 54, 73, 0.36);
  background: var(--accent-soft);
}

.asset-drag-handle,
.icon-button {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}

.asset-drag-handle {
  border-color: transparent;
  background: transparent;
  color: var(--faint);
  cursor: grab;
}

.asset-group-name,
.asset-subgroup-name {
  min-width: 0;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 4px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none;
}

.asset-group-name {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.asset-fold-icon {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  color: var(--accent-deep);
}

.asset-fold-icon .ui-icon {
  width: 14px;
  height: 14px;
}

.asset-group-head span,
.asset-subgroup em {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.asset-item-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr);
  gap: 12px;
  align-content: start;
  padding: 12px;
  background: var(--surface);
}

.asset-browser-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  background: var(--surface);
}

.asset-browser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.asset-browser-head p {
  color: var(--muted);
  line-height: 1.55;
}

.asset-ai-progress-panel {
  --vision-live: #8f3b58;
  --vision-live-soft: #f7eaef;
  --vision-complete: #39745e;
  --vision-complete-soft: #eaf3ee;
  --vision-paused: #9a6728;
  --vision-failed: #b83e4b;
  --vision-track: #eee8eb;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  padding: 10px;
}

.asset-ai-progress-panel.is-hidden {
  display: none;
}

.asset-ai-progress-top,
.asset-ai-progress-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.asset-ai-progress-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.asset-ai-progress-heading > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.asset-ai-progress-indicator {
  position: relative;
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border: 3px solid color-mix(in srgb, var(--vision-live) 20%, transparent);
  border-radius: 50%;
  background: var(--vision-live);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--vision-live) 9%, transparent);
}

.asset-ai-progress-panel.is-running:not(.is-paused):not(.is-queued) .asset-ai-progress-indicator::after {
  position: absolute;
  inset: -7px;
  border: 1px solid color-mix(in srgb, var(--vision-live) 34%, transparent);
  border-radius: inherit;
  content: "";
  animation: asset-ai-status-pulse 1.8s ease-out infinite;
}

.asset-ai-progress-panel.is-paused .asset-ai-progress-indicator {
  border-color: color-mix(in srgb, var(--vision-paused) 20%, transparent);
  background: var(--vision-paused);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--vision-paused) 9%, transparent);
}

.asset-ai-progress-panel.is-queued .asset-ai-progress-indicator {
  border-color: color-mix(in srgb, var(--muted) 18%, transparent);
  background: var(--muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 8%, transparent);
}

.asset-ai-progress-top strong {
  color: var(--ink);
  font-size: 13px;
}

.asset-ai-progress-top span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-ai-progress-top > em {
  flex: 0 0 auto;
  color: var(--vision-live);
  font-size: 15px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.02em;
}

.asset-ai-progress-bar {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--vision-track);
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ink-strong) 8%, transparent);
}

.asset-ai-progress-bar span {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--vision-live);
  box-shadow: 0 0 12px color-mix(in srgb, var(--vision-live) 26%, transparent);
  transition: width 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.asset-ai-progress-bar span::after,
.material-ai-lock-progress-bar span::after {
  position: absolute;
  top: 50%;
  right: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff8fa;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--vision-live) 74%, transparent), 0 0 10px color-mix(in srgb, var(--vision-live) 44%, transparent);
  content: "";
  transform: translateY(-50%);
}

.asset-ai-progress-panel.is-running .asset-ai-progress-bar span {
  background: var(--vision-live);
}

.asset-ai-progress-panel.is-paused .asset-ai-progress-bar span {
  background: var(--vision-paused);
  box-shadow: none;
}

.asset-ai-progress-panel.is-queued .asset-ai-progress-bar span::after {
  display: none;
}

.asset-ai-progress-panel.is-single .asset-ai-progress-bar span {
  width: 34% !important;
  background: var(--vision-live);
  animation: asset-ai-single-progress 1.35s ease-in-out infinite;
}

.asset-ai-progress-stats {
  justify-content: flex-start;
}

.asset-ai-progress-stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 76%, var(--vision-track));
  padding: 5px 9px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-medium);
  line-height: 1;
}

.asset-ai-progress-stats span::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.62;
}

.asset-ai-progress-stats .is-complete {
  background: var(--vision-complete-soft);
  color: var(--vision-complete);
}

.asset-ai-progress-stats .is-active {
  background: var(--vision-live-soft);
  color: var(--vision-live);
}

.asset-ai-progress-panel.is-paused .asset-ai-progress-stats .is-active {
  background: color-mix(in srgb, var(--vision-paused) 11%, var(--surface));
  color: var(--vision-paused);
}

.asset-ai-progress-stats .is-failed {
  color: var(--faint);
}

.asset-ai-progress-panel.has-failures .asset-ai-progress-stats .is-failed {
  background: color-mix(in srgb, var(--vision-failed) 10%, var(--surface));
  color: var(--vision-failed);
}

.asset-ai-progress-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

@keyframes asset-ai-single-progress {
  0% { transform: translateX(-120%); }
  55% { transform: translateX(95%); }
  100% { transform: translateX(290%); }
}

@keyframes asset-ai-status-pulse {
  0% { opacity: 0.7; transform: scale(0.72); }
  72%, 100% { opacity: 0; transform: scale(1.3); }
}

.asset-ai-progress-errors {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

body[data-appearance="deep-dark"] .asset-ai-progress-panel,
body[data-appearance="deep-dark"] .material-ai-lock-card {
  --vision-live: #d2728e;
  --vision-live-soft: #39242d;
  --vision-complete: #72aa92;
  --vision-complete-soft: #20322b;
  --vision-paused: #d2a45e;
  --vision-failed: #e0717b;
  --vision-track: #352d30;
}

.material-ai-lock-overlay {
  position: fixed;
  z-index: 210;
  inset: 0 0 0 var(--side-w);
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--canvas) 72%, transparent);
  padding: 24px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.material-ai-lock-overlay.is-hidden,
body:not([data-current-view="material"]) .material-ai-lock-overlay {
  display: none;
}

body.sidebar-collapsed .material-ai-lock-overlay {
  left: var(--side-collapsed-w);
}

.material-ai-lock-card {
  --vision-live: #8f3b58;
  --vision-live-soft: #f7eaef;
  --vision-track: #eee8eb;
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid color-mix(in srgb, var(--vision-live) 20%, var(--line));
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-raised) 96%, transparent);
  padding: 22px;
  box-shadow: 0 28px 70px color-mix(in srgb, var(--ink-strong) 20%, transparent);
}

.material-ai-lock-head {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.material-ai-lock-spinner {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 2px solid color-mix(in srgb, var(--vision-live) 16%, var(--line));
  border-top-color: var(--vision-live);
  border-right-color: color-mix(in srgb, var(--vision-live) 58%, var(--line));
  border-radius: 50%;
  animation: material-ai-lock-spin 1.05s linear infinite;
}

.material-ai-lock-copy {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.material-ai-lock-copy strong {
  color: var(--ink-strong);
  font-size: 16px;
  line-height: 1.4;
}

.material-ai-lock-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.material-ai-lock-progress-bar {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--vision-track);
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ink-strong) 8%, transparent);
}

.material-ai-lock-progress-bar > span {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--vision-live);
  box-shadow: 0 0 14px color-mix(in srgb, var(--vision-live) 30%, transparent);
  transition: width 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.material-ai-lock-progress-bar.is-indeterminate > span {
  width: 32% !important;
  animation: asset-ai-single-progress 1.35s ease-in-out infinite;
}

.material-ai-lock-overlay[data-state="queued"] .material-ai-lock-progress-bar > span::after {
  display: none;
}

.material-ai-lock-progress-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.material-ai-lock-progress-meta > span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.material-ai-lock-progress-meta > em {
  flex: 0 0 auto;
  color: var(--vision-live);
  font-size: 14px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-semibold);
}

body.material-ai-locked #materialView {
  pointer-events: none;
  user-select: none;
}

body.material-ai-locked .operator-notification-panel,
body.material-ai-locked .operator-notification-peek {
  z-index: 220;
}

@keyframes material-ai-lock-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .material-ai-lock-overlay,
  body.sidebar-collapsed .material-ai-lock-overlay {
    top: 64px;
    left: 0;
  }
}

@media (max-width: 760px) {
  body[data-current-view="material"] .asset-ai-progress-panel {
    padding: 13px;
  }

  .asset-ai-progress-top {
    align-items: flex-start;
  }

  .asset-ai-progress-stats {
    gap: 6px;
  }

  .material-ai-lock-card {
    gap: 14px;
    padding: 18px;
  }

  .material-ai-lock-progress-meta {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .material-ai-lock-spinner,
  .material-ai-lock-progress-bar.is-indeterminate > span {
    animation: none;
  }
}

.asset-ai-progress-errors.is-hidden {
  display: none;
}

.asset-ai-progress-errors div {
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--accent-deep);
  font-size: 12px;
  line-height: 1.45;
}

.asset-ai-progress-errors strong,
.asset-ai-progress-errors span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.asset-ai-progress-errors strong {
  color: var(--ink);
}

.asset-trash-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.asset-trash-actions #purgeTrashItemsBtn:not(:disabled) {
  border-color: rgba(201, 54, 73, 0.32);
  color: var(--accent-deep);
}

.asset-bulk-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.asset-bulk-rating button {
  min-width: 52px;
}

.asset-item-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 10px;
  max-height: none;
  overflow: auto;
  overflow-anchor: none;
}

.asset-item-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 8px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.asset-item-card.is-selectable {
  cursor: pointer;
}

.asset-item-card.is-selected {
  border-color: rgba(201, 54, 73, 0.46);
  box-shadow: 0 0 0 2px rgba(201, 54, 73, 0.12), var(--shadow-soft);
}

.asset-trash-card {
  background: #fffdf9;
}

.asset-trash-card::after {
  content: "回收站";
  position: absolute;
  top: 42px;
  right: 10px;
  z-index: 3;
  border: 1px solid rgba(233, 65, 54, 0.2);
  border-radius: 999px;
  background: rgba(255, 247, 232, 0.92);
  color: var(--amber);
  padding: 2px 7px;
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
}

.asset-select-check {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.asset-select-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.asset-select-check span {
  position: relative;
  width: 100%;
  height: 100%;
  border: 1.5px solid rgba(82, 92, 105, 0.42);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 7px rgba(16, 24, 40, 0.16);
}

.asset-select-check input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 2px 7px rgba(16, 24, 40, 0.16);
}

.asset-select-check:has(input:focus-visible) span {
  outline: 2px solid color-mix(in srgb, var(--accent) 62%, transparent);
  outline-offset: 2px;
}

.asset-preview-thumb {
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 3 / 4;
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  padding: 0;
  overflow: hidden;
  box-shadow: none;
}

.asset-grid-view-enabled .asset-preview-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(33.333% - 1px), rgba(255, 255, 255, 0.82) calc(33.333% - 1px), rgba(255, 255, 255, 0.82) calc(33.333% + 1px), transparent calc(33.333% + 1px)),
    linear-gradient(to right, transparent calc(66.666% - 1px), rgba(255, 255, 255, 0.82) calc(66.666% - 1px), rgba(255, 255, 255, 0.82) calc(66.666% + 1px), transparent calc(66.666% + 1px)),
    linear-gradient(to bottom, transparent calc(33.333% - 1px), rgba(255, 255, 255, 0.82) calc(33.333% - 1px), rgba(255, 255, 255, 0.82) calc(33.333% + 1px), transparent calc(33.333% + 1px)),
    linear-gradient(to bottom, transparent calc(66.666% - 1px), rgba(255, 255, 255, 0.82) calc(66.666% - 1px), rgba(255, 255, 255, 0.82) calc(66.666% + 1px), transparent calc(66.666% + 1px));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.asset-preview-thumb:hover {
  border-color: rgba(201, 54, 73, 0.42);
  transform: none;
}

.asset-preview-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.asset-list-footer {
  grid-column: 1 / -1;
  min-height: 64px;
  display: grid;
  place-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-list-footer.is-complete {
  color: var(--faint);
}

.asset-load-more-btn {
  min-width: 148px;
}

.annotation-dot {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 8px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #f7c948;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.2);
}

.asset-usage-badge {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 3;
  min-width: 34px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.68);
  color: #fff;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 5px 14px rgba(16, 24, 40, 0.22);
  backdrop-filter: blur(7px);
}

.asset-usage-badge.is-full {
  background: rgba(201, 54, 73, 0.9);
}

.asset-item-content {
  min-width: 0;
}

.asset-card-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-item-card strong {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-source-chip {
  max-width: 100%;
  display: inline-block;
  margin-top: 3px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--muted);
  padding: 2px 7px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-ai-chip {
  max-width: 42%;
  display: inline-flex;
  flex: 0 0 auto;
  margin-top: 0;
  border-radius: 999px;
  background: rgba(20, 30, 44, 0.06);
  color: var(--muted);
  padding: 2px 7px;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-ai-chip.is-read {
  background: rgba(157, 89, 102, 0.12);
  color: #8f3445;
}

.asset-ai-chip.is-unread {
  background: rgba(233, 65, 54, 0.16);
  color: #9d3a43;
}

.asset-ai-chip.is-running {
  background: rgba(201, 54, 73, 0.12);
  color: var(--accent-deep);
}

.asset-ai-chip.is-failed {
  background: rgba(201, 54, 73, 0.16);
  color: var(--accent-deep);
}

.asset-ai-chip.is-finished {
  background: rgba(20, 30, 44, 0.08);
  color: var(--muted);
}

.asset-card-media {
  position: relative;
  min-width: 0;
  isolation: isolate;
}

.asset-card-media .asset-preview-thumb {
  cursor: zoom-in;
}

.asset-card-media .asset-select-check {
  top: 9px;
  right: auto;
  left: 9px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.asset-item-card:hover .asset-card-media .asset-select-check,
.asset-item-card.is-menu-open .asset-card-media .asset-select-check,
.asset-item-card.is-selected .asset-card-media .asset-select-check,
.asset-item-card.is-selectable .asset-card-media .asset-select-check,
.asset-item-card:has(:focus-visible) .asset-card-media .asset-select-check {
  opacity: 1;
  transform: translateY(0);
}

.asset-hover-meta {
  position: absolute;
  z-index: 5;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.asset-item-card:hover .asset-hover-meta,
.asset-item-card.is-menu-open .asset-hover-meta,
.asset-item-card:has(:focus-visible) .asset-hover-meta {
  opacity: 1;
  transform: translateY(0);
}

.asset-hover-meta .asset-usage-badge {
  position: static;
  min-width: 32px;
  min-height: 21px;
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(16, 18, 23, 0.68);
  padding: 2px 6px;
  box-shadow: 0 4px 12px rgba(8, 10, 14, 0.18);
}

.asset-hover-meta .asset-usage-badge.is-full {
  background: rgba(201, 54, 73, 0.88);
}

.asset-hover-rating {
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(16, 18, 23, 0.68);
  color: #ffb15c;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(8, 10, 14, 0.18);
  backdrop-filter: blur(7px);
}

.asset-card-actions {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 46px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
  padding: 14px 7px 7px;
  background: linear-gradient(to top, rgba(10, 11, 15, 0.46), rgba(10, 11, 15, 0));
  pointer-events: none;
  transition: background 150ms ease;
}

.asset-item-card:hover .asset-card-actions,
.asset-item-card.is-menu-open .asset-card-actions,
.asset-item-card:has(:focus-visible) .asset-card-actions {
  background: linear-gradient(to top, rgba(10, 11, 15, 0.66), rgba(10, 11, 15, 0));
}

.asset-item-card.is-notification-target {
  border-color: color-mix(in srgb, var(--accent) 74%, white 26%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent), 0 18px 42px color-mix(in srgb, var(--accent) 18%, transparent);
  animation: asset-notification-target-pulse 900ms ease-out 2;
}

@keyframes asset-notification-target-pulse {
  0% { transform: translateY(0); }
  45% { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

.asset-card-actions .asset-ai-chip {
  max-width: 46%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(62, 64, 69, 0.54);
  color: rgba(255, 255, 255, 0.76);
  padding: 4px 8px;
  font-size: 11px;
  opacity: 0.76;
  box-shadow: 0 3px 12px rgba(7, 9, 12, 0.12);
  backdrop-filter: blur(7px);
}

.asset-card-actions .asset-ai-chip.is-read,
.asset-card-actions .asset-ai-chip.is-unread,
.asset-card-actions .asset-ai-chip.is-running,
.asset-card-actions .asset-ai-chip.is-finished,
.asset-card-actions .asset-ai-chip.is-failed {
  background: rgba(62, 64, 69, 0.54);
  color: rgba(255, 255, 255, 0.76);
}

.asset-card-secondary-actions {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 5px;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.asset-item-card:hover .asset-card-secondary-actions,
.asset-item-card.is-menu-open .asset-card-secondary-actions,
.asset-item-card:has(:focus-visible) .asset-card-secondary-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.asset-card-edit-btn,
.asset-card-more-btn {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 7px;
  background: rgba(250, 250, 251, 0.9);
  color: #282b31;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  box-shadow: 0 4px 12px rgba(7, 9, 12, 0.2);
  backdrop-filter: blur(8px);
}

.asset-card-edit-btn:hover,
.asset-card-more-btn:hover {
  border-color: #fff;
  background: #fff;
  color: #111318;
  transform: translateY(-1px);
}

.asset-card-edit-btn .ui-icon {
  width: 13px;
  height: 13px;
}

.asset-card-edit-btn {
  min-width: 0;
  flex: 1 1 auto;
}

.asset-card-edit-btn > span:last-child {
  white-space: nowrap;
}

.asset-card-more-btn {
  width: 32px;
  flex: 0 0 32px;
  padding: 0;
}

.asset-card-more-btn > span {
  position: relative;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: -6px 0 0 currentColor, 6px 0 0 currentColor;
}

.asset-card-menu {
  position: absolute;
  z-index: 12;
  right: 6px;
  bottom: 8px;
  width: min(224px, calc(100% - 12px));
  max-height: calc(100% - 16px);
  display: grid;
  align-content: start;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 96%, transparent);
  padding: 5px;
  box-shadow: 0 16px 38px rgba(7, 9, 12, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.98);
  transform-origin: right bottom;
  overflow: auto;
  pointer-events: none;
  backdrop-filter: blur(16px);
  transition: opacity 90ms ease, transform 90ms ease;
}

.asset-item-card.is-menu-open .asset-card-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.asset-card-menu > button,
.asset-card-rating-menu {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  padding: 7px 8px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  text-align: left;
}

.asset-card-menu > button:hover {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-raised));
}

.asset-card-menu > button.is-danger {
  border-radius: 7px;
  background: color-mix(in srgb, var(--danger, #c93649) 7%, transparent);
  color: var(--danger, #c93649);
}

.asset-card-menu > button.is-danger:hover {
  background: color-mix(in srgb, var(--danger, #c93649) 13%, var(--surface-raised));
}

.asset-card-menu > button .ui-icon,
.asset-card-menu-glyph {
  width: 16px;
  height: 16px;
}

.asset-card-menu-glyph.is-folder {
  position: relative;
  display: block;
  width: 16px;
  height: 12px;
  border: 1.4px solid currentColor;
  border-radius: 3px;
}

.asset-card-menu-glyph.is-folder::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 1px;
  width: 7px;
  height: 4px;
  border: 1.4px solid currentColor;
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
}

.asset-card-menu-glyph.is-star {
  display: grid;
  place-items: center;
  color: #d57a29;
  font-size: 17px;
}

.asset-card-menu-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}

.asset-card-rating-menu {
  grid-template-columns: 18px auto minmax(0, 1fr);
  align-items: start;
}

.asset-card-rating-menu > span:nth-child(2) {
  padding-top: 5px;
  white-space: nowrap;
}

.asset-card-rating-menu > .asset-card-rating-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  min-width: 0;
}

.asset-card-rating-menu button {
  width: 100%;
  min-width: 0;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: #d57a29;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.04em;
  line-height: 1;
  text-align: left;
}

.asset-card-rating-menu button:hover:not(:disabled) {
  border-color: color-mix(in srgb, #d57a29 62%, var(--line));
  background: color-mix(in srgb, #d57a29 10%, var(--surface));
  color: #b35f19;
}

.asset-card-rating-menu button:disabled {
  opacity: 0.36;
}

#assetCardMoveModal {
  z-index: 230;
  background: rgba(8, 10, 14, 0.64);
  backdrop-filter: blur(6px);
}

#assetDerivedDeleteModal {
  z-index: 240;
  background: rgba(38, 28, 32, 0.48);
  backdrop-filter: blur(8px) saturate(0.88);
}

#assetDerivedDeleteModal .asset-derived-delete-modal {
  width: min(1040px, 100%);
  max-height: min(790px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-brand-primary) 8%, var(--color-line-subtle));
  border-radius: var(--radius-card);
  background: var(--color-surface-solid);
  padding: 0;
  box-shadow: 0 24px 64px rgba(100, 37, 52, 0.1);
}

.asset-derived-delete-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6) var(--space-4);
  padding-left: var(--space-7);
}

.asset-derived-delete-head::before {
  position: absolute;
  top: var(--space-5);
  bottom: var(--space-4);
  left: var(--space-5);
  width: 4px;
  border-radius: 999px;
  background: var(--color-brand-primary);
  content: "";
}

.asset-derived-delete-kicker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-brand-readable);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
}

.asset-derived-delete-kicker .ui-icon {
  width: 16px;
  height: 16px;
}

.asset-derived-delete-kicker .ui-icon-final {
  --ui-icon-url: url("/assets/icons/nav-final.svg");
}

.asset-derived-delete-head h3 {
  margin: 4px 0 0;
  color: var(--color-text-primary);
  font-size: 28px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.asset-derived-delete-head .icon-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface-soft);
  color: var(--color-text-secondary);
  box-shadow: 0 6px 18px rgba(97, 49, 60, 0.08);
}

.asset-derived-delete-head .icon-button:hover,
.asset-derived-delete-head .icon-button:focus-visible {
  background: var(--color-brand-soft);
  color: var(--color-brand-readable);
}

.asset-derived-delete-summary-wrap {
  display: grid;
  grid-template-columns: var(--space-7) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  margin: 0 var(--space-6) var(--space-4);
  border: 0;
  border-radius: var(--radius-card);
  background: var(--color-brand-soft);
  padding: var(--space-2) var(--space-3);
}

.asset-derived-delete-link-mark {
  position: relative;
  width: var(--space-7);
  height: var(--space-7);
  border-radius: 50%;
  background: var(--color-surface-solid);
}

.asset-derived-delete-link-mark::before {
  position: absolute;
  inset: 12px;
  background: var(--color-brand-primary);
  mask: url("/assets/icons/nav-material.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/icons/nav-material.svg") center / contain no-repeat;
  content: "";
}

.asset-derived-delete-summary {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 1.65;
}

.asset-derived-delete-summary strong {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

.asset-derived-delete-summary span + strong,
.asset-derived-delete-summary strong + span {
  margin-left: 4px;
}

.asset-derived-delete-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 0 var(--space-6) var(--space-3);
  color: var(--color-text-muted);
  font-size: 14px;
}

.asset-derived-delete-select-all {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: var(--space-1);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

.asset-derived-delete-select-all input,
.asset-derived-delete-card input {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  margin: 0;
  border: 1.5px solid color-mix(in srgb, var(--color-text-muted) 34%, var(--color-line-subtle));
  border-radius: 6px;
  appearance: none;
  background: var(--color-surface-solid);
  padding: 0;
  cursor: pointer;
}

.asset-derived-delete-select-all input:focus-visible,
.asset-derived-delete-card input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-brand-primary) 22%, transparent);
  outline-offset: 2px;
}

.asset-derived-delete-select-all input:checked,
.asset-derived-delete-select-all input:indeterminate,
.asset-derived-delete-card input:checked {
  border-color: var(--color-brand-primary);
  background-color: var(--color-brand-primary);
  background-image: url("/assets/icons/ui-check.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px 12px;
}

.asset-derived-delete-toolbar > span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  background: var(--color-surface-soft);
  padding: 0 12px;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  box-shadow: 0 5px 18px rgba(104, 47, 60, 0.07);
}

.asset-derived-delete-grid {
  min-height: 210px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: start;
  gap: var(--space-2);
  overflow: auto;
  padding: 0 var(--space-6) var(--space-5);
  scrollbar-color: color-mix(in srgb, var(--color-brand-primary) 24%, transparent) transparent;
  grid-auto-rows: max-content;
}

.asset-derived-delete-card {
  position: relative;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--color-text-primary) 8%, transparent);
  border-radius: var(--radius-card);
  background: var(--color-surface-solid);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(92, 43, 55, 0.07);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  align-self: start;
}

.asset-derived-delete-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(92, 43, 55, 0.1);
}

.asset-derived-delete-card:has(input:checked) {
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand-primary) 12%, transparent), 0 16px 36px rgba(126, 50, 67, 0.1);
}

.asset-derived-delete-card-label {
  display: grid;
  cursor: pointer;
}

.asset-derived-delete-card-label input {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
}

.asset-derived-delete-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: block;
  background: var(--color-surface-soft);
  object-fit: cover;
}

.asset-derived-delete-name {
  min-width: 0;
  padding: var(--space-2);
  color: var(--color-text-primary);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#assetDerivedDeleteModal button.asset-derived-delete-preview {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: var(--radius-pill);
  background: rgba(38, 28, 32, 0.86);
  color: #fff;
  padding: 4px var(--space-2);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  backdrop-filter: blur(8px);
}

.asset-derived-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  border-top: 1px solid var(--color-line-subtle);
  background: var(--color-surface-soft);
  padding: var(--space-3) var(--space-6);
}

.asset-derived-delete-actions button {
  min-width: 120px;
  min-height: 46px;
  border-radius: var(--radius-pill);
  padding-inline: var(--space-5);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
}

.asset-derived-delete-actions .secondary {
  border-color: transparent;
  background: transparent;
  color: var(--color-text-secondary);
}

.asset-derived-delete-actions .secondary:hover,
.asset-derived-delete-actions .secondary:focus-visible {
  border-color: color-mix(in srgb, var(--color-brand-primary) 12%, transparent);
  background: var(--color-brand-soft);
  color: var(--color-brand-readable);
}

.asset-derived-delete-actions .is-danger {
  border-color: var(--color-danger-action);
  background: var(--color-danger-action);
  color: #fff;
  box-shadow: 0 12px 26px rgba(180, 35, 63, 0.1);
}

.asset-derived-delete-actions .is-danger:hover,
.asset-derived-delete-actions .is-danger:focus-visible {
  border-color: var(--color-danger-strong);
  background: var(--color-danger-strong);
  box-shadow: 0 14px 30px rgba(180, 35, 63, 0.1);
}

@media (max-width: 1080px) {
  .asset-derived-delete-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .asset-derived-delete-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #assetDerivedDeleteModal .asset-derived-delete-modal {
    max-height: calc(100vh - 20px);
    border-radius: var(--radius-card);
  }

  .asset-derived-delete-head,
  .asset-derived-delete-toolbar,
  .asset-derived-delete-actions {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .asset-derived-delete-head {
    padding-left: var(--space-6);
  }

  .asset-derived-delete-head::before {
    left: var(--space-3);
  }

  .asset-derived-delete-head h3 {
    font-size: 20px;
  }

  .asset-derived-delete-summary-wrap {
    grid-template-columns: 32px minmax(0, 1fr);
    margin: 0 var(--space-4) var(--space-3);
    padding: var(--space-2);
  }

  .asset-derived-delete-link-mark {
    width: 32px;
    height: 32px;
  }

  .asset-derived-delete-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-1);
    padding: 0 var(--space-4) var(--space-3);
  }

  .asset-derived-delete-actions button {
    flex: 1 1 0;
  }
}

@media (max-width: 700px) {
  .asset-derived-delete-select-all,
  .asset-derived-delete-head .icon-button,
  #assetDerivedDeleteModal button.asset-derived-delete-preview {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .asset-derived-delete-card {
    transition: none;
  }

  .asset-derived-delete-card:hover {
    transform: none;
  }
}

.asset-card-move-modal {
  width: min(480px, 100%);
  max-height: min(640px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  border-color: color-mix(in srgb, var(--line) 86%, transparent);
  background: var(--surface);
  padding: 0;
  overflow: hidden;
}

.asset-card-move-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px 12px 18px;
}

.asset-card-move-head strong {
  min-width: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card-move-head button {
  width: 34px;
  min-height: 34px;
  flex: 0 0 34px;
  padding: 0;
}

.asset-card-move-search {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 84%, transparent);
  padding: 0 12px;
  color: var(--muted);
}

.asset-card-move-search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent);
}

.asset-card-move-search .ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.asset-card-move-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  box-shadow: none;
}

.asset-card-move-section-label {
  color: var(--muted);
  padding: 15px 18px 7px;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
}

.asset-card-move-target-list {
  min-height: 220px;
  max-height: min(390px, 52vh);
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 2px 10px 14px;
  overflow: auto;
}

.asset-card-move-target-option {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
}

.asset-card-move-target-option:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-raised));
}

.asset-card-move-target-option.is-selected {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  background: color-mix(in srgb, var(--accent) 13%, var(--surface-raised));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 8%, transparent);
}

.asset-card-move-target-option.is-current {
  background: color-mix(in srgb, var(--line) 28%, transparent);
  cursor: default;
  opacity: 0.68;
}

.asset-card-move-target-option.is-subgroup {
  width: calc(100% - 26px);
  margin-left: 26px;
}

.asset-card-move-target-option .asset-card-menu-glyph {
  color: var(--muted);
}

.asset-card-move-target-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.asset-card-move-target-copy strong,
.asset-card-move-target-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card-move-target-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.asset-card-move-target-copy small {
  color: var(--faint);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

.asset-card-move-target-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 11px;
  font-weight: var(--font-weight-regular);
}

.asset-card-move-target-meta em {
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 42%, transparent);
  color: var(--muted);
  padding: 2px 7px;
  font-size: 9px;
  font-style: normal;
}

.asset-card-move-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 12px;
}

.asset-card-move-footer {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 14px;
}

.asset-card-move-footer > div {
  display: flex;
  gap: 8px;
}

.asset-card-move-footer .primary {
  min-width: 84px;
}

.asset-card-move-new-group {
  color: var(--accent);
}

.asset-card-move-new-group > span:first-child {
  font-size: 18px;
  font-weight: var(--font-weight-medium);
}

.asset-lightbox-shell {
  position: fixed;
  z-index: 260;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 7, 10, 0.86);
  padding: 28px;
  backdrop-filter: blur(10px);
}

.asset-lightbox-frame {
  position: relative;
  max-width: min(92vw, 1500px);
  display: grid;
  justify-items: center;
  gap: 10px;
}

.asset-lightbox-image-button {
  max-width: 100%;
  display: grid;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  cursor: zoom-out;
  overflow: hidden;
}

.asset-lightbox-image-button img {
  max-width: min(90vw, 1440px);
  max-height: 84vh;
  display: block;
  object-fit: contain;
}

.asset-lightbox-close {
  position: absolute;
  z-index: 2;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(20, 22, 27, 0.78);
  color: #fff;
  padding: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.asset-lightbox-title {
  max-width: min(82vw, 760px);
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.is-asset-lightbox-open {
  overflow: hidden;
}

.asset-preview-thumb:focus-visible,
.asset-card-edit-btn:focus-visible,
.asset-card-more-btn:focus-visible,
.asset-card-menu button:focus-visible,
.asset-lightbox-close:focus-visible,
.asset-lightbox-image-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (hover: none) {
  .asset-card-media .asset-select-check,
  .asset-hover-meta,
  .asset-card-secondary-actions {
    opacity: 1;
    transform: none;
  }

  .asset-card-secondary-actions {
    pointer-events: auto;
  }
}

@media (max-width: 760px) {
  .asset-lightbox-shell {
    padding: 16px;
  }

  .asset-lightbox-image-button img {
    max-width: calc(100vw - 32px);
    max-height: 80vh;
  }

  .asset-lightbox-close {
    top: 8px;
    right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .asset-item-card.is-notification-target {
    animation: none;
  }

  .asset-card-media .asset-select-check,
  .asset-hover-meta,
  .asset-card-actions,
  .asset-card-secondary-actions,
  .asset-card-menu,
  .asset-card-menu-chevron {
    transition: none;
  }
}

.asset-trash-time {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: var(--font-weight-regular);
  line-height: 1.3;
}

.asset-item-card p {
  display: -webkit-box;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

.asset-file-details {
  margin-top: 5px;
}

.asset-file-details summary {
  width: max-content;
  max-width: 100%;
  cursor: pointer;
  color: var(--faint);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
  list-style-position: inside;
}

.asset-file-details summary:hover {
  color: var(--muted);
}

.asset-file-details p {
  margin-top: 5px;
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 6px 7px;
  -webkit-line-clamp: 3;
}

.asset-quality-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--accent-hot);
  font-size: 12px;
  letter-spacing: 0;
}

.asset-tag-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.asset-tag-summary span,
.asset-tag-summary em {
  max-width: 100%;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--sage-soft);
  color: #8f3445;
  font-size: 11px;
  font-style: normal;
  line-height: 1;
  padding: 0 7px;
}

.tag-manager-panel {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}

.tag-manager-head,
.tag-merge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tag-manager-head {
  align-items: flex-end;
}

.tag-manager-panel .section-kicker {
  margin-bottom: 4px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.tag-manager-head p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.tag-manager-tools,
.tag-merge-bar {
  flex-wrap: wrap;
}

.tag-manager-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto 140px;
  gap: 6px;
  min-width: min(510px, 52%);
}

.tag-manager-tools input,
.tag-manager-tools button,
.tag-manager-tools select,
.tag-merge-bar select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: var(--surface);
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  box-shadow: none;
}

.tag-manager-tools select,
.tag-merge-bar select {
  padding-right: 32px;
}

.tag-manager-tools .themed-select-trigger,
.tag-merge-bar .themed-select-trigger {
  min-height: 32px;
  border-radius: 9px;
  font-size: 12px;
}

.tag-manager-tools input::placeholder {
  color: #b99aa4;
}

.tag-empty-filter {
  min-width: 78px;
  white-space: nowrap;
}

.tag-empty-filter.is-active {
  border-color: rgba(201, 54, 73, 0.32);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.image-tag-list {
  display: grid;
  gap: 2px;
  overflow: auto;
  width: min(100%, 760px);
  max-height: 520px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.image-tag-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 220px) 132px 38px 128px;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  border-bottom: 0;
  border-radius: 9px;
  padding: 0 10px 0 8px;
  color: var(--ink);
  transition: background 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.image-tag-row:last-child {
  border-bottom: 0;
}

.image-tag-row:hover {
  background: rgba(246, 248, 251, 0.82);
}

.image-tag-row.is-active {
  background: #fff1f3;
  box-shadow:
    inset 4px 0 0 var(--accent),
    0 0 0 1px rgba(201, 54, 73, 0.22),
    0 8px 18px rgba(201, 54, 73, 0.08);
}

.image-tag-row:has([data-image-tag-check]:checked) {
  background: var(--sage-soft);
  box-shadow: 0 0 0 1px rgba(157, 89, 102, 0.18);
}

.image-tag-row.is-active:has([data-image-tag-check]:checked) {
  background: #fff1f3;
  box-shadow:
    inset 4px 0 0 var(--accent),
    0 0 0 1px rgba(201, 54, 73, 0.24),
    0 8px 18px rgba(201, 54, 73, 0.08);
}

.image-tag-main {
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.image-tag-main:hover {
  color: var(--accent-deep);
}

.image-tag-hash {
  width: 16px;
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.image-tag-row.is-active .image-tag-hash,
.image-tag-row:has([data-image-tag-check]:checked) .image-tag-hash {
  border-radius: 5px;
  background: var(--surface);
  color: var(--accent-deep);
}

.image-tag-row.is-active .image-tag-name {
  color: var(--accent-deep);
}

.image-tag-name,
.image-tag-row time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-tag-name {
  color: var(--ink);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0;
}

.image-tag-count {
  justify-self: end;
  min-width: 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  text-align: right;
}

.image-tag-row time {
  color: var(--faint);
  font-size: 10px;
}

.image-tag-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.image-tag-row.is-active .image-tag-actions,
.image-tag-row:hover .image-tag-actions,
.image-tag-row:has([data-image-tag-check]:checked) .image-tag-actions {
  opacity: 1;
}

.image-tag-merge-check {
  width: 20px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.image-tag-merge-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

.image-tag-merge-check span {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.image-tag-merge-check input:checked + span {
  border-color: rgba(201, 54, 73, 0.52);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--surface);
}

.image-tag-actions button {
  min-height: 24px;
  border-color: var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 7px;
  font-size: 10px;
}

.image-tag-actions button:hover {
  border-color: rgba(201, 54, 73, 0.32);
  color: var(--accent-deep);
}

.tag-merge-bar {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  justify-content: flex-start;
}

.tag-merge-bar select {
  flex: 1 1 220px;
  max-width: 420px;
}

.tag-merge-bar .themed-select {
  flex: 1 1 220px;
  max-width: 420px;
}

.tag-merge-bar button {
  min-height: 30px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 9px;
  font-size: 11px;
}

.tag-merge-bar button.is-active {
  border-color: rgba(201, 54, 73, 0.32);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.tag-delete-selected {
  color: var(--accent-deep);
}

.tag-delete-selected:not(:disabled):hover {
  border-color: rgba(201, 54, 73, 0.42);
  background: #fff1f3;
  color: var(--accent-deep);
}

.asset-item-card .row-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) auto;
  gap: 6px;
}

.asset-item-card .row-actions button {
  min-width: 0;
  min-height: 34px;
  padding-inline: 9px;
}

.recipe-toolbar {
  align-items: center;
}

.recipe-workspace {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(520px, 0.72fr) minmax(280px, 360px);
  align-items: start;
  gap: 12px;
}

.recipe-slots-panel {
  display: grid;
  align-content: start;
  gap: 0;
  overflow: visible;
}

.recipe-chain-panel {
  position: sticky;
  top: 88px;
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(201, 54, 73, 0.16);
  border-radius: 12px;
  background: #fff8f9;
  padding: 12px;
}

.recipe-chain-panel .section-kicker {
  margin-bottom: 0;
  color: var(--accent-deep);
}

.recipe-chain-preview {
  display: grid;
  gap: 7px;
  border-radius: 8px;
  background: transparent;
  color: var(--accent-deep);
  padding: 0;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.recipe-chain-preview span {
  display: flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(201, 54, 73, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 0 9px;
}

.recipe-chain-preview i {
  display: none;
}

.recipe-table-head {
  display: grid;
  grid-template-columns: minmax(132px, 0.44fr) minmax(220px, 1fr) 104px;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff8f9;
  color: var(--muted);
  padding: 10px 14px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.recipe-slots {
  display: grid;
  gap: 0;
}

.recipe-slot {
  position: relative;
  display: grid;
  grid-template-columns: minmax(132px, 0.44fr) minmax(220px, 1fr) 104px;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 8px 14px;
  transition: background 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.recipe-slot:last-child {
  border-bottom: 0;
}

.recipe-slot.is-locked {
  background: var(--surface-raised);
}

.recipe-slot.is-dragging {
  opacity: 0.46;
  background: var(--accent-soft);
}

.recipe-slot.is-picker-open {
  z-index: 12;
}

.recipe-slot.is-drop-before::before,
.recipe-slot.is-drop-after::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 54, 73, 0.12);
  z-index: 2;
}

.recipe-slot.is-drop-before::before {
  top: -2px;
}

.recipe-slot.is-drop-after::after {
  bottom: -2px;
}

.recipe-position-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.recipe-position-cell strong {
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.recipe-slot .field {
  gap: 0;
}

.recipe-slot .field > span {
  display: none;
}

.recipe-group-picker {
  position: relative;
  min-width: 0;
}

.recipe-group-trigger {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 5px 10px;
  text-align: left;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.02);
}

.recipe-group-picker.is-open .recipe-group-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201, 54, 73, 0.12);
}

.recipe-group-value,
.recipe-group-chip {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-group-value {
  max-width: 100%;
}

.recipe-group-value.is-empty,
.recipe-group-chip.is-empty {
  background: var(--accent-wash);
  color: var(--muted);
}

.recipe-group-value.is-tone-1,
.recipe-group-chip.is-tone-1 {
  background: var(--tone-1);
}

.recipe-group-value.is-tone-2,
.recipe-group-chip.is-tone-2 {
  background: var(--tone-2);
}

.recipe-group-value.is-tone-3,
.recipe-group-chip.is-tone-3 {
  background: var(--tone-3);
}

.recipe-group-value.is-tone-4,
.recipe-group-chip.is-tone-4 {
  background: var(--tone-4);
}

.recipe-group-value.is-tone-5,
.recipe-group-chip.is-tone-5 {
  background: var(--tone-5);
}

.recipe-group-chevron {
  width: 10px;
  height: 10px;
  justify-self: center;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 140ms ease, border-color 140ms ease;
}

.recipe-group-picker.is-open .recipe-group-chevron {
  border-color: var(--accent);
  transform: rotate(225deg) translateY(-1px);
}

.recipe-group-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(100%, 360px);
  min-width: min(360px, 80vw);
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px;
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.16);
  z-index: 30;
}

.recipe-group-search {
  min-height: 38px;
  border-color: transparent;
  border-bottom-color: var(--line);
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 14px;
}

.recipe-group-search:focus {
  border-color: transparent;
  border-bottom-color: var(--accent);
  box-shadow: none;
}

.recipe-group-options {
  display: grid;
  gap: 4px;
  max-height: 246px;
  overflow: auto;
}

.recipe-group-option {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 4px 8px;
  text-align: left;
}

.recipe-group-option:hover,
.recipe-group-option.is-selected {
  background: var(--accent-wash);
  color: var(--ink-strong);
}

.recipe-group-option.is-selected::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: var(--accent);
  mask: url("/assets/icons/ui-check.svg") center / 15px 15px no-repeat;
  -webkit-mask: url("/assets/icons/ui-check.svg") center / 15px 15px no-repeat;
}

.recipe-group-option.is-selected .recipe-group-chip {
  margin-left: 2px;
}

.recipe-group-empty {
  padding: 10px 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: var(--font-weight-regular);
}

.recipe-drag-handle,
.recipe-lock-mark {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
}

.recipe-drag-handle {
  cursor: grab;
  padding: 0;
}

.recipe-drag-handle:active {
  cursor: grabbing;
}

.recipe-lock-mark {
  color: var(--faint);
}

.recipe-slot-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.recipe-slot-actions .icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.recipe-fixed-label {
  min-width: 42px;
  color: var(--faint);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  text-align: center;
}

.visual-card {
  position: relative;
  min-height: 230px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 12px;
  background: linear-gradient(145deg, #fff8f9 0%, #ffffff 58%, #fff1f3 100%);
  background-size: cover;
  background-position: center;
  color: var(--ink);
  padding: 14px;
  overflow: hidden;
}

.visual-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.72));
  pointer-events: none;
}

.visual-card > * {
  position: relative;
  z-index: 1;
}

.visual-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.visual-card-top span,
.visual-card-top em {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.visual-card-top span {
  background: var(--accent);
  color: #fff;
}

.visual-card-top em {
  max-width: 58%;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-card strong {
  color: var(--ink-strong);
  font-size: 20px;
  line-height: 1.28;
}

.visual-card p {
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
}

.visual-card small {
  display: -webkit-box;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px));
  gap: 12px;
}

.template-box,
.appearance-panel,
.usage-box,
.cover-demo-panel,
.case-study-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  padding: 14px;
}

.usage-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.appearance-panel {
  display: grid;
  gap: 10px;
}

.appearance-mode-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.appearance-mode-button {
  min-width: 0;
  min-height: 72px;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 12px;
  text-align: left;
}

.appearance-mode-button:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, transparent);
  background: var(--accent-wash);
}

.appearance-mode-button.is-active {
  border-color: var(--accent);
  background: var(--accent-wash);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.appearance-mode-button strong {
  min-width: 0;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.appearance-mode-button em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-box p {
  color: var(--muted);
  font-weight: var(--font-weight-regular);
  line-height: 1.62;
}

.state-conflict-card {
  width: min(620px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  border-top: 4px solid #d97706;
}

.state-conflict-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, #f59e0b 18%, var(--surface));
  color: #b45309;
  font-size: 25px;
  font-weight: var(--font-weight-bold);
}

.state-conflict-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.state-conflict-copy h3,
.state-conflict-copy p {
  margin: 0;
}

.state-conflict-copy > p:last-of-type {
  color: var(--muted);
  line-height: 1.65;
}

.state-conflict-notes {
  display: grid;
  gap: 7px;
  border-radius: 10px;
  background: var(--surface-raised);
  padding: 11px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.state-conflict-notes span::before {
  content: "•";
  margin-right: 7px;
  color: #d97706;
}

.state-conflict-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .state-conflict-card {
    grid-template-columns: 1fr;
  }

  .state-conflict-actions {
    grid-column: 1;
  }

  .state-conflict-actions button {
    width: 100%;
  }
}

.cover-demo-panel {
  display: grid;
  gap: 12px;
}

.cover-demo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cover-demo-head p {
  color: var(--muted);
  line-height: 1.62;
}

.cover-demo-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.cover-demo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}

.cover-demo-card {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px;
}

.cover-demo-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  object-fit: cover;
  background: #f7ecef;
}

.cover-demo-card strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover-demo-card .icon-button {
  position: absolute;
  top: 6px;
  right: 6px;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(17, 24, 39, 0.42);
  color: #fff;
}

.case-study-panel {
  display: grid;
  gap: 14px;
}

.case-study-head,
.case-editor-head,
.case-slot-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.case-study-head h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 18px;
}

.case-study-head p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.case-study-actions,
.case-slot-actions,
.case-study-list-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.case-study-learn-menu {
  position: relative;
}

.case-study-learn-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: 248px;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 8px;
  box-shadow: var(--shadow);
}

.case-study-learn-dropdown button {
  min-height: 58px;
  display: grid;
  justify-items: start;
  gap: 2px;
  border-color: transparent;
  border-radius: 9px;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
}

.case-study-learn-dropdown button:hover {
  background: var(--accent-soft);
}

.case-study-learn-dropdown span {
  color: var(--ink-strong);
  font-weight: var(--font-weight-semibold);
}

.case-study-learn-dropdown em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: var(--font-weight-regular);
  line-height: 1.35;
}

.case-study-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  min-height: 360px;
}

.case-study-sidebar {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.case-study-filter {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 10px;
}

.case-study-filter span {
  margin-bottom: 6px;
}

.case-study-list,
.case-study-editor {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.case-study-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 468px;
  overflow: auto;
  padding: 10px;
}

.case-study-list-item {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(105, 117, 134, 0.14);
  border-radius: 10px;
  background: var(--surface-raised);
  padding: 8px;
}

.case-study-list-item.is-active {
  border-color: rgba(201, 54, 73, 0.46);
  background: #fff8f8;
}

.case-study-list-item > button {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
}

.case-study-list-item img,
.case-study-empty-thumb {
  width: 52px;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  object-fit: cover;
  background: #f7ecef;
}

.case-study-empty-thumb {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: var(--font-weight-semibold);
}

.case-study-list-item strong,
.case-study-list-item em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-study-list-item strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.case-study-list-item em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.case-study-editor {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
}

.case-editor-head strong {
  display: block;
  margin-top: 5px;
  color: var(--ink-strong);
  font-size: 16px;
}

.case-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--muted);
  padding: 0 9px;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
}

.case-status.is-learned {
  background: #fff0f2;
  color: #8f3445;
}

.case-status.is-error {
  background: #fff0f0;
  color: var(--accent-deep);
}

.case-status.is-learning,
.case-status.is-analyzing {
  background: #fff0e8;
  color: #9d3a43;
}

.case-editor-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
}

.case-slot-list {
  display: grid;
  gap: 10px;
}

.case-slot-add-card {
  min-height: 76px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 1px dashed rgba(201, 54, 73, 0.38);
  border-radius: 12px;
  background: #fff8f8;
  color: var(--accent-deep);
  text-align: center;
}

.case-slot-add-card span {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.case-slot-add-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.case-slot-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  padding: 10px;
}

.case-slot-card:focus {
  border-color: rgba(201, 54, 73, 0.48);
  box-shadow: 0 0 0 4px rgba(201, 54, 73, 0.08);
  outline: none;
}

.case-slot-image img,
.case-slot-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 9px;
  object-fit: cover;
  background: #f7ecef;
}

.case-slot-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px dashed rgba(105, 117, 134, 0.24);
  color: var(--muted);
  font-weight: var(--font-weight-semibold);
}

.case-slot-placeholder em {
  color: var(--faint);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.case-slot-fields {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.case-slot-topline .field {
  flex: 1 1 180px;
}

.case-slot-analysis,
.case-learning-result,
.case-learning-error {
  border: 1px solid rgba(105, 117, 134, 0.14);
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--muted);
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.55;
}

.case-slot-analysis strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-strong);
}

.case-slot-analysis .is-error,
.case-learning-error {
  color: var(--accent-deep);
}

.case-learning-result summary {
  cursor: pointer;
  color: var(--ink-strong);
  font-weight: var(--font-weight-semibold);
}

.case-learning-result p {
  margin: 8px 0;
}

.case-learning-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(105, 117, 134, 0.14);
}

.case-learning-summary strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.case-learning-summary span {
  color: var(--muted);
  font-size: 12px;
}

.case-learning-block {
  padding: 10px 0;
  border-bottom: 1px solid rgba(105, 117, 134, 0.12);
}

.case-learning-block:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.case-learning-block > strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-strong);
  font-size: 12px;
}

.case-learning-block ul {
  margin: 0;
  padding-left: 18px;
}

.case-learning-block li + li {
  margin-top: 4px;
}

.case-learning-slot-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.case-learning-slot {
  min-width: 0;
  border: 1px solid rgba(105, 117, 134, 0.14);
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.7);
}

.case-learning-slot span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-strong);
  font-weight: var(--font-weight-semibold);
}

.case-learning-slot em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
}

.section-kicker {
  margin-bottom: 9px;
  color: var(--ink);
}

.template-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weight-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.weight-row {
  display: grid;
  grid-template-columns: 1fr 76px 18px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  padding: 10px;
}

.weight-row span,
.weight-row em {
  color: var(--muted);
  font-style: normal;
}

.settings-actions {
  margin-top: 16px;
}

body[data-current-view="settings"] .shell {
  padding: 12px 18px 18px;
}

body[data-current-view="settings"] .global-notice {
  display: none;
}

body[data-current-view="settings"] #settingsView {
  margin-top: 0;
}

body[data-current-view="settings"] #settingsView > .section-heading {
  display: none;
}

body[data-current-view="settings"] #settingsView .eyebrow {
  margin-bottom: 2px;
  font-size: 11px;
}

body[data-current-view="settings"] #settingsView h2 {
  font-size: 20px;
}

body[data-current-view="settings"] #settingsView > .section-heading p:last-child {
  max-width: none;
  font-size: 13px;
  line-height: 1.35;
}

body[data-current-view="settings"] #settingsView .settings-card {
  margin-top: 6px;
  padding: 12px;
}

body[data-current-view="settings"] .system-settings {
  gap: 10px;
}

body[data-current-view="settings"] .settings-source-panel {
  grid-template-columns: minmax(130px, 178px) minmax(0, 1fr);
  align-items: start;
  gap: 8px 12px;
  padding-bottom: 10px;
}

body[data-current-view="settings"] .settings-source-panel > div:first-child {
  padding-top: 3px;
}

body[data-current-view="settings"] .settings-source-panel > div:first-child p {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
}

body[data-current-view="settings"] .settings-command-strip {
  grid-template-columns: minmax(260px, 1fr) minmax(130px, 176px) auto;
  gap: 8px;
  padding: 8px;
}

body[data-current-view="settings"] .field {
  gap: 4px;
}

body[data-current-view="settings"] .field > span,
body[data-current-view="settings"] summary {
  font-size: 12px;
}

body[data-current-view="settings"] input,
body[data-current-view="settings"] select {
  min-height: 36px;
  border-radius: 9px;
  padding: 6px 10px;
}

body[data-current-view="settings"] select {
  padding-right: 32px;
}

body[data-current-view="settings"] .themed-select-trigger {
  min-height: 36px;
  border-radius: 9px;
}

body[data-current-view="settings"] button {
  min-height: 36px;
  border-radius: 9px;
}

body[data-current-view="settings"] .settings-file-drawer {
  grid-column: 1 / -1;
  padding: 7px 10px;
}

body[data-current-view="settings"] .settings-file-drawer[open] {
  max-height: 126px;
  overflow: auto;
}

body[data-current-view="settings"] .settings-main-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 10px;
  align-items: start;
}

body[data-current-view="settings"] .settings-left-panel,
body[data-current-view="settings"] .settings-side-panel {
  display: grid;
  gap: 8px;
}

body[data-current-view="settings"] .settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body[data-current-view="settings"] .settings-grid .small-field {
  max-width: none;
}

body[data-current-view="settings"] .template-box,
body[data-current-view="settings"] .appearance-panel,
body[data-current-view="settings"] .theme-panel,
body[data-current-view="settings"] .usage-box,
body[data-current-view="settings"] .cover-demo-panel,
body[data-current-view="settings"] .case-study-panel {
  margin-top: 0;
  border-radius: 10px;
  padding: 10px;
}

.theme-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.theme-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.theme-panel-head p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.color-theme-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.color-theme-card {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  padding: 8px;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.color-theme-card:hover {
  border-color: rgba(201, 54, 73, 0.32);
  background: var(--accent-wash);
  color: var(--ink-strong);
}

.color-theme-card.is-active {
  border-color: var(--accent);
  background: var(--accent-wash);
  box-shadow: 0 0 0 3px rgba(201, 54, 73, 0.1);
}

.theme-swatch-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 30px;
  overflow: hidden;
  border-radius: 8px;
}

.theme-swatch-row span {
  min-width: 0;
}

.theme-card-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.theme-card-copy strong,
.theme-card-copy em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-card-copy strong {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.theme-card-copy em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

body[data-current-view="settings"] .section-kicker {
  margin-bottom: 5px;
}

body[data-current-view="settings"] .template-preview {
  gap: 6px;
}

body[data-current-view="settings"] .template-box-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

body[data-current-view="settings"] .template-box-head .section-kicker {
  margin-bottom: 2px;
}

body[data-current-view="settings"] .template-mode-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

body[data-current-view="settings"] .schedule-custom-button {
  min-width: 62px;
  min-height: 28px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-raised));
  color: var(--accent-deep);
  padding: 0 12px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
}

body[data-current-view="settings"] .schedule-custom-button:hover,
body[data-current-view="settings"] .schedule-custom-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 58%, transparent);
  background: var(--accent-wash);
  color: var(--accent-deep);
}

body[data-current-view="settings"] .schedule-custom-button.is-active::before {
  width: 6px;
  height: 6px;
  content: "";
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

body[data-current-view="settings"] .schedule-customization-editor {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  padding-top: 12px;
}

body[data-current-view="settings"] .schedule-customization-editor[hidden] {
  display: none;
}

body[data-current-view="settings"] .schedule-editor-intro,
body[data-current-view="settings"] .schedule-editor-section-head,
body[data-current-view="settings"] .schedule-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body[data-current-view="settings"] .schedule-editor-intro strong,
body[data-current-view="settings"] .schedule-editor-section-head strong {
  color: var(--ink-strong);
  font-size: 12px;
}

body[data-current-view="settings"] .schedule-editor-intro span,
body[data-current-view="settings"] .schedule-editor-section-head span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
}

body[data-current-view="settings"] .schedule-editor-cycle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(96px, 0.9fr);
  align-items: end;
  gap: 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--canvas) 68%, var(--surface));
  padding: 10px;
}

body[data-current-view="settings"] .schedule-editor-cycle label,
body[data-current-view="settings"] .schedule-cycle-total {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

body[data-current-view="settings"] .schedule-cycle-mark {
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

body[data-current-view="settings"] .schedule-cycle-total strong {
  min-height: 32px;
  display: flex;
  align-items: center;
  color: var(--ink-strong);
  font-size: 13px;
}

body[data-current-view="settings"] .schedule-number-field {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-radius: 8px;
  background: var(--surface-raised);
  padding-right: 8px;
}

body[data-current-view="settings"] .schedule-number-field input {
  min-width: 0;
  width: 100%;
  min-height: 32px;
  border: 0;
  background: transparent;
  padding: 0 8px;
  color: var(--ink-strong);
}

body[data-current-view="settings"] .schedule-number-field em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

body[data-current-view="settings"] .schedule-editor-section {
  display: grid;
  gap: 7px;
}

body[data-current-view="settings"] .schedule-editor-rows {
  display: grid;
  gap: 5px;
}

body[data-current-view="settings"] .schedule-editor-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 68px;
  align-items: center;
  gap: 7px;
}

body[data-current-view="settings"] .schedule-row-name {
  color: var(--muted);
  font-size: 10px;
}

body[data-current-view="settings"] .schedule-editor-row > input {
  min-width: 0;
  width: 100%;
  min-height: 32px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--canvas) 68%, var(--surface));
  padding: 0 9px;
  color: var(--ink-strong);
  font-size: 11px;
}

body[data-current-view="settings"] .schedule-editor-row > input:focus,
body[data-current-view="settings"] .schedule-number-field:focus-within {
  outline: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 1px;
}

body[data-current-view="settings"] .schedule-number-field input:focus,
body[data-current-view="settings"] .schedule-number-field input:focus-visible {
  outline: 0;
  box-shadow: none;
}

body[data-current-view="settings"] .schedule-fixed-count {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  color: var(--muted);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

body[data-current-view="settings"] .schedule-editor-balance {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
}

body[data-current-view="settings"] .schedule-editor-balance strong {
  color: var(--ink-strong);
  font-size: 12px;
}

body[data-current-view="settings"] .schedule-editor-balance span {
  color: var(--muted);
  font-size: 10px;
}

body[data-current-view="settings"] .schedule-editor-balance span[data-state="valid"] {
  color: #4b996a;
}

body[data-current-view="settings"] .schedule-editor-balance span[data-state="invalid"] {
  color: var(--accent-deep);
}

body[data-current-view="settings"] .schedule-editor-actions {
  display: flex;
  justify-content: flex-start;
  gap: 6px;
}

body[data-current-view="settings"] .schedule-editor-actions .button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 10px;
}

body[data-current-view="settings"] .schedule-restore-button {
  color: var(--accent-deep);
}

body[data-current-view="settings"] .template-token {
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

body[data-current-view="settings"] .usage-box {
  gap: 10px;
}

body[data-current-view="settings"] .usage-box p,
body[data-current-view="settings"] .cover-demo-head p {
  font-size: 12px;
  line-height: 1.35;
}

body[data-current-view="settings"] .cover-demo-panel {
  gap: 8px;
}

body[data-current-view="settings"] .cover-demo-head {
  align-items: center;
  gap: 10px;
}

body[data-current-view="settings"] .cover-demo-actions {
  flex: 0 0 auto;
  gap: 6px;
}

body[data-current-view="settings"] .cover-demo-list {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  max-height: 118px;
  overflow: auto;
}

body[data-current-view="settings"] .cover-demo-list .empty-state {
  grid-column: 1 / -1;
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
}

body[data-current-view="settings"] .cover-demo-card {
  gap: 4px;
  border-radius: 8px;
  padding: 5px;
}

body[data-current-view="settings"] .cover-demo-card img {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
}

body[data-current-view="settings"] .cover-demo-card strong {
  font-size: 10px;
}

body[data-current-view="settings"] .case-study-workspace {
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 320px;
}

body[data-current-view="settings"] .case-study-list {
  max-height: 408px;
}

body[data-current-view="settings"] .case-study-filter {
  padding: 8px;
}

body[data-current-view="settings"] .case-study-editor {
  padding: 10px;
}

body[data-current-view="settings"] .case-slot-card {
  grid-template-columns: 92px minmax(0, 1fr);
}

body[data-current-view="settings"] .settings-actions {
  margin-top: 0;
}

body[data-current-view="settings"] .settings-actions .primary {
  width: 100%;
}

@media (max-width: 980px) {
  body[data-current-view="settings"] #settingsView > .section-heading,
  body[data-current-view="settings"] .settings-source-panel,
  body[data-current-view="settings"] .settings-command-strip,
  body[data-current-view="settings"] .settings-main-panel,
  body[data-current-view="settings"] .settings-grid,
  body[data-current-view="settings"] .appearance-mode-list,
  body[data-current-view="settingsCaseLibrary"] .case-study-workspace {
    grid-template-columns: 1fr;
  }

  body[data-current-view="settings"] .settings-source-panel > div:first-child {
    padding-top: 0;
  }

  body[data-current-view="settingsCaseLibrary"] .case-study-list,
  body[data-current-view="settingsCaseLibrary"] .case-study-editor {
    max-height: none;
    min-height: 0;
  }
}

@media (max-width: 620px) {
  body[data-current-view="settings"] .schedule-editor-cycle {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  body[data-current-view="settings"] .schedule-editor-cycle .schedule-cycle-mark:nth-of-type(2),
  body[data-current-view="settings"] .schedule-cycle-total {
    display: none;
  }

  body[data-current-view="settings"] .schedule-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-current-view="settings"] .schedule-editor-actions {
    flex-wrap: wrap;
  }

  body[data-current-view="settings"] .schedule-editor-actions .button {
    flex: 1 1 auto;
  }
}

/* --------------------------------------------------------------------------
   Night appearance — borderless, softly layered surfaces

   The light UI establishes hierarchy with nearby background tones rather than
   outlines. Keep the same visual language at night: a warm graphite canvas,
   slightly lifted work surfaces, and borders reserved for focus/selection.
   -------------------------------------------------------------------------- */
body[data-appearance="deep-dark"] {
  --canvas: #211f1d;
  --surface: #292725;
  --surface-raised: #302d2a;
  --surface-soft: #35322f;
  --surface-muted: #35322f;
  --surface-tint: #3a2d2d;
  --ink: #eee9e4;
  --ink-strong: #fffaf5;
  --muted: #b9b1aa;
  --faint: #837b75;
  --line: transparent;
  --line-strong: transparent;
  --accent: #ef7c80;
  --accent-deep: #ff9b91;
  --accent-hot: #f3a261;
  --accent-soft: #423031;
  --accent-wash: #382b2c;
  --blush: #995d61;
  --rose: #ef7c80;
  --tone-1: #382b2c;
  --tone-2: #43302f;
  --tone-3: #563b36;
  --tone-4: #3b342b;
  --tone-5: #433234;
  --sage: #d7aa79;
  --sage-soft: #3a3229;
  --amber: #f3a261;
  --nav: #1b1a18;
  --nav-soft: #262421;
  --nav-muted: #b9b1aa;
  --blue-select: #ef7c80;
  --border-color: transparent;
  --text-primary: var(--ink-strong);
  --text-secondary: var(--muted);
  --danger-color: #ff948d;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.12);
  background:
    radial-gradient(circle at 78% -12%, rgba(239, 124, 128, 0.055), transparent 34%),
    var(--canvas);
}

body[data-appearance="deep-dark"] .sidebar,
body[data-appearance="deep-dark"] .account-popover {
  background: var(--nav);
}

body[data-appearance="deep-dark"] .sidebar {
  border-right-color: transparent;
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.1);
}

body[data-appearance="deep-dark"] .sidebar-brand,
body[data-appearance="deep-dark"] .sidebar-title,
body[data-appearance="deep-dark"] .account-popover-meta,
body[data-appearance="deep-dark"] .settings-source-panel,
body[data-appearance="deep-dark"] .keyword-card-head,
body[data-appearance="deep-dark"] .pool-list-head,
body[data-appearance="deep-dark"] .knowledge-library-head,
body[data-appearance="deep-dark"] .account-table-row,
body[data-appearance="deep-dark"] .case-learning-summary,
body[data-appearance="deep-dark"] .case-learning-block {
  border-color: transparent;
}

body[data-appearance="deep-dark"] :where(
  .command-strip,
  .file-drawer,
  .calendar-table,
  .pool-workspace,
  .settings-card,
  .create-grid,
  .account-hero,
  .account-section,
  .speech-topbar,
  .speech-panel,
  .knowledge-workspace,
  .keyword-strategy-hero,
  .keyword-card,
  .radar-command-panel,
  .radar-wordcloud-panel,
  .radar-results-panel,
  .radar-progress-panel,
  .radar-semantic-panel,
  .settings-card,
  .recipe-slots-panel,
  .recipe-chain-panel,
  .asset-item-form,
  .asset-browser-panel,
  .tag-manager-panel,
  .visual-card,
  .appearance-panel,
  .theme-panel,
  .cover-demo-panel,
  .case-study-panel,
  .free-create-modal-card,
  .free-create-progress-card,
  .free-create-notice-card
) {
  border-color: transparent;
  background-color: var(--surface);
  box-shadow: var(--shadow-soft);
}

body[data-appearance="deep-dark"] :where(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .themed-select-trigger,
  .account-file-card,
  .speech-prompt-item,
  .knowledge-stat,
  .knowledge-asset-card,
  .keyword-strategy-summary > div,
  .keyword-pill,
  .pool-card,
  .radar-rule-card,
  .radar-info-popover,
  .radar-card,
  .chase-hit-card,
  .asset-item-card,
  .image-tag-row,
  .weight-row,
  .color-theme-card,
  .case-slot-card,
  .case-slot-analysis,
  .case-learning-result,
  .case-learning-error,
  .case-learning-slot
) {
  border-color: transparent;
  background-color: var(--surface-raised);
  box-shadow: none;
}

body[data-appearance="deep-dark"] :where(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .themed-select-trigger
) {
  background: var(--surface-soft);
  box-shadow: none;
}

body[data-appearance="deep-dark"] :where(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .themed-select-trigger
):hover {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-soft) 82%, var(--accent) 18%);
}

body[data-appearance="deep-dark"] :where(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .themed-select-trigger
):focus,
body[data-appearance="deep-dark"] .themed-select.is-open .themed-select-trigger {
  border-color: transparent;
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
}

body[data-appearance="deep-dark"] .themed-select-menu,
body[data-appearance="deep-dark"] :where(
  .radar-wordcloud-modal-card,
  .image-picker-modal-card,
  .asset-group-drawer,
  .modal-card
) {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-raised) 94%, var(--accent-wash));
  box-shadow: var(--shadow);
}

body[data-appearance="deep-dark"] :where(
  .sidebar-item,
  .sidebar-control,
  .knowledge-category-item,
  .speech-prompt-item,
  .color-theme-card,
  .account-file-card,
  .pool-card,
  .knowledge-asset-card,
  .image-tag-row
):hover {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-raised) 84%, var(--accent) 16%);
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"] .sidebar-item.is-active,
body[data-appearance="deep-dark"] .account-entry[aria-expanded="true"] {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-raised) 78%, var(--accent) 22%);
  color: var(--ink-strong);
  box-shadow: none;
}

body[data-appearance="deep-dark"] :where(
  .knowledge-category-item.is-active,
  .knowledge-asset-card.is-active,
  .speech-prompt-item.is-active,
  .color-theme-card.is-active,
  .asset-item-card.is-selected,
  .image-tag-row.is-active
) {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-raised) 72%, var(--accent) 28%);
  box-shadow: inset 3px 0 0 var(--accent);
}

body[data-appearance="deep-dark"] .creation-mode-tabs .creation-mode-tab {
  border: 0;
  background: var(--surface-raised);
  color: var(--muted);
}

body[data-appearance="deep-dark"] .creation-mode-tabs .creation-mode-tab:hover,
body[data-appearance="deep-dark"] .creation-mode-tabs .creation-mode-tab:focus-visible {
  background: var(--surface-soft);
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"] .creation-mode-tabs .creation-mode-tab.is-active,
body[data-appearance="deep-dark"] .creation-mode-tabs .creation-mode-tab.is-active:hover,
body[data-appearance="deep-dark"] .creation-mode-tabs .creation-mode-tab.is-active:focus-visible {
  background: var(--accent);
  color: #211817;
}

body[data-appearance="deep-dark"] .calendar-date-section,
body[data-appearance="deep-dark"] .calendar-date-section:nth-child(even) {
  border-color: transparent;
  background: var(--surface-raised);
  box-shadow: none;
}

body[data-appearance="deep-dark"] .calendar-date-section.is-pinned {
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--accent) 12%);
}

body[data-appearance="deep-dark"] :where(
  .knowledge-category-panel,
  .knowledge-library-panel,
  .knowledge-asset-editor-panel,
  .pool-form,
  .pool-list-panel
) {
  border-color: transparent;
}

body[data-appearance="deep-dark"] .knowledge-category-panel,
body[data-appearance="deep-dark"] .knowledge-asset-editor-panel,
body[data-appearance="deep-dark"] .pool-list-panel {
  background: var(--surface-raised);
}

body[data-appearance="deep-dark"] .knowledge-library-panel,
body[data-appearance="deep-dark"] .pool-form {
  background: var(--surface);
}

body[data-appearance="deep-dark"] :where(
  .speech-result,
  .knowledge-editor,
  .case-slot-add-card,
  .knowledge-legacy-notice,
  .knowledge-legacy-notice pre
) {
  border-color: transparent;
  background: var(--surface-soft);
  color: var(--ink);
}

body[data-appearance="deep-dark"] :where(
  .calendar-status-pill,
  .keyword-strategy-status,
  .radar-status-chip,
  .status-pill,
  .type-chip,
  .template-token
) {
  border-color: transparent;
}

body[data-appearance="deep-dark"] button:not(.primary):not(.sidebar-item):not(.sidebar-control):not(.creation-mode-tab) {
  border-color: transparent;
}

body[data-appearance="deep-dark"] button:not(.primary):not(.sidebar-item):not(.sidebar-control):not(.creation-mode-tab):hover {
  border-color: transparent;
}

body[data-appearance="deep-dark"] ::placeholder {
  color: #8e8580;
}

/* Radar has intentionally high-specificity light controls; normalize them too. */
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-search-field input,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-search-field input:hover,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-search-field input:focus {
  border-color: transparent;
  background: var(--surface-soft);
  background-color: var(--surface-soft);
  color: var(--ink-strong);
  box-shadow: none;
}

body[data-appearance="deep-dark"] .radar-pagination .radar-page-arrow,
body[data-appearance="deep-dark"] .radar-pagination .radar-page-number,
body[data-appearance="deep-dark"] .radar-card-actions a {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

body[data-appearance="deep-dark"] .radar-pagination .radar-page-arrow:hover:not(:disabled),
body[data-appearance="deep-dark"] .radar-pagination .radar-page-number:hover:not(.is-active),
body[data-appearance="deep-dark"] .radar-card-actions a:hover {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-soft) 80%, var(--accent) 20%);
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"] .radar-pagination .radar-page-number.is-active {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-soft));
  color: color-mix(in srgb, var(--accent) 82%, white);
}

body[data-appearance="deep-dark"] .radar-select input {
  border-color: color-mix(in srgb, var(--ink) 36%, transparent);
  background: transparent;
}

body[data-appearance="deep-dark"] .radar-select input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

body[data-appearance="deep-dark"] .radar-track-button:hover,
body[data-appearance="deep-dark"] .radar-track-button:focus-visible,
body[data-appearance="deep-dark"] .radar-track-button.is-tracked,
body[data-appearance="deep-dark"] .radar-track-button.is-tracked:hover,
body[data-appearance="deep-dark"] .radar-track-button.is-tracked:focus-visible {
  background: color-mix(in srgb, var(--surface-soft) 72%, #f2b705 28%);
}

/* Material toolbar follows the same quiet, borderless control treatment. */
body[data-appearance="deep-dark"][data-current-view="material"] .asset-toolbar-actions button:not(.asset-upload-trigger),
body[data-appearance="deep-dark"][data-current-view="material"] .asset-toolbar-actions .secondary,
body[data-appearance="deep-dark"][data-current-view="material"] .asset-toolbar-actions .ghost,
body[data-appearance="deep-dark"][data-current-view="material"] .asset-shooting-list-link,
body[data-appearance="deep-dark"][data-current-view="material"] .asset-annotation-search {
  border-color: transparent;
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: none;
}

body[data-appearance="deep-dark"][data-current-view="material"] .asset-toolbar-actions button:not(.asset-upload-trigger):hover,
body[data-appearance="deep-dark"][data-current-view="material"] .asset-toolbar-actions button:not(.asset-upload-trigger):focus-visible,
body[data-appearance="deep-dark"][data-current-view="material"] .asset-shooting-list-link:hover,
body[data-appearance="deep-dark"][data-current-view="material"] .asset-shooting-list-link:focus-visible,
body[data-appearance="deep-dark"][data-current-view="material"] .asset-annotation-search:focus-within {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-soft) 80%, var(--accent) 20%);
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"][data-current-view="material"] .asset-toolbar-actions button.is-active,
body[data-appearance="deep-dark"][data-current-view="material"] #assetTrashBtn.is-active,
body[data-appearance="deep-dark"][data-current-view="material"] #assetCollapseAllBtn.is-active {
  background: var(--accent-wash);
  color: var(--accent-deep);
}

body[data-appearance="deep-dark"] .asset-upload-dropdown,
body[data-appearance="deep-dark"] .asset-upload-option {
  border-color: transparent;
  background: var(--surface-raised);
  color: var(--ink);
}

body[data-appearance="deep-dark"] .asset-upload-option:hover,
body[data-appearance="deep-dark"] .asset-upload-option:focus-visible {
  background: color-mix(in srgb, var(--surface-raised) 80%, var(--accent) 20%);
}

body[data-appearance="deep-dark"] .asset-item-card,
body[data-appearance="deep-dark"] .asset-item-card:hover {
  border-color: transparent;
  box-shadow: none;
}

body[data-appearance="deep-dark"] .asset-select-check {
  border-color: transparent;
  background: transparent;
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"] .asset-select-check span {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(248, 248, 249, 0.92);
}

body[data-appearance="deep-dark"] .asset-select-check input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
}

/* Structured creation knowledge library. Kept last to survive global workbench flattening. */
body[data-current-view="knowledge"] .knowledge-workspace {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: 0 14px 38px rgba(42, 29, 34, 0.045);
}

body[data-current-view="knowledge"] .knowledge-category-panel,
body[data-current-view="knowledge"] .knowledge-library-panel,
body[data-current-view="knowledge"] .knowledge-asset-editor-panel {
  background-color: var(--surface-raised);
}

body[data-current-view="knowledge"] .knowledge-category-panel {
  background-color: color-mix(in srgb, var(--surface-soft) 78%, var(--surface-raised));
}

body[data-current-view="knowledge"] .knowledge-asset-editor-panel {
  background-color: color-mix(in srgb, var(--surface-soft) 36%, var(--surface-raised));
}

@media (max-width: 1180px) {
  body[data-current-view="knowledge"] .knowledge-workspace {
    grid-template-columns: 200px minmax(300px, 1fr) minmax(300px, 1fr);
  }

  .knowledge-actions input {
    width: 100%;
  }
}

@media (max-width: 920px) {
  body[data-current-view="knowledge"] .knowledge-workspace {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .knowledge-asset-editor-panel {
    grid-column: 1 / -1;
    min-height: 420px;
    border-top: 1px solid var(--line);
  }

  .knowledge-empty-editor {
    min-height: 300px;
  }
}

@media (max-width: 680px) {
  body[data-current-view="knowledge"] .knowledge-workspace {
    grid-template-columns: 1fr;
    margin-inline: 10px;
  }

  .knowledge-category-panel,
  .knowledge-library-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .knowledge-category-list {
    grid-template-columns: 1fr;
  }

  .knowledge-asset-editor-panel {
    grid-column: 1;
    padding: 16px;
  }
}

/* Keep schedule-to-inbox targeting visible even after hash navigation rerenders the list. */
.final-inbox-item.is-calendar-target,
.final-inbox-item.is-calendar-target:hover,
body:not([data-appearance="deep-dark"]) .final-inbox-item.is-calendar-target,
body:not([data-appearance="deep-dark"]) .final-inbox-item.is-calendar-target:hover {
  border: 1.5px solid color-mix(in srgb, var(--accent) 58%, #ffffff) !important;
  background: color-mix(in srgb, var(--accent-soft) 34%, var(--surface-raised)) !important;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent),
    0 10px 24px color-mix(in srgb, var(--accent) 9%, transparent) !important;
}

.final-inbox-item.is-calendar-target .final-inbox-copy strong {
  color: var(--accent-deep);
}

/* 自由创作：延续现有胭脂红系统，以纸张与编辑批注的感觉呈现。 */
#freeCreateModal,
#singleRewriteModal,
#chaseHitTypeModal,
#freeCreateProgressModal,
#freeCreateNoticeModal { z-index: 220; }
.free-create-modal-card,
.single-rewrite-modal-card,
.chase-hit-type-modal-card,
.free-create-progress-card,
.free-create-notice-card { position: relative; }
.free-create-modal-card { width: min(620px, calc(100vw - 36px)); padding: 28px; border-radius: 24px; overflow: hidden; }
.free-create-modal-card::before { content: ""; position: absolute; width: 260px; height: 260px; right: -130px; top: -150px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, transparent); pointer-events: none; }
.free-create-modal-lead { margin: 3px 0 18px; color: var(--muted); }
.free-create-topic-field { position: relative; display: block; }
.free-create-topic-field textarea { width: 100%; min-height: 190px; resize: vertical; padding: 18px 18px 36px; border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--surface) 93%, var(--accent) 7%); color: var(--ink-strong); line-height: 1.75; transition: border-color .18s ease, box-shadow .18s ease; }
.free-create-topic-field textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 72%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); }
.free-create-topic-field > span { position: absolute; right: 15px; bottom: 12px; color: var(--muted); font-size: 12px; }
.free-create-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.free-create-mode { display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); border-radius: 15px; background: var(--surface); color: var(--ink-strong); text-align: left; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.free-create-mode:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 24px rgba(54, 25, 31, .1); }
.free-create-mode.is-deep { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.free-create-mode-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; background: var(--accent); color: white; font-size: 13px; font-weight: var(--font-weight-semibold); }
.free-create-mode > span:last-child { display: grid; gap: 4px; }
.free-create-mode strong { font-size: 14px; }
.free-create-mode em { color: var(--muted); font-size: 11px; font-style: normal; }

/* 单篇仿写：输入原稿像两张叠放的稿纸，全程无描边，深浅模式只切换材质层级。 */
.single-rewrite-modal-card {
  width: min(700px, calc(100vw - 36px));
  max-height: min(820px, calc(100vh - 36px));
  overflow: auto;
  border: 0;
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 96%, var(--accent) 4%);
  padding: 28px;
  box-shadow: 0 28px 80px color-mix(in srgb, #180d10 24%, transparent);
}
.single-rewrite-modal-head { border: 0; padding-bottom: 5px; }
.single-rewrite-modal-lead { margin: 3px 0 20px; color: var(--muted); line-height: 1.65; }
.single-rewrite-form { display: grid; gap: 12px; }
.single-rewrite-field {
  position: relative;
  display: grid;
  gap: 9px;
  border: 0;
  border-radius: 17px;
  background: color-mix(in srgb, var(--ink) 3%, var(--surface));
  padding: 15px 16px 14px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 42%, transparent);
}
.single-rewrite-field > span { color: var(--ink-strong); font-size: 13px; font-weight: var(--font-weight-semibold); }
.single-rewrite-field input,
.single-rewrite-field textarea {
  width: 100%;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-strong);
  padding: 0 0 20px;
  box-shadow: none;
}
.single-rewrite-field input { height: 34px; font-size: 15px; }
.single-rewrite-field textarea { min-height: 230px; resize: vertical; line-height: 1.75; }
.single-rewrite-field input:focus,
.single-rewrite-field textarea:focus { border: 0; outline: 0; box-shadow: none; }
.single-rewrite-field:focus-within {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--accent) 70%, transparent);
}
.single-rewrite-field > em {
  position: absolute;
  right: 15px;
  bottom: 11px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.single-rewrite-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px 2px 0; }
.single-rewrite-footer > span { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.single-rewrite-footer > span i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 10%, transparent); }
.single-rewrite-footer .primary { min-width: 128px; min-height: 42px; border: 0; border-radius: 12px; }
.single-rewrite-footer .primary:disabled { opacity: .42; }
body[data-appearance="deep-dark"] .single-rewrite-modal-card {
  background: color-mix(in srgb, var(--surface) 92%, #000 8%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48);
}
body[data-appearance="deep-dark"] .single-rewrite-field {
  background: color-mix(in srgb, var(--surface-soft) 84%, #000 16%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}
body[data-appearance="deep-dark"] .single-rewrite-field:focus-within {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--accent) 78%, transparent);
}
.chase-hit-type-modal-card { width: min(720px, calc(100vw - 36px)); max-height: min(780px, calc(100vh - 36px)); padding: 28px; border-radius: 24px; overflow: auto; }
.chase-hit-type-modal-lead { margin: 3px 0 18px; color: var(--muted); line-height: 1.65; }
.chase-hit-type-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chase-hit-type-option { display: grid; gap: 7px; min-height: 82px; padding: 15px 16px; border: 1px solid color-mix(in srgb, var(--ink) 11%, transparent); border-radius: 15px; background: var(--surface); color: var(--ink-strong); text-align: left; box-shadow: none; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.chase-hit-type-option:hover:not(:disabled) { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 9%, transparent); }
.chase-hit-type-option.is-selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.chase-hit-type-option:disabled { cursor: not-allowed; opacity: .48; }
.chase-hit-type-option strong { font-size: 15px; }
.chase-hit-type-option span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.chase-hit-type-status { min-height: 22px; margin: 15px 2px 0; color: var(--muted); font-size: 12px; }
.chase-hit-type-actions { margin-top: 18px; }
.free-create-progress-card { width: min(680px, calc(100vw - 36px)); padding: 34px 36px 30px; border-radius: 24px; text-align: center; }
.free-progress-orbit { position: relative; width: 66px; height: 66px; margin: 0 auto 18px; }
.free-progress-orbit span { position: absolute; inset: 8px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 13%, transparent); }
.free-progress-orbit i { position: absolute; inset: 0; border: 2px solid transparent; border-top-color: var(--accent); border-right-color: color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 50%; animation: free-progress-spin 1s linear infinite; }
@keyframes free-progress-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .free-progress-orbit i { animation: none; border-color: color-mix(in srgb, var(--accent) 42%, transparent); border-top-color: var(--accent); }
  .free-progress-track span { transition: none; }
}
.free-progress-copy h3 { margin: 3px 0 7px; }
.free-progress-copy p:last-child { margin: 0; color: var(--muted); }
.free-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 2px 9px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.free-progress-meta span { display: inline-flex; align-items: center; gap: 7px; }
.free-progress-meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); }
.free-progress-meta time { color: var(--ink-strong); font-family: "SFMono-Regular", Consolas, monospace; }
.free-progress-track { height: 7px; margin: 0 0 20px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.free-progress-track span { display: block; width: 8%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #f1a1af)); transition: width .45s cubic-bezier(.2,.8,.2,1); }
.free-progress-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.free-progress-steps[data-step-set="read,confirm,produce"] { grid-template-columns: repeat(3, 1fr); }
.free-progress-steps span { display: grid; justify-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.free-progress-steps span::after { content: attr(data-progress-note); min-height: 14px; color: color-mix(in srgb, var(--muted) 78%, transparent); font-size: 9px; font-weight: var(--font-weight-medium); line-height: 1; }
.free-progress-steps i { width: 10px; height: 10px; border: 2px solid color-mix(in srgb, var(--ink) 16%, transparent); border-radius: 50%; background: var(--surface); }
.free-progress-steps span.is-active { color: var(--accent); font-weight: var(--font-weight-semibold); }
.free-progress-steps span.is-active i { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); }
.free-progress-steps span.is-done i { border-color: var(--accent); background: var(--accent); }
.free-progress-steps span.is-reused { color: color-mix(in srgb, var(--ink-strong) 72%, var(--muted)); }
.free-progress-steps span.is-reused i { border-color: color-mix(in srgb, var(--accent) 52%, var(--surface)); background: color-mix(in srgb, var(--accent) 52%, var(--surface)); }
.free-progress-actions { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; }
.free-progress-actions.is-hidden { display: none; }
.free-progress-actions button { min-width: 104px; }
.free-create-progress-card[data-progress-state="error"] .free-progress-orbit span { background: color-mix(in srgb, #d85656 14%, transparent); }
.free-create-progress-card[data-progress-state="error"] .free-progress-orbit i { border-color: color-mix(in srgb, #d85656 28%, transparent); border-top-color: #d85656; animation: none; transform: rotate(38deg); }
.free-create-progress-card[data-progress-state="error"] .free-progress-meta span::before { background: #d85656; box-shadow: 0 0 0 4px color-mix(in srgb, #d85656 10%, transparent); }
.free-create-progress-card[data-progress-state="error"] .free-progress-track span { background: #d85656; }
.free-create-progress-card[data-progress-state="error"] .free-progress-steps span.is-active { color: #d85656; }
.free-create-progress-card[data-progress-state="error"] .free-progress-steps span.is-active i { border-color: #d85656; box-shadow: 0 0 0 4px color-mix(in srgb, #d85656 10%, transparent); }
.free-create-notice-card { position: relative; width: min(450px, calc(100vw - 36px)); padding: 34px 34px 32px; border-radius: 22px; text-align: center; }
.free-notice-close { position: absolute; right: 14px; top: 14px; }
.free-notice-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 15px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font: var(--font-weight-bold) 23px/1 ui-serif, Georgia, serif; }
.free-create-notice-card h3 { margin: 0 0 9px; }
.free-create-notice-card p { margin: 0; color: var(--muted); line-height: 1.7; }
@media (max-width: 720px) {
  .free-create-mode-grid, .chase-hit-type-options { grid-template-columns: 1fr; }
  .free-progress-steps { grid-template-columns: repeat(3, 1fr); row-gap: 15px; }
  .free-progress-meta { align-items: flex-start; flex-direction: column; gap: 6px; }
  .single-rewrite-modal-card { padding: 22px 18px; }
  .single-rewrite-field textarea { min-height: 190px; }
  .single-rewrite-footer { align-items: stretch; flex-direction: column; }
  .single-rewrite-footer .primary { width: 100%; }
}

.create-view {
  margin-top: 12px;
}

.create-mode-tabs {
  min-height: 42px;
  display: inline-flex;
  align-items: flex-end;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 0 2px;
}

.create-mode-tab {
  position: relative;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 2px 11px;
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
}

.create-mode-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
}

.create-mode-tab:hover {
  background: transparent;
  color: var(--ink);
}

.create-mode-tab.is-active {
  color: var(--ink-strong);
}

.create-mode-tab.is-active::after {
  background: var(--ink-strong);
}

.create-mode-panel.is-active[data-create-mode-panel="graphic"] {
  display: block;
}

.create-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(420px, 1.08fr);
  min-height: calc(100vh - 174px);
  overflow: hidden;
}

.draft-meta {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow: auto;
}

.material-gate {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(157, 89, 102, 0.22);
  border-radius: 12px;
  background: var(--accent-wash);
  padding: 12px;
}

.generation-mode-choice {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  padding: 12px;
}

.generation-mode-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.generation-mode-btn {
  display: grid;
  min-height: 82px;
  align-content: center;
  gap: 4px;
  padding: 14px 16px;
  text-align: left;
}

.generation-mode-btn span {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.generation-mode-btn em {
  color: inherit;
  font-size: 12px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  opacity: 0.76;
}

.generation-mode-btn.secondary em {
  color: var(--muted);
  opacity: 1;
}

.create-view.is-free-creation .generation-mode-choice {
  display: none;
}

.free-creation-context {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 12px;
  background: linear-gradient(110deg, color-mix(in srgb, var(--accent) 9%, var(--surface)) 0%, var(--surface-raised) 68%);
}

.free-creation-context::after {
  content: "";
  position: absolute;
  width: 88px;
  height: 88px;
  right: -45px;
  top: -52px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.free-creation-context-badge {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: .02em;
}

.free-creation-context > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.free-creation-context strong {
  color: var(--ink-strong);
  font-size: 14px;
}

.free-creation-context p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.material-gate.is-empty {
  border-color: var(--line);
  background: var(--surface-raised);
}

.create-hotword-panel {
  display: grid;
  gap: 6px;
  padding: 2px 0 10px;
}

.create-hotword-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.create-hotword-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.create-hotword-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.create-hotword-list[hidden] {
  display: none;
}

.radar-semantic-actions {
  width: 100%;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.radar-semantic-actions #openHotwordGroupsModalBtn {
  grid-column: 2;
  justify-self: end;
}

.radar-semantic-actions #radarClassifyHotwordsPanelBtn {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.create-hotword-group {
  display: grid;
  gap: 4px;
}

.create-hotword-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent-wash) 62%, var(--surface));
  border-left: 3px solid var(--accent);
  padding: 5px 9px;
}

.create-hotword-group-head strong {
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.create-hotword-list-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 2px;
}

.create-hotword-chip {
  min-width: 0;
  display: block;
  max-width: 100%;
  min-height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-strong);
  padding: 1px 0;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none;
}

.create-hotword-chip:hover {
  color: var(--accent-deep);
  background: transparent;
}

.create-hotword-chip.is-readonly,
.create-hotword-chip.is-readonly:hover {
  color: var(--ink-strong);
  cursor: default;
}

.material-gate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.material-gate-head .section-kicker {
  display: block;
  margin-bottom: 4px;
}

.material-gate-head strong {
  display: block;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.45;
}

.material-checklist {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.material-source-line {
  border: 1px solid rgba(157, 89, 102, 0.18);
  border-radius: 8px;
  background: rgba(255, 240, 242, 0.82);
  color: #8f3445;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.material-item {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 9px;
  background: var(--surface);
  padding: 10px;
}

.material-item.is-sufficient {
  border-left-color: var(--sage);
}

.material-item.is-partial {
  border-left-color: var(--amber);
}

.material-item.is-missing {
  border-left-color: var(--accent);
}

.material-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.material-item-head strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.material-item-head span {
  min-width: 42px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.material-item p {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.material-item-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.material-item ul {
  margin-top: 0;
  gap: 4px;
}

.material-item li {
  font-size: 12px;
}

.material-item em {
  color: var(--accent-deep);
  font-size: 13px;
  font-style: normal;
  font-weight: var(--font-weight-semibold);
  line-height: 1.55;
}

.material-multi-hint {
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-soft));
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

.material-fill {
  min-height: 94px;
  border-color: rgba(201, 54, 73, 0.24);
  background: #fff;
  font-size: 14px;
  line-height: 1.62;
}

.material-option-list {
  display: grid;
  gap: 7px;
}

.material-option {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  color: var(--ink);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.material-option:hover {
  transform: translateX(2px);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.material-option i {
  position: relative;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 4px var(--surface-raised);
}

.material-option.is-selected {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-raised));
}

.material-option.is-selected i {
  border-color: var(--accent);
  background: transparent;
  box-shadow: none;
}

.material-option.is-selected i::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 4px;
  width: 5px;
  height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
}

.material-option span {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
}

.material-option b {
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft));
  color: var(--accent-deep);
  font-size: 10px;
}

.material-option-other {
  color: var(--muted);
}

.material-custom-answer {
  min-height: 86px;
  animation: knowledge-editor-in 180ms ease-out;
}

@keyframes knowledge-editor-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.manual-material-field textarea {
  min-height: 126px;
  background: #fff;
}

.manual-material-field.is-hidden {
  display: none;
}

.material-next {
  width: 100%;
  border-radius: 10px;
}

.stack-actions {
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.stack-actions .primary {
  min-width: 144px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.stack-actions .secondary,
.stack-actions .ghost {
  border-radius: 10px;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.draft-output {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  background: #f7ecef;
  overflow: hidden;
}

.output-title-field textarea {
  min-height: 44px;
  height: 44px;
  overflow: hidden;
  resize: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  padding-top: 11px;
  padding-bottom: 9px;
}

.output-title-heading,
.output-title-tools {
  min-width: 0;
  display: flex;
  align-items: center;
}

.output-title-heading {
  justify-content: space-between;
  gap: 12px;
}

.output-title-heading > label {
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.output-title-tools {
  justify-content: flex-end;
  gap: 10px;
}

.create-title-hotword-trigger {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 11px;
  white-space: nowrap;
}

.create-title-hotword-trigger.is-active {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-raised));
  color: var(--accent-deep);
}

body[data-current-view="create"] .create-title-hotword-panel {
  position: absolute;
  z-index: 8;
  top: 140px;
  right: 16px;
  width: min(320px, calc(100% - 32px));
}

.draft-output.is-title-hotword-open #draftBody {
  padding-right: 352px;
}

@media (max-width: 760px) {
  body[data-current-view="create"] .create-title-hotword-panel {
    right: 16px;
    left: 16px;
    width: auto;
  }

  .draft-output.is-title-hotword-open #draftBody {
    padding-right: 16px;
  }
}

.output-body-field {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  min-height: 0;
  overflow: hidden;
}

.quick-body-progress {
  position: absolute;
  z-index: 3;
  top: 29px;
  right: 1px;
  left: 1px;
  height: 4px;
  overflow: hidden;
  border-radius: 11px 11px 0 0;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  pointer-events: none;
}

.quick-body-progress i {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), #f2a19e);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 42%, transparent);
  transition: width 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.quick-body-progress i::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.66) 48%, transparent 100%);
  transform: translateX(-100%);
  animation: quick-body-progress-sweep 1.45s ease-in-out infinite;
}

@keyframes quick-body-progress-sweep {
  to { transform: translateX(100%); }
}

.output-body-field.is-quick-generating #draftBody {
  caret-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .quick-body-progress i {
    transition-duration: 80ms;
  }

  .quick-body-progress i::after {
    animation: none;
  }
}

#draftBody {
  height: auto;
  min-height: 0;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 15px 16px 34px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  font-weight: var(--font-weight-regular);
  line-height: 1.74;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.025);
}

#draftBody:focus {
  border-color: rgba(157, 89, 102, 0.42);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.025), 0 0 0 4px rgba(157, 89, 102, 0.09);
}

.body-count-corner {
  position: absolute;
  right: 13px;
  bottom: 10px;
  z-index: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #8a94a3;
  padding: 1px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  line-height: 1.6;
  pointer-events: none;
}

#draftBody::selection,
#draftTitle::selection {
  background: var(--blue-select);
}

.image-compose-view,
.final-view {
  min-height: 0;
}

body[data-current-view="imageCompose"] .shell {
  overflow-y: auto;
  padding: 14px 24px 22px;
}

body[data-current-view="imageCompose"] .workflow-bar {
  min-height: 52px;
  padding: 6px 8px;
}

body[data-current-view="imageCompose"] .global-notice {
  position: fixed;
  z-index: 30;
  top: calc(var(--header-h) + 14px);
  right: 34px;
  width: auto;
  max-width: min(420px, calc(100vw - 48px));
  margin: 0;
  border-color: rgba(201, 54, 73, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px 15px;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  backdrop-filter: blur(16px);
}

body[data-current-view="imageCompose"] .global-notice.is-idle {
  display: none;
}

.image-ai-progress {
  margin: 14px 4px 0;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-wash) 72%, var(--surface-raised)),
    var(--surface-raised)
  );
  padding: 11px 12px 10px;
  color: var(--ink);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 9%, transparent);
}

.image-ai-progress.is-hidden {
  display: none;
}

.image-ai-progress.is-done {
  border-color: color-mix(in srgb, #45b589 34%, transparent);
  background: color-mix(in srgb, #45b589 9%, var(--surface-raised));
  box-shadow: 0 10px 24px color-mix(in srgb, #45b589 8%, transparent);
}

.image-ai-progress.is-error {
  border-color: color-mix(in srgb, #d55f5f 36%, transparent);
  background: color-mix(in srgb, #d55f5f 9%, var(--surface-raised));
}

.image-ai-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.image-ai-progress-head strong {
  display: block;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
}

.image-ai-progress-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.image-ai-progress-head em {
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-size: 12px;
  font-style: normal;
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
}

.image-ai-progress.is-done .image-ai-progress-head em {
  color: #258a62;
}

.image-ai-progress.is-error .image-ai-progress-head em {
  color: #b44444;
}

.image-ai-progress-bar {
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 17%, var(--surface-raised));
}

.image-ai-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d94d67, #ef9aac);
  transition: width 0.28s ease;
}

.image-ai-progress.is-done .image-ai-progress-bar {
  background: color-mix(in srgb, #45b589 17%, var(--surface-raised));
}

.image-ai-progress.is-done .image-ai-progress-bar span {
  background: linear-gradient(90deg, #33a474, #7dd3a6);
}

.image-ai-progress.is-error .image-ai-progress-bar span {
  background: #c65b5b;
}

.image-ai-progress-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.image-ai-progress-steps span {
  min-width: 0;
  overflow: hidden;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--canvas));
  color: var(--muted);
  padding: 4px 5px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-ai-progress-steps span.is-active {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-raised));
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent);
}

.image-ai-progress-steps span.is-done {
  color: #258a62;
}

body[data-appearance="deep-dark"] .image-ai-progress {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-wash) 58%, var(--surface-raised)),
    var(--surface-raised)
  );
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

body[data-appearance="deep-dark"] .image-ai-progress-steps span {
  background: color-mix(in srgb, var(--surface-raised) 68%, var(--canvas));
  color: var(--muted);
}

body[data-appearance="deep-dark"] .image-ai-progress-steps span.is-active {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-raised));
  color: var(--accent-deep);
}

body[data-appearance="deep-dark"] .image-ai-progress.is-done .image-ai-progress-head em,
body[data-appearance="deep-dark"] .image-ai-progress-steps span.is-done {
  color: #79d5ae;
}

body[data-appearance="deep-dark"] .image-ai-progress.is-error .image-ai-progress-head em {
  color: #ff9c96;
}

.image-compose-layout {
  width: min(1260px, 100%);
  height: auto;
  min-height: 610px;
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: minmax(620px, 920px) 300px;
  gap: 24px;
  align-items: start;
  justify-content: center;
}

.image-compose-main {
  position: relative;
  min-width: 0;
  height: auto;
  min-height: calc(100vh - var(--header-h) - 100px);
  display: grid;
  grid-template-rows: auto minmax(340px, 1fr) auto;
  gap: 14px;
}

.image-edit-panel,
.image-copy-panel {
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04), 0 18px 44px rgba(16, 24, 40, 0.045);
}

.image-edit-panel {
  position: relative;
  z-index: 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 22px 16px;
  overflow: hidden;
}

.image-edit-head,
.image-ai-progress,
.image-merge-bar {
  flex: 0 0 auto;
}

.image-edit-head,
.readonly-copy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.readonly-copy-head {
  position: absolute;
  top: 22px;
  right: 28px;
  z-index: 2;
  justify-content: flex-end;
}

.image-hotword-trigger.is-active {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-raised));
  color: var(--accent-deep);
}

.image-edit-title-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.image-compose-count {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 42%, transparent);
  color: var(--muted);
  padding: 0 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  line-height: 1;
}

.image-edit-head h2 {
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.2;
}

.image-edit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.image-edit-actions .secondary {
  min-height: 36px;
  border-color: rgba(201, 54, 73, 0.2);
  background: rgba(255, 246, 247, 0.96);
  color: var(--accent);
}

.image-edit-actions .primary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-inline: 14px;
  white-space: nowrap;
}

.image-edit-actions .primary.is-loading {
  cursor: wait;
}

.button-spinner {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spinner-rotate 720ms linear infinite;
}

@keyframes button-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.image-edit-actions .secondary:hover:not(:disabled) {
  border-color: rgba(201, 54, 73, 0.36);
  background: #fff1f3;
}

.image-edit-actions .secondary:disabled {
  border-color: rgba(16, 24, 40, 0.08);
  background: #f8eef1;
  color: var(--muted);
}

.image-edit-actions .secondary.is-active {
  border-color: color-mix(in srgb, var(--accent) 58%, transparent);
  background: var(--accent);
  color: #fff;
}

.image-merge-bar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-wash) 72%, var(--surface));
  padding: 8px 10px 8px 14px;
}

.image-merge-bar.is-hidden {
  display: none;
}

.image-merge-bar > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.image-merge-bar > div {
  display: flex;
  gap: 8px;
}

.image-slot-list {
  --image-slot-size: 94px;
  flex: 0 0 auto;
  min-width: 0;
  min-height: var(--image-slot-size);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--image-slot-size);
  grid-template-rows: var(--image-slot-size);
  align-items: start;
  align-content: start;
  justify-content: start;
  gap: 10px;
  margin-top: 14px;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 10px 12px 0 2px;
}

.image-edit-panel.is-expanded .image-slot-list {
  max-height: 302px;
  grid-auto-flow: row;
  grid-auto-columns: auto;
  grid-template-columns: repeat(auto-fill, minmax(var(--image-slot-size), var(--image-slot-size)));
  grid-template-rows: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 12px 4px 2px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.image-slot-add-card {
  width: var(--image-slot-size);
  height: var(--image-slot-size);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  border: 1px dashed color-mix(in srgb, var(--muted) 40%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 82%, transparent);
  color: var(--muted);
  padding: 0;
  box-shadow: none;
}

.image-slot-add-card > .ui-icon {
  width: 26px;
  height: 26px;
}

.image-slot-add-card > em {
  font-size: 10px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  line-height: 1;
}

.image-slot-add-card:hover:not(:disabled),
.image-slot-add-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent-wash) 58%, var(--surface-raised));
  color: var(--accent-deep);
  outline: none;
}

.image-slot-add-card:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.image-slots-toggle {
  align-self: center;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 8px auto -4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
}

.image-slots-toggle[hidden] {
  display: none;
}

.image-slots-toggle .ui-icon {
  width: 12px;
  height: 12px;
  transition: transform 160ms ease;
}

.image-slots-toggle[aria-expanded="true"] .ui-icon {
  transform: rotate(180deg);
}

.image-slots-toggle:hover,
.image-slots-toggle:focus-visible {
  background: color-mix(in srgb, var(--line) 28%, transparent);
  color: var(--ink-strong);
  outline: none;
}

.image-slot-card {
  position: relative;
  width: var(--image-slot-size);
  height: var(--image-slot-size);
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0;
  background: transparent;
  cursor: move;
  transition: none;
}

.image-slot-card:hover,
.image-slot-card:focus-within {
  border-color: transparent;
  box-shadow: none;
  outline: none;
}

.image-slot-card.is-merge-selectable {
  border-color: color-mix(in srgb, var(--line-strong) 60%, transparent);
  padding: 3px;
  cursor: pointer;
}

.image-slot-card.is-merge-selectable .image-slot-pick {
  cursor: pointer;
}

.image-slot-card.is-merge-selectable:hover,
.image-slot-card.is-merge-selectable:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 56%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.image-slot-card.is-merge-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-wash) 78%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.image-slot-card.is-merge-disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.image-slot-card.is-readonly {
  cursor: default;
  opacity: 0.82;
}

.image-slot-readonly-badge,
.final-readonly-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 10%, var(--surface));
  color: var(--muted);
  padding: 2px 7px;
  font-size: 10px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.image-slot-readonly-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 4;
}

.image-slot-merge-check {
  position: absolute;
  z-index: 4;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.52);
  color: #fff;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

.image-slot-card.is-merge-selected .image-slot-merge-check {
  background: var(--accent);
}

.image-slot-card.is-dragging {
  cursor: move;
  opacity: 0.58;
  transform: none;
}

.image-slot-card.is-drop-before::before,
.image-slot-card.is-drop-after::after {
  position: absolute;
  z-index: 9;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(239, 74, 111, 0.16);
  content: "";
  pointer-events: none;
}

.image-slot-card.is-drop-before::before {
  left: -7px;
}

.image-slot-card.is-drop-after::after {
  right: -7px;
}

.image-slot-change {
  position: absolute;
  z-index: 4;
  left: 50%;
  margin-left: -31px;
  bottom: 6px;
  width: 62px;
  min-width: 62px;
  height: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  padding: 0 10px;
  opacity: 0;
  transform: none;
  transition: opacity 120ms linear;
  box-shadow: none;
}

.image-slot-delete {
  position: absolute;
  z-index: 5;
  top: -9px;
  right: -9px;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: #4a4f59;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
  padding: 0;
  opacity: 0;
  transform: none;
  transition: opacity 120ms linear, background-color 120ms linear;
}

.image-slot-card:hover .image-slot-change,
.image-slot-card:focus-within .image-slot-change,
.image-slot-card:hover .image-slot-delete,
.image-slot-card:focus-within .image-slot-delete {
  opacity: 1;
}

.image-slot-change:hover,
.image-slot-change:focus-visible,
.image-slot-change:active {
  background: rgba(17, 24, 39, 0.72);
  outline: none;
  box-shadow: none;
  transform: none;
}

.image-slot-delete:hover,
.image-slot-delete:focus-visible {
  background: var(--accent);
  outline: none;
}

.image-slot-delete .ui-icon {
  width: 14px;
  height: 14px;
}

body:not([data-appearance="deep-dark"]) .image-slot-change {
  border: 0;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .image-slot-delete {
  border-color: var(--surface);
  background: #4a4f59;
  color: #fff;
}

body:not([data-appearance="deep-dark"]) .image-slot-change:hover,
body:not([data-appearance="deep-dark"]) .image-slot-change:focus-visible,
body:not([data-appearance="deep-dark"]) .image-slot-change:active {
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  outline: none;
  box-shadow: none;
  transform: none;
}

body:not([data-appearance="deep-dark"]) .image-slot-delete:hover,
body:not([data-appearance="deep-dark"]) .image-slot-delete:focus-visible {
  background: var(--accent);
  color: #fff;
}

.image-slot-pick {
  position: relative;
  width: 100%;
  display: block;
  min-height: 0;
  border: 0;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  background: transparent;
  cursor: move;
}

.image-slot-number {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-bottom-right-radius: 10px;
  background: rgba(17, 24, 39, 0.62);
  color: #fff;
  font-weight: var(--font-weight-semibold);
}

.image-slot-thumb,
.image-choice-preview,
.final-inbox-thumb,
.final-image-card div,
.phone-cover-image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f7ecef;
}

.image-slot-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.035);
  user-select: none;
  -webkit-user-drag: none;
}

.image-slot-thumb img,
.image-choice-preview img,
.final-inbox-thumb img,
.final-image-card img,
.phone-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-slot-thumb img {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.image-slot-thumb-placeholder,
.image-choice-placeholder,
.phone-thumb-placeholder,
.final-inbox-thumb-placeholder,
.final-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 10px;
  background: linear-gradient(145deg, #eef3f0, #f8ecef);
  color: #758195;
  text-align: center;
  font-weight: var(--font-weight-semibold);
}

.image-slot-card strong,
.image-slot-card em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-slot-card strong {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  clip: rect(0 0 0 0);
  pointer-events: none;
  color: var(--ink-strong);
  font-size: 12px;
  line-height: 1.25;
}

.image-slot-card em {
  margin: 6px 1px 0;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.image-slot-menu {
  position: fixed;
  z-index: 120;
  top: 0;
  left: 0;
  width: min(184px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  display: grid;
  gap: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 5px;
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.18);
  visibility: hidden;
}

.image-slot-menu.is-positioned {
  visibility: visible;
}

.image-slot-menu button,
.image-slot-insert-action {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: var(--accent-wash);
  color: var(--ink);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.image-slot-menu button:hover,
.image-slot-insert-action:hover,
.image-slot-insert-action:focus-visible {
  background: var(--accent-soft);
}

.image-slot-menu button.is-danger {
  background: rgba(239, 74, 111, 0.12);
  color: var(--accent-deep);
}

.image-slot-menu button.is-danger:hover {
  background: rgba(239, 74, 111, 0.2);
}

.image-slot-menu button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.image-slot-insert-action {
  display: grid;
  grid-template-columns: auto 44px auto;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  cursor: pointer;
  outline: 0;
}

.image-slot-insert-action input {
  width: 44px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  font: inherit;
  font-weight: var(--font-weight-semibold);
  padding: 0 4px;
}

.image-slot-insert-action input:focus {
  border-color: rgba(239, 74, 111, 0.45);
  box-shadow: 0 0 0 2px rgba(239, 74, 111, 0.12);
  outline: 0;
}

.image-copy-panel {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 24px 32px 24px;
  overflow: hidden;
}

.image-copy-title-field,
.image-copy-body-field {
  min-width: 0;
  display: grid;
  gap: 0;
}

.image-copy-title-field {
  position: relative;
  padding-right: 190px;
}

.image-copy-title-field span,
.image-copy-body-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.image-copy-title-field textarea {
  min-height: 34px;
  resize: none;
  border-color: transparent;
  background: transparent;
  padding: 0 60px 0 0;
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  line-height: 1.62;
  overflow: hidden;
}

.image-title-count {
  position: absolute;
  right: 194px;
  bottom: 3px;
  border-radius: 999px;
  background: transparent;
  color: #aeb6c2;
  padding: 0;
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  pointer-events: none;
}

.image-title-count.is-over-limit {
  background: #f8e2e6;
  color: var(--accent-deep);
}

.final-copy pre {
  margin: 14px 0 0;
  white-space: pre-wrap;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.62;
}

.image-copy-body-field {
  position: relative;
  min-height: 0;
}

.image-copy-body-field textarea {
  height: 100%;
  min-height: 0;
  resize: none;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  padding: 0 40px 0 0;
  font-size: 15px;
  line-height: 1.62;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

body:not([data-appearance="deep-dark"]) .image-copy-title-field textarea,
body:not([data-appearance="deep-dark"]) .image-copy-body-field textarea {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .image-copy-title-field textarea:hover,
body:not([data-appearance="deep-dark"]) .image-copy-body-field textarea:hover,
body:not([data-appearance="deep-dark"]) .image-copy-title-field textarea:focus,
body:not([data-appearance="deep-dark"]) .image-copy-body-field textarea:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.image-copy-panel .body-count-corner {
  right: 44px;
  bottom: 24px;
}

.image-hotword-panel {
  position: absolute;
  z-index: 6;
  top: 68px;
  right: 28px;
  bottom: 24px;
  width: min(320px, calc(100% - 56px));
  max-height: none;
}

.image-copy-panel.is-hotword-open .image-copy-title-field {
  padding-right: 344px;
}

.image-copy-panel.is-hotword-open .image-copy-body-field {
  margin-right: 344px;
}

.image-copy-panel.is-hotword-open .body-count-corner {
  right: 388px;
}

.image-copy-actions {
  position: static;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 0;
  padding-top: 0;
}

.image-copy-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: transparent;
  background: #f0f2f5;
  box-shadow: none;
  padding: 0 18px;
  font-weight: var(--font-weight-semibold);
}

.image-copy-action.is-draft {
  border-color: transparent;
  background: #f0f2f5;
  color: #4c5565;
}

.image-copy-action.is-draft:hover {
  border-color: transparent;
  background: #e6e9ee;
  color: #2f3745;
}

.image-copy-action.is-final {
  border-color: transparent;
  background: #f8e2e6;
  color: var(--accent-deep);
}

.image-copy-action.is-final:hover {
  border-color: transparent;
  background: #f4cbd2;
}

.image-preview-rail {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: start;
  justify-items: center;
  gap: 16px;
  padding-top: 4px;
}

.cover-demo-settings-trigger {
  width: 232px;
  min-height: 44px;
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-color: color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 78%, var(--surface));
  padding: 0 11px 0 14px;
  color: var(--ink-strong);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--ink-strong) 7%, transparent);
}

.cover-demo-settings-trigger:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent-wash) 54%, var(--surface));
  color: var(--ink-strong);
}

.cover-demo-settings-trigger > span {
  min-width: 0;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.cover-demo-settings-trigger > em {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-wash);
  padding: 0 9px;
  color: var(--accent-deep);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
}

.preview-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border-radius: 999px;
  background: #e8eaed;
  padding: 5px;
}

.preview-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #7a808b;
  font-size: 15px;
}

.preview-tabs button.is-active {
  background: #fff;
  color: var(--ink-strong);
  box-shadow: var(--shadow-soft);
}

.phone-preview {
  width: 260px;
  height: 560px;
}

.phone-shell {
  width: 232px;
  height: 500px;
  overflow: hidden;
  border: 5px solid #595959;
  border-radius: 34px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.13);
  transform: scale(1.12);
  transform-origin: 0 0;
}

.phone-note-shell {
  display: grid;
  grid-template-rows: 34px 40px minmax(0, 1fr) 34px;
}

.phone-status {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  color: #111827;
  font-size: 10.5px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
}

.phone-status > strong {
  font: inherit;
}

.phone-status-icons {
  height: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #111827;
  transform: scale(0.75);
  transform-origin: right center;
}

.phone-status-signal {
  width: 14px;
  height: 10px;
  display: inline-flex;
  align-items: flex-end;
  gap: 1.4px;
}

.phone-status-signal > b {
  width: 2.4px;
  display: block;
  border-radius: 1px 1px 0 0;
  background: currentColor;
}

.phone-status-signal > b:nth-child(1) {
  height: 3px;
}

.phone-status-signal > b:nth-child(2) {
  height: 5px;
}

.phone-status-signal > b:nth-child(3) {
  height: 7px;
}

.phone-status-signal > b:nth-child(4) {
  height: 10px;
}

.phone-status-wifi {
  width: 15px;
  height: 11px;
  display: block;
  overflow: visible;
}

.phone-status-battery {
  position: relative;
  width: 21px;
  height: 10px;
  display: block;
  border: 1.4px solid currentColor;
  border-radius: 3px;
  padding: 1.3px;
}

.phone-status-battery::after {
  position: absolute;
  top: 2.3px;
  right: -3px;
  width: 1.8px;
  height: 4px;
  content: "";
  border-radius: 0 1px 1px 0;
  background: currentColor;
  opacity: 0.72;
}

.phone-status-battery > b {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 1.2px;
  background: currentColor;
}

.phone-note-head,
.phone-discovery-head {
  height: 40px;
  display: grid;
  align-items: center;
  border-bottom: 1px solid #eef0f3;
  padding: 0 14px;
}

.phone-note-head {
  grid-template-columns: 18px 18px minmax(0, 1fr) auto 18px;
  gap: 6px;
}

.phone-note-head strong,
.phone-discovery-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
  font-size: 12px;
}

.phone-back,
.phone-share {
  display: grid;
  place-items: center;
  color: #111827;
}

.phone-back .ui-icon {
  width: 16px;
  height: 16px;
  transform: rotate(180deg);
}

.phone-share .ui-icon {
  width: 15px;
  height: 15px;
}

.phone-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--blush) 0 28%, transparent 29%),
    radial-gradient(circle at 50% 50%, #fff 0 54%, transparent 55%),
    var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(201, 54, 73, 0.18);
}

.phone-note-head button {
  min-height: 24px;
  border-color: var(--rose);
  border-radius: 999px;
  color: var(--accent);
  padding: 0 9px;
  font-size: 11px;
}

.phone-note-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.phone-note-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.phone-hero {
  position: relative;
  aspect-ratio: var(--phone-image-ratio, 3 / 4);
  background: #f7ecef;
  cursor: pointer;
  user-select: none;
}

.phone-hero-image,
.phone-hero-image .phone-thumb,
.phone-hero-image .phone-thumb img,
.phone-hero-image .phone-thumb-placeholder,
.phone-hero-image > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.phone-image-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.46);
  color: #fff;
  padding: 3px 7px;
  font-size: 10px;
  line-height: 1;
}

.phone-image-nav {
  position: absolute;
  top: 50%;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.18);
  color: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 4px 12px rgba(17, 24, 39, 0.12);
  backdrop-filter: blur(10px) saturate(1.45);
  -webkit-backdrop-filter: blur(10px) saturate(1.45);
  opacity: 0.78;
  padding: 0;
  transform: translateY(-50%);
  transition: opacity 160ms ease, background 160ms ease, transform 160ms ease;
}

.phone-image-nav .ui-icon {
  width: 13px;
  height: 13px;
}

.phone-image-nav.is-prev {
  left: 10px;
}

.phone-image-nav.is-prev .ui-icon {
  transform: rotate(180deg);
}

.phone-image-nav.is-next {
  right: 10px;
}

.phone-image-nav:hover {
  background: rgba(17, 24, 39, 0.28);
  color: #fff;
  opacity: 0.96;
  transform: translateY(-50%) scale(1.04);
}

.phone-cover-image > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.phone-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 7px 0 3px;
}

.phone-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d3d7de;
}

.phone-dots span.is-active {
  background: var(--accent);
}

.phone-note-copy {
  padding: 6px 12px 20px;
}

.phone-note-copy strong,
.phone-note-copy p,
.phone-note-copy em {
  display: block;
}

.phone-note-copy strong {
  color: #20242b;
  font-size: 9.7px;
  line-height: 1.35;
  letter-spacing: 0;
}

.phone-note-copy p {
  margin-top: 5px;
  color: #333333;
  font-size: 8.8px;
  line-height: 1.42;
  white-space: pre-wrap;
}

.phone-note-topic {
  color: #1c3564;
}

.phone-note-copy em {
  margin-top: 7px;
  color: #a0a7b2;
  font-size: 8px;
  font-style: normal;
}

.phone-action-bar {
  height: 34px;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 7px;
  align-items: center;
  border-top: 1px solid #eef0f3;
  padding: 0 9px 2px;
  color: #111827;
  font-size: 10px;
}

.phone-action-bar span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  background: #f1f2f4;
  color: #a0a7b2;
  padding: 5px 7px;
  white-space: nowrap;
}

.phone-action-bar strong {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #111827;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.phone-action-bar .ui-icon {
  width: 11px;
  height: 11px;
}

.phone-action-bar strong b {
  font: inherit;
}

.phone-discovery-head {
  grid-template-columns: 30px 1fr 30px;
  text-align: center;
}

.phone-discovery-head > span {
  display: grid;
  place-items: center;
  color: #111827;
}

.phone-discovery-head > span .ui-icon {
  width: 16px;
  height: 16px;
}

.phone-discovery-shell {
  display: grid;
  grid-template-rows: 34px 40px 24px minmax(0, 1fr) 44px;
}

.phone-discovery-head {
  border-bottom: 0;
}

.phone-discovery-head strong {
  display: inline-flex;
  justify-content: center;
  gap: 18px;
  font-size: 11px;
}

.phone-discovery-head strong b,
.phone-discovery-head strong i {
  position: relative;
  font: inherit;
}

.phone-discovery-head strong b {
  color: #111827;
  font-weight: var(--font-weight-semibold);
}

.phone-discovery-head strong b::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateX(-50%);
}

.phone-discovery-head strong i {
  color: #8b92a1;
}

.phone-discovery-tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
  border-top: 1px solid #f0f1f4;
  border-bottom: 1px solid #eef0f3;
  padding: 0 12px;
  color: #8b92a1;
  font-size: 8.5px;
  white-space: nowrap;
}

.phone-discovery-tabs strong {
  color: #111827;
  font-size: 8.8px;
}

.phone-cover-feed {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  overflow: hidden;
  padding: 6px;
  background: #f5f6f8;
}

.phone-cover-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}

.phone-cover-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
}

.phone-cover-card.is-current {
  box-shadow: inset 0 0 0 1px rgba(201, 54, 73, 0.18);
}

.phone-cover-image {
  display: block;
  width: 100%;
  aspect-ratio: var(--phone-image-ratio, 1);
  overflow: hidden;
  background: #eef0f3;
}

.phone-cover-image img,
.phone-cover-image .phone-thumb,
.phone-cover-image .phone-thumb-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone-cover-image[class*="is-demo-"] {
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(237, 240, 244, 0.98)),
    linear-gradient(90deg, rgba(201, 54, 73, 0.04), rgba(246, 172, 185, 0.04));
}

.phone-cover-image.is-demo-warm {
  background:
    linear-gradient(145deg, rgba(255, 248, 238, 0.94), rgba(238, 241, 245, 0.96)),
    radial-gradient(circle at 20% 15%, rgba(255, 186, 91, 0.24), transparent 28%);
}

.phone-cover-image.is-demo-mist {
  background:
    linear-gradient(145deg, rgba(241, 248, 255, 0.94), rgba(244, 245, 247, 0.98)),
    radial-gradient(circle at 80% 22%, rgba(246, 172, 185, 0.18), transparent 30%);
}

.phone-cover-image.is-demo-paper {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(239, 241, 245, 0.96)),
    repeating-linear-gradient(135deg, rgba(17, 24, 39, 0.035) 0 1px, transparent 1px 10px);
}

.phone-cover-image span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  color: #111827;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.phone-cover-card strong {
  display: block;
  padding: 0 7px;
  overflow: hidden;
  margin-top: 6px;
  color: #111827;
  font-size: 9px;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.phone-cover-meta {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  padding: 0 7px 7px;
  color: #98a2b3;
  font-size: 8px;
}

.phone-cover-meta i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 28%, transparent 29%),
    #d9dee7;
}

.phone-cover-meta b,
.phone-cover-meta em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: inherit;
}

.phone-cover-meta em {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  justify-self: end;
  color: #7d8490;
}

.phone-cover-meta em .ui-icon {
  width: 9px;
  height: 9px;
}

.phone-bottom-nav {
  height: 44px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  color: #7a808b;
  text-align: center;
  font-size: 12px;
}

.phone-bottom-nav em {
  width: 34px;
  height: 30px;
  display: grid;
  place-items: center;
  justify-self: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-style: normal;
}

.phone-bottom-nav em .ui-icon {
  width: 18px;
  height: 18px;
}

.image-picker-modal {
  width: min(920px, calc(100vw - 36px));
  max-height: calc(100vh - 52px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.image-picker-modal .modal-head {
  grid-template-columns: minmax(180px, auto) minmax(240px, 320px) auto;
  gap: 14px;
}

#imagePickerModal .image-picker-modal .modal-head {
  grid-template-columns: minmax(140px, auto) minmax(240px, 320px) auto;
  align-items: center;
  padding: 14px 16px 12px;
}

#imagePickerModal #imagePickerTitle {
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
}

.image-picker-search {
  min-width: 0;
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  border: 0;
  border-radius: 10px;
  background: #f3f3f4;
  padding: 0 12px;
  color: var(--muted);
  box-shadow: none;
  overflow: hidden;
}

.image-picker-search .ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.image-picker-search input,
.image-picker-search input:hover,
.image-picker-search input:focus,
body:not([data-appearance="deep-dark"]) .image-picker-search input,
body:not([data-appearance="deep-dark"]) .image-picker-search input:hover,
body:not([data-appearance="deep-dark"]) .image-picker-search input:focus {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font: inherit;
  font-weight: var(--font-weight-semibold);
  -webkit-appearance: none;
  appearance: none;
}

.image-picker-search input::placeholder {
  color: var(--muted);
  font-weight: var(--font-weight-medium);
}

.image-picker-grid {
  min-height: 220px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 128px));
  grid-auto-rows: minmax(204px, auto);
  align-items: start;
  justify-content: start;
  gap: 14px;
  overflow: auto;
  padding: 4px;
}

.image-choice-card {
  position: relative;
  min-width: 0;
  min-height: 204px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.image-choice-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 54, 73, 0.1);
}

.image-choice-card.is-disabled {
  opacity: 0.52;
  filter: grayscale(0.9);
}

.asset-editor-pick.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.image-choice-preview {
  position: relative;
  border: 0;
  border-radius: 0;
  aspect-ratio: 3 / 4;
  height: auto;
  padding: 0;
}

.image-choice-expand {
  position: absolute;
  z-index: 3;
  right: 8px;
  bottom: 8px;
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(71, 77, 87, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #34363c;
  padding: 0;
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.18);
  backdrop-filter: blur(8px);
  cursor: zoom-in;
  transition: transform 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.image-choice-expand .ui-icon {
  width: 14px;
  height: 14px;
}

.image-choice-expand:hover,
.image-choice-expand:focus-visible {
  border-color: rgba(201, 54, 73, 0.28);
  background: #fff;
  color: var(--accent-deep);
  box-shadow: 0 5px 14px rgba(16, 24, 40, 0.22);
  transform: translateY(-1px);
}

.image-choice-expand:focus-visible {
  outline: 2px solid rgba(201, 54, 73, 0.42);
  outline-offset: 2px;
}

body[data-appearance="deep-dark"] .image-choice-expand {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(29, 27, 28, 0.88);
  color: rgba(255, 255, 255, 0.9);
}

body[data-appearance="deep-dark"] .image-choice-expand:hover,
body[data-appearance="deep-dark"] .image-choice-expand:focus-visible {
  background: rgba(45, 40, 42, 0.96);
  color: #fff;
}

.image-choice-check {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: auto;
  left: 8px;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(82, 92, 105, 0.42);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: transparent;
  padding: 0;
  box-shadow: 0 2px 7px rgba(16, 24, 40, 0.16);
  cursor: pointer;
}

.image-choice-check .ui-icon {
  width: 12px;
  height: 12px;
}

.image-choice-card.is-selected .image-choice-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.image-choice-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 10px;
}

.image-choice-meta strong,
.image-choice-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-choice-meta strong {
  color: var(--ink-strong);
  font-size: 13px;
  text-align: left;
}

.create-hotword-chip.is-more {
  color: var(--accent-deep);
  font-weight: var(--font-weight-medium);
}

.create-hotword-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hotword-groups-modal {
  width: min(980px, calc(100vw - 36px));
  max-height: calc(100vh - 52px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 16px;
}

.hotword-groups-modal-summary {
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hotword-groups-modal-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 6px;
}

.hotword-groups-modal-body .create-hotword-list-items {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 18px;
}

.hotword-modal-chip {
  font-size: 13px;
}

.image-choice-meta span {
  color: var(--muted);
  font-size: 12px;
}

.image-choice-card .asset-tag-summary {
  padding: 0 10px;
}

.image-choice-card p {
  min-height: 34px;
  margin: 6px 0 10px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.image-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
}

.image-picker-footer-main {
  min-width: 0;
  display: grid;
  gap: 8px;
  flex: 1;
}

#imagePickerModal.is-collage-picker .image-picker-modal {
  width: min(1120px, calc(100vw - 36px));
  height: min(760px, calc(100vh - 42px));
}

#imagePickerModal.is-collage-picker .image-picker-grid {
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  grid-auto-rows: minmax(196px, auto);
  align-content: start;
  padding: 10px 4px 18px;
}

#imagePickerModal.is-collage-picker .image-choice-card {
  min-height: 196px;
}

#imagePickerModal.is-collage-picker .image-picker-actions {
  align-items: end;
  min-height: 98px;
}

#imagePickerModal.is-collage-picker #confirmImagePickBtn {
  min-width: 118px;
  min-height: 44px;
  border-color: #171719;
  border-radius: 9px;
  background: #171719;
  color: #fff;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

#imagePickerModal.is-collage-picker #confirmImagePickBtn:hover {
  border-color: #2c2c30;
  background: #2c2c30;
  color: #fff;
}

#imagePickerModal.is-collage-picker #confirmImagePickBtn:disabled {
  border-color: #d7d7da;
  background: #d7d7da;
  color: #88888f;
}

.image-picker-selection-tray {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 4px 4px;
}

.image-picker-selection-tray.is-hidden {
  display: none;
}

.image-picker-selected-thumb {
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 56px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-tint);
}

.image-picker-selected-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.image-picker-selected-thumb em {
  position: absolute;
  left: 3px;
  bottom: 3px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(18, 18, 20, 0.78);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: var(--font-weight-semibold);
}

.image-picker-selected-thumb button,
body:not([data-appearance="deep-dark"]) .image-picker-selected-thumb button,
.image-picker-selected-thumb button:hover,
body:not([data-appearance="deep-dark"]) .image-picker-selected-thumb button:hover {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 19px;
  min-width: 19px;
  height: 19px;
  min-height: 19px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface-raised);
  border-radius: 50%;
  background: #76767d;
  color: #fff;
  padding: 0 0 1px;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(18, 18, 20, 0.2);
}

.image-choice-order {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 38px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(23, 23, 25, 0.78);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 2px 7px rgba(16, 24, 40, 0.16);
}

@media (max-width: 760px) {
  #imagePickerModal.is-collage-picker .image-picker-modal {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }

  #imagePickerModal.is-collage-picker .image-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(160px, auto);
    gap: 8px;
  }

  #imagePickerModal.is-collage-picker .image-picker-actions {
    align-items: stretch;
    flex-direction: column;
  }

  #imagePickerModal.is-collage-picker #confirmImagePickBtn {
    width: 100%;
  }
}

.account-avatar-modal {
  width: min(760px, calc(100vw - 36px));
  height: min(680px, calc(100vh - 52px));
  padding: 18px;
}

.account-avatar-picker-grid {
  min-height: 0;
  align-content: start;
  grid-template-columns: repeat(auto-fill, 74px);
  justify-content: start;
  gap: 10px;
  padding: 12px 6px;
}

.account-avatar-choice {
  position: relative;
  display: grid;
  align-content: start;
  gap: 5px;
  width: 74px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  overflow: visible;
}

.account-avatar-thumb {
  position: relative;
  width: 74px;
  height: 74px;
  min-width: 74px;
  min-height: 74px;
  aspect-ratio: 1 / 1;
  display: block;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--accent-wash) 42%, #fff);
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.06);
  cursor: pointer;
}

.account-avatar-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.account-avatar-choice.is-selected .account-avatar-thumb {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 54, 73, 0.12);
}

.account-avatar-choice strong,
.account-avatar-choice span {
  width: 100%;
  padding: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-avatar-choice strong {
  margin-top: 0;
  color: var(--ink-strong);
  font-size: 11px;
  line-height: 1.2;
}

.account-avatar-choice span {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.account-avatar-empty {
  min-height: 260px;
  grid-column: 1 / -1;
  display: grid;
  place-content: center;
  gap: 8px;
  border: 1px dashed color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-wash) 18%, #fff);
  color: var(--muted);
  text-align: center;
}

.account-avatar-empty strong {
  color: var(--ink-strong);
  font-size: 16px;
}

.account-avatar-empty span {
  font-size: 13px;
  font-weight: var(--font-weight-regular);
}

.account-avatar-cropper {
  grid-column: 1 / -1;
  min-height: 460px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
}

.account-avatar-crop-stage {
  width: min(360px, 62vw);
  height: min(360px, 62vw);
  border: 3px solid var(--accent);
  border-radius: 50%;
  overflow: hidden;
  background: #f7ecef;
  cursor: grab;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);
  touch-action: none;
  user-select: none;
}

.account-avatar-crop-stage:active {
  cursor: grabbing;
}

.account-avatar-crop-stage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.original-image-modal {
  width: min(760px, calc(100vw - 36px));
}

#imageOriginalModal .original-image-modal .modal-head {
  align-items: center;
  padding: 14px 16px 13px;
}

#imageOriginalModal .original-image-modal .modal-head > div {
  min-width: 0;
}

#imageOriginalTitle {
  overflow: hidden;
  font-size: 17px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.original-image-stage {
  display: grid;
  place-items: center;
  min-height: 320px;
  border-radius: 14px;
  background: #111827;
  overflow: hidden;
}

.original-image-stage img {
  max-width: 100%;
  max-height: min(70vh, 680px);
  display: block;
}

.draft-layout,
.final-layout {
  min-height: 0;
  display: grid;
  gap: 18px;
}

.draft-layout {
  grid-template-columns: minmax(320px, 640px);
}

.final-layout {
  grid-template-columns: 360px minmax(420px, 1fr) 180px;
  align-items: start;
}

.final-sidebar {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  border-radius: 18px;
  overflow: hidden;
}

.final-draft-panel,
.final-inbox-panel,
.final-main,
.final-actions-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.final-draft-panel,
.final-inbox-panel,
.final-main {
  min-width: 0;
  padding: 20px;
}

.draft-only-panel {
  border-color: transparent;
  box-shadow: none;
}

.final-draft-panel,
.final-inbox-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.final-draft-panel,
.final-inbox-panel {
  align-self: start;
}

.final-inbox-summary {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.draft-type-tabs {
  min-height: 42px;
  display: inline-flex;
  align-items: flex-end;
  gap: 36px;
  margin: 12px 0 14px;
  border-bottom: 1px solid var(--line);
  padding: 0 2px;
}

.draft-type-tabs button {
  position: relative;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  padding: 0 0 11px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
  white-space: nowrap;
}

.draft-type-tabs button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
}

.draft-type-tabs button:hover {
  background: transparent;
  color: var(--ink);
}

.draft-type-tabs button.is-active {
  color: var(--ink-strong);
}

.draft-type-tabs button.is-active::after {
  background: var(--ink-strong);
}

.final-inbox-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding-right: 4px;
}

.final-sidebar .final-inbox-list {
  max-height: calc(100vh - 340px);
}

.draft-only-list {
  max-height: calc(100vh - 260px);
}

.deleted-draft-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
}

.deleted-draft-section.is-hidden {
  display: none;
}

.deleted-draft-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.deleted-draft-heading h3 {
  margin: 3px 0 0;
  color: var(--ink-strong);
  font-size: 15px;
}

.deleted-draft-heading h3 span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-size: 11px;
}

.deleted-draft-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.deleted-draft-list {
  display: grid;
  gap: 8px;
}

.deleted-draft-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 64px;
  padding: 9px 10px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface-raised) 76%, transparent);
  color: var(--ink);
}

.deleted-draft-item .final-inbox-thumb {
  width: 42px;
  height: auto;
  aspect-ratio: 3 / 4;
  opacity: .72;
  filter: saturate(.72);
}

.deleted-draft-item button {
  min-height: 30px;
}

.deleted-draft-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.deleted-draft-actions .is-danger {
  color: var(--danger, #c93649);
}

.deleted-draft-actions .is-danger:not(:disabled):hover {
  background: color-mix(in srgb, var(--danger, #c93649) 9%, var(--surface-raised));
}

.final-inbox-item {
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(105, 117, 134, 0.16);
  border-radius: 12px;
  background: var(--surface-raised);
  padding: 10px;
  color: var(--ink);
  text-align: left;
}

.final-inbox-item:hover {
  border-color: transparent;
  background: #f2f2f2;
}

.final-inbox-item.is-active {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 24%, var(--surface-raised));
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent),
    0 8px 20px color-mix(in srgb, var(--accent) 8%, transparent);
}

.final-inbox-item.is-active:hover,
.final-inbox-item.is-draft.is-active,
.final-inbox-item.is-draft.is-active:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 28%, var(--surface-raised));
}

.final-inbox-item.is-draft {
  background: #fffaf8;
}

.final-inbox-item.is-draft:hover {
  border-color: transparent;
  background: #f2f2f2;
}

.draft-list-item:hover {
  border-color: rgba(105, 117, 134, 0.16);
  background: #fffaf8;
}

.final-type-tabs {
  gap: 32px;
  margin: 10px 0 14px;
}

.final-type-tabs button {
  font-size: 15px;
}

.final-status-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 8px;
  border-radius: 10px;
  background: var(--surface-raised);
  padding: 4px;
}

.final-status-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  box-shadow: none;
}

.final-status-count {
  margin: 0;
  color: currentColor;
  font: inherit;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.final-status-tabs button.is-active {
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: var(--shadow-soft);
}

.final-list-card {
  position: relative;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  padding-right: 12px;
}

.final-list-card.is-graphic {
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
}

.final-list-card.is-frozen,
.draft-list-item.is-frozen,
.deleted-draft-item.is-frozen,
.speech-schedule-card.is-frozen {
  opacity: 0.76;
}

.final-list-card.is-frozen:hover,
.draft-list-item.is-frozen:hover,
.speech-schedule-card.is-frozen:hover {
  transform: none;
}

.create-view.is-readonly .draft-title,
.create-view.is-readonly .draft-output,
.create-view.is-readonly .draft-meta,
.image-edit-panel.is-readonly {
  position: relative;
}

.create-view.is-readonly .draft-output::before,
.image-edit-panel.is-readonly::before {
  content: "已冻结 · 只读查看";
  position: absolute;
  z-index: 6;
  top: 10px;
  right: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 12%, var(--surface));
  color: var(--muted);
  padding: 4px 9px;
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  pointer-events: none;
}

.final-inbox-copy .final-card-kicker {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.final-origin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 7px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent-deep);
  font-size: 10px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  letter-spacing: .02em;
  white-space: nowrap;
}

.final-inbox-copy .final-card-title {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
  font-weight: var(--font-weight-medium);
}

.final-publish-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--muted);
  padding: 3px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.final-publish-badge.is-published {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  color: var(--accent-deep);
}

.draft-list-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.draft-item-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  text-align: left;
}

.draft-item-main:hover {
  border-color: transparent;
  color: inherit;
}

.draft-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.draft-item-actions button {
  min-height: 32px;
  padding: 0 10px;
}

.draft-item-actions .ui-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
}

.draft-speech-thumb {
  display: grid;
  place-items: center;
  background: var(--accent-wash);
  color: var(--accent);
}

.draft-speech-thumb .ui-icon {
  width: 22px;
  height: 22px;
}

.final-inbox-thumb {
  border-radius: 10px;
}

.final-inbox-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.final-inbox-copy strong,
.final-inbox-copy span,
.final-inbox-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.final-inbox-copy .draft-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: visible;
}

.draft-title-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.final-inbox-copy .draft-origin-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent-deep);
  font-size: 10px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  letter-spacing: .02em;
}

.final-inbox-copy strong {
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
}

.final-inbox-copy span,
.final-inbox-copy em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.final-image-strip {
  --final-image-card-min-width: 92px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--final-image-card-min-width), 1fr));
  gap: 12px;
  margin-top: 0;
  overflow: hidden;
}

.final-images-panel {
  min-width: 0;
  display: grid;
}

.final-images-toggle {
  margin-top: 10px;
  margin-bottom: 0;
}

.final-preview-card {
  min-height: min(720px, calc(100vh - 210px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.final-preview-card.is-speech .final-image-strip {
  display: block;
}

.final-image-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
}

.final-image-preview-button {
  width: 100%;
  display: block;
  border: 0;
  border-radius: inherit;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  text-align: left;
  cursor: zoom-in;
}

.final-image-preview-button:hover {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: inherit;
  transform: none;
}

.final-image-preview-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, #fff);
  outline-offset: -3px;
}

.final-image-card.is-missing {
  border-style: dashed;
  background: var(--accent-wash);
}

.final-image-card.is-missing strong {
  color: var(--accent-deep);
}

.final-image-card span {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-bottom-right-radius: 10px;
  background: rgba(17, 24, 39, 0.62);
  color: #fff;
  font-weight: var(--font-weight-semibold);
}

.final-image-card strong {
  display: block;
  padding: 9px 10px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.final-copy {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.final-copy h3 {
  margin: 0 0 12px;
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
}

.final-copy pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 1.8;
}

.final-actions-panel {
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 16px;
  position: sticky;
  top: 18px;
}

.final-actions-panel button {
  width: 100%;
  justify-content: center;
}

.final-speech-note {
  margin: 0;
}

.topic-area {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-tags button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-color: var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.topic-tags button.is-selected {
  border-color: rgba(240, 67, 103, 0.34);
  background: rgba(240, 67, 103, 0.06);
}

.topic-tags button.is-suggestion {
  border-style: dashed;
  color: var(--muted);
}

.topic-tags button.is-suggestion:hover {
  border-style: solid;
  color: var(--accent);
}

.topic-tags button.is-add {
  border-color: transparent;
  color: var(--ink);
}

.topic-tags i {
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  font-style: normal;
  margin-left: 5px;
}

.topic-tags .ui-icon {
  width: 13px;
  height: 13px;
}

.output-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.output-footer > div {
  display: flex;
  gap: 8px;
}

.draft-save-actions {
  margin-left: auto;
}

.output-footer .primary {
  min-width: 150px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.output-footer button:disabled {
  cursor: not-allowed;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.48);
  padding: 18px;
}

.modal-shell.is-hidden {
  display: none;
}

.modal-card {
  width: min(720px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.24);
}

.schedule-settings-modal {
  z-index: 140;
}

.cover-demo-settings-card {
  width: min(900px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--accent) 14%, rgba(255, 255, 255, 0.34));
  border-radius: 20px;
  padding: 20px;
}

.cover-demo-settings-head {
  padding-bottom: 14px;
}

.cover-demo-settings-head h3 {
  margin: 2px 0 4px;
  color: var(--ink-strong);
  font-size: 22px;
  line-height: 1.2;
}

.cover-demo-settings-head p:last-child {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.cover-demo-settings-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--canvas) 64%, var(--surface-raised));
  padding: 11px 12px 11px 14px;
}

.cover-demo-settings-toolbar > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.cover-demo-settings-toolbar strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.cover-demo-settings-toolbar span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.cover-demo-settings-list {
  min-height: 260px;
  max-height: min(540px, calc(100vh - 230px));
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  align-content: start;
  overflow: auto;
  border-radius: 14px;
  background: color-mix(in srgb, var(--canvas) 62%, var(--surface));
  padding: 14px;
  scrollbar-gutter: stable;
}

.cover-demo-settings-list .empty-state {
  grid-column: 1 / -1;
  min-height: 230px;
  display: grid;
  place-items: center;
  border: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 82%, transparent);
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.cover-demo-settings-list .cover-demo-card {
  transition: border-color 160ms ease, background-color 160ms ease;
}

.cover-demo-settings-list .cover-demo-card:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background: color-mix(in srgb, var(--accent-wash) 28%, var(--surface));
}

.schedule-settings-modal-card {
  width: min(900px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--accent) 14%, rgba(255, 255, 255, 0.34));
  border-radius: 20px;
  padding: 20px;
}

.schedule-settings-modal-head {
  padding-bottom: 14px;
}

.schedule-settings-modal-head h3 {
  margin: 2px 0 3px;
  color: var(--ink-strong);
  font-size: 22px;
  line-height: 1.2;
}

.schedule-settings-modal-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.schedule-settings-state {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--canvas) 64%, var(--surface-raised));
  padding: 7px 11px;
  color: var(--muted);
  font-size: 11px;
}

.schedule-settings-state strong {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 0 10px;
  font-size: 11px;
}

.schedule-settings-state strong::before {
  width: 6px;
  height: 6px;
  content: "";
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}

.schedule-settings-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.schedule-settings-mode-tabs > button {
  position: relative;
  min-width: 0;
  min-height: 68px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 3px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 12px;
  background: var(--surface-raised);
  padding: 11px 14px;
  text-align: left;
  box-shadow: none;
}

.schedule-settings-mode-tabs > button span {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.schedule-settings-mode-tabs > button em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.schedule-settings-mode-tabs > button.is-active {
  border-color: color-mix(in srgb, var(--accent) 52%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 52%, var(--surface-raised));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 10%, transparent);
}

.schedule-settings-mode-tabs > button.is-current::after {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.schedule-settings-mode-panel {
  min-height: 0;
  overflow: auto;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-raised) 74%, var(--surface));
  padding: 16px;
}

.schedule-default-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
}

.schedule-default-overview > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.schedule-plan-kicker {
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.08em;
}

.schedule-default-overview strong {
  color: var(--ink-strong);
  font-size: 16px;
}

.schedule-default-overview p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.schedule-default-overview > .primary {
  min-width: 126px;
  flex: 0 0 auto;
}

.schedule-default-overview > .primary:disabled {
  cursor: default;
}

.schedule-default-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border-top: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  padding-top: 14px;
}

.schedule-settings-modal-card .schedule-customization-editor {
  display: grid;
  gap: 14px;
}

.schedule-settings-modal-card .schedule-customization-editor[hidden] {
  display: none;
}

.schedule-settings-modal-card .schedule-editor-intro,
.schedule-settings-modal-card .schedule-editor-section-head,
.schedule-settings-modal-card .schedule-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-settings-modal-card .schedule-editor-intro strong,
.schedule-settings-modal-card .schedule-editor-section-head strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.schedule-settings-modal-card .schedule-editor-intro span,
.schedule-settings-modal-card .schedule-editor-section-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}

.schedule-settings-modal-card .schedule-editor-cycle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(116px, 0.9fr);
  align-items: end;
  gap: 9px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--canvas) 66%, var(--surface));
  padding: 11px;
}

.schedule-settings-modal-card .schedule-editor-cycle label,
.schedule-settings-modal-card .schedule-cycle-total {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.schedule-settings-modal-card .schedule-cycle-mark {
  padding-bottom: 8px;
  color: var(--muted);
}

.schedule-settings-modal-card .schedule-cycle-total strong {
  min-height: 34px;
  display: flex;
  align-items: center;
  color: var(--ink-strong);
  font-size: 14px;
}

.schedule-settings-modal-card .schedule-number-field {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-radius: 9px;
  background: var(--surface);
  padding-right: 9px;
}

.schedule-settings-modal-card .schedule-number-field input {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  border: 0;
  background: transparent;
  padding: 0 9px;
  color: var(--ink-strong);
}

.schedule-settings-modal-card .schedule-number-field em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.schedule-settings-modal-card .schedule-editor-section,
.schedule-settings-modal-card .schedule-editor-rows {
  display: grid;
  gap: 8px;
}

.schedule-settings-modal-card .schedule-editor-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 8px;
}

.schedule-settings-modal-card .schedule-row-name {
  color: var(--muted);
  font-size: 10px;
}

.schedule-settings-modal-card .schedule-editor-row > input {
  min-width: 0;
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 9px;
  background: var(--surface);
  padding: 0 10px;
  color: var(--ink-strong);
  font-size: 11px;
}

.schedule-settings-modal-card .schedule-editor-row > input:focus,
.schedule-settings-modal-card .schedule-number-field:focus-within {
  outline: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 1px;
}

.schedule-settings-modal-card .schedule-number-field input:focus,
.schedule-settings-modal-card .schedule-number-field input:focus-visible {
  outline: 0;
  box-shadow: none;
}

.schedule-settings-modal-card .schedule-fixed-count {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

.schedule-settings-modal-card .schedule-editor-balance {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
}

.schedule-settings-modal-card .schedule-editor-balance strong {
  color: var(--ink-strong);
  font-size: 12px;
}

.schedule-settings-modal-card .schedule-editor-balance span {
  color: var(--muted);
  font-size: 10px;
}

.schedule-settings-modal-card .schedule-editor-balance span[data-state="valid"] {
  color: #4b996a;
}

.schedule-settings-modal-card .schedule-editor-balance span[data-state="invalid"] {
  color: var(--accent-deep);
}

.schedule-settings-modal-card .schedule-editor-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.schedule-settings-modal-card .schedule-editor-actions .button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 11px;
}

@media (max-width: 720px) {
  .cover-demo-settings-modal {
    padding: 10px;
  }

  .cover-demo-settings-card {
    max-height: calc(100vh - 20px);
    gap: 10px;
    border-radius: 16px;
    padding: 14px;
  }

  .cover-demo-settings-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .cover-demo-settings-toolbar .cover-demo-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cover-demo-settings-toolbar .cover-demo-actions button {
    width: 100%;
  }

  .cover-demo-settings-list {
    min-height: 220px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .schedule-settings-modal {
    padding: 10px;
  }

  .schedule-settings-modal-card {
    max-height: calc(100vh - 20px);
    gap: 10px;
    border-radius: 16px;
    padding: 14px;
  }

  .schedule-settings-mode-tabs {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .schedule-settings-mode-tabs > button {
    min-height: 56px;
  }

  .schedule-default-overview,
  .schedule-settings-modal-card .schedule-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-default-overview > .primary {
    width: 100%;
  }

  .schedule-settings-modal-card .schedule-editor-cycle {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .schedule-settings-modal-card .schedule-editor-cycle .schedule-cycle-mark:nth-of-type(2),
  .schedule-settings-modal-card .schedule-cycle-total {
    display: none;
  }

  .schedule-settings-modal-card .schedule-editor-row {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .schedule-settings-modal-card .schedule-row-name {
    grid-column: 1 / -1;
  }

  .schedule-settings-modal-card .schedule-editor-balance {
    justify-items: start;
    text-align: left;
  }
}

.upload-modal {
  padding: 16px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head .compact {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
}

.modal-head .compact .ui-icon {
  width: 16px;
  height: 16px;
}

.speech-source-modal {
  width: min(760px, calc(100vw - 36px));
  max-height: calc(100vh - 52px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: 16px;
}

.speech-source-modal h3 {
  margin: 3px 0 0;
  color: var(--ink-strong);
  font-size: 20px;
}

.speech-source-summary {
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.speech-source-list {
  min-height: 240px;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 2px 4px 2px 0;
}

.speech-source-item {
  min-height: 92px;
}

.speech-source-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.upload-qr-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 18px;
  padding-top: 16px;
  align-items: center;
}

.qr-frame {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-raised);
  padding: 16px;
}

.qr-frame img {
  width: 260px;
  height: 260px;
}

.upload-qr-info {
  display: grid;
  gap: 10px;
}

.upload-target-field {
  gap: 6px;
}

.upload-target-field select {
  min-height: 44px;
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  background-color: var(--surface);
}

.upload-target-field .themed-select-trigger {
  min-height: 44px;
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}

.upload-qr-info strong {
  color: var(--ink-strong);
  font-size: 18px;
}

.upload-qr-info p,
.upload-qr-info a {
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.upload-qr-info a {
  color: var(--accent-deep);
  font-weight: var(--font-weight-semibold);
}

.upload-status {
  border: 1px solid rgba(157, 89, 102, 0.18);
  border-radius: 10px;
  background: var(--sage-soft);
  color: var(--sage);
  padding: 10px 12px;
  font-weight: var(--font-weight-medium);
}

.final-export-modal {
  width: min(760px, calc(100vw - 32px));
}

.final-export-permission-note {
  border-left: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  padding-left: 10px;
  font-size: 12px;
}

.final-export-local-btn {
  width: auto;
  justify-self: start;
  margin-top: 2px;
}

.asset-preview-modal {
  width: min(1160px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 16px;
}

.asset-preview-modal .modal-head {
  align-items: center;
}

.asset-editor-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.asset-editor-heading h2 {
  margin: 0;
}

.asset-editor-meta-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-editor-meta-actions button {
  min-width: 76px;
  min-height: 32px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.asset-editor-meta-actions button.is-active,
.asset-editor-meta-actions button:not(:disabled):hover {
  border-color: rgba(201, 54, 73, 0.28);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.asset-editor-meta-actions button:disabled {
  opacity: 1;
  cursor: default;
}

/* Editing is a focused modal workflow and must stay above the sticky material toolbar. */
#assetPreviewModal {
  z-index: 300;
}

#imagePickerModal.is-over-asset-editor {
  z-index: 320;
}

#imageOriginalModal.is-over-image-picker {
  z-index: 340;
}

.asset-editor-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 14px;
  padding-top: 14px;
}

.asset-editor-stage {
  position: relative;
  min-width: 0;
  min-height: 420px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(45deg, rgba(211, 218, 228, 0.42) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(211, 218, 228, 0.42) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(211, 218, 228, 0.42) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(211, 218, 228, 0.42) 75%),
    #f7ecef;
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  overflow: auto;
  padding: 12px;
}

.asset-editor-stage canvas {
  max-width: 100%;
  max-height: calc(100vh - 190px);
  display: block;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.22);
  cursor: grab;
}

.asset-editor-stage canvas:active {
  cursor: grabbing;
}

.asset-editor-stage canvas.is-mosaic-active,
.asset-editor-stage canvas.is-mosaic-active:active {
  cursor: none;
  touch-action: none;
}

.asset-editor-stage canvas.is-text-active,
.asset-editor-stage canvas.is-text-active:active,
.asset-editor-stage canvas.is-pip-active,
.asset-editor-stage canvas.is-pip-active:active {
  cursor: grab;
  touch-action: none;
}

.asset-editor-stage canvas.is-pip-reframe-active,
.asset-editor-stage canvas.is-pip-reframe-active:active {
  cursor: all-scroll;
}

.asset-editor-inline-text {
  position: absolute;
  z-index: 8;
  min-width: 92px;
  min-height: 48px;
  margin: 0;
  overflow: auto;
  border: 1.5px solid rgba(232, 79, 95, 0.94);
  border-radius: 4px;
  outline: 0;
  background: transparent;
  color: #fff;
  padding: 4px 6px;
  caret-color: #e84f5f;
  text-align: center;
  paint-order: stroke fill;
  resize: none;
  transform-origin: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.76), 0 4px 14px rgba(15, 13, 18, 0.2);
}

.asset-editor-inline-text::selection {
  background: rgba(108, 99, 232, 0.42);
  color: inherit;
}

.asset-editor-inline-text.is-hidden {
  display: none;
}

.asset-mosaic-cursor {
  position: absolute;
  z-index: 6;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: rgba(20, 24, 31, 0.08);
  box-shadow: 0 0 0 1px rgba(14, 18, 26, 0.66), 0 3px 14px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.asset-mosaic-cursor.is-erase {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.16);
}

.asset-mosaic-dock {
  order: 2;
  display: grid;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(28, 25, 25, 0.92);
  color: #fff;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(16, 18, 24, 0.2);
  backdrop-filter: blur(16px);
}

.asset-mosaic-dock-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
}

.asset-mosaic-icon-action {
  width: 36px;
  height: 36px;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  padding: 0;
  font-size: 22px;
  line-height: 1;
}

.asset-mosaic-icon-action.is-confirm {
  border-color: rgba(255, 255, 255, 0.88);
  background: #fff;
  color: #242020;
}

.asset-mosaic-size-control {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) 32px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-mosaic-size-control input {
  min-width: 0;
  accent-color: #fff;
}

.asset-mosaic-size-control output {
  color: rgba(255, 255, 255, 0.74);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.asset-mosaic-command-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.asset-mosaic-command-row button {
  min-width: 0;
  min-height: 30px;
  border-color: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.78);
  padding: 0 6px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-mosaic-command-row button.is-active {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.94);
  color: #292323;
}

.asset-mosaic-command-row button:disabled {
  opacity: 0.34;
}

.asset-mosaic-presets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.asset-mosaic-presets button {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
  border-color: rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.74);
  padding: 6px 9px;
  text-align: left;
}

.asset-mosaic-presets button.is-active {
  border-color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.asset-mosaic-presets span {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background-color: #9a7277;
  background-image:
    linear-gradient(45deg, rgba(255, 218, 184, 0.72) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(63, 92, 112, 0.68) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(185, 107, 105, 0.82) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(232, 205, 151, 0.78) 75%);
  background-position: 0 0, 0 50%, 50% -50%, -50% 0;
}

.asset-mosaic-presets span.is-fine {
  background-size: 6px 6px;
}

.asset-mosaic-presets span.is-standard {
  background-size: 10px 10px;
}

.asset-mosaic-presets span.is-coarse {
  background-size: 16px 16px;
}

.asset-mosaic-presets em {
  overflow: hidden;
  font-size: 12px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .asset-mosaic-dock-head {
    gap: 8px;
  }
}

.asset-editor-controls {
  min-width: 0;
  max-height: calc(100vh - 126px);
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  padding: 12px;
}

.asset-editor-tabs {
  order: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 4px;
}

.asset-editor-tabs button {
  min-height: 36px;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-tabs button.is-active {
  border-color: rgba(201, 54, 73, 0.32);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.asset-editor-quick-tools {
  order: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.asset-editor-quick-tools button {
  min-height: 36px;
  border-color: rgba(201, 54, 73, 0.28);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 6px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.asset-editor-quick-tools button.is-active,
.asset-editor-quick-tools button:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.asset-editor-enhance-entry {
  position: relative;
  min-width: 0;
}

.asset-editor-enhance-entry #assetEditorEnhanceToolBtn {
  width: 100%;
}

.asset-enhancement-preview-trigger {
  position: relative;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  align-self: start;
  justify-self: end;
  border: 1px solid rgba(93, 80, 154, 0.28);
  border-radius: 50%;
  background: rgba(109, 96, 181, 0.08);
  color: #5d509a;
  cursor: help;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.asset-enhancement-preview-trigger:hover,
.asset-enhancement-preview-trigger:focus-visible {
  border-color: rgba(93, 80, 154, 0.58);
  background: rgba(109, 96, 181, 0.16);
  color: #4d408d;
  outline: none;
}

.asset-enhancement-preview-icon {
  display: block;
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.asset-enhancement-preview-popover {
  position: fixed;
  z-index: 240;
  width: 244px;
  max-width: calc(100vw - 32px);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-5px) scale(0.98);
  transform-origin: top center;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 12px;
  background: var(--surface-raised);
  padding: 6px;
  pointer-events: none;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.asset-enhancement-preview-trigger:hover .asset-enhancement-preview-popover,
.asset-enhancement-preview-popover.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: none;
}

.asset-enhancement-preview-popover video {
  display: block;
  width: 100%;
  max-height: min(58vh, 360px);
  border-radius: 8px;
  background: #0b0b0c;
  object-fit: contain;
}

.asset-enhancement-preview-popover strong,
.asset-enhancement-preview-popover small {
  display: block;
  text-align: center;
}

.asset-enhancement-preview-popover strong {
  margin-top: 7px;
  color: var(--ink);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
}

.asset-enhancement-preview-popover small {
  margin: 3px 3px 2px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-panel {
  display: grid;
  gap: 10px;
}

.asset-editor-tool {
  order: 2;
  display: none;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.asset-editor-tool[open] {
  display: grid;
  border-color: rgba(201, 54, 73, 0.28);
}

.asset-editor-tool-button {
  display: none;
  min-height: 54px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.asset-editor-tool-button::-webkit-details-marker {
  display: none;
}

.asset-editor-tool-button::after {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
  mask: url("/assets/icons/ui-add.svg") center / 16px 16px no-repeat;
  -webkit-mask: url("/assets/icons/ui-add.svg") center / 16px 16px no-repeat;
  transition: transform 160ms ease, background 160ms ease;
}

.asset-editor-tool[open] .asset-editor-tool-button {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.asset-editor-tool[open] .asset-editor-tool-button::after {
  background: var(--accent-deep);
  transform: rotate(45deg);
}

.asset-editor-tool-button span,
.asset-editor-tool-button small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-editor-tool-button span {
  color: inherit;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.asset-editor-tool-button small {
  grid-column: 1 / 2;
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-tool-body {
  border-top: 0;
  padding: 12px;
}

.asset-editor-retouch-target {
  margin: 0 0 2px;
  padding: 7px 10px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
}

.asset-editor-retouch-target.is-pip-target {
  background: color-mix(in srgb, var(--accent-soft) 76%, var(--surface));
  color: var(--accent-deep);
}

.asset-enhancement-tool[open] {
  border-color: rgba(93, 80, 154, 0.34);
  background:
    linear-gradient(145deg, rgba(109, 96, 181, 0.08), transparent 46%),
    var(--surface);
}

.asset-enhancement-panel {
  gap: 12px;
}

.asset-enhancement-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.asset-enhancement-heading strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.asset-enhancement-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.asset-enhancement-heading > span {
  flex: 0 0 auto;
  border: 1px solid rgba(93, 80, 154, 0.24);
  border-radius: 999px;
  background: rgba(109, 96, 181, 0.09);
  color: #5d509a;
  padding: 4px 7px;
  font-size: 9px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.04em;
}

.asset-enhancement-modes {
  display: grid;
  gap: 7px;
}

.asset-enhancement-mode {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 9px 10px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.asset-enhancement-mode:hover {
  border-color: rgba(93, 80, 154, 0.34);
}

.asset-enhancement-mode:has(input:checked) {
  border-color: rgba(93, 80, 154, 0.52);
  background: rgba(109, 96, 181, 0.1);
  box-shadow: inset 3px 0 0 #6d60b5;
}

.asset-enhancement-mode-choice {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.asset-enhancement-mode-choice input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #6d60b5;
}

.asset-enhancement-mode-copy,
.asset-enhancement-mode-copy strong,
.asset-enhancement-mode-copy small {
  min-width: 0;
  display: block;
}

.asset-enhancement-mode-copy strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
}

.asset-enhancement-mode-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.asset-enhancement-progress {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(93, 80, 154, 0.2);
  border-radius: 10px;
  background: rgba(109, 96, 181, 0.08);
  padding: 10px;
}

.asset-enhancement-progress.is-hidden {
  display: none;
}

.asset-enhancement-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.asset-enhancement-progress-copy strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
}

.asset-enhancement-progress-copy span {
  color: #5d509a;
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-semibold);
}

.asset-enhancement-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(93, 80, 154, 0.13);
}

.asset-enhancement-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d60b5, #c93649 72%, #e7a85d);
  transition: width 420ms ease;
}

.asset-enhancement-action {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  background: linear-gradient(100deg, #584a99, #6d60b5 58%, #85536f);
  box-shadow: 0 10px 22px rgba(80, 65, 145, 0.18);
  font-weight: var(--font-weight-semibold);
}

.asset-enhancement-action:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.54;
}

.asset-enhancement-hint {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.asset-meta-panel {
  order: 3;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.asset-editor-panel[data-asset-editor-panel] {
  order: 4;
}

.asset-tag-editor {
  display: grid;
  gap: 8px;
}

.asset-tag-editor > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.asset-editor-tags em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.asset-editor-tag {
  min-height: 28px;
  border: 1px solid rgba(157, 89, 102, 0.18);
  border-radius: 999px;
  background: var(--sage-soft);
  color: #8f3445;
  padding: 0 9px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-tag span {
  display: inline-grid;
  place-items: center;
  color: #8a4a3a;
}

.asset-editor-tag .ui-icon {
  width: 12px;
  height: 12px;
}

.asset-tag-input-row,
.asset-meta-actions {
  display: flex;
  gap: 8px;
}

.asset-tag-input-row input {
  min-width: 0;
  flex: 1;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 0 10px;
}

.asset-editor-text-panel {
  gap: 12px;
}

.asset-editor-text-panel-head {
  display: block;
}

.asset-editor-add-text-btn {
  width: 100%;
  min-height: 46px;
  border-color: rgba(201, 54, 73, 0.3);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 0 16px;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.asset-editor-add-text-btn:hover {
  border-color: rgba(201, 54, 73, 0.5);
  background: color-mix(in srgb, var(--accent-soft) 76%, var(--accent) 24%);
}

.asset-editor-pip-panel {
  gap: 12px;
}

.asset-editor-add-pip-btn {
  width: 100%;
  min-height: 46px;
  border-color: rgba(201, 54, 73, 0.3);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 0 16px;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.asset-editor-add-pip-btn:hover {
  border-color: rgba(201, 54, 73, 0.5);
  background: color-mix(in srgb, var(--accent-soft) 76%, var(--accent) 24%);
}

.asset-editor-pip-selection-hint {
  min-height: 18px;
  margin: -2px 2px 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-regular);
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-editor-pip-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.asset-editor-pip-actions button {
  min-width: 0;
  min-height: 60px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border-color: var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 88%, var(--nav) 12%);
  color: var(--ink);
  padding: 7px 3px;
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  white-space: nowrap;
}

.asset-editor-pip-actions button:not(:disabled):hover,
.asset-editor-pip-actions button.is-active {
  border-color: rgba(201, 54, 73, 0.34);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.asset-editor-pip-actions button.is-danger:not(:disabled):hover {
  border-color: rgba(201, 54, 73, 0.42);
  background: color-mix(in srgb, var(--accent-soft) 82%, var(--surface));
}

.asset-editor-pip-actions button:disabled,
.asset-editor-pip-ratios button:disabled,
.asset-editor-pip-layer-actions button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.asset-editor-pip-actions .ui-icon {
  width: 20px;
  height: 20px;
}

.asset-editor-pip-flip-icon {
  transform: rotate(90deg) scaleY(-1);
}

.asset-editor-pip-transform {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 90%, var(--nav) 10%);
  padding: 10px;
}

.asset-editor-pip-transform.is-hidden {
  display: none;
}

.asset-editor-pip-transform label {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
}

.asset-editor-pip-transform label > span,
.asset-editor-pip-transform output,
.asset-editor-pip-section-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-pip-transform input {
  min-width: 0;
  margin: 0;
}

.asset-editor-pip-transform output {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.asset-editor-pip-ratio-section {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.asset-editor-pip-section-label {
  padding-left: 2px;
}

.asset-editor-pip-ratio-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.asset-editor-pip-reframe-btn {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-color: var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--nav) 12%);
  color: var(--ink);
  padding: 0 10px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.asset-editor-pip-reframe-btn .ui-icon {
  width: 14px;
  height: 14px;
}

.asset-editor-pip-reframe-btn:not(:disabled):hover,
.asset-editor-pip-reframe-btn.is-active {
  border-color: rgba(201, 54, 73, 0.4);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.asset-editor-pip-reframe-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.asset-editor-pip-reframe-hint {
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: var(--font-weight-regular);
  line-height: 1.45;
}

.asset-editor-pip-ratios {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px;
}

.asset-editor-pip-ratios button {
  min-width: 0;
  min-height: 52px;
  display: grid;
  place-items: center;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 4px 1px;
  font-size: 9px;
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.asset-editor-pip-ratio-preview {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 88%, var(--nav) 12%);
  padding: 2px;
  line-height: 1;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.asset-editor-pip-ratios button[data-asset-pip-ratio="2:3"] .asset-editor-pip-ratio-preview {
  width: 28px;
}

.asset-editor-pip-ratios button[data-asset-pip-ratio="3:2"] .asset-editor-pip-ratio-preview {
  height: 28px;
}

.asset-editor-pip-ratios button[data-asset-pip-ratio="3:4"] .asset-editor-pip-ratio-preview {
  width: 32px;
}

.asset-editor-pip-ratios button[data-asset-pip-ratio="4:3"] .asset-editor-pip-ratio-preview {
  height: 32px;
}

.asset-editor-pip-ratios button[data-asset-pip-ratio="9:16"] .asset-editor-pip-ratio-preview {
  width: 24px;
  font-size: 8px;
  letter-spacing: -0.25px;
}

.asset-editor-pip-ratios button[data-asset-pip-ratio="16:9"] .asset-editor-pip-ratio-preview {
  height: 24px;
}

.asset-editor-pip-ratios button:not(:disabled):hover .asset-editor-pip-ratio-preview,
.asset-editor-pip-ratios button.is-active .asset-editor-pip-ratio-preview {
  border-color: rgba(201, 54, 73, 0.4);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.asset-editor-pip-ratios button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 58%, transparent);
  outline-offset: 1px;
}

.asset-editor-pip-layer-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.asset-editor-pip-layer-actions button {
  min-width: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 5px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.asset-editor-pip-layer-actions button:not(:disabled):hover {
  border-color: rgba(201, 54, 73, 0.34);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.asset-editor-pip-layer-actions .ui-icon {
  width: 13px;
  height: 13px;
}

.asset-editor-text-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.asset-editor-text-presets button {
  min-width: 0;
  min-height: 68px;
  display: grid;
  place-items: center;
  gap: 3px;
  border-color: var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(31, 28, 29, 0.92), rgba(61, 48, 51, 0.9));
  color: #fff;
  padding: 8px;
}

.asset-editor-text-presets button:nth-child(2) {
  color: #fff36a;
}

.asset-editor-text-presets button.is-active {
  border-color: rgba(232, 79, 95, 0.92);
  box-shadow: 0 0 0 2px rgba(232, 79, 95, 0.16);
}

.asset-editor-text-presets strong {
  overflow: hidden;
  font-family: "Lizi Qiaokeai Jian Zhongcu", "励字敲可爱简中粗", "Yuanti SC", "PingFang SC", sans-serif;
  font-size: 16px;
  font-weight: var(--font-weight-art-heavy);
  line-height: 1.15;
  text-overflow: ellipsis;
  text-shadow: -1px -1px 0 #050505, 1px -1px 0 #050505, -1px 1px 0 #050505, 1px 1px 0 #050505;
  white-space: nowrap;
}

.asset-editor-text-presets small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: var(--font-weight-medium);
}

.asset-text-layers {
  display: grid;
  gap: 6px;
}

.asset-text-layer {
  min-width: 0;
  min-height: 34px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  padding: 5px 7px;
  color: var(--ink);
  text-align: left;
}

.asset-text-layer.is-active {
  border-color: rgba(201, 54, 73, 0.42);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.asset-text-layer-swatch {
  width: 16px;
  height: 16px;
  border: 2px solid #111;
  border-radius: 4px;
}

.asset-text-layer span:not(.asset-text-layer-swatch) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-text-layer em {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-semibold);
}

.asset-editor-inline-grid,
.asset-editor-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.asset-editor-text-buttons {
  --asset-text-action-group-bg: color-mix(in srgb, var(--surface) 86%, var(--nav) 14%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--asset-text-action-group-bg);
  padding: 5px;
}

.asset-editor-text-buttons button {
  min-height: 34px;
  border-color: transparent;
  border-radius: 7px;
  padding: 0 8px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.asset-editor-text-buttons button:not(:disabled):hover {
  background: color-mix(in srgb, var(--accent-soft) 48%, transparent);
}

.asset-editor-text-buttons button.is-active {
  border-color: rgba(201, 54, 73, 0.42);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

#duplicateAssetEditorTextBtn {
  display: grid;
  place-items: center;
}

.asset-editor-copy-icon {
  position: relative;
  width: 19px;
  height: 19px;
  display: block;
}

.asset-editor-copy-icon::before,
.asset-editor-copy-icon::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 15px;
  border: 1.5px solid currentColor;
  border-radius: 1px;
  box-sizing: border-box;
}

.asset-editor-copy-icon::before {
  top: 0;
  left: 5px;
}

.asset-editor-copy-icon::after {
  top: 4px;
  left: 1px;
  background: var(--asset-text-action-group-bg, var(--surface));
}

.asset-editor-text-spacing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px;
}

.asset-editor-text-spacing.is-hidden {
  display: none;
}

.asset-editor-text-style-editor {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 2px;
}

.asset-editor-text-style-tabs {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.asset-editor-text-style-tabs::-webkit-scrollbar {
  display: none;
}

.asset-editor-text-style-tabs button {
  position: relative;
  min-height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 1px;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.asset-editor-text-style-tabs button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0;
  transform: scaleX(0.5);
  transition: opacity 140ms ease, transform 140ms ease;
}

.asset-editor-text-style-tabs button.is-active {
  color: var(--ink);
}

.asset-editor-text-style-tabs button.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.asset-editor-text-style-pane {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.asset-editor-text-style-pane.is-hidden,
.asset-editor-text-style-pane[hidden] {
  display: none;
}

.asset-editor-text-swatches {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 2px 7px;
  scrollbar-color: color-mix(in srgb, var(--muted) 28%, transparent) transparent;
  scrollbar-width: thin;
}

.asset-text-color-swatch,
.asset-editor-color-picker {
  position: relative;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex: 0 0 16px;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--line-strong) 76%, transparent);
  border-radius: 999px;
  background: var(--swatch, transparent);
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(20, 15, 17, 0.08);
}

.asset-text-color-swatch::after,
.asset-editor-color-picker::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid transparent;
  border-radius: 50%;
  pointer-events: none;
}

.asset-text-color-swatch:hover,
.asset-editor-color-picker:hover {
  transform: translateY(-1px);
}

.asset-text-color-swatch.is-active::after,
.asset-editor-color-picker.is-active::after {
  border-color: var(--accent);
}

.asset-text-color-swatch.is-none {
  background: transparent;
}

.asset-text-color-swatch.is-none::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 2px;
  width: 10px;
  height: 1px;
  border-radius: 999px;
  background: var(--muted);
  transform: rotate(-45deg);
}

.asset-editor-color-picker > span {
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: conic-gradient(#ff3155, #ffb020, #f7ec35, #2fd174, #31b9f4, #7557ed, #ef45c7, #ff3155);
  pointer-events: none;
}

.asset-editor-panel .asset-editor-color-picker input[type="color"] {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 0;
  border-radius: inherit;
  opacity: 0;
  padding: 0;
  cursor: pointer;
}

.asset-editor-text-adjustments {
  display: grid;
  gap: 13px;
}

.asset-editor-text-adjustments label {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.asset-editor-text-adjustments label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-text-adjustments input[type="range"] {
  min-width: 0;
  margin: 0;
}

.asset-editor-panel.is-hidden {
  display: none;
}

.asset-editor-panel .field {
  display: grid;
  gap: 6px;
}

.asset-editor-panel .field span,
.asset-editor-check span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-panel input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.asset-editor-panel input[type="number"] {
  width: 100%;
  min-height: 38px;
}

.asset-editor-panel input[type="color"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  padding: 4px;
}

.asset-editor-panel textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
}

.asset-editor-check {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-editor-picker {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.asset-editor-picker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.asset-editor-pick {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 6px;
  cursor: pointer;
}

.asset-editor-pick.is-selected {
  border-color: rgba(201, 54, 73, 0.48);
  background: var(--accent-soft);
  cursor: grab;
  touch-action: none;
}

.asset-editor-pick.is-dragging {
  opacity: 0.56;
}

.asset-editor-pick.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201, 54, 73, 0.16);
}

.asset-editor-pick input {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  z-index: 1;
}

.asset-editor-pick em {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-semibold);
  z-index: 1;
}

.asset-editor-pick img {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: block;
  border-radius: 7px;
  object-fit: cover;
  background: var(--surface-raised);
}

.asset-editor-pick > span:not(.asset-editor-pick-order) {
  min-width: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-editor-pick small {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-editor-pick small.asset-editor-pick-position {
  color: var(--accent);
  font-weight: var(--font-weight-semibold);
}

.asset-editor-pick-order {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.asset-editor-pick-order button {
  min-height: 28px;
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.asset-editor-pick-order button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.asset-editor-actions {
  order: 5;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.asset-editor-actions button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border-radius: 9px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.asset-editor-actions button,
.asset-editor-actions button.primary,
.asset-editor-actions button.secondary,
.asset-editor-actions button.ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.asset-editor-actions button:hover,
.asset-editor-actions button.primary:hover,
.asset-editor-actions button.secondary:hover,
.asset-editor-actions button.ghost:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-tint));
  color: var(--ink-strong);
  box-shadow: none;
}

.asset-editor-actions button:disabled {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.48;
}

.asset-editor-status {
  order: 6;
  margin: 0;
  border: 1px solid rgba(105, 117, 134, 0.14);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

/* Collage is a dedicated two-stage workflow: source selection first, layout second. */
#assetPreviewModal.is-collage-mode .asset-editor-quick-tools,
#assetPreviewModal.is-collage-mode .asset-mosaic-dock,
#assetPreviewModal.is-collage-mode [data-asset-editor-tool] {
  display: none;
}

#assetPreviewModal.is-collage-mode .asset-editor-stage {
  background-color: #f1f1f3;
  background-image:
    linear-gradient(rgba(91, 86, 101, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 86, 101, 0.055) 1px, transparent 1px);
  background-size: 20px 20px;
}

#assetPreviewModal.is-collage-mode .asset-editor-stage canvas {
  box-shadow: 0 16px 44px rgba(20, 19, 26, 0.17);
}

.asset-editor-collage-panel {
  order: 1 !important;
  display: grid;
  gap: 16px;
  padding-bottom: 4px;
}

.asset-editor-collage-intro {
  display: grid;
  gap: 10px;
}

.asset-editor-collage-intro > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.asset-editor-collage-intro strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  text-align: right;
}

.asset-editor-collage-choose {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px dashed color-mix(in srgb, var(--accent) 48%, var(--line));
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent-soft) 76%, var(--surface));
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.asset-editor-collage-choose > span:first-child {
  font-size: 22px;
  font-weight: var(--font-weight-regular);
  line-height: 1;
}

.asset-editor-collage-sources {
  min-height: 56px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 5px;
}

.asset-editor-collage-sources.is-empty {
  display: none;
}

.asset-editor-collage-sources button {
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 56px;
  min-height: 56px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 0;
}

.asset-editor-collage-sources button.is-active {
  border-color: #6c63e8;
  box-shadow: 0 0 0 2px rgba(108, 99, 232, 0.12);
}

.asset-editor-collage-sources img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.asset-editor-collage-sources em {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(20, 20, 23, 0.78);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: var(--font-weight-semibold);
}

.asset-editor-collage-source-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: -9px;
}

.asset-editor-collage-source-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-collage-source-actions button.is-danger:not(:disabled) {
  color: #b73549;
}

.asset-editor-collage-slot-zoom,
.asset-editor-collage-border-controls > label:not(.asset-editor-collage-seamless),
.asset-editor-collage-tone-controls label {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-collage-slot-zoom input,
.asset-editor-collage-border-controls input[type="range"],
.asset-editor-collage-tone-controls input[type="range"] {
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  accent-color: #6c63e8;
  box-shadow: none;
}

.asset-editor-collage-slot-zoom output,
.asset-editor-collage-border-controls output,
.asset-editor-collage-tone-controls output {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.asset-editor-collage-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.asset-editor-collage-section-title {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.asset-editor-collage-section-title small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-collage-ratios {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.asset-editor-collage-ratios button {
  min-width: 0;
  min-height: 68px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface-tint);
  color: var(--muted);
  padding: 5px 2px;
}

.asset-editor-collage-ratios button.is-active {
  border-color: rgba(108, 99, 232, 0.46);
  background: rgba(108, 99, 232, 0.09);
  color: #5d55ce;
}

.asset-editor-collage-ratios button > span {
  display: block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  opacity: 0.86;
}

.asset-editor-collage-ratios .is-portrait { width: 20px; height: 27px; }
.asset-editor-collage-ratios .is-landscape { width: 27px; height: 20px; }
.asset-editor-collage-ratios .is-square { width: 23px; height: 23px; }
.asset-editor-collage-ratios .is-story { width: 16px; height: 29px; }
.asset-editor-collage-ratios .is-wide { width: 29px; height: 16px; }

.asset-editor-collage-ratios em {
  font-size: 10px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.asset-editor-collage-creative-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.asset-editor-collage-creative-tabs > button {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 7px 10px;
  cursor: pointer;
  text-align: left;
}

.asset-editor-collage-creative-tabs > button > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.asset-editor-collage-creative-tabs > button.is-active {
  border-color: rgba(108, 99, 232, 0.35);
  background: color-mix(in srgb, #6c63e8 7%, var(--surface));
  color: #5d55ce;
}

.asset-editor-collage-creative-tabs > button.is-active .ui-icon {
  transform: rotate(180deg);
}

.asset-editor-collage-layout-thumb {
  width: 44px;
  height: 52px;
  display: grid;
  grid-template-columns: repeat(var(--collage-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--collage-rows), minmax(0, 1fr));
  gap: 2px;
  border-radius: 5px;
  background: color-mix(in srgb, currentColor 8%, transparent);
  padding: 3px;
}

.asset-editor-collage-layout-thumb i {
  min-width: 0;
  min-height: 0;
  border: 1.25px solid currentColor;
  border-radius: 2px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.asset-editor-collage-layout-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 76px;
}

.asset-editor-collage-layout-options > p {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.asset-editor-collage-layout-options button {
  width: 72px;
  min-width: 72px;
  height: 72px;
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface-tint);
  color: var(--muted);
  padding: 8px;
}

.asset-editor-collage-layout-options button:hover,
.asset-editor-collage-layout-options button:focus-visible,
.asset-editor-collage-layout-options button.is-active {
  border-color: rgba(108, 99, 232, 0.48);
  background: rgba(108, 99, 232, 0.08);
  color: #5d55ce;
}

.asset-editor-collage-border-controls {
  display: grid;
  gap: 13px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.asset-editor-collage-seamless {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.asset-editor-collage-seamless > span {
  display: grid;
  gap: 2px;
}

.asset-editor-collage-seamless strong,
.asset-editor-collage-creative-tabs strong {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.asset-editor-collage-seamless small,
.asset-editor-collage-creative-tabs small {
  color: var(--muted);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-collage-seamless input {
  width: 36px;
  min-width: 36px;
  height: 20px;
  min-height: 20px;
  flex: 0 0 36px;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 24%, transparent);
  padding: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 28%, transparent);
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.asset-editor-collage-seamless input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.28);
  transition: transform 160ms ease;
}

.asset-editor-collage-seamless input:checked {
  background: #6c63e8;
  box-shadow: inset 0 0 0 1px rgba(108, 99, 232, 0.5);
}

.asset-editor-collage-seamless input:checked::after {
  transform: translateX(16px);
}

.asset-editor-collage-seamless input:hover {
  background: color-mix(in srgb, var(--muted) 34%, transparent);
}

.asset-editor-collage-seamless input:checked:hover {
  background: #5d55ce;
}

.asset-editor-collage-seamless input:focus,
.asset-editor-collage-seamless input:focus-visible {
  background-color: color-mix(in srgb, var(--muted) 24%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted) 28%, transparent);
}

.asset-editor-collage-seamless input:checked:focus,
.asset-editor-collage-seamless input:checked:focus-visible {
  background-color: #6c63e8;
  box-shadow: inset 0 0 0 1px rgba(108, 99, 232, 0.5);
}

.asset-editor-collage-color-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.asset-editor-collage-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-editor-collage-swatches button,
.asset-editor-collage-swatches > label {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--collage-swatch, conic-gradient(#ff6b6b, #ffd166, #69db7c, #4dabf7, #9775fa, #ff6b6b));
  padding: 0;
}

.asset-editor-collage-swatches button.is-active {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.01px #6c63e8;
}

.asset-editor-collage-swatches > label {
  position: relative;
  overflow: hidden;
  color: #fff;
  cursor: pointer;
}

.asset-editor-collage-swatches input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.asset-editor-collage-swatches > label span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 16px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.44);
  pointer-events: none;
}

.asset-editor-collage-creative-tools {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.asset-editor-collage-tone-controls {
  display: grid;
  gap: 13px;
  padding: 14px 4px 2px;
}

.asset-editor-collage-text-mount {
  padding-top: 12px;
}

.asset-editor-collage-text-mount > .asset-editor-text-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 12px;
}

.asset-editor-collage-panel > .asset-editor-picker-list.is-hidden {
  display: none;
}

body[data-appearance="deep-dark"] #assetPreviewModal.is-collage-mode .asset-editor-stage {
  background-color: #18181c;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
}

@media (max-width: 760px) {
  .asset-editor-collage-ratios {
    grid-template-columns: repeat(5, minmax(48px, 1fr));
    overflow-x: auto;
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.16);
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.45);
  background-clip: content-box;
}

@media (max-width: 1420px) {
  :root {
    --side-w: 212px;
  }

  .account-hero {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 16px;
  }

  .account-identity {
    gap: 10px;
  }

  .account-identity-main {
    gap: 14px;
  }

  .account-name-row {
    gap: 6px;
  }

  .account-terminal-badge {
    padding-inline: 7px;
  }

  #logoutAccountBtn {
    width: 84px;
    min-width: 84px;
  }

  .workflow-bar {
    min-width: 0;
    grid-template-columns: repeat(4, minmax(70px, 1fr));
  }

  .calendar-controlbar {
    grid-template-columns: auto minmax(180px, 1fr) auto;
    gap: 12px;
  }

  .create-grid {
    grid-template-columns: minmax(340px, 0.95fr) minmax(340px, 1.05fr);
  }

  .image-compose-layout {
    grid-template-columns: minmax(680px, 1fr) 310px;
    gap: 22px;
  }

  .final-layout {
    grid-template-columns: 300px minmax(360px, 1fr) 160px;
  }

  .phone-hero {
    height: auto;
  }

}

@media (max-width: 980px) {
  .account-identity {
    flex-wrap: wrap;
  }

  .account-identity-actions {
    width: 100%;
    justify-content: flex-end;
  }

  body[data-current-view="create"] .shell {
    display: block;
    overflow-y: auto;
  }

  body[data-current-view="create"] #createView,
  body[data-current-view="create"] .create-mode-panel,
  body[data-current-view="create"] .create-mode-panel.is-active[data-create-mode-panel="graphic"],
  body[data-current-view="create"] .create-grid {
    height: auto;
    overflow: visible;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    padding: 10px;
  }

  .sidebar-title {
    display: none;
  }

  .sidebar-brand {
    flex: 0 0 auto;
    margin: 0;
    border-bottom: 0;
    padding: 0;
  }

  .sidebar-brand-copy {
    display: none;
  }

  .sidebar-main,
  .sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: max-content;
  }

  .sidebar-main {
    padding-top: 0;
  }

  .sidebar-footer {
    margin-top: 0;
    padding-top: 0;
  }

  .sidebar-item {
    width: auto;
    min-width: 104px;
    margin-top: 0;
  }

  .sidebar-item.is-active::before {
    left: 8px;
  }

  .shell {
    padding: 14px 12px 28px;
    overflow-x: hidden;
  }

  .workflow-context {
    grid-template-columns: 1fr;
  }

  .workflow-bar,
  .account-hero,
  .account-cycle-card,
  .account-progress-panel,
  .calendar-controlbar,
  .command-strip,
  .speech-board,
  .image-compose-layout,
  .final-layout,
  .case-study-workspace,
  .case-editor-grid,
  .pool-workspace,
  .radar-workspace,
  .asset-workspace,
  .asset-editor-shell,
  .upload-qr-layout,
  .pool-form,
  .asset-browser-panel,
  .recipe-workspace,
  .create-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .account-divider {
    display: none;
  }

  .account-progress-panel {
    grid-template-areas:
      "head"
      "heatmap"
      "service";
    align-items: stretch;
  }

  .account-service-row {
    min-width: 0;
    text-align: left;
  }

  .account-cycle-action {
    justify-items: start;
    text-align: left;
  }

  .account-file-grid,
  .account-list-tools,
  .account-table-head,
  .account-table-row {
    grid-template-columns: 1fr;
  }

  body[data-current-view="speech"] .shell,
  body[data-current-view="create"][data-create-mode="speech"] .shell {
    overflow-y: auto;
  }

  body[data-current-view="speech"] #speechView,
  body[data-current-view="create"][data-create-mode="speech"] .speech-view.is-active {
    height: auto;
    overflow: visible;
  }

  .speech-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .speech-actions {
    justify-content: stretch;
  }

  .speech-actions > button {
    flex: 1 1 0;
    justify-content: center;
  }

  .speech-panel {
    min-height: 320px;
  }

  .image-copy-actions {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
  }

  .image-copy-action {
    justify-content: center;
  }

  .image-copy-panel .body-count-corner {
    bottom: 20px;
  }

  .calendar-controlbar {
    align-items: stretch;
  }

  .calendar-actions {
    justify-content: stretch;
  }

  .calendar-status-pill,
  .calendar-actions > .primary {
    justify-content: center;
  }

  .progress-strip {
    flex-wrap: wrap;
  }

  body[data-current-view="imageCompose"] .shell {
    padding: 14px 12px 28px;
    overflow-y: auto;
  }

  body[data-current-view="imageCompose"] .global-notice {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    text-align: center;
  }

  .image-compose-layout {
    height: auto;
    min-height: 0;
    margin-top: 14px;
  }

  .image-compose-main {
    height: auto;
    min-height: 0;
    grid-template-rows: auto minmax(360px, 48vh) auto;
  }

  .final-inbox-list {
    max-height: none;
  }

  .final-actions-panel {
    grid-template-columns: 1fr;
    position: static;
  }

  .case-study-head,
  .case-editor-head,
  .case-slot-topline {
    display: grid;
    grid-template-columns: 1fr;
  }

  .case-slot-card {
    grid-template-columns: 1fr;
  }

  body[data-current-view="settings"] .case-study-workspace,
  body[data-current-view="settings"] .case-slot-card {
    grid-template-columns: 1fr;
  }

  .image-edit-panel,
  .image-copy-panel {
    border-radius: 16px;
  }

  .image-edit-panel {
    min-height: 0;
    padding: 18px;
  }

  .image-copy-panel {
    padding: 20px;
  }

  .image-hotword-panel {
    right: 20px;
    bottom: 20px;
    width: min(320px, calc(100% - 40px));
  }

  .image-copy-panel.is-hotword-open .image-copy-title-field {
    padding-right: 0;
  }

  .image-copy-panel.is-hotword-open .image-copy-body-field {
    margin-right: 0;
  }

  .image-copy-panel.is-hotword-open .body-count-corner {
    right: 32px;
  }

  .image-preview-rail {
    justify-items: stretch;
  }

  .phone-preview,
  .phone-shell {
    justify-self: center;
  }

  .recipe-workspace {
    max-width: 100%;
  }

  .recipe-chain-panel {
    position: static;
    order: -1;
  }

  .recipe-chain-preview {
    display: flex;
    flex-wrap: wrap;
  }

  .recipe-chain-preview i {
    display: inline;
  }

  .pool-workspace {
    min-height: auto;
  }

  .asset-editor-stage {
    min-height: 320px;
  }

  .asset-editor-controls {
    max-height: 42vh;
  }

  .pool-form {
    align-self: start;
    grid-template-rows: auto auto auto auto auto;
    align-content: start;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pool-form .wide-field textarea {
    height: min(420px, 52vh);
    min-height: 260px;
  }

  .pool-form .form-actions {
    align-self: start;
  }

  .qr-frame img {
    width: min(260px, 78vw);
    height: min(260px, 78vw);
  }

  .workflow-bar {
    max-width: 100%;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
  }

  .workflow-actions {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .step-tab {
    width: 100%;
    min-width: 0;
  }

  .summary-grid,
  .weight-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-progress-cell {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
  }

  .calendar-progress-heatmap {
    gap: 7px;
  }

  .calendar-progress-cell {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .speech-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .draft-meta {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .draft-output {
    min-height: 620px;
  }

  .output-body-field {
    min-height: 360px;
  }

  .table-head {
    display: none;
  }

  .recipe-table-head {
    display: none;
  }

  .recipe-slot {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .recipe-slot-actions {
    justify-content: flex-start;
  }

  .calendar-date-section {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .calendar-date-group-list {
    min-width: 0;
  }

  .calendar-title-row {
    grid-template-columns: 150px minmax(220px, 2fr) 116px 118px 110px;
  }

  .tag-manager-head {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .knowledge-workspace {
    grid-template-columns: 1fr;
  }

  .knowledge-side-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .keyword-strategy-summary,
  .keyword-strategy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tag-manager-tools {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto 140px;
  }

  .type-chip,
  .title-link,
  .status-pill,
  .row-actions,
  .benchmark-name {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 18px;
  }

  .account-hero {
    padding: 14px;
  }

  .account-identity {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-identity-main {
    width: 100%;
  }

  .account-identity-actions {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
  }

  .account-count {
    width: 30px;
    height: 30px;
  }

  .workflow-bar,
  .calendar-controlbar,
  .summary-grid,
  .weight-grid,
  .strip-actions,
  .workflow-actions,
  .asset-toolbar,
  .recipe-toolbar,
  .asset-toolbar-actions,
  .recipe-toolbar-actions,
  .form-actions,
  .settings-actions,
  .stack-actions,
  .row-actions,
  .usage-box,
  .output-footer,
  .output-footer > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workflow-actions {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .workflow-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(74px, 1fr));
  }

  .calendar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .keyword-strategy-hero,
  .keyword-strategy-actions,
  .keyword-strategy-summary,
  .keyword-strategy-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .calendar-topic-cell,
  .calendar-date-section {
    grid-template-columns: 1fr;
  }

  .calendar-title-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .workflow-actions .pill-button {
    justify-self: start;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .pill-button,
  .stack-actions .primary {
    width: 100%;
  }

  .summary-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-grid > div:last-child {
    border-bottom: 0;
  }

  .pool-card {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .asset-item-card {
    grid-template-columns: 1fr;
  }

  .tag-manager-tools {
    grid-template-columns: 1fr;
  }

  .speech-prompt-list {
    grid-template-columns: 1fr;
  }

  .speech-source-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .knowledge-toolbar,
  .knowledge-actions,
  .knowledge-side-panel {
    display: grid;
    grid-template-columns: 1fr;
  }

  .knowledge-editor {
    min-height: 420px;
  }

  .image-tag-row {
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 4px 8px;
    min-height: 58px;
    padding: 7px 10px;
  }

  .image-tag-row time {
    grid-column: 1 / 2;
  }

  .image-tag-count {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
  }

  .image-tag-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .pool-card-main {
    grid-template-columns: 1fr;
  }

  .pool-card .type-chip {
    max-width: 100%;
    justify-self: start;
  }
}

/* System-wide layout flattening: remove decorative container nesting. */
.view > .settings-card,
body[data-current-view="settings"] #settingsView .settings-card,
body[data-current-view="create"] .create-grid,
body[data-current-view="knowledge"] .knowledge-workspace,
body[data-current-view="recipe"] .recipe-workspace,
body[data-current-view="create"][data-create-mode="speech"] .speech-topbar,
body[data-current-view="speech"] .speech-topbar {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.command-strip,
.calendar-table,
.pool-workspace,
.create-grid,
.speech-topbar,
.speech-panel,
.knowledge-workspace,
.recipe-workspace,
.recipe-slots-panel,
.recipe-chain-panel {
  box-shadow: none;
}

.calendar-table,
.pool-workspace,
.speech-panel,
.knowledge-editor-panel,
.knowledge-side-panel,
.recipe-slots-panel,
.recipe-chain-panel {
  border-color: color-mix(in srgb, var(--line) 62%, transparent);
}

body[data-current-view="settings"] .settings-source-panel,
body[data-current-view="settings"] .settings-main-panel,
body[data-current-view="settings"] .case-study-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-current-view="settings"] .settings-source-panel {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  padding: 0 0 14px;
}

body[data-current-view="settings"] .settings-command-strip {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

body[data-current-view="settings"] .settings-file-drawer {
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  border-radius: 0;
  background: transparent;
}

body[data-current-view="settings"] .settings-main-panel {
  gap: 18px;
}

body[data-current-view="settings"] .settings-left-panel,
body[data-current-view="settings"] .settings-side-panel {
  gap: 14px;
}

body[data-current-view="settings"] .template-box,
body[data-current-view="settings"] .appearance-panel,
body[data-current-view="settings"] .theme-panel,
body[data-current-view="settings"] .usage-box,
body[data-current-view="settings"] .cover-demo-panel,
body[data-current-view="settings"] .case-study-panel {
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 14px 0 0;
}

body[data-current-view="settings"] .case-study-panel {
  margin-top: 4px;
}

body[data-current-view="settings"] .case-study-workspace {
  border-top: 1px solid color-mix(in srgb, var(--line) 54%, transparent);
  padding-top: 12px;
}

body[data-current-view="settings"] .case-study-sidebar,
body[data-current-view="settings"] .case-study-editor {
  border-color: color-mix(in srgb, var(--line) 52%, transparent);
  box-shadow: none;
}

body[data-current-view="settings"] .color-theme-card,
body[data-current-view="settings"] .cover-demo-card {
  box-shadow: none;
}

body[data-current-view="settingsCaseLibrary"] .case-study-page-card {
  margin-top: 10px;
  padding: 0;
}

body[data-current-view="settingsCaseLibrary"] .case-study-panel {
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 16px 0 0;
}

body[data-current-view="settingsCaseLibrary"] .case-study-workspace {
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - 230px);
}

body[data-current-view="settingsCaseLibrary"] .case-study-list {
  max-height: calc(100vh - 335px);
}

body[data-current-view="settingsCaseLibrary"] .case-study-editor {
  min-height: calc(100vh - 335px);
}

body[data-current-view="calendar"] .calendar-table {
  border: 0;
  border-radius: 0;
  background: transparent;
}

body[data-current-view="calendar"] .table-head {
  background: color-mix(in srgb, var(--surface-raised) 78%, var(--accent-soft));
}

body[data-current-view="calendar"] .calendar-date-section {
  background: color-mix(in srgb, var(--surface-raised) 90%, transparent);
}

body[data-current-view="calendar"] .calendar-date-section.is-done {
  background: color-mix(in srgb, var(--sage-soft) 72%, var(--surface));
}

body[data-current-view="calendar"] .calendar-row,
body[data-current-view="calendar"] .calendar-topic-row.is-done {
  background: transparent;
}

body[data-current-view="pool"] .pool-workspace {
  height: calc(100vh - 28px);
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body[data-current-view="pool"] .shell {
  overflow: hidden;
  padding-bottom: 14px;
}

body[data-current-view="pool"] #poolView {
  height: 100%;
  min-height: 0;
  margin-top: 0;
}

body[data-current-view="pool"] .pool-form {
  min-height: 0;
  border-right-color: color-mix(in srgb, var(--line) 58%, transparent);
}

body[data-current-view="pool"] .pool-list-panel {
  background: transparent;
}

body[data-current-view="create"] .create-grid,
body[data-current-view="knowledge"] .knowledge-workspace,
body[data-current-view="recipe"] .recipe-workspace,
body[data-current-view="create"][data-create-mode="speech"] .speech-board,
body[data-current-view="speech"] .speech-board {
  gap: 14px;
}

body[data-current-view="create"] .create-grid {
  background: transparent;
}

body[data-current-view="speech"] .speech-topbar,
body[data-current-view="create"][data-create-mode="speech"] .speech-topbar {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding: 0 0 12px;
}

body[data-current-view="create"][data-create-mode="speech"] .speech-panel,
body[data-current-view="speech"] .speech-panel,
body[data-current-view="knowledge"] .knowledge-editor-panel,
body[data-current-view="knowledge"] .knowledge-note,
body[data-current-view="knowledge"] .knowledge-stat,
body[data-current-view="recipe"] .recipe-slots-panel,
body[data-current-view="recipe"] .recipe-chain-panel {
  border-color: color-mix(in srgb, var(--line) 52%, transparent);
  box-shadow: none;
}

/* Deeper flattening for workbench internals that still looked like nested cards. */
body[data-current-view="create"] .workflow-bar,
body[data-current-view="create"][data-create-mode="speech"] .workflow-bar,
body[data-current-view="speech"] .workflow-bar {
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 0 10px;
}

body[data-current-view="create"] .shell > .global-notice,
body[data-current-view="create"][data-create-mode="speech"] .shell > .global-notice,
body[data-current-view="speech"] .shell > .global-notice {
  min-height: 34px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  border-radius: 0;
  background: transparent;
  padding: 0 2px 8px;
}

body[data-current-view="create"] .draft-meta,
body[data-current-view="create"] .draft-output {
  background: transparent;
}

body[data-current-view="create"] .draft-meta {
  border-right-color: color-mix(in srgb, var(--line) 62%, transparent);
  padding-left: 6px;
}

body[data-current-view="create"] .draft-output {
  padding-right: 0;
}

body[data-current-view="create"] .material-gate {
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 0;
  background: transparent;
  padding: 0 0 14px;
}

body[data-current-view="create"] .material-source-line {
  border: 0;
  border-left: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-radius: 0;
  background: color-mix(in srgb, var(--accent-wash) 58%, transparent);
  padding: 7px 10px;
}

body[data-current-view="create"] .material-item {
  border: 0;
  border-left: 3px solid color-mix(in srgb, var(--line-strong) 70%, transparent);
  border-radius: 0;
  background: transparent;
  padding: 8px 0 8px 12px;
}

body[data-current-view="create"] .material-item + .material-item {
  border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}

body[data-current-view="create"] .material-item.is-sufficient {
  border-left-color: var(--sage);
}

body[data-current-view="create"] .material-item.is-partial {
  border-left-color: var(--amber);
}

body[data-current-view="create"] .material-item.is-missing {
  border-left-color: var(--accent);
}

body[data-current-view="create"] .stack-actions {
  border-top-color: color-mix(in srgb, var(--line) 62%, transparent);
  background: color-mix(in srgb, var(--canvas) 84%, white);
}

body[data-current-view="speech"] .speech-board,
body[data-current-view="create"][data-create-mode="speech"] .speech-board {
  gap: 0;
}

body[data-current-view="speech"] .speech-panel,
body[data-current-view="create"][data-create-mode="speech"] .speech-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 16px 18px;
}

body[data-current-view="speech"] .speech-panel + .speech-panel,
body[data-current-view="create"][data-create-mode="speech"] .speech-panel + .speech-panel {
  border-left: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}

body[data-current-view="speech"] .speech-prompt-item,
body[data-current-view="create"][data-create-mode="speech"] .speech-prompt-item {
  background: color-mix(in srgb, var(--surface-raised) 76%, transparent);
  box-shadow: none;
}

body[data-current-view="speech"] .speech-result,
body[data-current-view="create"][data-create-mode="speech"] .speech-result {
  background: var(--surface);
}

body[data-current-view="settings"] .case-study-workspace {
  gap: 0;
}

body[data-current-view="settings"] .case-study-filter,
body[data-current-view="settings"] .case-study-list,
body[data-current-view="settings"] .case-study-editor {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-current-view="settings"] .case-study-sidebar {
  border-right: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  padding-right: 14px;
}

body[data-current-view="settings"] .case-study-editor {
  padding: 0 0 0 18px;
}

body[data-current-view="settings"] .case-study-filter {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, transparent);
  padding: 0 0 12px;
}

body[data-current-view="settings"] .case-study-list {
  padding: 12px 10px 0 0;
}

body[data-current-view="settings"] .case-study-list-item {
  background: transparent;
  box-shadow: none;
}

body[data-current-view="settings"] .case-study-list-item.is-active {
  background: color-mix(in srgb, var(--accent-wash) 48%, transparent);
}

body[data-current-view="settings"] .case-slot-card {
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  border-radius: 0;
  background: transparent;
  padding: 14px 0 0;
}

body[data-current-view="settings"] .case-slot-card:focus {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: none;
}

body[data-current-view="settings"] .case-slot-add-card {
  border: 1px dashed color-mix(in srgb, var(--accent) 34%, transparent);
  background: color-mix(in srgb, var(--accent-wash) 46%, transparent);
  box-shadow: none;
}

body[data-current-view="settings"] .case-slot-analysis,
body[data-current-view="settings"] .case-learning-result,
body[data-current-view="settings"] .case-learning-error {
  border-color: color-mix(in srgb, var(--line) 50%, transparent);
  background: color-mix(in srgb, var(--surface-raised) 58%, transparent);
}

/* XHS-inspired quiet surface system: separate zones with color blocks instead of divider lines. */
body:not([data-appearance="deep-dark"]) {
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-raised: #f7f7f7;
  --surface-tint: #f3f3f3;
  --accent-soft: #f2f2f2;
  --accent-wash: #f7f7f7;
  --line: #ececec;
  --line-strong: #dddddd;
  --nav: #f7f7f7;
  --nav-soft: #eeeeee;
  --nav-muted: #686868;
  --shadow: none;
  --shadow-soft: none;
}

body:not([data-appearance="deep-dark"]) {
  background: var(--canvas);
}

body:not([data-appearance="deep-dark"]) button {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) button:hover {
  border-color: transparent;
  background: #f2f2f2;
  color: var(--ink-strong);
}

body:not([data-appearance="deep-dark"]) .primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

body:not([data-appearance="deep-dark"]) .primary:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: #fff;
}

body:not([data-appearance="deep-dark"]) input,
body:not([data-appearance="deep-dark"]) select,
body:not([data-appearance="deep-dark"]) textarea,
body:not([data-appearance="deep-dark"]) .themed-select-trigger {
  border-color: transparent;
  background-color: #f7f7f7;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) input:hover,
body:not([data-appearance="deep-dark"]) select:hover,
body:not([data-appearance="deep-dark"]) textarea:hover,
body:not([data-appearance="deep-dark"]) .themed-select-trigger:hover {
  border-color: transparent;
  background-color: #f2f2f2;
  color: var(--ink-strong);
}

body:not([data-appearance="deep-dark"]) input:focus,
body:not([data-appearance="deep-dark"]) select:focus,
body:not([data-appearance="deep-dark"]) textarea:focus,
body:not([data-appearance="deep-dark"]) .themed-select.is-open .themed-select-trigger {
  border-color: transparent;
  background-color: #f2f2f2;
  box-shadow: 0 0 0 3px rgba(29, 29, 31, 0.06);
}

body:not([data-appearance="deep-dark"]) textarea.asset-editor-inline-text,
body:not([data-appearance="deep-dark"]) textarea.asset-editor-inline-text:hover,
body:not([data-appearance="deep-dark"]) textarea.asset-editor-inline-text:focus {
  border-color: rgba(232, 79, 95, 0.94);
  background: transparent;
  background-color: transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.76), 0 4px 14px rgba(15, 13, 18, 0.2);
}

/* The quiet light theme flattens generic buttons. Restore the text editor's
   authored controls so presets, swatches and grouped actions remain legible. */
body:not([data-appearance="deep-dark"]) .asset-editor-text-panel {
  --asset-text-light-control: #f7f3f4;
  --asset-text-light-control-hover: #f1e9eb;
  --asset-text-light-line: #e4d9dc;
  --asset-text-action-group-bg: #f2eaec;
}

body:not([data-appearance="deep-dark"]) .asset-editor-pip-panel .asset-editor-add-pip-btn {
  border-color: rgba(201, 54, 73, 0.28);
  background: #f8e9ec;
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgba(201, 54, 73, 0.04);
}

body:not([data-appearance="deep-dark"]) .asset-editor-pip-panel .asset-editor-add-pip-btn:hover {
  border-color: rgba(201, 54, 73, 0.42);
  background: #f3dce1;
  color: var(--accent-deep);
}

body:not([data-appearance="deep-dark"]) .asset-editor-pip-actions button,
body:not([data-appearance="deep-dark"]) .asset-editor-pip-layer-actions button,
body:not([data-appearance="deep-dark"]) .asset-editor-pip-reframe-btn {
  border-color: #e4d9dc;
  background: #f2eaec;
  color: #3a2a2f;
}

body:not([data-appearance="deep-dark"]) .asset-editor-pip-ratios button {
  border-color: transparent;
  background: transparent;
  color: #3a2a2f;
}

body:not([data-appearance="deep-dark"]) .asset-editor-pip-ratio-preview {
  border-color: #e4d9dc;
  background: #f2eaec;
}

body:not([data-appearance="deep-dark"]) .asset-editor-pip-actions button:not(:disabled):hover,
body:not([data-appearance="deep-dark"]) .asset-editor-pip-actions button.is-active,
body:not([data-appearance="deep-dark"]) .asset-editor-pip-reframe-btn:not(:disabled):hover,
body:not([data-appearance="deep-dark"]) .asset-editor-pip-reframe-btn.is-active,
body:not([data-appearance="deep-dark"]) .asset-editor-pip-layer-actions button:not(:disabled):hover {
  border-color: rgba(201, 54, 73, 0.28);
  background: #f3dfe3;
  color: var(--accent-deep);
}

body:not([data-appearance="deep-dark"]) .asset-editor-pip-ratios button:not(:disabled):hover .asset-editor-pip-ratio-preview,
body:not([data-appearance="deep-dark"]) .asset-editor-pip-ratios button.is-active .asset-editor-pip-ratio-preview {
  border-color: rgba(201, 54, 73, 0.28);
  background: #f3dfe3;
  color: var(--accent-deep);
}

body:not([data-appearance="deep-dark"]) .asset-editor-pip-transform {
  border-color: #e4d9dc;
  background: #fbf8f9;
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-add-text-btn {
  border-color: rgba(201, 54, 73, 0.28);
  background: #f8e9ec;
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgba(201, 54, 73, 0.04);
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-add-text-btn:hover {
  border-color: rgba(201, 54, 73, 0.42);
  background: #f3dce1;
  color: var(--accent-deep);
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-presets button {
  border: 0;
  background: #f0ebed;
  color: #fff;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-presets button:hover {
  border: 0;
  background: #e8e1e3;
  color: #fff;
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-presets button:nth-child(2),
body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-presets button:nth-child(2):hover {
  color: #fff36a;
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-presets button.is-active {
  border: 0;
  background: #f3dfe3;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-presets small {
  color: #7a6d72;
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-inline-grid select,
body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-inline-grid input {
  border-color: var(--asset-text-light-line);
  background: var(--asset-text-light-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-inline-grid select:hover,
body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-inline-grid input:hover {
  border-color: #d8c8cc;
  background: var(--asset-text-light-control-hover);
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-buttons {
  --asset-text-action-group-bg: #f2eaec;
  border-color: var(--asset-text-light-line);
  background: var(--asset-text-action-group-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-buttons button {
  border-color: transparent;
  background: transparent;
  color: #3a2a2f;
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-buttons button:not(:disabled):hover {
  border-color: rgba(201, 54, 73, 0.12);
  background: rgba(201, 54, 73, 0.09);
  color: var(--accent-deep);
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-buttons button.is-active {
  border-color: rgba(201, 54, 73, 0.28);
  background: #f3dfe3;
  color: var(--accent-deep);
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-style-editor,
body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-style-tabs {
  border-color: #e6dde0;
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-text-color-swatch {
  border-color: rgba(46, 32, 36, 0.24);
  background: var(--swatch, transparent);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.88), 0 2px 5px rgba(46, 32, 36, 0.14);
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-text-color-swatch:hover {
  border-color: rgba(46, 32, 36, 0.42);
  background: var(--swatch, transparent);
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-text-color-swatch.is-none,
body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-text-color-swatch.is-none:hover {
  background: #fff;
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-color-picker {
  border-color: rgba(46, 32, 36, 0.22);
  background: #fff;
  box-shadow: 0 2px 5px rgba(46, 32, 36, 0.14);
}

body:not([data-appearance="deep-dark"]) .asset-editor-text-panel .asset-editor-text-spacing {
  border-color: var(--asset-text-light-line);
  background: #fbf8f9;
}

/* In light mode the mosaic editor follows the workspace's borderless surface
   system; contrast comes from filled states rather than dark chrome. */
body:not([data-appearance="deep-dark"]) .asset-mosaic-dock {
  border: 0;
  background: #f2f2f2;
  color: var(--ink);
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-icon-action {
  border: 0;
  background: #e4e4e4;
  color: #44363b;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-icon-action:hover {
  border: 0;
  background: #dcdcdc;
  color: #2f2529;
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-icon-action.is-confirm,
body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-icon-action.is-confirm:hover {
  border: 0;
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-size-control output {
  color: #786b70;
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-size-control input[type="range"] {
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--accent);
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-command-row button {
  border: 0;
  background: #e5e5e5;
  color: #6f6267;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-command-row button:not(:disabled):hover {
  border: 0;
  background: #dcdcdc;
  color: #3f3337;
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-command-row button.is-active,
body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-command-row button.is-active:hover {
  border: 0;
  background: #f4dfe4;
  color: var(--accent-deep);
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-command-row button:disabled {
  border: 0;
  background: #e9e9e9;
  color: #aaa3a6;
  opacity: 0.58;
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-presets button {
  border: 0;
  background: #e7e7e7;
  color: #685b60;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-presets button:hover {
  border: 0;
  background: #dedede;
  color: #3e3236;
}

body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-presets button.is-active,
body:not([data-appearance="deep-dark"]) .asset-mosaic-dock .asset-mosaic-presets button.is-active:hover {
  border: 0;
  background: #f4dfe4;
  color: var(--accent-deep);
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .workspace {
  background: var(--surface);
}

body:not([data-appearance="deep-dark"]) .sidebar {
  border-right: 0;
  background: var(--nav);
  padding: 18px 14px;
  scrollbar-width: none;
}

body:not([data-appearance="deep-dark"]) .sidebar::-webkit-scrollbar {
  display: none;
}

body:not([data-appearance="deep-dark"]) .sidebar-brand,
body:not([data-appearance="deep-dark"]) .sidebar-title,
body:not([data-appearance="deep-dark"]) .account-popover-meta {
  border: 0;
}

body:not([data-appearance="deep-dark"]) .sidebar-brand {
  margin-bottom: 20px;
  padding: 0 2px;
}

body:not([data-appearance="deep-dark"]) .sidebar-title {
  margin: 0 10px 16px;
  padding: 0;
  color: #9a9a9a;
}

body:not([data-appearance="deep-dark"]) .menu-toggle {
  --menu-toggle-icon-color: #5f5f5f;
  border: 0;
  background: transparent;
}

body:not([data-appearance="deep-dark"]) .menu-toggle:hover {
  background: var(--nav-soft);
}

body:not([data-appearance="deep-dark"]) .rb-mark {
  border: 0;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .sidebar-brand-copy strong,
body:not([data-appearance="deep-dark"]) .account-popover,
body:not([data-appearance="deep-dark"]) .account-popover-head strong,
body:not([data-appearance="deep-dark"]) .account-popover-meta strong {
  color: var(--ink-strong);
}

body:not([data-appearance="deep-dark"]) .sidebar-item {
  min-height: 46px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #555555;
  padding: 0 12px;
}

body:not([data-appearance="deep-dark"]) .sidebar-item:hover,
body:not([data-appearance="deep-dark"]) .account-entry[aria-expanded="true"] {
  border: 0;
  background: var(--nav-soft);
  color: var(--ink-strong);
}

body:not([data-appearance="deep-dark"]) .sidebar-item.is-active {
  border: 0;
  background: var(--nav-soft);
  color: var(--ink-strong);
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .sidebar-item.is-active::before {
  content: none;
}

body:not([data-appearance="deep-dark"]) .account-popover {
  border: 0;
  background: #ffffff;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .shell {
  background: var(--surface);
  padding: 18px 26px 34px;
}

body:not([data-appearance="deep-dark"]) .workflow-bar,
body:not([data-appearance="deep-dark"]) .workflow-action-menu summary,
body:not([data-appearance="deep-dark"]) .workflow-actions {
  border: 0;
  background: #f7f7f7;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .workflow-bar {
  border-radius: 12px;
  padding: 5px;
}

body:not([data-appearance="deep-dark"]) .step-tab {
  border: 0;
  background: transparent;
  color: #686868;
}

body:not([data-appearance="deep-dark"]) .step-tab:hover,
body:not([data-appearance="deep-dark"]) .step-tab.is-active {
  background: #ffffff;
  color: var(--ink-strong);
}

body:not([data-appearance="deep-dark"]) .step-tab.is-active .step-badge {
  background: #eeeeee;
  color: #555555;
}

body:not([data-appearance="deep-dark"]) .calendar-controlbar,
body:not([data-appearance="deep-dark"]) .section-heading,
body:not([data-appearance="deep-dark"]) .pool-list-head,
body:not([data-appearance="deep-dark"]) .asset-toolbar,
body:not([data-appearance="deep-dark"]) .speech-topbar,
body:not([data-appearance="deep-dark"]) .note-detail-top,
body:not([data-appearance="deep-dark"]) .modal-head,
body:not([data-appearance="deep-dark"]) .modal-actions {
  border: 0;
}

body:not([data-appearance="deep-dark"]) .command-strip,
body:not([data-appearance="deep-dark"]) .calendar-table,
body:not([data-appearance="deep-dark"]) .pool-workspace,
body:not([data-appearance="deep-dark"]) .settings-card,
body:not([data-appearance="deep-dark"]) .create-grid,
body:not([data-appearance="deep-dark"]) .account-hero,
body:not([data-appearance="deep-dark"]) .account-section,
body:not([data-appearance="deep-dark"]) .speech-board,
body:not([data-appearance="deep-dark"]) .knowledge-workspace,
body:not([data-appearance="deep-dark"]) .recipe-workspace,
body:not([data-appearance="deep-dark"]) .asset-workspace,
body:not([data-appearance="deep-dark"]) .case-study-workspace,
body:not([data-appearance="deep-dark"]) .final-sidebar,
body:not([data-appearance="deep-dark"]) .final-main,
body:not([data-appearance="deep-dark"]) .final-actions-panel {
  border: 0;
  background: #f7f7f7;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .calendar-table,
body:not([data-appearance="deep-dark"]) .pool-workspace,
body:not([data-appearance="deep-dark"]) .account-hero,
body:not([data-appearance="deep-dark"]) .account-section {
  border-radius: 12px;
}

body:not([data-appearance="deep-dark"]) .table-head,
body:not([data-appearance="deep-dark"]) .account-table-head,
body:not([data-appearance="deep-dark"]) .calendar-row,
body:not([data-appearance="deep-dark"]) .account-table-row,
body:not([data-appearance="deep-dark"]) .pool-card,
body:not([data-appearance="deep-dark"]) .recipe-table-head,
body:not([data-appearance="deep-dark"]) .recipe-row,
body:not([data-appearance="deep-dark"]) .case-slot-card {
  border: 0;
  background: transparent;
}

body:not([data-appearance="deep-dark"]) .table-head,
body:not([data-appearance="deep-dark"]) .account-table-head,
body:not([data-appearance="deep-dark"]) .recipe-table-head {
  color: #777777;
}

body:not([data-appearance="deep-dark"]) .calendar-date-section,
body:not([data-appearance="deep-dark"]) .calendar-row,
body:not([data-appearance="deep-dark"]) .pool-card,
body:not([data-appearance="deep-dark"]) .account-table-row,
body:not([data-appearance="deep-dark"]) .recipe-row,
body:not([data-appearance="deep-dark"]) .case-study-list-item,
body:not([data-appearance="deep-dark"]) .final-inbox-item,
body:not([data-appearance="deep-dark"]) .speech-prompt-item {
  border-radius: 10px;
  transition: background 160ms ease, color 160ms ease;
}

body:not([data-appearance="deep-dark"]) .calendar-date-section:hover,
body:not([data-appearance="deep-dark"]) .calendar-row:hover,
body:not([data-appearance="deep-dark"]) .pool-card:hover,
body:not([data-appearance="deep-dark"]) .account-table-row:hover,
body:not([data-appearance="deep-dark"]) .recipe-row:hover,
body:not([data-appearance="deep-dark"]) .case-study-list-item:hover,
body:not([data-appearance="deep-dark"]) .final-inbox-item:hover,
body:not([data-appearance="deep-dark"]) .speech-prompt-item:hover {
  background: #eeeeee;
}

body:not([data-appearance="deep-dark"]) .draft-list-item:hover {
  background: #fffaf8;
}

body:not([data-appearance="deep-dark"]) .calendar-date-section.is-done,
body:not([data-appearance="deep-dark"]) .calendar-row.is-done,
body:not([data-appearance="deep-dark"]) .calendar-row.is-active,
body:not([data-appearance="deep-dark"]) .case-study-list-item.is-active,
body:not([data-appearance="deep-dark"]) .final-inbox-item.is-active,
body:not([data-appearance="deep-dark"]) .speech-prompt-item.is-active {
  background: #eeeeee;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .table-head {
  background: #f1f1f1;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .table-head::before {
  background: var(--surface);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-controlbar {
  background: var(--surface);
  box-shadow: 0 8px 16px rgba(255, 255, 255, 0.82);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-controlbar::before {
  background: var(--surface);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-row {
  background: transparent;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section {
  background: #f4f4f4;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section:nth-child(even) {
  background: #f8f8f8;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-row:hover {
  background: transparent;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section:nth-child(even):hover {
  background: #f0f0f0;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section.is-done {
  background: #f3f5f1;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-topic-row.is-done {
  background: transparent;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-count-field input,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-topic-select .themed-select-trigger,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .title-link.is-empty {
  background-color: #ffffff;
}

body:not([data-appearance="deep-dark"]) .pool-list-panel,
body:not([data-appearance="deep-dark"]) .pool-form,
body:not([data-appearance="deep-dark"]) .draft-meta,
body:not([data-appearance="deep-dark"]) .draft-output,
body:not([data-appearance="deep-dark"]) .speech-panel,
body:not([data-appearance="deep-dark"]) .knowledge-editor-panel,
body:not([data-appearance="deep-dark"]) .knowledge-side-panel,
body:not([data-appearance="deep-dark"]) .recipe-slots-panel,
body:not([data-appearance="deep-dark"]) .recipe-chain-panel,
body:not([data-appearance="deep-dark"]) .case-study-sidebar,
body:not([data-appearance="deep-dark"]) .case-study-editor {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .pool-list-panel,
body:not([data-appearance="deep-dark"]) .draft-output,
body:not([data-appearance="deep-dark"]) .speech-panel + .speech-panel,
body:not([data-appearance="deep-dark"]) .case-study-editor {
  background: #ffffff;
}

body:not([data-appearance="deep-dark"]) .pool-form,
body:not([data-appearance="deep-dark"]) .draft-meta,
body:not([data-appearance="deep-dark"]) .case-study-sidebar {
  background: #f7f7f7;
}

body:not([data-appearance="deep-dark"]) .account-divider,
body:not([data-appearance="deep-dark"]) .account-progress-panel,
body:not([data-appearance="deep-dark"]) .account-table,
body:not([data-appearance="deep-dark"]) .settings-source-panel,
body:not([data-appearance="deep-dark"]) .settings-file-drawer,
body:not([data-appearance="deep-dark"]) .template-box,
body:not([data-appearance="deep-dark"]) .appearance-panel,
body:not([data-appearance="deep-dark"]) .theme-panel,
body:not([data-appearance="deep-dark"]) .usage-box,
body:not([data-appearance="deep-dark"]) .cover-demo-panel,
body:not([data-appearance="deep-dark"]) .case-study-panel,
body:not([data-appearance="deep-dark"]) .material-gate,
body:not([data-appearance="deep-dark"]) .material-item + .material-item,
body:not([data-appearance="deep-dark"]) .stack-actions,
body:not([data-appearance="deep-dark"]) .asset-ai-progress-errors,
body:not([data-appearance="deep-dark"]) .asset-toolbar,
body:not([data-appearance="deep-dark"]) .asset-editor-footer {
  border: 0;
}

body:not([data-appearance="deep-dark"]) .account-progress-panel,
body:not([data-appearance="deep-dark"]) .material-gate,
body:not([data-appearance="deep-dark"]) .stack-actions {
  background: #f7f7f7;
  border-radius: 10px;
  padding: 12px;
}

body:not([data-appearance="deep-dark"]) .account-file-card,
body:not([data-appearance="deep-dark"]) .color-theme-card,
body:not([data-appearance="deep-dark"]) .cover-demo-card,
body:not([data-appearance="deep-dark"]) .asset-item-card,
body:not([data-appearance="deep-dark"]) .asset-preview-thumb,
body:not([data-appearance="deep-dark"]) .case-slot-add-card,
body:not([data-appearance="deep-dark"]) .image-choice-card,
body:not([data-appearance="deep-dark"]) .final-inbox-item,
body:not([data-appearance="deep-dark"]) .final-preview-card {
  border-color: transparent;
  background: #ffffff;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .account-file-card:hover,
body:not([data-appearance="deep-dark"]) .color-theme-card:hover,
body:not([data-appearance="deep-dark"]) .cover-demo-card:hover,
body:not([data-appearance="deep-dark"]) .asset-item-card:hover,
body:not([data-appearance="deep-dark"]) .asset-preview-thumb:hover,
body:not([data-appearance="deep-dark"]) .case-slot-add-card:hover,
body:not([data-appearance="deep-dark"]) .image-choice-card:hover {
  border-color: transparent;
  background: #eeeeee;
  box-shadow: none;
}

body[data-current-view="material"]:not([data-appearance="deep-dark"]) .asset-workspace,
body[data-current-view="material"]:not([data-appearance="deep-dark"]) .asset-browser-panel {
  background: transparent;
}

body[data-current-view="material"]:not([data-appearance="deep-dark"]) .asset-item-list {
  box-sizing: border-box;
  min-height: calc(100vh - 116px);
  background: #f7f7f7;
  padding: 20px;
}

body:not([data-appearance="deep-dark"]) .type-chip,
body:not([data-appearance="deep-dark"]) .template-token,
body:not([data-appearance="deep-dark"]) .status-pill,
body:not([data-appearance="deep-dark"]) .calendar-status-pill {
  border-color: transparent;
  background: #eeeeee;
  color: #555555;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-done {
  border: 0;
  background: transparent;
  color: #555555;
}

body:not([data-appearance="deep-dark"]) .pool-type-head {
  border: 0;
  background: #eeeeee;
}

body:not([data-appearance="deep-dark"]) .pool-type-tab,
body:not([data-appearance="deep-dark"]) .pool-card-actions .icon-button,
body:not([data-appearance="deep-dark"]) .title-link {
  border: 0;
  background: transparent;
}

body:not([data-appearance="deep-dark"]) .pool-type-tab:hover,
body:not([data-appearance="deep-dark"]) .pool-type-tab.is-active,
body:not([data-appearance="deep-dark"]) .pool-card-actions .icon-button:hover,
body:not([data-appearance="deep-dark"]) .title-link:hover {
  background: #eeeeee;
  color: var(--ink-strong);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .title-link.is-empty,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .title-link.is-empty:hover {
  background: #ffffff;
}

body:not([data-appearance="deep-dark"]) .draft-type-tabs button,
body:not([data-appearance="deep-dark"]) .draft-type-tabs button:hover,
body:not([data-appearance="deep-dark"]) .draft-type-tabs button.is-active {
  background: transparent;
}

body:not([data-appearance="deep-dark"]) .draft-type-tabs button:hover {
  color: var(--ink);
}

body:not([data-appearance="deep-dark"]) .draft-type-tabs button.is-active {
  color: var(--ink-strong);
}

body:not([data-appearance="deep-dark"]) .asset-upload-trigger,
body:not([data-appearance="deep-dark"]) .asset-upload-trigger:hover,
body:not([data-appearance="deep-dark"]) .asset-upload-menu:hover .asset-upload-trigger,
body:not([data-appearance="deep-dark"]) .asset-upload-menu:focus-within .asset-upload-trigger {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 16px rgba(201, 54, 73, 0.18);
}

body:not([data-appearance="deep-dark"]) .asset-upload-menu:hover .asset-upload-trigger,
body:not([data-appearance="deep-dark"]) .asset-upload-menu:focus-within .asset-upload-trigger {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
}

body:not([data-appearance="deep-dark"]) .asset-upload-dropdown {
  border-color: transparent;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(16, 24, 40, 0.14);
}

body:not([data-appearance="deep-dark"]) .asset-upload-option {
  border: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .asset-upload-option:hover,
body:not([data-appearance="deep-dark"]) .asset-upload-option:focus-visible {
  background: #eeeeef;
  color: var(--ink-strong);
}

body[data-current-view="material"] .asset-toolbar-actions .asset-upload-trigger,
body[data-current-view="material"] .asset-toolbar-actions .asset-upload-trigger:hover,
body[data-current-view="material"] .asset-toolbar-actions .asset-upload-menu:hover .asset-upload-trigger,
body[data-current-view="material"] .asset-toolbar-actions .asset-upload-menu:focus-within .asset-upload-trigger {
  border: 0;
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

body[data-current-view="material"] .asset-toolbar-actions .asset-upload-menu:hover .asset-upload-trigger,
body[data-current-view="material"] .asset-toolbar-actions .asset-upload-menu:focus-within .asset-upload-trigger {
  background: var(--accent-deep);
}

body[data-current-view="material"]:not([data-appearance="deep-dark"]) .asset-shooting-list-link {
  border: 0;
  background: #f3f3f4;
  color: var(--ink);
  box-shadow: none;
}

body[data-current-view="material"]:not([data-appearance="deep-dark"]) .asset-shooting-list-link:hover {
  border: 0;
  background: #ececef;
  color: var(--ink-strong);
}

body[data-current-view="material"] .asset-toolbar-actions button,
body[data-current-view="material"] .asset-toolbar-actions .secondary,
body[data-current-view="material"] .asset-toolbar-actions .ghost,
body[data-current-view="material"] .asset-shooting-list-link {
  min-height: 38px;
  border: 0;
  border-color: transparent;
  border-radius: 10px;
  background: #f3f3f4;
  color: var(--ink);
  box-shadow: none;
}

body[data-current-view="material"] .asset-toolbar-actions button:hover,
body[data-current-view="material"] .asset-toolbar-actions button:focus-visible,
body[data-current-view="material"] .asset-toolbar-actions .secondary:hover,
body[data-current-view="material"] .asset-toolbar-actions .ghost:hover,
body[data-current-view="material"] .asset-shooting-list-link:hover,
body[data-current-view="material"] .asset-shooting-list-link:focus-visible {
  border: 0;
  border-color: transparent;
  background: #ececef;
  color: var(--ink-strong);
  box-shadow: none;
}

body[data-current-view="material"] .asset-toolbar-actions .asset-upload-trigger,
body[data-current-view="material"] .asset-toolbar-actions .asset-upload-trigger:hover,
body[data-current-view="material"] .asset-toolbar-actions .asset-upload-menu:hover .asset-upload-trigger,
body[data-current-view="material"] .asset-toolbar-actions .asset-upload-menu:focus-within .asset-upload-trigger {
  border: 0;
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

body[data-current-view="material"] .asset-toolbar-actions .asset-upload-menu:hover .asset-upload-trigger,
body[data-current-view="material"] .asset-toolbar-actions .asset-upload-menu:focus-within .asset-upload-trigger {
  background: var(--accent-deep);
}

body[data-current-view="material"] .asset-toolbar-actions button.is-active,
body[data-current-view="material"] #assetTrashBtn.is-active,
body[data-current-view="material"] #assetCollapseAllBtn.is-active {
  border: 0;
  border-color: transparent;
  background: #f8e7ec;
  color: var(--accent-deep);
  box-shadow: none;
}

body[data-current-view="material"] .asset-annotation-search,
body[data-current-view="material"]:not([data-appearance="deep-dark"]) .asset-annotation-search {
  height: 38px;
  border: 0;
  border-color: transparent;
  border-radius: 10px;
  background: #f3f3f4;
  box-shadow: none;
  overflow: hidden;
}

body[data-current-view="material"] .asset-annotation-search:focus-within,
body[data-current-view="material"]:not([data-appearance="deep-dark"]) .asset-annotation-search:focus-within {
  border: 0;
  border-color: transparent;
  background: #f3f3f4;
  box-shadow: none;
}

.image-picker-modal .image-choice-check,
body:not([data-appearance="deep-dark"]) .image-picker-modal .image-choice-check,
.image-picker-modal .image-choice-check:hover,
body:not([data-appearance="deep-dark"]) .image-picker-modal .image-choice-check:hover {
  top: 8px;
  right: auto;
  left: 8px;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  border: 1.5px solid rgba(82, 92, 105, 0.42);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: transparent;
  box-shadow: 0 2px 7px rgba(16, 24, 40, 0.16);
  transform: none;
}

.image-picker-modal .image-choice-card.is-selected .image-choice-check,
body:not([data-appearance="deep-dark"]) .image-picker-modal .image-choice-card.is-selected .image-choice-check,
.image-picker-modal .image-choice-card.is-selected .image-choice-check:hover,
body:not([data-appearance="deep-dark"]) .image-picker-modal .image-choice-card.is-selected .image-choice-check:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.image-picker-modal .image-choice-check .ui-icon {
  width: 12px;
  height: 12px;
}

/* Use one restrained selection signal: the fixed checkbox plus a quiet card outline. */
.image-picker-modal .image-choice-card.is-selected,
body:not([data-appearance="deep-dark"]) .image-picker-modal .image-choice-card.is-selected,
.image-picker-modal .image-choice-card.is-selected:hover,
body:not([data-appearance="deep-dark"]) .image-picker-modal .image-choice-card.is-selected:hover {
  border: 1px solid var(--accent);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(239, 74, 111, 0.12);
  transform: none;
}

.image-picker-modal .image-choice-card.is-selected .image-choice-preview::after {
  content: none;
}

.image-picker-modal .image-choice-card.is-selected .image-choice-check,
body:not([data-appearance="deep-dark"]) .image-picker-modal .image-choice-card.is-selected .image-choice-check {
  z-index: 3;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  box-shadow: 0 2px 7px rgba(16, 24, 40, 0.16);
}

.image-picker-modal .image-choice-card.is-selected .image-choice-check .ui-icon {
  width: 12px;
  height: 12px;
}

body[data-current-view="material"] .asset-annotation-search input,
body[data-current-view="material"] .asset-annotation-search input:hover,
body[data-current-view="material"] .asset-annotation-search input:focus,
body[data-current-view="material"]:not([data-appearance="deep-dark"]) .asset-annotation-search input,
body[data-current-view="material"]:not([data-appearance="deep-dark"]) .asset-annotation-search input:hover,
body[data-current-view="material"]:not([data-appearance="deep-dark"]) .asset-annotation-search input:focus {
  height: 100%;
  min-height: 0;
  border: 0;
  border-color: transparent;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

body[data-current-view="radar"] .radar-select input,
body[data-current-view="radar"]:not([data-appearance="deep-dark"]) .radar-select input,
body[data-current-view="radar"]:not([data-appearance="deep-dark"]) .radar-select input:hover,
body[data-current-view="radar"]:not([data-appearance="deep-dark"]) .radar-select input:focus {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  max-height: 16px;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--ink-strong) 48%, transparent);
  background: transparent;
  background-color: transparent;
  box-shadow: none;
}

body[data-current-view="radar"] .radar-select input:checked,
body[data-current-view="radar"]:not([data-appearance="deep-dark"]) .radar-select input:checked,
body[data-current-view="radar"]:not([data-appearance="deep-dark"]) .radar-select input:checked:hover,
body[data-current-view="radar"]:not([data-appearance="deep-dark"]) .radar-select input:checked:focus {
  border-color: #202124;
  background: #202124;
  background-color: #202124;
}

@media (max-width: 980px) {
  body:not([data-appearance="deep-dark"]) .sidebar {
    background: var(--nav);
    border: 0;
  }

  body:not([data-appearance="deep-dark"]) .shell {
    padding: 14px 12px 28px;
  }
}

/* Final inbox hover stays inside the night palette instead of inheriting the
   light-theme gray card treatment. Active cards keep their accent outline. */
body[data-appearance="deep-dark"][data-current-view="final"] .final-inbox-item:not(.is-active):hover {
  border-color: color-mix(in srgb, var(--ink) 10%, transparent);
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--ink) 12%);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

/* Dark controls must never inherit the light pink/gray hover fills from the
   shared component layer. Keep the feedback local to the night palette. */
body[data-appearance="deep-dark"] :where(.secondary, .ghost, button.template-token):hover,
body[data-appearance="deep-dark"] :where(.secondary, .ghost, button.template-token):focus-visible {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-soft) 82%, var(--accent) 18%);
  color: var(--ink-strong);
  box-shadow: none;
  outline: none;
  transform: none;
}

body[data-appearance="deep-dark"] .image-edit-actions .secondary:not(.is-active) {
  border-color: transparent;
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: none;
}

body[data-appearance="deep-dark"] .image-edit-actions .secondary:not(.is-active):hover,
body[data-appearance="deep-dark"] .image-edit-actions .secondary:not(.is-active):focus-visible {
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--accent) 22%);
  color: var(--ink-strong);
  transform: none;
}

body[data-appearance="deep-dark"] .image-copy-action.is-draft {
  background: var(--surface-soft);
  color: var(--ink);
}

body[data-appearance="deep-dark"] .image-copy-action.is-draft:hover,
body[data-appearance="deep-dark"] .image-copy-action.is-draft:focus-visible {
  background: color-mix(in srgb, var(--surface-soft) 82%, var(--ink) 18%);
  color: var(--ink-strong);
  transform: none;
}

body[data-appearance="deep-dark"] .image-copy-action.is-final,
body[data-appearance="deep-dark"] .image-copy-action.is-final:hover,
body[data-appearance="deep-dark"] .image-copy-action.is-final:focus-visible {
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--accent) 30%);
  color: var(--ink-strong);
  transform: none;
}

body[data-appearance="deep-dark"][data-current-view="material"] button.asset-card-edit-btn,
body[data-appearance="deep-dark"][data-current-view="material"] button.asset-card-more-btn,
body[data-appearance="deep-dark"][data-current-view="material"] button.asset-card-edit-btn:hover,
body[data-appearance="deep-dark"][data-current-view="material"] button.asset-card-more-btn:hover,
body[data-appearance="deep-dark"][data-current-view="material"] button.asset-card-edit-btn:focus-visible,
body[data-appearance="deep-dark"][data-current-view="material"] button.asset-card-more-btn:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(10, 12, 16, 0.9);
  color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 14px rgba(5, 7, 10, 0.28);
  outline: none;
  transform: none;
}

body[data-appearance="deep-dark"][data-current-view="final"] .final-actions-panel .secondary:hover,
body[data-appearance="deep-dark"][data-current-view="final"] .final-actions-panel .secondary:focus-visible,
body[data-appearance="deep-dark"][data-current-view="final"] .final-actions-panel .ghost:hover,
body[data-appearance="deep-dark"][data-current-view="final"] .final-actions-panel .ghost:focus-visible {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-soft) 84%, var(--ink) 16%);
  color: var(--ink-strong);
  box-shadow: none;
  outline: none;
  transform: none;
}

/* Draft inbox uses one geometry in both themes; night mode only changes color. */
body[data-appearance="deep-dark"][data-current-view="draft"] .final-inbox-item.is-draft,
body[data-appearance="deep-dark"][data-current-view="draft"] .final-inbox-item.is-draft:hover,
body[data-appearance="deep-dark"][data-current-view="draft"] .draft-list-item,
body[data-appearance="deep-dark"][data-current-view="draft"] .draft-list-item:hover {
  background: var(--surface-raised);
  color: var(--ink);
}

body[data-appearance="deep-dark"][data-current-view="draft"] .draft-list-item:hover {
  background: color-mix(in srgb, var(--surface-raised) 82%, var(--accent) 18%);
  transform: translateY(-1px);
}

body[data-appearance="deep-dark"][data-current-view="draft"] .final-inbox-thumb {
  background: var(--surface-soft);
}

body[data-appearance="deep-dark"][data-current-view="draft"] .final-inbox-copy strong {
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"][data-current-view="draft"] .final-inbox-copy span,
body[data-appearance="deep-dark"][data-current-view="draft"] .final-inbox-copy em {
  color: var(--muted);
}

body[data-appearance="deep-dark"][data-current-view="draft"] .final-inbox-copy em {
  color: var(--faint);
}

body[data-appearance="deep-dark"][data-current-view="draft"] .final-inbox-copy .draft-origin-badge {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-soft));
  color: var(--accent-deep);
}

body[data-appearance="deep-dark"][data-current-view="draft"] .draft-item-actions .secondary {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

body[data-appearance="deep-dark"][data-current-view="draft"] .draft-item-actions .secondary:hover {
  background: color-mix(in srgb, var(--accent-soft) 74%, var(--accent) 26%);
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"][data-current-view="draft"] .draft-item-actions .ghost {
  background: transparent;
  color: var(--muted);
}

body[data-appearance="deep-dark"][data-current-view="draft"] .draft-item-actions .ghost:hover {
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--accent) 22%);
  color: var(--accent-deep);
}

body[data-appearance="deep-dark"][data-current-view="draft"] .deleted-draft-section {
  border-color: transparent;
}

body[data-appearance="deep-dark"][data-current-view="draft"] .deleted-draft-item {
  border: 0;
  background: var(--surface-raised);
}

/* Night-mode finishing details: brand legibility and preview mode switch. */
body[data-appearance="deep-dark"] .sidebar-brand-copy strong {
  color: color-mix(in srgb, var(--ink-strong) 88%, var(--accent) 12%);
}

body[data-appearance="deep-dark"] .preview-tabs {
  gap: 3px;
  border: 0;
  background: var(--surface-raised);
  padding: 4px;
  box-shadow: none;
}

body[data-appearance="deep-dark"] .preview-tabs button,
body[data-appearance="deep-dark"] .preview-tabs button:hover,
body[data-appearance="deep-dark"] .preview-tabs button:focus-visible {
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

body[data-appearance="deep-dark"] .preview-tabs button:hover,
body[data-appearance="deep-dark"] .preview-tabs button:focus-visible {
  background: var(--surface-soft);
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"] .preview-tabs button.is-active,
body[data-appearance="deep-dark"] .preview-tabs button.is-active:hover,
body[data-appearance="deep-dark"] .preview-tabs button.is-active:focus-visible {
  background: color-mix(in srgb, var(--surface-soft) 72%, var(--accent) 28%);
  color: var(--ink-strong);
  box-shadow: none;
}

/* Let the calendar heading breathe on the night canvas; avoid a full-width slab. */
body[data-appearance="deep-dark"][data-current-view="calendar"] .calendar-controlbar {
  background: var(--canvas);
  box-shadow: none;
}

body[data-appearance="deep-dark"][data-current-view="calendar"] .calendar-controlbar::before {
  content: none;
}

/* Light mode mirrors the night layout with two independent color blocks. */
body:not([data-appearance="deep-dark"])[data-current-view="create"] .create-grid {
  background: #ffffff;
}

body:not([data-appearance="deep-dark"])[data-current-view="create"] .draft-meta {
  border-right: 0;
  background: #ffffff;
}

body:not([data-appearance="deep-dark"])[data-current-view="create"] #draftBody,
body:not([data-appearance="deep-dark"])[data-current-view="create"] #draftBody:focus {
  border: 0;
  background: #f7f7f7;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"])[data-current-view="create"] #draftBody:focus {
  background: #f2f2f2;
}

body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-choice {
  gap: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-btn.primary,
body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-btn.primary:hover,
body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-btn.primary:focus-visible {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent-deep);
  box-shadow: none;
}

body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-btn.primary:hover,
body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-btn.primary:focus-visible {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-btn.primary em {
  color: var(--accent-deep);
  opacity: 0.72;
}

body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-btn.secondary,
body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-btn.secondary:hover,
body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-btn.secondary:focus-visible {
  border-color: transparent;
  background: #f1f1f1;
  color: var(--ink);
  box-shadow: none;
}

body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-btn.secondary:hover,
body:not([data-appearance="deep-dark"])[data-current-view="create"] .generation-mode-btn.secondary:focus-visible {
  background: #e9e9e9;
  color: var(--ink-strong);
}

/* Keep the deep-generation choice dark across hover and keyboard focus. */
body[data-appearance="deep-dark"][data-current-view="create"] .generation-mode-btn.secondary,
body[data-appearance="deep-dark"][data-current-view="create"] .generation-mode-btn.secondary:hover,
body[data-appearance="deep-dark"][data-current-view="create"] .generation-mode-btn.secondary:focus-visible {
  border-color: transparent;
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: none;
}

body[data-appearance="deep-dark"][data-current-view="create"] .generation-mode-btn.secondary:hover,
body[data-appearance="deep-dark"][data-current-view="create"] .generation-mode-btn.secondary:focus-visible {
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--accent) 22%);
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"][data-current-view="create"] .generation-mode-btn.secondary em,
body[data-appearance="deep-dark"][data-current-view="create"] .generation-mode-btn.secondary:hover em,
body[data-appearance="deep-dark"][data-current-view="create"] .generation-mode-btn.secondary:focus-visible em {
  color: var(--muted);
}

/* Sidebar appearance switch: a compact footer control shared by both themes. */

.sidebar-appearance-toggle,
.sidebar-appearance-toggle:hover,
.sidebar-appearance-toggle:focus-visible {
  width: 88px;
  min-width: 88px;
  min-height: 22px;
  display: block;
  align-self: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.sidebar-appearance-toggle {
  cursor: pointer;
}

.sidebar-footer .sidebar-appearance-toggle {
  justify-self: start;
  margin: 8px 0 0 12px;
}

.sidebar-appearance-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 48%, transparent);
  outline-offset: 3px;
}

.sidebar-appearance-track {
  position: relative;
  width: 88px;
  height: 22px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 78%, #fff 22%),
    color-mix(in srgb, var(--accent) 82%, #7b2538 18%)
  );
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.sidebar-appearance-thumb {
  position: absolute;
  z-index: 1;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(39, 32, 92, 0.24);
  transition: transform 190ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sidebar-appearance-icon {
  position: absolute;
  z-index: 2;
  top: 2px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  transition: color 160ms ease, transform 190ms ease;
}

.sidebar-appearance-icon svg {
  width: 13px;
  height: 13px;
  overflow: visible;
}

.sidebar-appearance-sun {
  left: 2px;
  color: #f1ad33;
}

.sidebar-appearance-sun circle {
  fill: currentColor;
  stroke: none;
}

.sidebar-appearance-sun path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.sidebar-appearance-moon {
  right: 2px;
}

.sidebar-appearance-moon path {
  fill: currentColor;
}

.sidebar-appearance-toggle:hover .sidebar-appearance-track {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent),
    0 4px 12px color-mix(in srgb, var(--accent) 22%, transparent);
}

body[data-appearance="deep-dark"] .sidebar-appearance-track {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 78%, var(--surface-raised) 22%),
    color-mix(in srgb, var(--accent) 68%, #6f2434 32%)
  );
}

body[data-appearance="deep-dark"] .sidebar-appearance-thumb {
  transform: translateX(66px);
}

body[data-appearance="deep-dark"] .sidebar-appearance-sun {
  color: rgba(255, 255, 255, 0.88);
}

body[data-appearance="deep-dark"] .sidebar-appearance-moon {
  color: #f3c846;
}

body.sidebar-collapsed .sidebar-brand {
  align-items: center;
}

body.sidebar-collapsed .sidebar-appearance-toggle,
body.sidebar-collapsed .sidebar-appearance-track {
  width: 22px;
  min-width: 22px;
}

body.sidebar-collapsed .sidebar-appearance-toggle {
  justify-self: center;
  margin-left: 0;
}

body.sidebar-collapsed .sidebar-appearance-thumb,
body.sidebar-collapsed[data-appearance="deep-dark"] .sidebar-appearance-thumb {
  transform: none;
}

body.sidebar-collapsed .sidebar-appearance-moon {
  display: none;
}

body.sidebar-collapsed[data-appearance="deep-dark"] .sidebar-appearance-sun {
  display: none;
}

body.sidebar-collapsed[data-appearance="deep-dark"] .sidebar-appearance-moon {
  right: auto;
  left: 2px;
  display: grid;
}

/* Speech source picker: keep selection dark, legible and on-brand at night. */
body[data-appearance="deep-dark"] .speech-source-modal {
  border: 0;
  background: var(--surface);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.38);
}

body[data-appearance="deep-dark"] .speech-source-modal .speech-source-item,
body[data-appearance="deep-dark"] .speech-source-modal .speech-source-item:hover,
body[data-appearance="deep-dark"] .speech-source-modal .speech-source-item:focus-visible {
  border: 0;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: none;
}

body[data-appearance="deep-dark"] .speech-source-modal .speech-source-item:hover,
body[data-appearance="deep-dark"] .speech-source-modal .speech-source-item:focus-visible {
  background: color-mix(in srgb, var(--surface-soft) 86%, var(--accent) 14%);
}

body[data-appearance="deep-dark"] .speech-source-modal .speech-source-item.is-active,
body[data-appearance="deep-dark"] .speech-source-modal .speech-source-item.is-active:hover,
body[data-appearance="deep-dark"] .speech-source-modal .speech-source-item.is-active:focus-visible {
  border: 0;
  background: color-mix(in srgb, var(--surface-soft) 76%, var(--accent) 24%);
  color: var(--ink-strong);
  box-shadow: inset 3px 0 0 var(--accent);
}

body[data-appearance="deep-dark"] .speech-source-modal .final-inbox-copy strong {
  color: var(--ink-strong);
}

body[data-appearance="deep-dark"] .speech-source-modal .final-inbox-copy span,
body[data-appearance="deep-dark"] .speech-source-modal .final-inbox-copy em {
  color: var(--muted);
}

/* Title-side hotword reference: a docked floating surface that never covers the title. */
.chase-hit-title-input-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.chase-hit-hotword-trigger {
  min-width: 82px;
  min-height: 40px;
  white-space: nowrap;
}

.chase-hit-hotword-trigger.is-active {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-raised));
  color: var(--accent-deep);
}

.chase-hit-card.is-hotword-open {
  grid-template-columns: 28px 64px minmax(260px, 1fr) minmax(260px, 320px) auto;
  align-items: start;
}

.chase-hit-card.is-hotword-open .chase-hit-index,
.chase-hit-card.is-hotword-open .chase-hit-cover,
.chase-hit-card.is-hotword-open .chase-hit-card-actions {
  margin-top: 10px;
}

.chase-hit-hotword-panel {
  min-width: 0;
  max-height: 320px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 96%, var(--accent-wash));
  padding: 10px;
  box-shadow: 0 12px 28px rgba(35, 25, 28, .12);
}

.chase-hit-hotword-panel[hidden] {
  display: none;
}

.chase-hit-hotword-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chase-hit-hotword-head > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.chase-hit-hotword-head strong {
  color: var(--ink-strong);
  font-size: 13px;
}

.chase-hit-hotword-head span,
.chase-hit-hotword-panel > p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.chase-hit-hotword-panel > p {
  margin: 0;
}

.chase-hit-hotword-head button {
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.chase-hit-hotword-categories {
  min-width: 0;
  display: grid;
  grid-template-rows: repeat(2, 26px);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 1px 1px 5px;
  scrollbar-width: thin;
}

.chase-hit-hotword-categories button {
  min-width: 48px;
  min-height: 26px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 7px;
  background: var(--surface-soft, var(--surface-raised));
  color: var(--muted);
  padding: 3px 8px;
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.chase-hit-hotword-categories button:hover,
.chase-hit-hotword-categories button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  color: var(--ink-strong);
  outline: none;
}

.chase-hit-hotword-categories button.is-active {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-raised));
  color: var(--accent-deep);
}

.chase-hit-hotword-body {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 3px;
}

.chase-hit-hotword-body .create-hotword-group {
  gap: 3px;
}

.chase-hit-hotword-body .create-hotword-group-head {
  min-height: 26px;
  padding: 3px 7px;
}

.chase-hit-hotword-body .create-hotword-group-head strong {
  font-size: 11px;
}

.chase-hit-hotword-body .create-hotword-list-items {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 10px;
}

.chase-hit-hotword-chip {
  min-height: 24px;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
}

.chase-hit-hotword-chip:hover,
.chase-hit-hotword-chip:focus-visible {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  outline: none;
}

@media (max-width: 1180px) {
  .chase-hit-card.is-hotword-open {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .chase-hit-card.is-hotword-open .chase-hit-index {
    display: none;
  }

  .chase-hit-card.is-hotword-open .chase-hit-cover {
    width: 58px;
    height: auto;
  }

  .chase-hit-card.is-hotword-open .chase-hit-hotword-panel,
  .chase-hit-card.is-hotword-open .chase-hit-card-actions {
    grid-column: 2;
    margin-top: 0;
  }
}

@media (max-width: 620px) {
  .chase-hit-title-input-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .chase-hit-hotword-trigger {
    width: max-content;
    min-height: 32px;
  }

  .chase-hit-card.is-hotword-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .chase-hit-card.is-hotword-open .chase-hit-cover {
    display: none;
  }

  .chase-hit-card.is-hotword-open .chase-hit-copy,
  .chase-hit-card.is-hotword-open .chase-hit-hotword-panel,
  .chase-hit-card.is-hotword-open .chase-hit-card-actions {
    grid-column: 1;
  }
}

/* Match the chase-hit pool to the restrained daily-creation workspace. */
body[data-current-view="chaseHit"] #chaseHitView {
  --calendar-sticky-top: 0px;
  --calendar-controlbar-height: 56px;
  margin-top: 0;
}

.chase-hit-controlbar,
body[data-appearance="deep-dark"] .chase-hit-controlbar {
  grid-template-columns: auto minmax(0, 1fr);
  background: var(--canvas);
  box-shadow: none;
}

.chase-hit-controlbar::before,
body[data-appearance="deep-dark"] .chase-hit-controlbar::before {
  content: "";
  background: var(--canvas);
}

.chase-hit-controlbar .calendar-actions > .secondary {
  min-width: 128px;
  min-height: 36px;
  border-radius: 10px;
}

body[data-current-view="chaseHit"] #chaseHitView > .creation-mode-tabs {
  margin: 0 0 12px;
}

body[data-current-view="chaseHit"] #chaseHitView > .creation-mode-tabs .chase-hit-search {
  width: 220px;
  margin-left: auto;
}

.chase-hit-workspace,
body[data-appearance="deep-dark"] .chase-hit-workspace {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.chase-hit-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 86%, var(--canvas));
  padding: 8px 12px;
}

.chase-hit-header > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.chase-hit-header-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.chase-hit-search {
  width: 250px;
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-soft, var(--surface-raised)) 82%, var(--canvas));
  padding: 0 10px;
  box-shadow: none;
}

.chase-hit-search input,
body[data-appearance="deep-dark"] .chase-hit-search input,
.chase-hit-search input:hover,
body[data-appearance="deep-dark"] .chase-hit-search input:hover,
.chase-hit-search input:focus,
body[data-appearance="deep-dark"] .chase-hit-search input:focus {
  min-height: 34px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chase-hit-summary {
  min-height: 38px;
  justify-content: flex-end;
  padding: 10px 2px 8px;
  color: var(--muted);
  font-size: 12px;
}

.chase-hit-list {
  gap: 8px;
}

.chase-hit-card,
body[data-appearance="deep-dark"] .chase-hit-card {
  grid-template-columns: 28px 64px minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 88px;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--canvas));
  color: var(--ink);
  padding: 10px 12px;
  box-shadow: none;
  transition: background 160ms ease;
}

.chase-hit-card:hover,
body[data-appearance="deep-dark"] .chase-hit-card:hover {
  border: 0;
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--accent) 12%);
  transform: none;
  box-shadow: none;
}

.chase-hit-card.is-creating,
.chase-hit-card.is-creating:hover,
body[data-appearance="deep-dark"] .chase-hit-card.is-creating,
body[data-appearance="deep-dark"] .chase-hit-card.is-creating:hover {
  border: 0;
  background: color-mix(in srgb, var(--surface-raised) 78%, var(--accent) 22%);
  box-shadow: inset 3px 0 0 var(--accent);
  transform: none;
}

.chase-hit-index {
  color: var(--faint);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0;
}

.chase-hit-cover {
  width: 64px;
  height: auto;
  border-radius: 10px;
}

.chase-hit-copy h3 {
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
}

.chase-hit-copy p {
  margin-top: 5px;
}

.chase-hit-card-actions {
  gap: 6px;
}

.chase-hit-card-actions .primary {
  min-width: 70px;
}

.chase-hit-card-actions .secondary,
.chase-hit-card-actions .ghost {
  min-width: 58px;
}

.chase-hit-remove,
.chase-hit-remove:hover,
.chase-hit-remove:focus-visible {
  width: 32px;
  height: 32px;
  border: 0;
  background: var(--surface-soft, var(--surface-raised));
  color: var(--accent);
  box-shadow: none;
  transform: none;
}

.chase-hit-remove:hover,
.chase-hit-remove:focus-visible {
  background: color-mix(in srgb, var(--surface-soft, var(--surface-raised)) 76%, var(--accent) 24%);
  color: var(--accent-deep);
}

.chase-hit-title-editor input,
body[data-appearance="deep-dark"] .chase-hit-title-editor input {
  border: 0;
  background: var(--surface-soft, var(--surface-raised));
  box-shadow: none;
}

.chase-hit-title-editor input:focus,
body[data-appearance="deep-dark"] .chase-hit-title-editor input:focus {
  border: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

@media (max-width: 860px) {
  .chase-hit-workspace {
    padding: 0;
  }

  .chase-hit-header {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .chase-hit-header-actions,
  .chase-hit-search {
    width: 100%;
  }

  body[data-current-view="chaseHit"] #chaseHitView > .creation-mode-tabs .chase-hit-search {
    width: min(100%, 320px);
  }

  .chase-hit-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .chase-hit-cover {
    width: 58px;
    height: auto;
  }
}

/*
 * Keep the sticky heading visually on the page canvas while giving it an
 * opaque paint layer. Without this layer, the creation-mode tabs remain
 * visible through the heading as they scroll underneath it.
 */
body[data-current-view="calendar"] .calendar-controlbar,
body[data-appearance="deep-dark"][data-current-view="calendar"] .calendar-controlbar {
  background: var(--canvas);
  box-shadow: none;
}

body[data-current-view="calendar"] .calendar-controlbar::before,
body[data-appearance="deep-dark"][data-current-view="calendar"] .calendar-controlbar::before {
  content: "";
  background: var(--canvas);
}

/* Radar follows the same quiet, borderless workspace language as daily creation. */
body[data-current-view="radar"] .shell {
  overflow: hidden;
  background: transparent;
  padding: 14px 18px 0;
}

body[data-current-view="radar"] #radarView {
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

body[data-current-view="radar"] .radar-workspace {
  grid-template-columns: minmax(308px, 336px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 24px;
  background: transparent;
}

body[data-current-view="radar"] .radar-command-panel,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-command-panel,
body[data-current-view="radar"] .radar-results-panel,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-results-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-current-view="radar"] .radar-command-panel {
  min-height: 0;
  gap: 10px;
  overflow: hidden;
  padding: 8px 0 18px;
}

body[data-current-view="radar"] .radar-panel-head {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-items: start;
  gap: 5px;
  padding: 0 2px;
}

body[data-current-view="radar"] .radar-panel-head h2 {
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
}

body[data-current-view="radar"] .radar-status {
  width: max-content;
  max-width: 100%;
  min-height: 26px;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  padding-inline: 9px;
  font-size: 11px;
  overflow: visible;
  text-overflow: clip;
}

html:not([data-auth-role="creator"]) body[data-current-view="radar"] .radar-form {
  align-self: stretch;
  grid-template-rows: minmax(220px, 1fr) auto minmax(240px, 1fr);
  gap: clamp(18px, 2.2dvh, 26px);
  overflow: hidden;
  padding-right: 5px;
}

html:not([data-auth-role="creator"]) body[data-current-view="radar"] .radar-keyword-field {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 68%, transparent);
  padding: 12px 10px 10px;
}

html:not([data-auth-role="creator"]) body[data-current-view="radar"] .radar-keyword-picker {
  width: 100%;
  align-self: stretch;
  min-height: 0;
  max-height: none;
  gap: 2px;
  padding-right: 2px;
}

body[data-current-view="radar"] .radar-keyword-option {
  min-height: 34px;
  padding: 5px 4px;
}

body[data-current-view="radar"] .radar-settings-drawer,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-settings-drawer {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-current-view="radar"] .radar-settings-drawer summary {
  min-height: 34px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
  padding-inline: 9px;
}

body[data-current-view="radar"] .radar-settings-drawer summary:hover {
  background: color-mix(in srgb, var(--surface-raised) 82%, var(--accent) 18%);
}

body[data-current-view="radar"] .radar-collection-panel,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-collection-panel {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 54%, transparent);
  padding: 9px 10px 8px;
}

body[data-current-view="radar"] .radar-collection-panel .radar-settings-drawer summary {
  background: color-mix(in srgb, var(--surface-raised) 76%, transparent);
}

body[data-current-view="radar"] .radar-command-row {
  min-height: 38px;
  padding-inline: 2px;
}

body[data-current-view="radar"] .radar-wordcloud-panel,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-wordcloud-panel {
  min-height: 0;
  align-self: stretch;
  grid-template-columns: minmax(104px, 126px) minmax(0, 1fr);
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 68%, transparent);
  padding: 9px;
  box-shadow: none;
}

body[data-current-view="radar"] .radar-wordcloud-body {
  min-height: 0;
  height: auto;
  align-self: stretch;
  background: color-mix(in srgb, var(--surface) 64%, transparent);
  padding: 5px;
}

body[data-current-view="radar"] .radar-wordcloud-cloud {
  background:
    radial-gradient(circle at 16% 18%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 34%),
    linear-gradient(145deg, color-mix(in srgb, var(--surface-soft, var(--surface-raised)) 92%, var(--accent) 8%), var(--surface-raised));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink-strong) 7%, transparent);
  font-family: var(--font-sans);
  font-synthesis-weight: none;
}

body[data-current-view="radar"] .radar-wordcloud-cloud:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: none;
}

body[data-current-view="radar"] .radar-wordcloud-word {
  text-shadow: none;
}

body[data-current-view="radar"] .radar-wordcloud-word[data-tone="ink"] {
  --token-ink: var(--ink-strong);
}

body[data-current-view="radar"] .radar-wordcloud-word[data-tone="paper"] {
  --token-ink: var(--accent-deep);
  text-shadow: none;
}

body[data-current-view="radar"] .radar-wordcloud-word[data-tone="ochre"] {
  --token-ink: color-mix(in srgb, var(--accent-deep) 76%, var(--muted));
}

body[data-current-view="radar"] .radar-wordcloud-word[data-tone="rust"] {
  --token-ink: color-mix(in srgb, var(--accent) 72%, var(--ink-strong));
}

body[data-current-view="radar"] .radar-wordcloud-dialog-body {
  background: var(--surface-soft, var(--surface-raised));
}

body[data-current-view="radar"] .radar-wordcloud-actions {
  gap: 6px;
}

body[data-current-view="radar"] .radar-wordcloud-action {
  min-width: 0;
  flex: 1 1 0;
  padding-inline: 9px;
}

body[data-current-view="radar"] .radar-results-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

body[data-current-view="radar"] .radar-results-head {
  grid-template-columns: minmax(145px, auto) minmax(0, 1fr);
  min-height: 54px;
  gap: 12px;
  padding: 4px 0 10px;
}

body[data-current-view="radar"] .radar-results-head strong {
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
}

body[data-current-view="radar"] .radar-results-tools {
  flex-wrap: nowrap;
  overflow: visible;
}

body[data-current-view="radar"] .radar-tool-button {
  min-width: 0;
  padding-inline: 10px;
}

body[data-current-view="radar"] .radar-search-field {
  width: clamp(142px, 16vw, 190px);
  min-width: 142px;
}

body[data-current-view="radar"] .radar-search-field input,
body[data-current-view="radar"] .radar-search-field input:hover,
body[data-current-view="radar"] .radar-search-field input:focus {
  border: 0;
  background: var(--surface-soft, var(--surface-raised));
  background-color: var(--surface-soft, var(--surface-raised));
  box-shadow: none;
}

body[data-current-view="radar"] .radar-progress-panel,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-progress-panel {
  margin-bottom: 8px;
  border: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-raised) 78%, var(--accent) 22%);
  box-shadow: none;
}

body[data-current-view="radar"] .radar-results-main {
  grid-template-columns: minmax(0, 1fr) minmax(250px, 286px);
  gap: 24px;
  padding: 0;
}

body[data-current-view="radar"] .radar-results {
  align-content: start;
  gap: 6px;
  padding-right: 2px;
}

body[data-current-view="radar"] .radar-card,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-card {
  grid-template-columns: 20px 56px minmax(0, 500px) auto minmax(0, 1fr);
  gap: 9px;
  justify-content: start;
  min-height: 76px;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 84%, var(--canvas));
  padding: 7px 8px;
  box-shadow: none;
  transition: background 160ms ease;
}

body[data-current-view="radar"] .radar-card:hover,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-card:hover {
  background: color-mix(in srgb, var(--surface-raised) 86%, var(--accent) 14%);
}

body[data-current-view="radar"] .radar-cover {
  width: 56px;
  border-radius: 8px;
}

body[data-current-view="radar"] .radar-card h3 {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

body[data-current-view="radar"] .radar-card-actions {
  grid-column: 4;
  justify-content: flex-start;
  margin-left: 8px;
}

body[data-current-view="radar"] .radar-card-actions a,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-card-actions a {
  border: 0;
  background: var(--surface-soft, var(--surface-raised));
  box-shadow: none;
}

body[data-current-view="radar"] .radar-track-button:hover,
body[data-current-view="radar"] .radar-track-button:focus-visible,
body[data-current-view="radar"] .radar-track-button.is-tracked,
body[data-current-view="radar"] .radar-track-button.is-tracked:hover,
body[data-current-view="radar"] .radar-track-button.is-tracked:focus-visible,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-track-button:hover,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-track-button:focus-visible,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-track-button.is-tracked {
  background: color-mix(in srgb, var(--surface-soft, var(--surface-raised)) 74%, var(--accent) 26%);
  color: var(--accent-deep);
  transform: none;
}

body[data-current-view="radar"] .radar-semantic-panel,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-semantic-panel {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
  padding: 10px;
  box-shadow: none;
}

body[data-current-view="radar"] .radar-semantic-head {
  min-height: 0;
  display: grid;
  gap: 10px;
}

body[data-current-view="radar"] .radar-semantic-copy {
  display: grid;
  gap: 3px;
}

body[data-current-view="radar"] .radar-semantic-copy strong {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

body[data-current-view="radar"] .radar-semantic-copy span {
  font-size: 11px;
  line-height: 1.45;
}

body[data-current-view="radar"] .radar-semantic-head > .radar-semantic-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 6px;
}

body[data-current-view="radar"] .radar-semantic-head button {
  min-width: 0;
  padding-inline: 7px;
}

body[data-current-view="radar"] .radar-hotword-groups {
  gap: 6px;
}

body[data-current-view="radar"] .radar-pagination,
body[data-appearance="deep-dark"][data-current-view="radar"] .radar-pagination {
  background: transparent;
  padding-bottom: 8px;
}

@media (max-width: 1400px) {
  body[data-current-view="radar"] .radar-workspace {
    grid-template-columns: minmax(276px, 300px) minmax(0, 1fr);
    gap: 18px;
  }

  body[data-current-view="radar"] .radar-results-main {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 236px);
    gap: 18px;
  }

  body[data-current-view="radar"] .radar-results-tools .radar-tool-button span:last-child {
    display: none;
  }

  body[data-current-view="radar"] .radar-results-tools .radar-tool-button {
    width: 32px;
    min-width: 32px;
    padding: 0;
  }
}

@media (max-width: 1060px) {
  body[data-current-view="radar"] .shell {
    overflow-y: auto;
  }

  body[data-current-view="radar"] #radarView,
  body[data-current-view="radar"] .radar-workspace {
    height: auto;
    overflow: visible;
  }

  body[data-current-view="radar"] .radar-workspace {
    grid-template-columns: 1fr;
  }

  body[data-current-view="radar"] .radar-command-panel {
    overflow: visible;
  }

  body[data-current-view="radar"] .radar-form {
    overflow: visible;
  }

  body[data-current-view="radar"] .radar-results-panel {
    min-height: 680px;
    overflow: visible;
  }

  body[data-current-view="radar"] .radar-results-main {
    min-height: 600px;
  }
}

@media (max-width: 760px) {
  body[data-current-view="radar"] .shell {
    padding-inline: 12px;
  }

  body[data-current-view="radar"] .radar-results-head,
  body[data-current-view="radar"] .radar-results-main {
    grid-template-columns: 1fr;
  }

  body[data-current-view="radar"] .radar-results-tools {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  body[data-current-view="radar"] .radar-search-field {
    width: min(100%, 240px);
  }

  body[data-current-view="radar"] .radar-semantic-panel {
    min-height: 300px;
  }

  body[data-current-view="radar"] .radar-card,
  body[data-appearance="deep-dark"][data-current-view="radar"] .radar-card {
    grid-template-columns: 22px 64px minmax(0, 1fr);
  }

  body[data-current-view="radar"] .radar-card-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-left: 0;
  }
}

/* --------------------------------------------------------------------------
   Light workspace alignment — settings, drafts, and material library

   These three utility views share one rhythm: a readable page heading, a
   softly tinted work surface, and white task cards. Accent color is reserved
   for the action that moves work forward.
   -------------------------------------------------------------------------- */

body[data-current-view="settings"] .shell,
body[data-current-view="draft"] .shell {
  padding: 22px 26px 32px;
}

body[data-current-view="settings"] #settingsView,
body[data-current-view="draft"] #draftView {
  width: min(980px, 100%);
  margin: 0 auto;
}

body[data-current-view="draft"] #draftView {
  width: min(1180px, 100%);
}

body[data-current-view="settings"] #settingsView > .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 0 0 18px;
  padding: 0 2px;
}

body[data-current-view="settings"] #settingsView > .section-heading .eyebrow,
body[data-current-view="material"] #materialView > .section-heading .eyebrow {
  margin: 0 0 3px;
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  letter-spacing: .11em;
  text-transform: uppercase;
}

body[data-current-view="settings"] #settingsView > .section-heading h2,
body[data-current-view="material"] #materialView > .section-heading h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 22px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -.02em;
}

body[data-current-view="settings"] #settingsView > .section-heading .settings-heading-meta,
body[data-current-view="material"] #materialView > .section-heading > p {
  max-width: 590px;
  margin: 0 0 2px;
  text-align: right;
}

body[data-current-view="settings"] #settingsView > .section-heading .settings-heading-meta p,
body[data-current-view="material"] #materialView > .section-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

body[data-current-view="settings"] .settings-autosave-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

body[data-current-view="settings"] .settings-autosave-status::before {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--faint);
  content: "";
}

body[data-current-view="settings"] .settings-autosave-status[data-state="saving"]::before {
  background: var(--accent);
  animation: settings-save-pulse 900ms ease-in-out infinite alternate;
}

body[data-current-view="settings"] .settings-autosave-status[data-state="saved"] {
  color: var(--ink);
}

body[data-current-view="settings"] .settings-autosave-status[data-state="saved"]::before {
  background: var(--accent);
}

@keyframes settings-save-pulse {
  to { opacity: .35; }
}

body[data-current-view="settings"] #settingsView .settings-card {
  margin: 0;
  padding: 0;
}

body[data-current-view="settings"] .system-settings {
  gap: 16px;
}

body[data-current-view="settings"] .settings-source-panel {
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px 18px;
  border: 0;
  border-radius: 16px;
  background: var(--surface-raised);
  padding: 18px;
}

body[data-current-view="settings"] .settings-command-strip {
  grid-template-columns: minmax(260px, 1fr) minmax(142px, 190px) auto;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--canvas) 70%, var(--surface));
  padding: 12px;
}

body[data-current-view="settings"] .settings-file-drawer {
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--canvas) 64%, var(--surface));
  padding: 9px 12px;
}

body[data-current-view="settings"] .settings-main-panel {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 370px);
  gap: 16px;
}

body[data-current-view="settings"] .settings-left-panel,
body[data-current-view="settings"] .settings-side-panel {
  gap: 12px;
}

body[data-current-view="settings"] .settings-grid,
body[data-current-view="settings"] .template-box,
body[data-current-view="settings"] .appearance-panel,
body[data-current-view="settings"] .theme-panel,
body[data-current-view="settings"] .usage-box,
body[data-current-view="settings"] .cover-demo-panel {
  border: 0;
  border-radius: 16px;
  background: var(--surface-raised);
  box-shadow: none;
}

body[data-current-view="settings"] .settings-grid {
  gap: 12px;
  padding: 16px;
}

body[data-current-view="settings"] .template-box,
body[data-current-view="settings"] .appearance-panel,
body[data-current-view="settings"] .theme-panel,
body[data-current-view="settings"] .usage-box,
body[data-current-view="settings"] .cover-demo-panel {
  margin: 0;
  padding: 16px;
}

body[data-current-view="settings"] .appearance-mode-button,
body[data-current-view="settings"] .color-theme-card {
  border: 0;
  background: color-mix(in srgb, var(--canvas) 70%, var(--surface));
}

body[data-current-view="settings"] .appearance-mode-button.is-active,
body[data-current-view="settings"] .color-theme-card.is-active {
  border: 1px solid color-mix(in srgb, var(--accent) 58%, transparent);
  background: var(--accent-wash);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

body[data-current-view="settings"] .usage-box {
  align-items: flex-start;
  gap: 14px;
}

body[data-current-view="settings"] .usage-box > button {
  flex: 0 0 auto;
  margin-top: 2px;
}

body[data-current-view="draft"] .draft-layout {
  grid-template-columns: minmax(0, 1fr);
}

body[data-current-view="draft"] .draft-only-panel {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: color-mix(in srgb, var(--canvas) 72%, var(--surface));
  padding: 24px;
}

body[data-current-view="draft"]:not([data-appearance="deep-dark"]) .draft-only-panel {
  background: #f5f5f6;
}

body[data-current-view="draft"] .draft-only-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 28%, transparent) 44%, transparent 74%);
  content: "";
}

body[data-current-view="draft"] .draft-only-panel > .section-heading {
  margin: 0;
}

body[data-current-view="draft"] .draft-only-panel > .section-heading h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 22px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -.02em;
}

body[data-current-view="draft"] .draft-type-tabs {
  width: 100%;
  margin: 12px 0 0;
}

body[data-current-view="draft"] .final-inbox-summary {
  margin: 14px 0 16px;
}

body[data-current-view="draft"] .draft-only-list {
  gap: 9px;
  max-height: none;
  padding: 0;
  overflow: visible;
}

body[data-current-view="draft"] .draft-list-item {
  min-height: 94px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  padding: 14px 16px;
  box-shadow: none;
}

body[data-current-view="draft"]:not([data-appearance="deep-dark"]) .draft-list-item {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(29, 29, 31, .035);
}

body[data-current-view="draft"] .draft-list-item:hover {
  border: 0;
  background: color-mix(in srgb, var(--surface) 82%, var(--accent-wash));
  transform: translateY(-1px);
}

body[data-current-view="draft"] .draft-item-main {
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 14px;
}

body[data-current-view="draft"] .draft-item-main .final-inbox-thumb {
  width: 60px;
  height: auto;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
}

body[data-current-view="draft"] .draft-item-actions {
  gap: 6px;
}

body[data-current-view="draft"] .draft-item-actions button {
  min-height: 34px;
  border: 0;
  background: color-mix(in srgb, var(--canvas) 72%, var(--surface));
}

body[data-current-view="draft"]:not([data-appearance="deep-dark"]) .draft-item-actions .secondary {
  background: #f0f0f2;
}

body[data-current-view="draft"] .draft-item-actions .ghost {
  background: transparent;
  color: var(--muted);
}

body[data-current-view="draft"] .draft-only-list > .empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
}

body[data-current-view="draft"] .deleted-draft-section {
  margin-top: 18px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
}

body[data-current-view="material"] .shell {
  padding: 18px 20px 28px;
}

body[data-current-view="material"] #materialView > .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 0 0 14px;
  padding: 0 2px;
}

body[data-current-view="material"] #materialView > .settings-card {
  margin: 0;
}

body[data-current-view="material"] .asset-studio {
  gap: 14px;
}

body[data-current-view="material"] .asset-toolbar {
  top: 8px;
  min-height: 58px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-raised);
  margin: 0;
  padding: 10px 12px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--ink-strong) 5%, transparent);
}

body[data-current-view="material"] .asset-toolbar::before {
  display: block;
  top: -40px;
  border-bottom: 0;
  pointer-events: none;
}

body[data-current-view="material"] .asset-toolbar-actions {
  flex-wrap: wrap;
  gap: 7px;
}

body[data-current-view="material"] .asset-toolbar-actions button,
body[data-current-view="material"] .asset-shooting-list-link,
body[data-current-view="material"] .asset-annotation-search {
  min-height: 36px;
  height: 36px;
}

body[data-current-view="material"] .asset-annotation-search {
  flex: 1 1 230px;
  min-width: 190px;
  max-width: 330px;
}

body[data-current-view="material"] #analyzeCurrentAssetGroupBtn {
  background: var(--accent-wash);
  color: var(--accent-deep);
}

body[data-current-view="material"] #assetTrashBtn,
body[data-current-view="material"] #deleteAssetItemsBtn {
  color: var(--ink);
}

body[data-current-view="material"] .asset-workspace,
body[data-current-view="material"] .asset-browser-panel {
  border-radius: 16px;
}

body[data-current-view="material"] .asset-item-list,
body[data-current-view="material"]:not([data-appearance="deep-dark"]) .asset-item-list {
  min-height: calc(100vh - 190px);
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  gap: 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--canvas) 72%, var(--surface));
  padding: 16px;
}

body[data-current-view="material"] .asset-item-card {
  border: 0;
  border-radius: 13px;
  background: var(--surface);
  overflow: hidden;
}

body[data-current-view="material"] .asset-item-card:hover {
  border: 0;
  background: var(--surface);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--ink-strong) 8%, transparent);
  transform: translateY(-2px);
}

/* Light mode needs the same stable image-overlay contrast as deep mode. */
body:not([data-appearance="deep-dark"])[data-current-view="material"] .asset-item-card:hover .asset-card-actions,
body:not([data-appearance="deep-dark"])[data-current-view="material"] .asset-item-card.is-menu-open .asset-card-actions,
body:not([data-appearance="deep-dark"])[data-current-view="material"] .asset-item-card:has(:focus-visible) .asset-card-actions {
  background: linear-gradient(to top, rgba(10, 12, 16, 0.78), rgba(10, 12, 16, 0));
}

body:not([data-appearance="deep-dark"])[data-current-view="material"] .asset-card-actions .asset-ai-chip,
body:not([data-appearance="deep-dark"])[data-current-view="material"] .asset-card-actions .asset-ai-chip.is-read,
body:not([data-appearance="deep-dark"])[data-current-view="material"] .asset-card-actions .asset-ai-chip.is-unread,
body:not([data-appearance="deep-dark"])[data-current-view="material"] .asset-card-actions .asset-ai-chip.is-running,
body:not([data-appearance="deep-dark"])[data-current-view="material"] .asset-card-actions .asset-ai-chip.is-finished,
body:not([data-appearance="deep-dark"])[data-current-view="material"] .asset-card-actions .asset-ai-chip.is-failed,
body:not([data-appearance="deep-dark"])[data-current-view="material"] button.asset-card-edit-btn,
body:not([data-appearance="deep-dark"])[data-current-view="material"] button.asset-card-more-btn {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(24, 27, 33, 0.86);
  color: rgba(255, 255, 255, 0.94);
  opacity: 1;
  box-shadow: 0 5px 14px rgba(5, 7, 10, 0.28);
  backdrop-filter: blur(10px) saturate(85%);
  -webkit-backdrop-filter: blur(10px) saturate(85%);
}

body:not([data-appearance="deep-dark"])[data-current-view="material"] button.asset-card-edit-btn:hover,
body:not([data-appearance="deep-dark"])[data-current-view="material"] button.asset-card-edit-btn:focus-visible,
body:not([data-appearance="deep-dark"])[data-current-view="material"] button.asset-card-more-btn:hover,
body:not([data-appearance="deep-dark"])[data-current-view="material"] button.asset-card-more-btn:focus-visible {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(10, 12, 16, 0.96);
  color: #fff;
  box-shadow: 0 7px 18px rgba(5, 7, 10, 0.34);
}

body[data-current-view="material"] .asset-preview-thumb {
  border-radius: 13px 13px 9px 9px;
}

@media (max-width: 980px) {
  body[data-current-view="settings"] #settingsView > .section-heading,
  body[data-current-view="material"] #materialView > .section-heading {
    display: grid;
    gap: 6px;
  }

  body[data-current-view="settings"] #settingsView > .section-heading .settings-heading-meta,
  body[data-current-view="material"] #materialView > .section-heading > p {
    text-align: left;
  }

  body[data-current-view="settings"] .settings-autosave-status {
    justify-content: flex-start;
  }

  body[data-current-view="settings"] .settings-source-panel,
  body[data-current-view="settings"] .settings-command-strip,
  body[data-current-view="settings"] .settings-main-panel {
    grid-template-columns: 1fr;
  }

  body[data-current-view="material"] .asset-shooting-list-link {
    margin-left: 0;
  }

}

@media (max-width: 720px) {
  body[data-current-view="settings"] .shell,
  body[data-current-view="draft"] .shell,
  body[data-current-view="material"] .shell {
    padding: 16px 12px 24px;
  }

  body[data-current-view="settings"] .settings-grid,
  body[data-current-view="settings"] .appearance-mode-list,
  body[data-current-view="settings"] .color-theme-list {
    grid-template-columns: 1fr;
  }

  body[data-current-view="draft"] .draft-only-panel {
    padding: 18px 14px;
  }

  body[data-current-view="draft"] .draft-list-item {
    grid-template-columns: 1fr;
  }

  body[data-current-view="draft"] .draft-item-actions {
    padding-left: 74px;
  }

  body[data-current-view="material"] .asset-annotation-search {
    order: 5;
    max-width: none;
  }
}

/* Calendar rows must scroll behind an opaque, frozen table heading. */
body[data-current-view="calendar"] .table-head,
body[data-appearance="deep-dark"][data-current-view="calendar"] .table-head {
  z-index: 85;
  isolation: isolate;
  background: var(--surface-raised);
  box-shadow: 0 10px 0 var(--canvas);
}

body[data-current-view="calendar"] .table-head::before,
body[data-appearance="deep-dark"][data-current-view="calendar"] .table-head::before {
  top: calc(-1 * (var(--calendar-controlbar-height) + 14px));
  right: -2px;
  bottom: -10px;
  left: -2px;
  z-index: -1;
  border-radius: 12px;
  background: var(--canvas);
}

body[data-current-view="calendar"] .table-body {
  position: relative;
  z-index: 0;
}

/* Keep the calendar creation modes visible above the sticky heading mask. */
body[data-current-view="calendar"] #calendarView > .creation-mode-tabs {
  position: relative;
  z-index: 90;
}

/* Compact the date control and reserve deliberate breathing room before topics. */
@media (min-width: 981px) {
  body[data-current-view="calendar"] .table-head,
  body[data-current-view="calendar"] .calendar-date-section {
    grid-template-columns: 104px 24px 180px minmax(260px, 1fr) 132px 124px 112px;
  }

  body[data-current-view="calendar"] .table-head > :nth-child(1) {
    grid-column: 1;
  }

  body[data-current-view="calendar"] .table-head > :nth-child(2) {
    grid-column: 3;
  }

  body[data-current-view="calendar"] .table-head > :nth-child(3) {
    grid-column: 4;
  }

  body[data-current-view="calendar"] .table-head .calendar-status-filter {
    grid-column: 5;
  }

  body[data-current-view="calendar"] .table-head .calendar-action-heading {
    grid-column: 6 / 8;
  }

  body[data-current-view="calendar"] .calendar-date-group-list {
    grid-column: 3 / -1;
  }
}

/* Settings controls keep a dark surface on hover instead of flashing white. */
body[data-appearance="deep-dark"] #settingsView button:not(.primary):not(.appearance-mode-button):not(.color-theme-card):hover,
body[data-appearance="deep-dark"] #settingsView button:not(.primary):not(.appearance-mode-button):not(.color-theme-card):focus-visible,
body[data-appearance="deep-dark"] #settingsCaseLibraryView button:not(.primary):hover,
body[data-appearance="deep-dark"] #settingsCaseLibraryView button:not(.primary):focus-visible {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--accent) 22%);
  color: var(--ink-strong);
  box-shadow: none;
}

body[data-appearance="deep-dark"] #settingsView button:not(.primary):hover .ui-icon,
body[data-appearance="deep-dark"] #settingsView button:not(.primary):focus-visible .ui-icon,
body[data-appearance="deep-dark"] #settingsCaseLibraryView button:not(.primary):hover .ui-icon,
body[data-appearance="deep-dark"] #settingsCaseLibraryView button:not(.primary):focus-visible .ui-icon {
  color: currentColor;
}

/* The footer appearance switch must not grow or shift when the pointer enters it. */
body button.sidebar-appearance-toggle,
body button.sidebar-appearance-toggle:hover,
body button.sidebar-appearance-toggle:focus-visible,
body button.sidebar-appearance-toggle:active {
  min-height: 22px;
  background: transparent;
  box-shadow: none;
  transform: none;
}

body .sidebar-appearance-toggle:hover .sidebar-appearance-track,
body .sidebar-appearance-toggle:focus-visible .sidebar-appearance-track {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  transform: none;
}

/* Template library: two calm work zones instead of nested, edge-to-edge cards. */
@media (min-width: 981px) {
  body[data-current-view="pool"] .shell {
    padding: 22px 26px;
  }

  body[data-current-view="pool"] .pool-workspace {
    height: calc(100vh - 44px);
    grid-template-columns: minmax(360px, 0.72fr) minmax(600px, 1.28fr);
    gap: 32px;
    overflow: visible;
  }

  body[data-current-view="pool"] .pool-form {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto clamp(280px, 42vh, 460px) auto auto;
    gap: 18px;
    align-content: start;
    padding: 8px 0 0;
    border: 0;
    background: transparent;
  }

  /* The light editor uses a visible tinted surface, so keep its copy off the edge. */
  body:not([data-appearance="deep-dark"])[data-current-view="pool"] .pool-form {
    padding: 8px 18px 0;
  }

  body[data-current-view="pool"] .pool-form :where(
    input,
    textarea,
    .themed-select-trigger
  ) {
    border-color: transparent;
    border-radius: 12px;
    box-shadow: none;
  }

  body[data-current-view="pool"] .pool-list-panel {
    background: transparent;
  }

  body[data-current-view="pool"] .pool-list-head {
    min-height: 0;
    padding: 8px 0 22px;
    border: 0;
  }

  body[data-current-view="pool"] .pool-type-tabs {
    column-gap: 10px;
    row-gap: 10px;
  }

  body[data-current-view="pool"] .pool-list {
    gap: 4px;
    overflow-y: auto;
    padding: 8px 0 6px;
  }

  body[data-current-view="pool"] .pool-card,
  body[data-appearance="deep-dark"][data-current-view="pool"] .pool-card {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    padding: 6px 10px;
  }

  body[data-current-view="pool"] .pool-card:hover,
  body[data-appearance="deep-dark"][data-current-view="pool"] .pool-card:hover {
    background: color-mix(in srgb, var(--surface-raised) 82%, var(--accent) 18%);
  }

  body[data-current-view="pool"] .pool-pagination {
    border: 0;
    padding-right: 0;
  }
}

/* Pinned template chips stay warm and legible without flashing white at night. */
body[data-appearance="deep-dark"][data-current-view="pool"] .pool-card .type-chip.is-pinned {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-raised) 84%, var(--amber) 16%);
  color: color-mix(in srgb, var(--amber) 84%, #fff 16%);
  box-shadow: none;
}

/* Template library switcher: typographic tabs with one quiet underline. */
.pool-template-tabs {
  display: flex;
  align-items: center;
  gap: 30px;
}

.pool-template-tab,
body[data-appearance="deep-dark"] .pool-template-tab,
body[data-appearance="deep-dark"] .pool-template-tab:hover,
body[data-appearance="deep-dark"] .pool-template-tab:focus-visible {
  position: relative;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 3px 13px;
  font-size: 19px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
  transform: none;
}

.pool-template-tab em {
  margin-left: 5px;
  color: currentColor;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.pool-template-tab::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 99px;
  background: transparent;
}

.pool-template-tab:hover,
.pool-template-tab:focus-visible {
  color: var(--ink-strong);
}

.pool-template-tab.is-active,
body[data-appearance="deep-dark"] .pool-template-tab.is-active,
body[data-appearance="deep-dark"] .pool-template-tab.is-active:hover {
  background: transparent;
  color: var(--ink-strong);
}

.pool-template-tab.is-active::after {
  background: var(--accent);
}

.pool-workspace[data-pool-template-mode="speech"] .pool-form {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.pool-workspace[data-pool-template-mode="speech"] .pool-type-field {
  display: none;
}

.pool-workspace[data-pool-template-mode="speech"] .pool-usage-strip {
  display: none;
}

@media (min-width: 981px) {
  body[data-current-view="pool"] .pool-workspace[data-pool-template-mode="speech"] .pool-form {
    grid-template-rows: auto auto auto minmax(220px, 1fr) auto;
  }
}

.speech-transcript-importer {
  grid-column: 1 / -1;
  display: grid;
  gap: 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 14px;
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 52%),
    color-mix(in srgb, var(--surface-raised) 74%, transparent);
  padding: 14px;
}

.pool-workspace:not([data-pool-template-mode="speech"]) .speech-transcript-importer {
  display: none;
}

.speech-transcript-importer-head,
.speech-transcript-action-row {
  align-items: center;
  gap: 12px;
}

.speech-transcript-importer-head {
  display: flex;
  justify-content: space-between;
}

.speech-transcript-action-row {
  display: grid;
  grid-template-columns: minmax(176px, max-content) minmax(0, 1fr);
}

.speech-transcript-importer-head > div {
  display: grid;
  gap: 3px;
}

.speech-transcript-importer-head strong {
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.speech-transcript-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.04em;
}

.speech-transcript-local-badge {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 999px;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

.speech-transcript-input-wrap {
  display: block;
}

body[data-current-view="pool"] .speech-transcript-input-wrap textarea,
body[data-appearance="deep-dark"][data-current-view="pool"] .speech-transcript-input-wrap textarea {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
}

.speech-transcript-progress {
  display: grid;
  grid-template-columns: max-content minmax(14px, 1fr) max-content minmax(14px, 1fr) max-content;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

.speech-transcript-progress i {
  height: 1px;
  background: var(--line);
}

.speech-transcript-progress span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--line);
  vertical-align: 1px;
}

.speech-transcript-progress span.is-active,
.speech-transcript-progress span.is-done {
  color: var(--ink-strong);
}

.speech-transcript-progress span.is-active::before,
.speech-transcript-progress span.is-done::before {
  background: var(--accent);
}

.speech-transcript-progress.is-running span.is-active::before {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
  animation: speech-transcript-pulse 1.4s ease-in-out infinite;
}

.speech-transcript-meter {
  display: grid;
  gap: 7px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: 9px 10px;
}

.speech-transcript-meter[hidden] {
  display: none;
}

.speech-transcript-meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

.speech-transcript-meter-head strong {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.speech-transcript-progressbar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
}

.speech-transcript-progressbar i {
  position: relative;
  display: block;
  width: 1%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 72%, #fff), var(--accent));
  transition: width 360ms ease;
}

.speech-transcript-meter.is-running .speech-transcript-progressbar i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-100%);
  animation: speech-transcript-scan 1.6s ease-in-out infinite;
}

.speech-transcript-meter.is-complete .speech-transcript-progressbar i {
  background: var(--accent);
}

.speech-transcript-meter.is-failed .speech-transcript-progressbar i {
  background: var(--danger, #c94a5b);
}

.speech-transcript-caution {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--ink);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
}

.speech-transcript-caution span {
  width: 15px;
  height: 15px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
}

.speech-transcript-meter:not(.is-running) .speech-transcript-caution {
  display: none;
}

.speech-transcript-action {
  min-width: 176px;
  min-height: 38px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding-inline: 14px;
  white-space: nowrap;
}

.speech-transcript-action strong {
  white-space: nowrap;
}

.speech-transcript-action > span {
  font-size: 17px;
  line-height: 1;
}

.speech-transcript-action-row p,
.speech-transcript-result {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.speech-transcript-action-row p {
  text-align: right;
  overflow-wrap: anywhere;
}

.speech-transcript-result {
  overflow: hidden;
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  padding-top: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@keyframes speech-transcript-pulse {
  50% { box-shadow: 0 0 0 7px transparent; }
}

@keyframes speech-transcript-scan {
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .speech-transcript-progress.is-running span.is-active::before {
    animation: none;
  }

  .speech-transcript-progressbar i {
    transition: none;
  }

  .speech-transcript-meter.is-running .speech-transcript-progressbar i::after {
    animation: none;
  }
}

@media (max-width: 980px) {
  body[data-current-view="pool"] .shell {
    overflow-y: auto;
    padding-bottom: 28px;
  }

  body[data-current-view="pool"] #poolView,
  body[data-current-view="pool"] .pool-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  body[data-current-view="pool"] .pool-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  body[data-current-view="pool"] .pool-form,
  body[data-current-view="pool"] .pool-list-panel {
    min-height: 0;
  }

  body[data-current-view="pool"] .pool-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .pool-usage-strip {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .pool-usage-strip > .secondary {
    width: 100%;
  }

  .speech-transcript-importer-head,
  .speech-transcript-action-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .speech-transcript-action-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .speech-transcript-action {
    width: 100%;
  }

  .speech-transcript-action-row p {
    text-align: left;
  }
}

/* Calendar switches between independent graphic and speech schedules. */
.calendar-content-tabs {
  gap: 24px;
  white-space: nowrap;
}

.calendar-content-tab,
body[data-appearance="deep-dark"] .calendar-content-tab,
body[data-appearance="deep-dark"] .calendar-content-tab:hover,
body[data-appearance="deep-dark"] .calendar-content-tab:focus-visible {
  min-height: 42px;
  padding-bottom: 10px;
  font-size: 18px;
}

#calendarView[data-calendar-content-mode="speech"] .calendar-table .table-head {
  display: none;
}

#calendarView[data-calendar-content-mode="speech"] .calendar-table {
  min-height: 260px;
  width: 100%;
}

#calendarView[data-calendar-content-mode="speech"] .calendar-table .table-body {
  min-height: 260px;
  display: grid;
  place-items: center;
}

#calendarView[data-calendar-content-mode="speech"] .calendar-table.has-speech-items .table-body {
  min-height: 0;
  display: block;
  width: 100%;
}

#calendarView[data-calendar-content-mode="speech"] .calendar-table.has-speech-items,
body:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .calendar-table.has-speech-items {
  min-height: 0;
  border-radius: 0;
  background: transparent;
}

.speech-schedule-list {
  width: 100%;
  display: grid;
  gap: 8px;
}

.speech-schedule-card {
  width: 100%;
  box-sizing: border-box;
}

.speech-schedule-card:hover {
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--accent) 12%);
}

.speech-schedule-card .chase-hit-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.speech-schedule-remove .speech-mic-icon {
  width: 18px;
  height: 18px;
}

#calendarView[data-calendar-content-mode="speech"] .speech-schedule-search {
  width: 220px;
  margin-left: auto;
}

@media (max-width: 760px) {
  .speech-schedule-card {
    grid-template-columns: 32px 54px minmax(0, 1fr);
  }

  .speech-schedule-card .chase-hit-card-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }

  #calendarView[data-calendar-content-mode="speech"] .speech-schedule-search {
    width: min(100%, 320px);
    margin-left: 0;
  }
}

/* Speech style selection: creators choose a name; prompt text stays in settings. */
body[data-current-view="create"][data-create-mode="speech"] .speech-topbar {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.speech-style-picker {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.speech-style-menu {
  position: relative;
  z-index: 30;
  flex: 0 0 auto;
}

.speech-duration-control {
  --speech-duration-progress: 50%;
  width: 220px;
  min-width: 220px;
  min-height: 58px;
  display: grid;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 84%, transparent);
  color: var(--muted);
  padding: 8px 12px 9px;
}

.speech-duration-control:focus-within {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background: color-mix(in srgb, var(--surface-raised) 90%, var(--accent-wash));
}

.speech-duration-copy {
  min-height: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  line-height: 1;
}

.speech-duration-copy > strong {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
}

.speech-duration-slider {
  position: relative;
  display: flex;
  align-items: center;
  height: 16px;
}

.speech-duration-slider::before {
  content: "";
  position: absolute;
  inset: 6px 1px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 1px 50%, color-mix(in srgb, var(--ink) 50%, transparent) 0 2px, transparent 2.5px),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--ink) 50%, transparent) 0 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 1px) 50%, color-mix(in srgb, var(--ink) 50%, transparent) 0 2px, transparent 2.5px),
    linear-gradient(90deg, var(--accent) 0 var(--speech-duration-progress), color-mix(in srgb, var(--muted) 22%, transparent) var(--speech-duration-progress) 100%);
}

.speech-duration-slider input {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 16px;
  min-height: 0;
  max-height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  appearance: none;
  cursor: pointer;
}

.speech-duration-slider input:hover,
.speech-duration-slider input:focus,
.speech-duration-slider input:focus-visible,
.speech-duration-slider input:active {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
}

.speech-duration-slider input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.speech-duration-slider input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 3px solid var(--surface-raised);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-deep) 28%, transparent);
  appearance: none;
}

.speech-style-menu-trigger {
  min-width: 224px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 84%, transparent);
  color: var(--ink);
  padding: 0 11px;
  text-align: left;
}

.speech-style-menu-trigger:hover,
.speech-style-menu-trigger:focus-visible,
.speech-style-menu.is-open .speech-style-menu-trigger {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background: color-mix(in srgb, var(--surface-raised) 90%, var(--accent-wash));
}

.speech-style-menu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: var(--surface-raised);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.6;
}

.speech-style-menu-trigger > span {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.speech-style-menu-trigger > em {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--accent-deep);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speech-style-menu-trigger > i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.speech-style-menu.is-open .speech-style-menu-trigger > i {
  transform: translateY(2px) rotate(225deg);
}

.speech-style-dropdown {
  width: min(430px, calc(100vw - 48px));
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.speech-style-menu.is-open .speech-style-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.speech-style-dropdown .speech-prompt-item {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted);
  padding: 0 10px;
  text-align: center;
  box-shadow: none;
}

.speech-style-dropdown .speech-prompt-item strong {
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.speech-style-dropdown .speech-prompt-item:hover,
.speech-style-dropdown .speech-prompt-item:focus-visible {
  background: color-mix(in srgb, var(--surface-raised) 82%, var(--accent) 18%);
  color: var(--ink-strong);
}

.speech-style-dropdown .speech-prompt-item.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 18%, transparent);
}

body[data-current-view="create"][data-create-mode="speech"] .speech-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.speech-quality-panel {
  display: grid;
  grid-template-rows: 32px minmax(0, 1fr);
  gap: 10px;
}

.speech-quality-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.speech-quality-head > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.speech-quality-head span {
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
}

.speech-quality-head em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.speech-quality-result {
  min-height: 0;
  overflow-y: auto;
  border-radius: 10px;
  background: var(--surface);
}

.speech-quality-empty {
  min-height: 100%;
  display: grid;
  place-content: center;
  gap: 7px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.speech-quality-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.speech-quality-empty span {
  font-size: 12px;
  line-height: 1.65;
}

.speech-quality-empty.is-loading strong {
  color: var(--accent);
}

.speech-quality-empty.is-error strong {
  color: var(--danger-color);
}

.speech-quality-list {
  display: grid;
  align-content: start;
}

.speech-quality-item {
  display: grid;
  gap: 7px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  padding: 12px 2px 13px;
}

.speech-quality-item:first-child {
  padding-top: 2px;
}

.speech-quality-item:last-child {
  border-bottom: 0;
}

.speech-quality-item-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.speech-quality-item-line strong {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.speech-quality-badges {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.speech-quality-count {
  flex: 0 0 auto;
  min-width: 62px;
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--muted);
  padding: 4px 7px;
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  text-align: center;
}

.speech-quality-count em {
  margin-left: 5px;
  font-size: 10px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  opacity: 0.72;
}

.speech-quality-item.is-present .speech-quality-count {
  background: color-mix(in srgb, var(--sage-soft) 80%, transparent);
  color: var(--sage);
}

.speech-quality-item.is-risk .speech-quality-count {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.speech-quality-level {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 25px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
}

.speech-quality-level.is-level-strong {
  border-color: color-mix(in srgb, var(--sage) 22%, transparent);
  background: color-mix(in srgb, var(--sage-soft) 82%, transparent);
  color: var(--sage);
}

.speech-quality-level.is-level-medium {
  border-color: color-mix(in srgb, #c98b35 24%, transparent);
  background: color-mix(in srgb, #c98b35 13%, transparent);
  color: #b97820;
}

.speech-quality-level.is-level-weak {
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.speech-quality-item p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.58;
}

.speech-prompt-settings-card {
  min-height: min(680px, calc(100vh - 150px));
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.speech-prompt-settings-sidebar {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  border-right: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding: 22px;
}

.speech-prompt-settings-intro p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.speech-prompt-settings-list {
  display: grid;
  align-content: start;
  grid-template-columns: 1fr;
  gap: 8px;
  overflow-y: auto;
}

.speech-prompt-settings-list .speech-prompt-item {
  min-height: 56px;
}

.speech-prompt-settings-editor {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(300px, 1fr) auto;
  gap: 18px;
  padding: 24px 28px;
}

.speech-prompt-settings-head,
.speech-prompt-settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.speech-prompt-settings-head h3 {
  margin-top: 4px;
  font-size: 22px;
}

.speech-prompt-settings-head > em,
.speech-prompt-settings-footer > span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.speech-prompt-settings-editor .speech-prompt-editor {
  display: grid;
  gap: 8px;
}

.speech-prompt-settings-editor .speech-prompt-editor > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.speech-prompt-body-editor {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}

.speech-prompt-settings-editor .speech-prompt-textarea {
  min-height: 300px;
  resize: vertical;
}

body[data-appearance="deep-dark"] .speech-prompt-settings-card {
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

@media (max-width: 1400px) {
  body[data-current-view="create"][data-create-mode="speech"] .speech-topbar,
  body[data-current-view="speech"] .speech-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-current-view="create"][data-create-mode="speech"] .speech-actions,
  body[data-current-view="speech"] .speech-actions {
    align-self: flex-end;
  }
}

@media (max-width: 1180px) {
  body[data-current-view="create"][data-create-mode="speech"] .speech-topbar,
  .speech-style-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .speech-style-menu-trigger {
    width: 100%;
  }

  .speech-duration-control {
    width: 100%;
    min-width: 0;
  }

  .speech-style-dropdown {
    width: min(430px, calc(100vw - 40px));
  }

  body[data-current-view="create"][data-create-mode="speech"] .speech-actions {
    align-self: flex-end;
  }
}

@media (max-width: 760px) {
  .speech-prompt-settings-card {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .speech-prompt-settings-sidebar {
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  }

  .speech-prompt-settings-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .speech-prompt-settings-editor {
    padding: 20px;
  }
}

/* Material marquee selection and its compact batch-action dock. */
body[data-current-view="material"] .asset-item-card.is-selected,
body[data-appearance="deep-dark"][data-current-view="material"] .asset-item-card.is-selected,
body[data-appearance="deep-dark"][data-current-view="material"] .asset-item-card.is-selected:hover {
  outline: 0;
  border-color: transparent;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 10px 24px color-mix(in srgb, var(--accent) 12%, transparent) !important;
}

body[data-current-view="material"] .asset-item-card.is-selected::before {
  content: "";
  position: absolute;
  z-index: 7;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: inherit;
  pointer-events: none;
}

body[data-current-view="material"] .asset-select-check {
  width: 22px;
  height: 22px;
}

body[data-current-view="material"] .asset-select-check span {
  width: 100%;
  height: 100%;
}

body[data-current-view="material"] .asset-select-check input:checked + span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 7px;
  width: 6px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

body[data-current-view="material"] .asset-preview-thumb img {
  user-select: none;
  -webkit-user-drag: none;
}

body.is-asset-marquee-selecting,
body.is-asset-marquee-selecting * {
  cursor: crosshair !important;
  user-select: none !important;
}

.asset-selection-marquee {
  position: fixed;
  z-index: 190;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 17%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--surface-raised) 42%, transparent) inset;
  pointer-events: none;
}

.asset-selection-bar {
  position: fixed;
  z-index: 180;
  left: calc(50% + var(--side-w) / 2);
  bottom: 28px;
  width: max-content;
  max-width: calc(100vw - var(--side-w) - 32px);
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 66%, var(--line-strong));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-raised) 72%, var(--accent) 28%);
  color: var(--ink-strong);
  padding: 7px 8px;
  box-shadow: 0 20px 52px color-mix(in srgb, #000 31%, transparent), 0 5px 22px color-mix(in srgb, var(--accent) 28%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 62%, transparent);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  transform: translateX(-50%);
  animation: asset-selection-bar-in 170ms ease-out;
}

body.sidebar-collapsed .asset-selection-bar {
  left: calc(50% + var(--side-collapsed-w) / 2);
}

body:not([data-current-view="material"]) .asset-selection-bar {
  display: none !important;
}

body.asset-selection-active[data-current-view="material"] #moveSelectedAssetItemsBtn,
body.asset-selection-active[data-current-view="material"] #assetBulkRatingGroup,
body.asset-selection-active[data-current-view="material"] #deleteAssetItemsBtn,
body.asset-selection-active[data-current-view="material"] #selectAssetItemsBtn,
body.asset-selection-active[data-current-view="material"] #cancelAssetDeleteBtn {
  display: none !important;
}

.asset-selection-count,
.asset-selection-action,
.asset-selection-rating {
  display: inline-flex;
  align-items: center;
}

.asset-selection-count {
  gap: 8px;
  min-width: 82px;
  padding: 0 8px;
  white-space: nowrap;
}

.asset-selection-count strong {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.asset-selection-count-icon {
  position: relative;
  width: 20px;
  height: 16px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  color: var(--accent-deep);
}

.asset-selection-count-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.asset-selection-count-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 10px;
  height: 6px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: skewY(-35deg);
}

.asset-selection-divider {
  width: 1px;
  height: 28px;
  flex: 0 0 auto;
  margin: 0 3px;
  background: var(--line);
}

.asset-selection-action {
  min-width: 0;
  min-height: 38px;
  justify-content: center;
  gap: 5px;
  border: 0 !important;
  border-radius: 9px;
  background: transparent !important;
  color: color-mix(in srgb, var(--ink-strong) 76%, var(--accent-deep)) !important;
  padding: 7px 9px;
  box-shadow: none !important;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.asset-selection-action:hover,
.asset-selection-action:focus-visible,
body[data-appearance="deep-dark"] .asset-selection-action:hover,
body[data-appearance="deep-dark"] .asset-selection-action:focus-visible {
  background: var(--accent-wash) !important;
  color: var(--ink-strong) !important;
  transform: none;
}

.asset-selection-action:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: -2px;
}

.asset-selection-action:disabled {
  opacity: 0.34;
}

.asset-selection-action .ui-icon {
  width: 15px;
  height: 15px;
}

.asset-selection-action.is-danger {
  color: var(--accent-deep) !important;
}

.asset-selection-action.is-close {
  width: 38px;
  padding-inline: 0;
}

.asset-selection-rating {
  gap: 1px;
}

.asset-selection-rating .asset-selection-action {
  padding-inline: 7px;
}

.asset-selection-folder-icon {
  position: relative;
  width: 17px;
  height: 13px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.asset-selection-folder-icon::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 1px;
  width: 7px;
  height: 4px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: var(--surface-raised);
}

.asset-selection-move-wrap {
  position: relative;
}

.asset-selection-move-dropdown {
  top: auto;
  right: auto;
  bottom: calc(100% + 12px);
  left: 0;
}

body[data-appearance="deep-dark"] .asset-selection-bar {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line-strong));
  background: color-mix(in srgb, var(--surface-raised) 64%, var(--accent) 36%);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.5), 0 6px 24px color-mix(in srgb, var(--accent) 34%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

@keyframes asset-selection-bar-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@media (max-width: 980px) {
  .asset-selection-bar,
  body.sidebar-collapsed .asset-selection-bar {
    left: 50%;
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 620px) {
  .asset-selection-bar {
    bottom: 10px;
    width: calc(100vw - 20px);
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 14px;
  }

  .asset-selection-divider {
    display: none;
  }

  .asset-selection-count {
    min-width: auto;
  }

  .asset-selection-action-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .asset-selection-bar {
    animation: none;
  }
}

/* Material filter: one compact trigger with combinable sort, vision, rating and usage choices. */
.asset-filter-control {
  position: relative;
  z-index: 72;
  flex: 0 0 auto;
}

body[data-current-view="material"] .asset-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-inline: 12px;
  white-space: nowrap;
}

.asset-filter-count {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding-inline: 5px;
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.asset-filter-chevron {
  width: 12px;
  height: 12px;
  transition: transform 140ms ease;
}

.asset-filter-btn[aria-expanded="true"] .asset-filter-chevron {
  transform: rotate(180deg);
}

.asset-filter-menu {
  position: absolute;
  z-index: 95;
  top: calc(100% + 9px);
  left: 0;
  width: min(292px, calc(100vw - 28px));
  max-height: min(500px, calc(100vh - 132px));
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-raised) 97%, transparent);
  color: var(--ink);
  padding: 6px;
  box-shadow: 0 18px 46px rgba(8, 10, 14, 0.24);
  overflow: auto;
  backdrop-filter: blur(18px);
}

.asset-filter-section {
  display: grid;
  gap: 2px;
  padding: 5px 0 7px;
}

.asset-filter-section + .asset-filter-section {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.asset-filter-section-label {
  color: var(--faint);
  padding: 4px 9px 5px;
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.07em;
}

body[data-current-view="material"] .asset-toolbar-actions .asset-filter-menu .asset-filter-section > button {
  width: 100%;
  min-height: 35px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 17px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 7px 9px;
  box-shadow: none;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  text-align: left;
}

body[data-current-view="material"] .asset-toolbar-actions .asset-filter-menu .asset-filter-section > button:hover,
body[data-current-view="material"] .asset-toolbar-actions .asset-filter-menu .asset-filter-section > button:focus-visible,
body[data-current-view="material"] .asset-toolbar-actions .asset-filter-menu .asset-filter-section > button[aria-checked="true"] {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-raised));
  color: var(--ink-strong);
}

.asset-filter-section button > small {
  color: var(--faint);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  text-align: right;
}

.asset-filter-check {
  position: relative;
  grid-column: 3;
  width: 16px;
  height: 16px;
  justify-self: end;
}

[data-asset-filter-kind][aria-checked="true"] .asset-filter-check::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 4px;
  width: 5px;
  height: 8px;
  border-right: 2px solid var(--accent-deep);
  border-bottom: 2px solid var(--accent-deep);
  transform: rotate(45deg);
}

.asset-filter-stars {
  min-width: 36px;
  color: #d57a29;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.04em;
}

.asset-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 7px 5px 1px;
}

body[data-current-view="material"] .asset-toolbar-actions .asset-filter-menu #resetAssetFilterBtn {
  width: auto;
  min-height: 30px;
  display: inline-flex;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 5px 7px;
  box-shadow: none;
  font-size: 11px;
}

body[data-current-view="material"] .asset-toolbar-actions .asset-filter-menu #resetAssetFilterBtn:hover,
body[data-current-view="material"] .asset-toolbar-actions .asset-filter-menu #resetAssetFilterBtn:focus-visible {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-raised));
  color: var(--accent-deep);
}

#assetFilterResultCount {
  color: var(--faint);
  padding-right: 5px;
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

@media (max-width: 720px) {
  .asset-filter-menu {
    position: fixed;
    top: 74px;
    right: 14px;
    left: 14px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .asset-filter-chevron {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Role login — a single front door for the creator and operator workspaces.
   -------------------------------------------------------------------------- */

body:not(.is-authenticated) .admin-shell {
  display: none;
}

.login-view {
  --login-ink: #211a31;
  --login-muted: #716b82;
  --login-line: rgba(72, 60, 105, 0.13);
  --login-violet: #7063d9;
  --login-violet-deep: #5146b5;
  --login-coral: #c93649;
  --login-sky: #c9e7f4;
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  min-height: 650px;
  display: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.94) 0 7%, transparent 25%),
    linear-gradient(145deg, #f8f2ee 0%, #f4eef5 46%, #eef4fa 100%);
  color: var(--login-ink);
}

body.is-auth-checking .login-view,
body.is-login-active .login-view,
body.is-creator-pending .login-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.login-view::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(75, 61, 113, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75, 61, 113, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, #000, transparent 64%);
}

.login-view::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -14vw;
  bottom: -42vh;
  width: 70vw;
  height: 92vh;
  border: 1px solid rgba(112, 99, 217, 0.09);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transform: rotate(-15deg);
}

.login-ambient {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(1px);
  pointer-events: none;
}

.login-ambient-one {
  top: 10%;
  right: 22%;
  width: 180px;
  height: 180px;
  background: rgba(171, 198, 243, 0.28);
}

.login-ambient-two {
  bottom: 4%;
  left: 31%;
  width: 240px;
  height: 240px;
  background: rgba(244, 183, 184, 0.19);
}

.login-brandbar,
.login-footer {
  width: min(1380px, calc(100% - 64px));
  margin: 0 auto;
}

.login-brandbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.login-brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background:
    url("/assets/icons/brand-mark.svg") center / cover no-repeat,
    #fff;
  box-shadow: 0 10px 24px rgba(74, 49, 104, 0.16);
}

.login-brand > span:last-child {
  display: grid;
  gap: 1px;
}

.login-brand strong {
  color: var(--login-ink);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.06em;
}

.login-brand em {
  color: #8b8498;
  font-family: var(--font-sans);
  font-size: 9px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.18em;
}

.login-version {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(92, 76, 134, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: #817a90;
  padding: 0 13px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.04em;
  backdrop-filter: blur(14px);
}

.login-shell {
  width: min(1380px, calc(100% - 64px));
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(410px, 0.82fr);
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow:
    0 36px 90px rgba(58, 45, 82, 0.13),
    inset 0 0 0 1px rgba(87, 70, 126, 0.05);
  backdrop-filter: blur(22px);
}

.login-story {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  gap: 24px;
  overflow: hidden;
  border-right: 1px solid var(--login-line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(239, 237, 252, 0.46)),
    radial-gradient(circle at 72% 58%, rgba(147, 189, 230, 0.24), transparent 34%);
  padding: clamp(38px, 4.8vw, 72px);
}

.login-story::after {
  content: "";
  position: absolute;
  right: -150px;
  bottom: -190px;
  width: 480px;
  height: 480px;
  border: 72px solid rgba(112, 99, 217, 0.055);
  border-radius: 50%;
  pointer-events: none;
}

.login-story-copy {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--login-violet-deep);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.12em;
}

.login-kicker::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.login-story h1 {
  margin-top: 16px;
  color: var(--login-ink);
  font-family: var(--font-sans);
  font-size: clamp(40px, 4.1vw, 66px);
  font-weight: var(--font-weight-semibold);
  line-height: 1.14;
  letter-spacing: -0.045em;
}

.login-story-copy > p {
  max-width: 570px;
  margin-top: 20px;
  color: var(--login-muted);
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.85;
}

.login-track-scene {
  position: relative;
  z-index: 1;
  min-height: 270px;
}

.login-track-line {
  position: absolute;
  top: 46%;
  left: 4%;
  width: 78%;
  height: 41%;
  border: 1.5px solid rgba(112, 99, 217, 0.25);
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 0 0 55% 0;
  transform: rotate(-7deg);
}

.login-track-line::before {
  content: "";
  position: absolute;
  top: -4px;
  right: -7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--login-coral);
  box-shadow: 0 0 0 6px rgba(201, 54, 73, 0.1);
}

.login-track-node {
  position: absolute;
  width: 108px;
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.76);
  padding: 16px;
  box-shadow: 0 20px 42px rgba(74, 59, 112, 0.12);
  backdrop-filter: blur(14px);
}

.login-track-node > span {
  color: #aaa4b6;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.14em;
}

.login-track-node strong {
  color: var(--login-ink);
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
}

.login-track-node em {
  color: var(--login-muted);
  font-size: 11px;
  font-style: normal;
}

.login-track-node::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 13px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(112, 99, 217, 0.22), rgba(201, 54, 73, 0.16));
}

.login-track-node.node-one {
  bottom: 25%;
  left: 2%;
  transform: rotate(-5deg);
}

.login-track-node.node-two {
  bottom: 13%;
  left: 24%;
  transform: rotate(3deg);
}

.login-track-node.node-three {
  right: 31%;
  bottom: 18%;
  transform: rotate(-2deg);
}

.login-track-node.node-four {
  right: 8%;
  bottom: 34%;
  transform: rotate(5deg);
}

.login-floating-card {
  position: absolute;
  display: grid;
  border: 1px solid rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 56px rgba(70, 55, 104, 0.14);
  backdrop-filter: blur(14px);
}

.login-floating-card-primary {
  top: -2%;
  right: 10%;
  width: 174px;
  grid-template-columns: 1fr auto;
  gap: 3px 8px;
  border-radius: 18px;
  padding: 16px;
  transform: rotate(2deg);
}

.login-card-signal {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #68b897;
  box-shadow: 0 0 0 5px rgba(104, 184, 151, 0.11);
}

.login-floating-card-primary small {
  grid-column: 1 / -1;
  color: var(--login-muted);
  font-size: 10px;
}

.login-floating-card-primary strong {
  grid-column: 1 / -1;
  color: var(--login-ink);
  font-family: var(--font-sans);
  font-size: 24px;
}

.login-floating-card-primary div {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece9f3;
}

.login-floating-card-primary div i {
  display: block;
  width: 80%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--login-violet), #9bb9e5);
}

.login-floating-card-note {
  top: 20%;
  left: 8%;
  width: 210px;
  gap: 2px;
  border-radius: 16px;
  padding: 14px 16px;
  transform: rotate(-2deg);
}

.login-floating-card-note > span {
  color: var(--login-coral);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
}

.login-floating-card-note strong {
  color: var(--login-ink);
  font-size: 13px;
}

.login-floating-card-note em {
  color: var(--login-muted);
  font-size: 10px;
  font-style: normal;
}

.login-story-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8b8498;
  font-size: 11px;
}

.login-story-foot i {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #68b897;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.86);
}

.login-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(255, 255, 255, 0.74);
  padding: 14px;
}

.login-role-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(83, 68, 120, 0.08);
  border-radius: 16px;
  background: rgba(236, 233, 242, 0.7);
}

.login-role-switch button {
  position: relative;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #827b90;
  padding: 0 12px;
  box-shadow: none;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

.login-role-switch button:hover {
  color: var(--login-violet-deep);
}

.login-role-switch button.is-active {
  background: #fff;
  color: var(--login-violet-deep);
  box-shadow: 0 8px 22px rgba(70, 54, 102, 0.1);
}

.login-role-switch button.is-active::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: -6px;
  left: 16px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--login-violet), transparent);
}

.login-role-icon {
  position: relative;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.login-role-icon-creator::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.login-role-icon-creator::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 3px;
  left: 4px;
  height: 6px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.login-role-icon-operator {
  border-radius: 5px;
}

.login-role-icon-operator::before,
.login-role-icon-operator::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.login-role-icon-operator::before {
  top: 4px;
  bottom: 4px;
  left: 6px;
  width: 1.5px;
  box-shadow: 6px 0 currentColor;
}

.login-role-icon-operator::after {
  top: 7px;
  right: 4px;
  left: 4px;
  height: 1.5px;
  box-shadow: 0 6px currentColor;
}

.login-form-wrap,
.creator-pending {
  width: min(430px, calc(100% - 48px));
  align-self: center;
  justify-self: center;
}

.login-panel-heading > span {
  color: var(--login-coral);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.1em;
}

.login-panel-heading h2,
.creator-pending h2 {
  margin-top: 7px;
  color: var(--login-ink);
  font-size: clamp(26px, 2vw, 32px);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.035em;
}

.login-panel-heading p,
.creator-pending > p {
  margin-top: 7px;
  color: var(--login-muted);
  font-size: 13px;
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 29px;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field > span {
  color: #4c4658;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.login-input-wrap {
  position: relative;
}

.login-input-wrap input {
  height: 54px;
  min-height: 54px;
  border: 1px solid rgba(80, 67, 112, 0.13);
  border-radius: 13px;
  background: rgba(250, 249, 252, 0.9);
  color: var(--login-ink);
  padding: 0 48px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.login-input-wrap input:hover {
  border-color: rgba(112, 99, 217, 0.28);
  background: #fff;
}

.login-input-wrap input:focus {
  border-color: var(--login-violet);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(112, 99, 217, 0.09);
}

.login-input-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 17px;
  width: 18px;
  height: 18px;
  color: #9b94a8;
  transform: translateY(-50%);
  pointer-events: none;
}

.login-input-user {
  border: 1.6px solid currentColor;
  border-radius: 50%;
}

.login-input-user::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.login-input-user::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 2px;
  left: 3px;
  height: 5px;
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.login-input-lock {
  top: calc(50% + 2px);
  height: 14px;
  border: 1.6px solid currentColor;
  border-radius: 4px;
}

.login-input-lock::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 3px;
  width: 8px;
  height: 9px;
  border: 1.6px solid currentColor;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  color: #9b94a8;
  transform: translateY(-50%);
}

.login-password-toggle:hover {
  border-color: transparent;
  background: rgba(112, 99, 217, 0.07);
  color: var(--login-violet);
}

.login-password-toggle:active {
  transform: translateY(-50%);
}

.login-password-toggle span {
  position: relative;
  width: 18px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 70% 20%;
  transform: rotate(45deg);
}

.login-password-toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.login-password-toggle[aria-pressed="true"] span::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -3px;
  width: 22px;
  height: 1.5px;
  background: currentColor;
}

.login-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -4px;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--login-muted);
  font-size: 11px;
  cursor: pointer;
}

.login-remember input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--login-violet);
}

.login-view .login-submit {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(120deg, var(--login-violet-deep), var(--login-violet));
  color: #fff;
  box-shadow: 0 14px 30px rgba(81, 70, 181, 0.22);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.login-view .login-submit:hover {
  border-color: transparent;
  background: linear-gradient(120deg, #493eaa, #6558d1);
  color: #fff;
  box-shadow: 0 17px 36px rgba(81, 70, 181, 0.29);
  transform: translateY(-1px);
}

.login-submit i {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.17);
}

.login-submit i::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 4px;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid #fff;
  border-right: 1.5px solid #fff;
  transform: rotate(45deg);
}

.login-submit.is-loading i {
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  background: transparent;
  animation: login-spin 700ms linear infinite;
}

.login-submit.is-loading i::before {
  display: none;
}

.login-status {
  min-height: 18px;
  margin-top: -8px;
  color: var(--login-coral);
  font-size: 11px;
  line-height: 1.55;
}

.creator-pending {
  display: grid;
  justify-items: center;
  text-align: center;
}

.creator-pending-mark {
  position: relative;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid rgba(112, 99, 217, 0.14);
  border-radius: 25px;
  background: linear-gradient(145deg, #fff, #eeebfb);
  box-shadow: 0 20px 45px rgba(81, 70, 181, 0.16);
  transform: rotate(-5deg);
}

.creator-pending-mark::before,
.creator-pending-mark::after,
.creator-pending-mark span {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.creator-pending-mark::before {
  width: 21px;
  height: 21px;
  background: var(--login-violet);
  transform: translateY(-10px);
}

.creator-pending-mark::after {
  width: 38px;
  height: 20px;
  border-radius: 20px 20px 9px 9px;
  background: linear-gradient(120deg, var(--login-violet), #9b91ed);
  transform: translateY(14px);
}

.creator-pending-mark span {
  right: -7px;
  bottom: 5px;
  width: 24px;
  height: 24px;
  border: 4px solid #fff;
  background: var(--login-coral);
}

.creator-pending > p {
  max-width: 360px;
}

.creator-pending-route {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 7px;
  margin: 28px 0;
  border: 1px solid rgba(112, 99, 217, 0.11);
  border-radius: 13px;
  background: rgba(112, 99, 217, 0.045);
  padding: 15px;
  color: var(--login-muted);
  font-size: 10px;
}

.creator-pending-route i {
  height: 1px;
  background: rgba(112, 99, 217, 0.24);
}

.creator-back-button {
  min-height: 36px;
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--login-muted);
  box-shadow: none;
  font-size: 11px;
}

.creator-back-button:hover {
  border-color: transparent;
  color: var(--login-violet-deep);
}

.login-footer {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #9a94a4;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.login-view[data-role="creator"] {
  --login-violet: #c95b6c;
  --login-violet-deep: #ad4054;
}

.login-view[data-role="creator"] .login-story {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(252, 235, 239, 0.48)),
    radial-gradient(circle at 72% 58%, rgba(244, 181, 191, 0.25), transparent 34%);
}

.login-view[data-role="creator"] .login-track-line::before {
  background: #7063d9;
  box-shadow: 0 0 0 6px rgba(112, 99, 217, 0.1);
}

body.is-auth-checking .login-panel,
body.is-auth-checking .login-story {
  opacity: 0;
}

body.is-login-active .login-panel,
body.is-login-active .login-story,
body.is-creator-pending .login-panel,
body.is-creator-pending .login-story {
  animation: login-reveal 460ms ease both;
}

body.is-login-active .login-panel,
body.is-creator-pending .login-panel {
  animation-delay: 80ms;
}

@keyframes login-reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes login-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
  .login-shell {
    grid-template-columns: minmax(0, 0.9fr) minmax(390px, 1.1fr);
  }

  .login-story {
    padding: 42px;
  }

  .login-track-node.node-three {
    right: 25%;
  }

  .login-track-node.node-four {
    right: 0;
  }

  .login-floating-card-primary {
    right: 3%;
  }
}

@media (max-height: 820px) and (min-width: 861px) {
  .login-brandbar {
    min-height: 72px;
  }

  .login-footer {
    min-height: 46px;
  }

  .login-shell {
    height: calc(100vh - 118px);
    margin: 0 auto;
  }

  .login-story {
    grid-template-rows: auto minmax(170px, 1fr) auto;
    gap: 12px;
    padding: 32px 48px 25px;
  }

  .login-story h1 {
    margin-top: 10px;
    font-size: clamp(38px, 3.7vw, 52px);
  }

  .login-story-copy > p {
    margin-top: 12px;
    line-height: 1.65;
  }

  .login-track-scene {
    min-height: 178px;
  }

  .login-track-node {
    width: 98px;
    min-height: 88px;
    border-radius: 19px;
    padding: 12px;
  }

  .login-track-node.node-one {
    bottom: 8%;
  }

  .login-track-node.node-two {
    bottom: 0;
  }

  .login-track-node.node-three {
    bottom: 4%;
  }

  .login-track-node.node-four {
    bottom: 20%;
  }

  .login-floating-card-primary {
    top: -8%;
  }

  .login-floating-card-note {
    top: 10%;
  }

  .login-panel {
    padding: 10px;
  }

  .login-role-switch button {
    min-height: 46px;
  }

  .login-panel-heading h2,
  .creator-pending h2 {
    font-size: 26px;
  }

  .login-form {
    gap: 11px;
    margin-top: 19px;
  }

  .login-field {
    gap: 5px;
  }

  .login-input-wrap input,
  .login-submit {
    height: 50px;
    min-height: 50px;
  }

  .creator-pending-mark {
    width: 66px;
    height: 66px;
    margin-bottom: 18px;
  }

  .creator-pending-route {
    margin: 20px 0;
  }
}

@media (max-width: 860px) {
  .login-view {
    min-height: 720px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.is-auth-checking .login-view,
  body.is-login-active .login-view,
  body.is-creator-pending .login-view {
    grid-template-rows: auto auto auto;
  }

  .login-brandbar,
  .login-footer,
  .login-shell {
    width: min(620px, calc(100% - 32px));
  }

  .login-brandbar {
    min-height: 76px;
  }

  .login-shell {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .login-story {
    min-height: 270px;
    grid-template-rows: auto auto;
    border-right: 0;
    border-bottom: 1px solid var(--login-line);
    border-radius: 28px 28px 0 0;
    padding: 34px;
  }

  .login-story::after {
    display: none;
  }

  .login-story h1 {
    font-size: clamp(34px, 8vw, 48px);
  }

  .login-story-copy > p {
    max-width: 500px;
  }

  .login-track-scene {
    min-height: 76px;
  }

  .login-track-line,
  .login-floating-card,
  .login-story-foot {
    display: none;
  }

  .login-track-node {
    position: relative;
    inset: auto !important;
    width: auto;
    min-height: 62px;
    transform: none !important;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 8px 22px rgba(74, 59, 112, 0.08);
  }

  .login-track-node::after,
  .login-track-node em,
  .login-track-node > span {
    display: none;
  }

  .login-track-scene {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .login-track-node strong {
    text-align: center;
    font-size: 12px;
  }

  .login-panel {
    min-height: 590px;
    border-radius: 0 0 28px 28px;
  }

  .login-footer {
    min-height: 56px;
  }
}

@media (max-width: 560px) {
  .login-view {
    min-width: 360px;
  }

  .login-brandbar,
  .login-footer,
  .login-shell {
    width: calc(100% - 20px);
  }

  .login-version,
  .login-footer span:last-child {
    display: none;
  }

  .login-story {
    min-height: 240px;
    padding: 26px 22px;
  }

  .login-story h1 {
    margin-top: 11px;
    font-size: 34px;
  }

  .login-story-copy > p {
    margin-top: 13px;
    font-size: 13px;
    line-height: 1.65;
  }

  .login-track-scene {
    min-height: 52px;
  }

  .login-track-node {
    min-height: 48px;
    padding: 7px;
  }

  .login-panel {
    min-height: 575px;
    padding: 9px;
  }

  .login-role-switch button {
    min-height: 48px;
    padding: 0 6px;
    font-size: 12px;
  }

  .login-form-wrap,
  .creator-pending {
    width: calc(100% - 30px);
  }

  .login-form {
    margin-top: 23px;
  }

}

@media (prefers-reduced-motion: reduce) {
  body.is-login-active .login-panel,
  body.is-login-active .login-story,
  body.is-creator-pending .login-panel,
  body.is-creator-pending .login-story,
  .login-submit.is-loading i {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Creator workspace — the same V2 data, with a calmer merchant-facing view.
   -------------------------------------------------------------------------- */

[data-creator-only] {
  display: none;
}

[data-internal-only] {
  display: none !important;
}

html[data-auth-role="creator"] [data-operator-only] {
  display: none !important;
}

html[data-auth-role="creator"] .account-cycle-card {
  grid-template-columns: minmax(280px, 1.2fr) minmax(220px, 0.9fr);
}

@media (max-width: 720px) {
  html[data-auth-role="creator"] .account-cycle-card {
    grid-template-columns: 1fr;
  }
}

/* 拍摄辅助线是查看工具，运营端和商家端都应始终可用。 */
html[data-auth-role="creator"] #referenceToggleGridBtn[data-role-shared] {
  display: inline-flex !important;
}

/* 优秀素材参考沿用素材库的控件、分组与卡片语言，但保持为独立只读灵感域。 */
.reference-library-modal {
  padding: 22px;
  z-index: 50;
}

body.reference-library-open .asset-toolbar {
  z-index: 1;
}

.reference-library-dialog {
  width: min(1480px, 96vw);
  height: min(900px, 94vh);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--canvas);
  box-shadow: var(--shadow-strong);
}

.reference-library-head,
.reference-library-toolbar,
.reference-browser-head,
.reference-preview-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.reference-library-head {
  min-height: 50px;
  padding: 8px 16px 8px 22px;
  border-bottom: 1px solid var(--line);
}

.reference-library-titlebar {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.reference-library-head h2 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.reference-library-head .section-kicker {
  flex: 0 0 auto;
  margin: 0;
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.reference-library-head p,
.reference-preview-dialog p {
  margin: 0;
  color: var(--ink-muted);
}

.reference-library-head p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.reference-library-toolbar {
  justify-content: flex-start;
  min-height: 62px;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.reference-library-toolbar > button,
.reference-library-toolbar .asset-upload-trigger {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-raised);
  box-shadow: none;
}

.reference-library-toolbar .reference-search {
  width: min(360px, 30vw);
  margin-left: auto;
}

.reference-library-toolbar #referenceBatchDeleteBtn:not(:disabled) {
  color: var(--accent-deep);
}

.reference-library-readonly {
  color: var(--ink-muted);
  font-size: 13px;
  white-space: nowrap;
}

.reference-library-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

.reference-group-tree {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  z-index: auto !important;
  opacity: 1;
  pointer-events: auto;
  width: auto;
  min-width: 0;
  height: 100%;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.reference-group-tree .asset-group-tree-body {
  height: 100%;
}

.reference-group {
  position: relative;
  display: grid;
  gap: 2px;
}

.reference-group::before {
  content: "";
  position: absolute;
  z-index: 4;
  right: 8px;
  left: 8px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: scaleX(.78);
  transition: opacity 100ms ease, transform 100ms ease;
}

.reference-group.is-drop-before::before {
  top: -4px;
  opacity: 1;
  transform: scaleX(1);
}

.reference-group.is-drop-after::before {
  bottom: -4px;
  opacity: 1;
  transform: scaleX(1);
}

.reference-group.is-drop-before::after,
.reference-group.is-drop-after::after {
  content: "";
  position: absolute;
  z-index: 5;
  left: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  pointer-events: none;
}

.reference-group.is-drop-before::after {
  top: -7px;
}

.reference-group.is-drop-after::after {
  bottom: -7px;
}

.reference-subgroup-list {
  display: grid;
  gap: 2px;
}

.reference-group-row {
  display: grid;
  grid-template-columns: 22px 22px minmax(110px, 1fr) auto 28px 28px;
  align-items: center;
  gap: 2px;
  margin: 3px 8px;
  padding: 4px;
  border-radius: 9px;
  transition: opacity 120ms ease, transform 120ms ease, background 160ms ease;
}

.reference-group.is-dragging > .reference-group-row {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  opacity: .42;
  transform: scale(.985);
}

.reference-group.is-move-confirmed > .reference-group-row {
  animation: reference-group-move-confirmed 700ms ease-out;
}

@keyframes reference-group-move-confirmed {
  0% { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); }
  100% { background: color-mix(in srgb, var(--accent) 0%, var(--surface)); }
}

.reference-group-toggle,
.reference-group-toggle-placeholder {
  width: 22px;
  height: 28px;
}

.reference-group-toggle {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-muted);
  padding: 0;
  cursor: pointer;
}

.reference-group-toggle:hover,
.reference-group-toggle:focus-visible {
  background: var(--surface-raised);
  color: var(--ink);
}

.reference-group-toggle > span {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
  transform: rotate(90deg);
  transition: transform 140ms ease;
}

.reference-group.is-collapsed .reference-group-toggle > span {
  transform: rotate(0deg);
}

.reference-subgroup-row {
  margin-left: 22px;
}

.reference-subgroup-branch {
  position: relative;
  align-self: stretch;
}

.reference-subgroup-branch::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8px;
  width: 10px;
  height: 50%;
  border-left: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0 0 0 6px;
}

.reference-group-row.is-active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.reference-group-row .reference-group-name {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 7px 4px;
  text-align: left;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.reference-group-row > em {
  color: var(--ink-muted);
  font-size: 12px;
  font-style: normal;
}

.reference-group-tree .reference-group-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

.reference-group-actions button {
  width: 100%;
  min-height: 40px;
  border-color: var(--line);
  background: var(--surface-raised);
  box-shadow: none;
}

.v2-action-dialog {
  z-index: 110;
  background: rgba(10, 8, 8, 0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.v2-action-dialog-card {
  position: relative;
  width: min(500px, calc(100vw - 32px));
  overflow: hidden;
  padding: 20px;
  border: 0;
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.34);
  animation: v2-action-dialog-in 160ms ease-out both;
}

.v2-action-dialog-card::before {
  content: none;
}

.v2-action-dialog-head,
.v2-action-dialog-heading,
.v2-action-dialog-actions {
  display: flex;
  align-items: center;
}

.v2-action-dialog-head {
  justify-content: space-between;
  gap: 16px;
}

.v2-action-dialog-heading {
  min-width: 0;
  align-items: flex-start;
  gap: 12px;
}

.v2-action-dialog-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
  color: var(--accent);
}

.v2-action-dialog-mark .ui-icon {
  width: 17px;
  height: 17px;
}

.v2-action-dialog-alert {
  font-size: 19px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.v2-action-dialog-heading h3 {
  margin: 3px 0 0;
  color: var(--ink-strong);
  font-size: 19px;
  line-height: 1.3;
}

.v2-action-dialog-message {
  margin: 18px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
}

.v2-action-dialog-field {
  margin-top: 16px;
  gap: 5px;
  border-radius: 14px;
  background: var(--surface);
  padding: 12px 14px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.v2-action-dialog-field:focus-within {
  background: color-mix(in srgb, var(--surface) 82%, var(--accent-soft));
  box-shadow: inset 4px 0 0 var(--accent);
}

.v2-action-dialog-field input {
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.v2-action-dialog-field input:focus,
.v2-action-dialog-field input:focus-visible {
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.v2-action-dialog-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 0;
  border: 0;
}

.v2-action-dialog-actions button {
  min-width: 108px;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
}

.v2-action-dialog-actions .secondary {
  background: var(--surface);
}

.v2-action-dialog[data-tone="danger"] .v2-action-dialog-mark {
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
}

.v2-action-dialog[data-tone="warning"] .v2-action-dialog-mark {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--accent-deep);
}

.v2-action-dialog[data-tone="warning"] .v2-action-dialog-message {
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--accent-wash) 58%, var(--surface));
  padding: 12px 14px;
  color: var(--ink);
}

.v2-action-dialog[data-tone="warning"] .v2-action-dialog-actions .primary {
  background: var(--accent);
  color: #fff;
}

.v2-action-dialog-head > .icon-button {
  border: 0;
  background: var(--surface);
  box-shadow: none;
}

@keyframes v2-action-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .v2-action-dialog-card,
  .reference-group.is-move-confirmed > .reference-group-row { animation: none; }
  .reference-group-row,
  .reference-group::before { transition: none; }
}

.reference-browser-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 18px 20px 20px;
}

.reference-browser-head {
  align-items: flex-end;
  padding: 0 2px 14px;
}

.reference-browser-head > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.reference-browser-head > span,
.reference-browser-head > div span {
  color: var(--ink-muted);
  font-size: 12px;
}

.reference-item-list {
  align-content: start;
  padding: 2px;
  outline: none;
}

.reference-item-card {
  grid-template-rows: auto auto;
}

.reference-item-card .reference-select-check {
  opacity: 0 !important;
  pointer-events: none;
}

.reference-library-modal.is-reference-selection-mode .reference-item-card .reference-select-check,
.reference-item-card.is-selected .reference-select-check {
  opacity: 1 !important;
  pointer-events: auto;
  transform: translateY(0);
}

.reference-item-card .asset-preview-thumb {
  cursor: zoom-in;
}

.reference-item-card img,
.reference-preview-stage img {
  -webkit-user-drag: none;
  user-select: none;
}

.reference-card-meta {
  display: flex;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 11px;
}

.reference-grid-enabled .reference-item-card .asset-preview-thumb::after,
.reference-grid-enabled .reference-preview-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(33.333% - 1px), rgba(255,255,255,.86) calc(33.333% - 1px), rgba(255,255,255,.86) calc(33.333% + 1px), transparent calc(33.333% + 1px)),
    linear-gradient(to right, transparent calc(66.666% - 1px), rgba(255,255,255,.86) calc(66.666% - 1px), rgba(255,255,255,.86) calc(66.666% + 1px), transparent calc(66.666% + 1px)),
    linear-gradient(to bottom, transparent calc(33.333% - 1px), rgba(255,255,255,.86) calc(33.333% - 1px), rgba(255,255,255,.86) calc(33.333% + 1px), transparent calc(33.333% + 1px)),
    linear-gradient(to bottom, transparent calc(66.666% - 1px), rgba(255,255,255,.86) calc(66.666% - 1px), rgba(255,255,255,.86) calc(66.666% + 1px), transparent calc(66.666% + 1px));
}

.reference-preview-dialog {
  width: min(1000px, 92vw);
  max-height: 92vh;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-strong);
}

.reference-preview-modal,
#referenceMoveModal {
  z-index: 80;
}

.reference-preview-dialog > header {
  padding: 0 0 12px;
}

.reference-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
  max-height: 76vh;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
}

.reference-preview-stage img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
}

.reference-preview-dialog > p {
  padding-top: 10px;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 760px) {
  .reference-library-modal { padding: 0; }
  .reference-library-dialog { width: 100vw; height: 100vh; border-radius: 0; }
  .reference-library-head .section-kicker,
  .reference-library-head p,
  .reference-browser-head > span { display: none; }
  .reference-library-toolbar { flex-wrap: wrap; }
  .reference-library-toolbar .reference-search { width: 100%; margin-left: 0; order: 10; }
  .reference-library-workspace { grid-template-columns: 1fr; grid-template-rows: 156px minmax(0, 1fr); }
  .reference-group-tree { border-right: 0; border-bottom: 1px solid var(--line); overflow: auto; }
  .reference-item-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

html[data-auth-role="creator"] #settingsView,
html[data-auth-role="creator"] #settingsCaseLibraryView,
html[data-auth-role="creator"] #settingsSpeechPromptsView,
html[data-auth-role="creator"] #poolView,
html[data-auth-role="creator"] #recipeView {
  display: none !important;
}

html[data-auth-role="creator"] .account-terminal-badge {
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--accent-deep);
}

html[data-auth-role="creator"] #radarView {
  overflow: hidden;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--canvas) 92%, #fff), var(--canvas));
}

html[data-auth-role="creator"] .radar-workspace {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  overflow: auto;
  scrollbar-width: none;
  padding: clamp(14px, 2vw, 28px);
  background:
    radial-gradient(circle at 84% 14%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 28%),
    transparent;
}

html[data-auth-role="creator"] .radar-workspace::-webkit-scrollbar {
  display: none;
}

html[data-auth-role="creator"] body[data-current-view="radar"] .radar-command-panel {
  width: min(1320px, 100%);
  height: auto;
  min-height: 0;
  max-height: none;
  margin: auto;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: clamp(8px, 1.4vw, 18px);
  overflow: visible;
}

html[data-auth-role="creator"] .radar-form {
  display: block;
  height: auto;
  min-height: 0;
}

html[data-auth-role="creator"] body[data-current-view="radar"] .radar-wordcloud-panel {
  --creator-radar-board-size: clamp(520px, 76dvh, 720px);
  height: auto;
  min-height: 0;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.65fr);
  grid-template-rows: auto auto;
  align-items: stretch;
  gap: 12px 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

html[data-auth-role="creator"] .radar-wordcloud-head {
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 56px;
  align-items: flex-start;
  padding: 0 4px;
}

html[data-auth-role="creator"] .radar-wordcloud-head > div {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: baseline;
  justify-content: start;
  gap: 7px 5px;
}

html[data-auth-role="creator"] .creator-radar-section-name {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--accent-deep);
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
}

.creator-radar-section-name i {
  color: var(--muted);
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

html[data-auth-role="creator"] .radar-wordcloud-head strong {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  line-height: 1.25;
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
}

html[data-auth-role="creator"] .radar-wordcloud-head strong > .creator-help-icon {
  margin-left: 5px;
  vertical-align: middle;
  transform: none;
}

html[data-auth-role="creator"] .radar-wordcloud-head strong > .creator-help-icon:hover,
html[data-auth-role="creator"] .radar-wordcloud-head strong > .creator-help-icon:focus-visible {
  transform: none;
}

html[data-auth-role="creator"] .radar-wordcloud-head #radarWordCloudMeta {
  grid-column: 1 / -1;
  grid-row: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
}

html[data-auth-role="creator"] .radar-wordcloud-head #radarWordCloudMeta > span,
html[data-auth-role="creator"] .radar-wordcloud-head #radarWordCloudMeta > time {
  display: inline;
  color: inherit;
  white-space: nowrap;
}

html[data-auth-role="creator"] .radar-wordcloud-head #radarWordCloudMeta > i {
  color: color-mix(in srgb, var(--muted) 62%, transparent);
  font-style: normal;
}

html[data-auth-role="creator"] body[data-current-view="radar"] .radar-wordcloud-viewport {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 28px;
  gap: 8px;
  height: var(--creator-radar-board-size);
  min-height: 0;
}

html[data-auth-role="creator"] body[data-current-view="radar"] .radar-wordcloud-body {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  width: min(100%, calc(var(--creator-radar-board-size) - 44px));
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  border: 0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 22% 20%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 30%),
    color-mix(in srgb, var(--surface-raised) 86%, var(--accent) 3%);
  padding: 14px;
  box-shadow: none;
  overflow: hidden;
}

html[data-auth-role="creator"] .radar-wordcloud-actions {
  display: none;
}

html[data-auth-role="creator"] .radar-wordcloud-body .radar-wordcloud-cloud.is-modal {
  width: 100%;
  height: 100%;
}

html[data-auth-role="creator"] .creator-radar-scale-control {
  grid-column: 1;
  grid-row: 2;
  justify-self: center;
  width: min(100%, calc(var(--creator-radar-board-size) - 44px));
  height: 28px;
  min-height: 28px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-raised) 78%, var(--accent) 4%);
  padding: 0 6px;
}

.creator-radar-scale-control button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-strong);
  padding: 0;
  font-size: 17px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
}

.creator-radar-scale-control button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-deep);
}

.creator-radar-scale-control button:disabled {
  opacity: 0.35;
}

.creator-radar-scale-control input {
  width: 100%;
  height: 14px;
  min-height: 0;
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  cursor: ew-resize;
  appearance: none;
  -webkit-appearance: none;
}

.creator-radar-scale-control input::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0 var(--scale-fill), color-mix(in srgb, var(--muted) 18%, transparent) var(--scale-fill) 100%);
}

.creator-radar-scale-control input::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
}

.creator-radar-scale-control input::-moz-range-progress {
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.creator-radar-scale-control input::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
  margin-top: -3.5px;
  appearance: none;
  -webkit-appearance: none;
}

.creator-radar-scale-control input::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.creator-radar-scale-control input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 4px;
}

.creator-radar-scale-control output {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

html[data-auth-role="creator"] .creator-radar-keyword-panel {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: var(--creator-radar-board-size);
  max-height: 720px;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-raised) 86%, var(--accent) 3%);
}

.creator-radar-keyword-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  border: 0;
  padding: 0 18px;
}

.creator-radar-keyword-head strong {
  color: var(--ink-strong);
  font-size: 15px;
}

.creator-radar-keyword-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.creator-radar-keyword-columns,
.creator-radar-keyword-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
}

.creator-radar-keyword-columns {
  min-height: 36px;
  border: 0;
  background: color-mix(in srgb, var(--surface) 46%, transparent);
  color: var(--muted);
  padding: 0 16px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.08em;
}

.creator-radar-keyword-columns span:last-child {
  text-align: right;
}

.creator-radar-keyword-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 10px 12px;
  scrollbar-gutter: stable;
}

.creator-radar-keyword-row {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  padding: 0 7px;
  font-size: 12px;
}

.creator-radar-keyword-row:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.creator-radar-keyword-row:first-child,
.creator-radar-keyword-row:nth-child(2),
.creator-radar-keyword-row:nth-child(3) {
  color: var(--accent-deep);
}

.creator-radar-keyword-row > span {
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-semibold);
}

.creator-radar-keyword-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-radar-keyword-row em {
  justify-self: end;
  color: var(--accent-deep);
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-weight-semibold);
}

html[data-auth-role="creator"] #assetEditorAnnotation[readonly] {
  cursor: default;
  resize: none;
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  background: color-mix(in srgb, var(--canvas) 70%, var(--surface));
  color: var(--ink);
  box-shadow: none;
}

html[data-auth-role="creator"] #assetEditorAnnotation[readonly]:focus {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  outline: 3px solid color-mix(in srgb, var(--accent) 8%, transparent);
}

html[data-auth-role="creator"] .asset-annotation-readonly-note {
  display: block;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  html[data-auth-role="creator"] .radar-workspace {
    padding: 14px;
  }

  html[data-auth-role="creator"] .radar-command-panel {
    height: auto;
    min-height: calc(100dvh - 28px);
    max-height: none;
    gap: 16px;
    border-radius: 18px;
    padding: 20px 16px;
    overflow: visible;
  }

  html[data-auth-role="creator"] body[data-current-view="radar"] .radar-wordcloud-panel {
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    padding: 0;
  }

  html[data-auth-role="creator"] body[data-current-view="radar"] .radar-wordcloud-viewport {
    grid-column: 1;
    grid-row: 2;
    height: auto;
    grid-template-rows: auto 28px;
  }

  html[data-auth-role="creator"] body[data-current-view="radar"] .radar-wordcloud-body {
    width: 100%;
    height: auto;
    min-height: 0;
  }

  html[data-auth-role="creator"] .creator-radar-scale-control {
    width: 100%;
  }

  html[data-auth-role="creator"] .radar-wordcloud-head #radarWordCloudMeta {
    flex-wrap: wrap;
  }

  html[data-auth-role="creator"] .creator-radar-keyword-panel {
    grid-column: 1;
    grid-row: 3;
    height: min(66dvh, 520px);
    min-height: 420px;
  }
}

/* Workspace identity: keep the active creator/operator center visible in the sidebar. */
@media (min-width: 761px) {
  .sidebar-brand {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .sidebar-brand-copy {
    min-height: 34px;
  }
}

.sidebar-center-label {
  width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent-deep);
  padding: 0 10px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  line-height: 1;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.sidebar-center-label::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 10%, transparent);
  content: "";
}

body[data-appearance="deep-dark"] .sidebar-center-label {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

body[data-appearance="deep-dark"] button.operator-notification-bell,
body[data-appearance="deep-dark"] button.operator-notification-bell:hover,
body[data-appearance="deep-dark"] button.operator-notification-bell:focus-visible,
body[data-appearance="deep-dark"] button.operator-notification-bell[aria-expanded="true"] {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-raised) 82%, transparent);
  color: var(--ink);
}

body[data-appearance="deep-dark"] .operator-notification-panel,
body[data-appearance="deep-dark"] .operator-notification-peek {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-raised) 96%, #000 4%);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.46);
}

body.sidebar-collapsed .sidebar-center-label {
  display: none;
}

@media (max-width: 760px) {
  .sidebar-center-label {
    display: none;
  }

  .sidebar-brand-row {
    width: auto;
  }

  .operator-notification-panel,
  .operator-notification-peek,
  body.sidebar-collapsed .operator-notification-panel,
  body.sidebar-collapsed .operator-notification-peek {
    top: 68px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .operator-notification-bell.is-running::after,
  .operator-notification-item.is-running .operator-notification-item-icon::before,
  .operator-notification-peek.is-running .operator-notification-item-icon::before,
  .operator-notification-peek,
  .asset-ai-progress-panel.is-single .asset-ai-progress-bar span {
    animation: none;
  }

  .asset-ai-progress-panel.is-running .asset-ai-progress-indicator::after {
    animation: none;
  }
}

/* Role-aware dashboard: a read-only action layer over existing workspace flows. */
body[data-current-view="dashboard"] .workflow-context,
body[data-current-view="dashboard"] .shell > .global-notice {
  display: none;
}

body[data-current-view="dashboard"] #dashboardView {
  margin-top: 0;
}

.dashboard-page {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 10px 0 20px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 4px 22px;
}

.dashboard-panel-head span,
.dashboard-card-head span,
.dashboard-next-label {
  display: block;
  margin: 0 0 7px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-heading h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(27px, 3vw, 40px);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.dashboard-role-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 14px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}

.dashboard-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 16px;
}

.dashboard-primary-card,
.dashboard-stats-card,
.dashboard-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.dashboard-primary-card {
  position: relative;
  min-height: 244px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  overflow: hidden;
  border-radius: 18px;
  padding: 34px 34px 30px 42px;
}

.dashboard-primary-card::before {
  position: absolute;
  top: 30px;
  bottom: 30px;
  left: 20px;
  width: 4px;
  border-radius: 99px;
  background: var(--accent);
  content: "";
}

.dashboard-primary-card::after {
  position: absolute;
  top: 25px;
  left: 15px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  content: "";
}

.dashboard-primary-card[data-tone="waiting"]::before,
.dashboard-primary-card[data-tone="waiting"]::after {
  background: var(--amber);
  box-shadow: 0 0 0 1px var(--amber);
}

.dashboard-primary-card[data-tone="complete"]::before,
.dashboard-primary-card[data-tone="complete"]::after {
  background: var(--sage);
  box-shadow: 0 0 0 1px var(--sage);
}

.dashboard-primary-copy {
  min-width: 0;
}

.dashboard-primary-copy em {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 0 10px;
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.dashboard-primary-copy h2 {
  max-width: 720px;
  margin: 18px 0 10px;
  color: var(--ink-strong);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.dashboard-primary-copy p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.dashboard-primary-action {
  min-width: 132px;
  min-height: 42px;
  white-space: nowrap;
}

.dashboard-stats-card {
  min-height: 244px;
  border-radius: 18px;
  padding: 24px;
}

.dashboard-card-head,
.dashboard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-card-head strong,
.dashboard-panel-head h2 {
  display: block;
  margin: 0;
  color: var(--ink-strong);
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
}

.dashboard-card-head em,
.dashboard-panel-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.dashboard-progress-track {
  height: 7px;
  overflow: hidden;
  margin-top: 20px;
  border-radius: 99px;
  background: var(--accent-soft);
}

.dashboard-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 240ms ease;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.dashboard-stat {
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.dashboard-stat strong {
  color: var(--ink-strong);
  font-size: 22px;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.04em;
}

.dashboard-stat span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
}

.dashboard-panel-grid.is-single {
  grid-template-columns: 1fr;
}

/* Unified dashboard skeleton. Creator-specific presentation is layered in creator-home-redesign.css. */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  grid-template-rows: auto auto auto;
  gap: 16px;
  align-items: start;
}

.dashboard-main-column,
.dashboard-right-column,
.dashboard-hero-section {
  display: contents;
}

.dashboard-grid .dashboard-heading {
  grid-column: 1 / -1;
  grid-row: 1;
}

.dashboard-grid .dashboard-primary-card {
  grid-column: 1;
  grid-row: 2;
}

.dashboard-grid .dashboard-stats-card {
  grid-column: 2;
  grid-row: 2;
}

.dashboard-grid .dashboard-reminders-panel {
  grid-column: 1;
  grid-row: 3;
}

.dashboard-grid .dashboard-quick-panel {
  grid-column: 2;
  grid-row: 3;
}

.dashboard-panel {
  min-width: 0;
  border-radius: 16px;
  padding: 24px;
}

.dashboard-task-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.dashboard-view[data-dashboard-role="operator"] .dashboard-task-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-task {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-raised);
  padding: 13px 14px;
}

.dashboard-task-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
}

.dashboard-task.is-done .dashboard-task-index {
  background: color-mix(in srgb, var(--sage) 18%, var(--surface));
  color: var(--sage);
}

.dashboard-task.is-waiting .dashboard-task-index {
  background: color-mix(in srgb, var(--amber) 15%, var(--surface));
  color: var(--amber);
}

.dashboard-task-copy {
  min-width: 0;
}

.dashboard-task-copy strong,
.dashboard-task-copy span {
  display: block;
}

.dashboard-task-copy strong {
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-task-copy span {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-task-action {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  padding: 0 4px;
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
  white-space: nowrap;
}

.dashboard-task-action:hover,
.dashboard-task-action:focus-visible {
  border: 0;
  background: var(--accent-soft);
  color: var(--accent-deep);
  box-shadow: none;
}

.dashboard-task-status {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.dashboard-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.dashboard-quick-action {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-raised);
  color: var(--ink);
  padding: 0 13px;
  text-align: left;
  box-shadow: none;
}

.dashboard-quick-action::after {
  color: var(--accent-deep);
  content: "›";
  font-size: 20px;
  line-height: 1;
}

.dashboard-quick-action:hover,
.dashboard-quick-action:focus-visible {
  border-color: var(--line-strong);
  background: var(--accent-wash);
  color: var(--ink-strong);
  box-shadow: none;
}

.dashboard-empty-tasks {
  min-height: 94px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

@media (max-width: 1040px) {
  .dashboard-focus-grid,
  .dashboard-panel-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-view[data-dashboard-role="operator"] .dashboard-task-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .dashboard-page {
    padding-top: 0;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 10px 2px 18px;
  }

  .dashboard-primary-card {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 28px 22px 22px 34px;
  }

  .dashboard-primary-card::before {
    left: 14px;
  }

  .dashboard-primary-card::after {
    left: 9px;
  }

  .dashboard-primary-action {
    width: 100%;
  }

  .dashboard-stats-card,
  .dashboard-panel {
    padding: 18px;
  }

  .dashboard-view[data-dashboard-role="operator"] .dashboard-task-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-progress-track > span {
    transition: none;
  }
}

/* Settings composition: core controls followed by the operator tool grid. */
body[data-current-view="settings"] .settings-main-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

body[data-current-view="settings"] .settings-left-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
}

body[data-current-view="settings"] .settings-left-panel > .settings-grid {
  height: 100%;
  min-height: 142px;
}

body[data-current-view="settings"] .settings-grid {
  align-content: center;
  padding: 18px;
}

body[data-current-view="settings"] .settings-side-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

body[data-current-view="settings"] .settings-tools-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 0;
}

body[data-current-view="settings"] .settings-tools-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

body[data-current-view="settings"] .settings-side-panel > .usage-box {
  grid-column: span 1;
  min-height: 126px;
  align-items: flex-start;
}

body[data-current-view="settings"] .settings-side-panel > .usage-box {
  padding: 18px;
}

@media (max-width: 1180px) {
  body[data-current-view="settings"] .settings-left-panel {
    grid-template-columns: 1fr;
  }

  body[data-current-view="settings"] .settings-side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-current-view="settings"] .settings-side-panel > .usage-box {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  body[data-current-view="settings"] .settings-side-panel {
    grid-template-columns: 1fr;
  }

  body[data-current-view="settings"] .settings-tools-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* --------------------------------------------------------------------------
   Shared onboarding — merchant overview and operator radar workflow.
   -------------------------------------------------------------------------- */

.creator-onboarding-replay {
  display: none;
}

html[data-auth-role="creator"] .creator-onboarding-replay {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--nav-muted);
  padding: 0 12px;
  text-align: left;
}

html[data-auth-role="creator"] .creator-onboarding-replay:hover,
html[data-auth-role="creator"] .creator-onboarding-replay:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 18%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, var(--nav));
  color: var(--accent-deep);
}

.creator-onboarding-replay-icon,
.creator-help-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: ui-rounded, "SF Pro Rounded", var(--font-sans);
  font-style: normal;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

.creator-onboarding-replay-icon {
  width: 20px;
  height: 20px;
  font-size: 12px;
}

body.sidebar-collapsed .creator-onboarding-replay {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .creator-onboarding-replay-label {
  display: none;
}

.creator-help-icon {
  display: none;
}

html[data-auth-role="creator"] .creator-help-icon {
  position: relative;
  width: 17px;
  height: 17px;
  display: inline-grid;
  margin-left: 6px;
  color: color-mix(in srgb, var(--muted) 82%, var(--accent));
  font-size: 10px;
  vertical-align: 0.08em;
  cursor: help;
  user-select: none;
  outline: none;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

html[data-auth-role="creator"] .creator-help-icon:hover,
html[data-auth-role="creator"] .creator-help-icon:focus-visible {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

html[data-auth-role="creator"] .creator-help-contained {
  position: relative;
}

html[data-auth-role="creator"] .creator-help-icon.is-contained {
  width: 14px;
  height: 14px;
  margin: 0 0 0 4px;
  border-color: currentColor;
  background: transparent;
  color: currentColor;
  font-size: 8px;
  opacity: 0.72;
  vertical-align: middle;
  transform: none;
}

html[data-auth-role="creator"] .creator-help-icon.is-contained:hover,
html[data-auth-role="creator"] .creator-help-icon.is-contained:focus-visible {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 13%, transparent);
  color: currentColor;
  opacity: 1;
  transform: none;
}

html[data-auth-role="creator"] .creation-mode-tab > .creator-help-icon.is-contained {
  margin-left: 1px;
}

html[data-auth-role="creator"] .creation-mode-tab.is-active > .creator-help-icon.is-contained {
  background: rgba(255, 255, 255, 0.1);
  opacity: 0.88;
}

html[data-auth-role="creator"] .creator-help-inline-host {
  display: flex;
  align-items: center;
  gap: 2px;
}

.creator-help-popover {
  position: fixed;
  z-index: 360;
  width: min(310px, calc(100vw - 24px));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  background: rgba(35, 29, 31, 0.96);
  color: #fff;
  padding: 11px 13px;
  box-shadow: 0 16px 36px rgba(20, 10, 14, 0.28);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.65;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 110ms ease, transform 110ms ease;
}

.creator-help-popover.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.creator-onboarding-tour {
  position: fixed;
  inset: 0;
  z-index: 400;
}

/* Operator steps are completed on the highlighted controls themselves. The
   four masks keep the rest of the page inert while the spotlight hole remains
   clickable for mouse and keyboard users. */
.creator-onboarding-tour.is-operator {
  pointer-events: none;
}

.creator-onboarding-tour.is-operator .creator-tour-mask,
.creator-onboarding-tour.is-operator .creator-tour-card {
  pointer-events: auto;
}

.creator-onboarding-tour.is-operator .creator-tour-focus {
  pointer-events: none;
}

body.creator-tour-open .sidebar {
  position: relative;
  z-index: 403;
  isolation: isolate;
  pointer-events: none;
  box-shadow: 14px 0 34px rgba(30, 14, 19, 0.16);
}

body.creator-tour-open .sidebar::after {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1;
  width: var(--side-w);
  background: rgba(31, 19, 24, 0.64);
  content: "";
  pointer-events: none;
  transition: width 180ms ease;
}

body.sidebar-collapsed.creator-tour-open .sidebar::after {
  width: var(--side-collapsed-w);
}

body.creator-tour-open .sidebar-item.creator-tour-nav-target {
  position: relative;
  z-index: 2;
  border-color: transparent;
  outline: 0;
  box-shadow: none;
}

body.creator-tour-open .creator-tour-content-target {
  border-color: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.creator-tour-mask,
.creator-tour-focus,
.creator-tour-card {
  position: fixed;
}

.creator-tour-mask {
  z-index: 400;
  background: transparent;
}

.creator-tour-focus {
  z-index: 401;
  border: 2px solid color-mix(in srgb, var(--accent) 88%, #fff);
  border-radius: 16px;
  background: transparent;
  box-shadow:
    0 0 0 100vmax rgba(31, 19, 24, 0.64),
    0 18px 46px rgba(70, 18, 31, 0.22);
  clip-path: inset(-100vmax);
  pointer-events: auto;
  transition: inset 180ms ease, width 180ms ease, height 180ms ease;
}

.creator-tour-card {
  right: 24px;
  bottom: 24px;
  z-index: 402;
  width: min(430px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 15%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--ink);
  padding: 20px 22px 15px;
  box-shadow: 0 26px 72px rgba(35, 13, 22, 0.3);
  backdrop-filter: blur(18px) saturate(118%);
  -webkit-backdrop-filter: blur(18px) saturate(118%);
  font-family: var(--font-sans);
  transition: top 180ms ease, left 180ms ease;
  animation: creator-tour-card-in 180ms ease-out both;
}

.creator-tour-card[data-protected-layout] {
  width: min(286px, calc(100vw - 48px));
}

.creator-tour-card[data-protected-layout] h2 {
  font-size: 18px;
}

.creator-tour-card.is-top {
  top: 24px;
  bottom: auto;
}

.creator-tour-progress-track {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  overflow: hidden;
  background: color-mix(in srgb, var(--accent) 11%, var(--surface));
}

.creator-tour-progress-track span {
  display: block;
  width: 14.285%;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--blush));
  transition: width 180ms ease;
}

.creator-tour-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.055em;
}

.creator-tour-meta em {
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-style: normal;
  font-weight: var(--font-weight-regular);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.creator-tour-card h2 {
  margin: 11px 0 0;
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.018em;
  line-height: 1.35;
}

.creator-tour-card p {
  margin: 7px 0 0;
  color: color-mix(in srgb, var(--muted) 84%, transparent);
  font-size: 12px;
  font-weight: var(--font-weight-regular);
  line-height: 1.65;
}

.creator-tour-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 16px;
}

body button.creator-tour-prev,
body button.creator-tour-next {
  min-height: 44px;
  margin: 0;
  border-radius: 11px;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

body button.creator-tour-prev {
  flex: 0 0 92px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  background: color-mix(in srgb, var(--surface-raised) 82%, transparent);
  color: var(--accent-deep);
  box-shadow: none;
}

body button.creator-tour-prev[hidden] {
  display: none;
}

body button.creator-tour-prev:hover,
body button.creator-tour-prev:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-raised));
  color: var(--accent-deep);
}

body button.creator-tour-next {
  min-width: 0;
  flex: 1 1 auto;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 22%, transparent);
}

body button.creator-tour-next:hover,
body button.creator-tour-next:focus-visible {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: #fff;
}

body button.creator-tour-next:disabled,
body button.creator-tour-next:disabled:hover {
  border-color: color-mix(in srgb, var(--muted) 18%, var(--line));
  background: color-mix(in srgb, var(--muted) 10%, var(--surface-raised));
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  box-shadow: none;
  cursor: default;
}

body button.creator-tour-skip {
  width: 100%;
  min-height: 28px;
  margin-top: 7px;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  padding: 0;
  box-shadow: none;
  font-size: 11px;
  font-weight: var(--font-weight-regular);
}

body button.creator-tour-skip:hover,
body button.creator-tour-skip:focus-visible {
  border: 0;
  background: transparent;
  color: var(--accent-deep);
}

/* Light mode uses a quiet grayscale stage. Muted rose is reserved for the
   single focus frame, progress and primary action. */
body:not([data-appearance="deep-dark"]).creator-tour-open .sidebar {
  border-right: 1px solid rgba(42, 43, 45, 0.08);
  background: linear-gradient(180deg, #f5f5f4 0%, #ececeb 100%);
  box-shadow: 14px 0 34px rgba(28, 29, 31, 0.13);
}

body:not([data-appearance="deep-dark"]).creator-tour-open .sidebar::after {
  background: rgba(41, 42, 44, 0.58);
}

body:not([data-appearance="deep-dark"]).creator-tour-open .sidebar-brand,
body:not([data-appearance="deep-dark"]).creator-tour-open .sidebar-control,
body:not([data-appearance="deep-dark"]).creator-tour-open .sidebar-item:not(.creator-tour-nav-target),
body:not([data-appearance="deep-dark"]).creator-tour-open .creator-onboarding-replay,
body:not([data-appearance="deep-dark"]).creator-tour-open .sidebar-theme-toggle {
  opacity: 0.58;
}

body:not([data-appearance="deep-dark"]).creator-tour-open .sidebar-item.creator-tour-nav-target,
body:not([data-appearance="deep-dark"]).creator-tour-open .sidebar-item.creator-tour-nav-target:hover {
  border-color: transparent;
  outline: 0;
  background: #f2dadd;
  color: #69303d;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]) .creator-tour-mask {
  background: transparent;
}

body:not([data-appearance="deep-dark"]) .creator-tour-focus {
  border-color: rgba(183, 78, 98, 0.76);
  background: rgba(255, 255, 255, 0.025);
  box-shadow:
    0 0 0 100vmax rgba(41, 42, 44, 0.58),
    0 22px 54px rgba(24, 25, 27, 0.22);
}

body:not([data-appearance="deep-dark"]) .creator-tour-card {
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(54, 55, 57, 0.97), rgba(35, 36, 38, 0.96));
  color: #f7f7f6;
  box-shadow: 0 28px 72px rgba(18, 19, 21, 0.34);
  backdrop-filter: blur(20px) saturate(106%);
  -webkit-backdrop-filter: blur(20px) saturate(106%);
}

body:not([data-appearance="deep-dark"]) .creator-tour-progress-track {
  background: rgba(255, 255, 255, 0.08);
}

body:not([data-appearance="deep-dark"]) .creator-tour-progress-track span {
  background: linear-gradient(90deg, #9d5f6d, #b96e7f, #c88995);
}

body:not([data-appearance="deep-dark"]) .creator-tour-meta {
  color: #c98a98;
}

body:not([data-appearance="deep-dark"]) .creator-tour-meta em {
  color: rgba(245, 245, 244, 0.52);
}

body:not([data-appearance="deep-dark"]) .creator-tour-card h2 {
  color: #fafafa;
}

body:not([data-appearance="deep-dark"]) .creator-tour-card p {
  color: rgba(245, 245, 244, 0.68);
}

body:not([data-appearance="deep-dark"]) button.creator-tour-prev {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 245, 244, 0.78);
}

body:not([data-appearance="deep-dark"]) button.creator-tour-prev:hover,
body:not([data-appearance="deep-dark"]) button.creator-tour-prev:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

body:not([data-appearance="deep-dark"]) button.creator-tour-next {
  border-color: transparent;
  background: #c85d75;
  color: #fff;
  box-shadow: 0 10px 24px rgba(18, 19, 21, 0.2);
}

body:not([data-appearance="deep-dark"]) button.creator-tour-next:hover,
body:not([data-appearance="deep-dark"]) button.creator-tour-next:focus-visible {
  border-color: transparent;
  background: #d36d83;
  color: #fff;
}

body:not([data-appearance="deep-dark"]) button.creator-tour-next:disabled,
body:not([data-appearance="deep-dark"]) button.creator-tour-next:disabled:hover {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(245, 245, 244, 0.42);
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]).creator-tour-open .dashboard-primary-card.creator-tour-content-target .dashboard-primary-action {
  border-color: #edc6cf;
  background: #edc6cf;
  color: #5b2b36;
  box-shadow: none;
}

body:not([data-appearance="deep-dark"]).creator-tour-open .dashboard-primary-card.creator-tour-content-target .dashboard-primary-action:hover,
body:not([data-appearance="deep-dark"]).creator-tour-open .dashboard-primary-card.creator-tour-content-target .dashboard-primary-action:focus-visible {
  border-color: #e5b3bf;
  background: #e5b3bf;
  color: #4f2530;
}

body:not([data-appearance="deep-dark"]) button.creator-tour-skip {
  color: rgba(245, 245, 244, 0.46);
}

body:not([data-appearance="deep-dark"]) button.creator-tour-skip:hover,
body:not([data-appearance="deep-dark"]) button.creator-tour-skip:focus-visible {
  color: #f5f5f4;
}

@keyframes creator-tour-card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  .creator-tour-card,
  .creator-tour-card.is-top {
    top: auto;
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    padding: 20px 20px 14px;
    border-radius: 16px;
  }

  .creator-tour-card h2 {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .creator-tour-card {
    animation: none;
    transition: none;
  }

  .creator-tour-focus,
  .creator-tour-progress-track span,
  .creator-help-icon,
  .creator-help-popover {
    transition: none;
  }
}
/* Only the selected tab exposes its count, as plain inline text. */
.calendar-content-tab,
.draft-type-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tab-current-count,
.pool-template-tab .tab-current-count {
  margin: 0;
  color: currentColor;
  font: inherit;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.tab-current-count[hidden] {
  display: none !important;
}

/*
 * Light calendar: a quiet card-and-rail system.
 * The date rail carries the schedule rhythm; content stays on clean white cards
 * instead of being grouped into large rectangular grey bands.
 */
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) {
  --calendar-light-canvas: #f6f6f7;
  --calendar-light-card: #ffffff;
  --calendar-light-card-soft: #fbf9fa;
  --calendar-light-line: #ebe6e8;
  --calendar-light-line-strong: #dfd6da;
  --calendar-light-muted: #88777d;
  --calendar-light-shadow: 0 8px 26px rgba(56, 35, 42, 0.045), 0 1px 2px rgba(56, 35, 42, 0.035);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .shell {
  background: var(--calendar-light-canvas);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView {
  max-width: 1680px;
  margin-inline: auto;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-controlbar,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-controlbar::before {
  background: var(--calendar-light-canvas);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-controlbar {
  margin-bottom: 5px;
  box-shadow: 0 12px 20px color-mix(in srgb, var(--calendar-light-canvas) 94%, transparent);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tabs {
  gap: 26px;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab:focus-visible,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab.is-active,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab.is-active:hover {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab {
  color: #766a6e;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab:focus-visible,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab.is-active {
  color: var(--ink-strong);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-rule-info-btn,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-rule-info-btn:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-rule-info-btn:focus-visible,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-rule-info-btn[aria-expanded="true"] {
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-rule-info-btn:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-rule-info-btn:focus-visible,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-rule-info-btn[aria-expanded="true"] {
  background: #eee9eb;
  color: var(--accent-deep);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .progress-copy {
  gap: 0;
  color: var(--calendar-light-muted);
  font-size: 12.5px;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .progress-copy > span {
  display: inline-flex;
  align-items: center;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .progress-copy > span + span::before {
  width: 1px;
  height: 12px;
  margin: 0 12px;
  background: var(--calendar-light-line-strong);
  content: "";
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .progress-copy strong {
  margin-inline: 2px;
  color: var(--accent-deep);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs {
  min-height: 50px;
  gap: 8px;
  margin: 0 0 12px;
  padding: 5px 0 7px;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab:focus-visible {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #71666a;
  padding-inline: 17px;
  box-shadow: none;
  transform: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab:focus-visible {
  border-color: var(--calendar-light-line);
  background: var(--calendar-light-card);
  color: var(--ink-strong);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 18%, var(--calendar-light-card));
  background: color-mix(in srgb, var(--accent-soft) 74%, var(--calendar-light-card));
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 5%, transparent);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .creation-mode-count {
  background: #ece8e9;
  color: #81747a;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .creation-mode-tab.is-active .creation-mode-count {
  background: color-mix(in srgb, var(--accent) 12%, var(--calendar-light-card));
  color: var(--accent-deep);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-table,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .calendar-table.has-speech-items {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .table-head {
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--calendar-light-line);
  border-radius: 0;
  background: var(--calendar-light-canvas);
  color: #8b8184;
  padding-inline: 18px;
  box-shadow: 0 12px 18px color-mix(in srgb, var(--calendar-light-canvas) 96%, transparent);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .table-head::before {
  right: -1px;
  left: -1px;
  border-radius: 0;
  background: var(--calendar-light-canvas);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status-filter .themed-select-trigger {
  min-height: 34px;
  border: 1px solid var(--calendar-light-line);
  border-radius: 999px;
  background: var(--calendar-light-card);
  color: #74686c;
  padding-inline: 12px 10px;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status-filter .themed-select-trigger:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status-filter .themed-select.is-open .themed-select-trigger {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--calendar-light-line));
  background: var(--calendar-light-card);
  color: var(--ink-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 7%, transparent);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section:nth-child(even),
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section.is-done {
  position: relative;
  margin-top: 12px;
  border: 1px solid var(--calendar-light-line);
  border-radius: 18px;
  background: var(--calendar-light-card);
  padding: 15px 18px;
  box-shadow: var(--calendar-light-shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section + .calendar-date-section {
  margin-top: 12px;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section::before {
  position: absolute;
  top: 19px;
  bottom: 19px;
  left: -1px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: #ded5d8;
  content: "";
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section:nth-child(even):hover {
  border-color: var(--calendar-light-line-strong);
  background: var(--calendar-light-card);
  box-shadow: 0 12px 32px rgba(56, 35, 42, 0.065), 0 2px 4px rgba(56, 35, 42, 0.035);
  transform: translateY(-1px);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section.is-pinned {
  border-color: color-mix(in srgb, var(--accent) 17%, var(--calendar-light-line));
  background: linear-gradient(105deg, color-mix(in srgb, var(--accent-soft) 34%, var(--calendar-light-card)), var(--calendar-light-card) 38%);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section.is-pinned::before {
  background: var(--accent);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section.is-done::before {
  background: #87a58e;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-group-list {
  gap: 0;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-row,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-row:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-topic-row.is-done {
  gap: 0;
  padding: 0;
  background: transparent;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display.is-static {
  min-height: 36px;
  border: 1px solid var(--calendar-light-line);
  border-radius: 999px;
  background: var(--calendar-light-card-soft);
  color: #6f6267;
  padding-inline: 12px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
  box-shadow: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display:hover {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--calendar-light-line));
  color: var(--accent-deep);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display.is-static {
  justify-content: center;
  border-color: color-mix(in srgb, var(--accent) 17%, var(--calendar-light-line));
  background: color-mix(in srgb, var(--accent-soft) 46%, var(--calendar-light-card));
  color: var(--accent-deep);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  color: #9a7f88;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row {
  min-height: 43px;
  padding-block: 4px;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row + .calendar-title-row {
  margin-top: 4px;
  border-top: 1px solid #f0edef;
  padding-top: 8px;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .topic-chip {
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--calendar-light-line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 46%, var(--calendar-light-card));
  color: var(--accent-deep);
  font-weight: var(--font-weight-medium);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .topic-chip.is-pinned {
  border-color: color-mix(in srgb, var(--accent) 14%, var(--calendar-light-line));
  background: var(--calendar-light-card);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .title-link,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .title-link:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .title-link:focus-visible {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-strong);
  padding: 6px 8px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
  transform: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .title-link:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .title-link:focus-visible {
  background: #faf7f8;
  color: var(--accent-deep);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status:focus-visible {
  min-height: 30px;
  justify-content: center;
  justify-self: start;
  border: 0;
  border-radius: 999px;
  background: #f4f1f2;
  color: #766a6e;
  padding-inline: 11px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
  transform: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-create,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-create:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-create:focus-visible {
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--calendar-light-card));
  color: var(--accent-deep);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-draft,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-draft:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-draft:focus-visible {
  background: #f8f2e9;
  color: #82653f;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-final,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-final:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-final:focus-visible,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-published,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-published:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status.is-published:focus-visible {
  background: #edf5ef;
  color: #52745b;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-inline-action,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-inline-action:hover:not(:disabled),
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-inline-action:focus-visible:not(:disabled) {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8f6d77;
  padding-inline: 10px;
  box-shadow: none;
  transform: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-inline-action:hover:not(:disabled),
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-inline-action:focus-visible:not(:disabled) {
  background: color-mix(in srgb, var(--accent-soft) 58%, var(--calendar-light-card));
  color: var(--accent-deep);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-inline-action:disabled {
  background: transparent;
  color: #bdb4b7;
  cursor: not-allowed;
  opacity: 0.58;
}

@media (min-width: 1301px) {
  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .table-head,
  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section {
    grid-template-columns: 104px 24px 164px minmax(300px, 1fr) 132px 124px 112px;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row {
    grid-template-columns: 164px minmax(300px, 1fr) 132px 124px 112px;
  }
}

@media (min-width: 981px) and (max-width: 1300px) {
  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .table-head,
  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section {
    grid-template-columns: 88px 16px 132px minmax(220px, 1fr) 108px;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .table-head .calendar-action-heading {
    display: none;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-group-list {
    grid-column: 3 / -1;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row {
    grid-template-columns: 132px minmax(220px, 1fr) 108px;
    gap: 5px 8px;
    padding-block: 7px;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-topic-cell {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .title-link {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-status {
    grid-column: 3;
    grid-row: 1;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-inline-action:nth-last-child(2) {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-inline-action:last-child {
    grid-column: 3;
    grid-row: 2;
    justify-self: start;
  }
}

@media (max-width: 980px) {
  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs::-webkit-scrollbar {
    display: none;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-table {
    overflow: visible;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section,
  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section:nth-child(even),
  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section.is-done {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row {
    grid-template-columns: 120px minmax(0, 1fr) 104px;
    gap: 6px 8px;
    padding-block: 7px;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-topic-cell {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .title-link {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-status {
    grid-column: 3;
    grid-row: 1;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-inline-action:nth-last-child(2) {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-inline-action:last-child {
    grid-column: 3;
    grid-row: 2;
    justify-self: start;
  }
}

@media (max-width: 680px) {
  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-controlbar {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-bottom: 10px;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .progress-strip {
    overflow-x: auto;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section,
  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section:nth-child(even),
  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section.is-done {
    grid-template-columns: 1fr;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-rail {
    width: max-content;
    min-width: 86px;
    margin-top: 0;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-group-list {
    grid-column: 1;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-topic-cell {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-status {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .title-link {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-inline-action:nth-last-child(2) {
    grid-column: 1;
    grid-row: 3;
  }

  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-inline-action:last-child {
    grid-column: 2;
    grid-row: 3;
  }
}

/* Typographic content tabs use their underline as focus feedback, never a box. */
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab:focus-visible {
  outline: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab:focus-visible::after {
  background: color-mix(in srgb, var(--accent) 42%, transparent);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-content-tab.is-active:focus-visible::after {
  background: var(--accent);
}

/* Speech schedules share the same clean white-card language as graphic schedules. */
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-card,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-card:hover {
  position: relative;
  min-height: 96px;
  border: 1px solid var(--calendar-light-line);
  border-radius: 18px;
  background: var(--calendar-light-card);
  padding: 12px 16px;
  box-shadow: var(--calendar-light-shadow);
  transform: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-card:hover {
  border-color: var(--calendar-light-line-strong);
  box-shadow: 0 12px 32px rgba(56, 35, 42, 0.065), 0 2px 4px rgba(56, 35, 42, 0.035);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-card::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: -1px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: #ded5d8;
  content: "";
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-card.is-creating::before {
  background: var(--accent);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-search {
  border: 1px solid var(--calendar-light-line);
  border-radius: 999px;
  background: var(--calendar-light-card);
  box-shadow: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--calendar-light-line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 7%, transparent);
}

/*
 * Light calendar — borderless inbox alignment.
 * Drafts and finals create hierarchy with a quiet workspace, white list rows,
 * typography and hairline separators. Calendar follows the same rule here:
 * no outlined groups, no floating shadows and no decorative status rails.
 */
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) {
  --calendar-light-canvas: #f5f5f6;
  --calendar-light-card-soft: #f1f1f3;
  --calendar-light-line: #ebe9eb;
  --calendar-light-line-strong: #dedadd;
  --calendar-light-muted: #81767a;
  --calendar-light-shadow: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-controlbar {
  box-shadow: none;
}

/* Secondary creation modes use a pill state so they remain distinct from the primary underlined tabs. */
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs {
  min-height: 46px;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  border-bottom: 0;
  padding: 4px 2px;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab:focus-visible,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active:focus-visible {
  position: relative;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0 17px;
  box-shadow: none;
  transform: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab {
  color: #756b6f;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab:focus-visible {
  background: var(--calendar-light-card);
  color: var(--ink-strong);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active:focus-visible {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab::before,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active::before {
  content: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab::after,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView > .creation-mode-tabs .creation-mode-tab.is-active::after {
  display: none;
  content: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .creation-mode-count,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .creation-mode-tab.is-active .creation-mode-count {
  min-width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  padding: 0;
  opacity: .58;
}

/* Keep single-rewrite surfaces truly borderless after global form/modal compatibility rules. */
#singleRewriteModal .single-rewrite-modal-card {
  border: 0 !important;
}

#singleRewriteModal .single-rewrite-field input,
#singleRewriteModal .single-rewrite-field textarea,
#singleRewriteModal .single-rewrite-field input:focus,
#singleRewriteModal .single-rewrite-field textarea:focus {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* One light divider is enough for the heading; the filter has no outline. */
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .table-head {
  border: 0;
  border-bottom: 1px solid var(--calendar-light-line);
  box-shadow: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status-filter .themed-select-trigger,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status-filter .themed-select-trigger:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status-filter .themed-select.is-open .themed-select-trigger {
  border: 0;
  border-radius: 10px;
  background: #eeeeef;
  box-shadow: none;
}

/* Date groups match draft rows: white surfaces without visible frames. */
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section:nth-child(even),
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section.is-pinned,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section.is-done,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section:nth-child(even):hover {
  border: 0;
  border-radius: 14px;
  background: var(--calendar-light-card);
  box-shadow: none;
  transform: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section + .calendar-date-section {
  margin-top: 9px;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section::before,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section.is-pinned::before,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-section.is-done::before {
  content: none;
}

/* Dates and topic types are labels, not nested pills. */
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display.is-static {
  min-height: 34px;
  justify-content: flex-start;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #766a6f;
  padding-inline: 0;
  box-shadow: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-display.is-static {
  color: var(--accent-deep);
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .topic-chip,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .topic-chip.is-pinned {
  min-height: 28px;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-deep);
  padding: 0;
  text-align: left;
}

/*
 * Every schedule entry shares one visual center line. The topic cell used to
 * opt into start alignment while titles, statuses and actions were centered;
 * the second entry also had asymmetric vertical padding. Together those rules
 * made each column look like it belonged to a different row.
 */
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row .calendar-topic-cell {
  align-self: center;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row + .calendar-title-row {
  padding-block: 4px;
}

@media (min-width: 1301px) {
  body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-date-rail {
    display: flex;
    min-height: 44px;
    align-items: center;
    margin-top: 0;
  }
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-title-row + .calendar-title-row {
  border-top-color: #f0eef0;
}

/* Status still reads at a glance, but the chip is fill-only and never outlined. */
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status:hover,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) .calendar-status:focus-visible {
  border: 0;
  box-shadow: none;
}

/* Speech schedules use the same borderless rows as graphic schedules. */
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-card,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-card:hover {
  border: 0;
  border-radius: 14px;
  background: var(--calendar-light-card);
  box-shadow: none;
  transform: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-card::before,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-card.is-creating::before {
  content: none;
}

body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-search,
body[data-current-view="calendar"]:not([data-appearance="deep-dark"]) #calendarView[data-calendar-content-mode="speech"] .speech-schedule-search:focus-within {
  border: 0;
  border-radius: 10px;
  background: #eeeeef;
  box-shadow: none;
}

/* Graphic editor: reserve one third for controls and two thirds for writing. */
@media (min-width: 981px) {
  body[data-current-view="create"][data-create-mode="graphic"] .create-grid {
    grid-template-columns: minmax(300px, 1fr) minmax(420px, 2fr);
  }
}

/* Graphic creation: give mode selection the upper half and the command the lower half. */
@media (min-width: 981px) and (min-height: 680px) {
  body[data-current-view="create"][data-create-mode="graphic"] .draft-meta {
    height: 100%;
    max-height: 100%;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  body[data-current-view="create"][data-create-mode="graphic"] .draft-meta > * {
    flex: 0 0 auto;
  }

  body[data-current-view="create"][data-create-mode="graphic"] .generation-mode-btn {
    min-height: 104px;
    padding: 18px 20px;
  }

  body[data-current-view="create"][data-create-mode="graphic"] .generation-mode-btn span {
    font-size: 15px;
  }

  body[data-current-view="create"][data-create-mode="graphic"] .draft-command-field {
    flex: 1 1 300px;
    min-height: 0;
    grid-template-rows: auto minmax(220px, 1fr);
  }

  body[data-current-view="create"][data-create-mode="graphic"] .draft-command-field textarea {
    height: 100%;
    min-height: 220px;
    resize: none;
  }
}

body[data-current-view="create"][data-create-mode="graphic"] .draft-meta {
  scrollbar-width: none;
}

body[data-current-view="create"][data-create-mode="graphic"] .draft-meta::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Keep the authored collage controls legible after the global light-theme flattening rules. */
body:not([data-appearance="deep-dark"]) .asset-editor-collage-choose,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-choose:hover {
  border: 1px dashed rgba(108, 99, 232, 0.42);
  background: #f0effc;
  color: #5d55ce;
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-source-actions button,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-creative-tabs > button {
  border: 1px solid #e7e7eb;
  background: #f7f7f8;
  color: var(--ink);
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-creative-tabs > button.is-active {
  border-color: rgba(108, 99, 232, 0.42);
  background: #efedfc;
  color: #5d55ce;
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-sources button,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-sources button:hover {
  border: 2px solid transparent;
  background: #f3f3f5;
  transform: none;
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-sources button.is-active,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-sources button.is-active:hover {
  border-color: #6c63e8;
  background: #f3f3f5;
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-ratios button,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-layout-options button {
  border: 1px solid transparent;
  background: #f3f3f5;
  color: #73737b;
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-ratios button:hover,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-ratios button.is-active,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-layout-options button:hover,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-layout-options button.is-active {
  border-color: rgba(108, 99, 232, 0.42);
  background: #efedfc;
  color: #5d55ce;
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-layout-options {
  background: transparent;
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-seamless input,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-seamless input:focus,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-seamless input:focus-visible {
  border: 0;
  background: #d9d9df;
  box-shadow: inset 0 0 0 1px #c9c9d1;
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-seamless input:hover {
  background: #c9c9d1;
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-seamless input:checked,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-seamless input:checked:hover,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-seamless input:checked:focus,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-seamless input:checked:focus-visible {
  background: #6c63e8;
  box-shadow: inset 0 0 0 1px rgba(108, 99, 232, 0.5);
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-swatches button,
body:not([data-appearance="deep-dark"]) .asset-editor-collage-swatches button:hover {
  border: 1px solid #d8d8dc;
  background: var(--collage-swatch);
  transform: none;
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-swatches button.is-active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4.01px #6c63e8;
}

body:not([data-appearance="deep-dark"]) .asset-editor-collage-slot-zoom input[type="range"],
body:not([data-appearance="deep-dark"]) .asset-editor-collage-border-controls input[type="range"],
body:not([data-appearance="deep-dark"]) .asset-editor-collage-tone-controls input[type="range"] {
  border: 0;
  background: transparent;
  accent-color: #6c63e8;
  box-shadow: none;
}

/* Deep creation only interrupts the user when a choice or补充 is actually needed. */
body[data-current-view="create"] .material-gate,
body:not([data-appearance="deep-dark"])[data-current-view="create"] .material-gate {
  gap: 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  padding: 0;
}

body[data-current-view="create"] .material-gate.is-checking {
  background: var(--surface-raised);
  padding: 16px;
}

body:not([data-appearance="deep-dark"])[data-current-view="create"] .material-gate.is-checking {
  background: #f3f3f3;
}

.material-gate-progress {
  display: grid;
  gap: 10px;
}

.material-progress-head,
.material-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.material-progress-head strong,
.material-action-head strong {
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.45;
}

.material-progress-head span,
.material-action-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
}

.material-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 72%, transparent);
}

.material-progress-track i {
  display: block;
  width: 28%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  animation: material-progress-running 1.7s ease-in-out infinite;
  will-change: transform;
}

@keyframes material-progress-running {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(150%); }
  100% { transform: translateX(360%); }
}

@media (prefers-reduced-motion: reduce) {
  .material-progress-track i {
    width: 42%;
    animation: none;
    transform: translateX(68%);
  }
}

.material-gate-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

body[data-current-view="create"] .material-checklist {
  gap: 10px;
  max-height: 440px;
}

body[data-current-view="create"] .material-item,
body[data-current-view="create"] .material-item.is-partial,
body[data-current-view="create"] .material-item.is-missing,
body[data-current-view="create"] .material-item + .material-item {
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-raised);
  padding: 12px;
}

body:not([data-appearance="deep-dark"])[data-current-view="create"] .material-item,
body:not([data-appearance="deep-dark"])[data-current-view="create"] .material-item + .material-item {
  background: #f3f3f3;
}

body[data-current-view="create"] .material-item-head strong {
  font-size: 13px;
  line-height: 1.55;
}

body[data-current-view="create"] .material-item-head span {
  min-width: auto;
  min-height: auto;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

body[data-current-view="create"] .material-multi-hint {
  padding: 0;
  background: transparent;
  color: var(--muted);
}

/* 手机扫码上传：把二维码降为辅助信息，把当前进度放到视觉中心。 */
#mobileUploadModal .upload-modal {
  width: min(780px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 24px;
  padding: 22px 24px 24px;
}

#mobileUploadModal .modal-head {
  align-items: flex-start;
  border-bottom: 0;
  padding: 0 0 22px;
}

#mobileUploadModal .modal-head h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  font-weight: var(--font-weight-semibold);
}

#mobileUploadModal .upload-modal-summary {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: var(--font-weight-regular);
}

#mobileUploadModal .upload-qr-layout {
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
}

#mobileUploadModal .upload-qr-panel {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 4px 28px 4px 0;
  text-align: center;
}

#mobileUploadModal .qr-frame {
  display: grid;
  width: 210px;
  height: 210px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 11px;
}

#mobileUploadModal .qr-frame img {
  display: block;
  width: 186px;
  height: 186px;
  object-fit: contain;
}

#mobileUploadModal .upload-qr-panel > p {
  margin: 16px 0 4px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  font-weight: var(--font-weight-medium);
}

#mobileUploadModal .upload-link-action {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: var(--font-weight-regular);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#mobileUploadModal .upload-qr-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
}

#mobileUploadModal .upload-target-field {
  gap: 7px;
}

#mobileUploadModal .upload-target-field > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
}

#mobileUploadModal .upload-target-field select,
#mobileUploadModal .upload-target-field .themed-select-trigger {
  min-height: 48px;
  border-color: transparent;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-raised));
  font-weight: var(--font-weight-medium);
}

#mobileUploadModal .upload-target-confirmation {
  margin: -3px 2px 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: var(--font-weight-regular);
}

#mobileUploadModal .upload-target-confirmation strong {
  color: var(--ink);
  font-weight: var(--font-weight-medium);
}

#mobileUploadModal .upload-status {
  display: grid;
  min-height: 126px;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent-soft) 86%, var(--surface-raised));
  padding: 18px;
  color: var(--ink);
}

#mobileUploadModal .upload-status-mark {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 12%, transparent);
}

#mobileUploadModal .upload-status-mark::after {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: #fff;
  content: "";
  animation: mobile-upload-pulse 1.25s ease-in-out infinite;
}

#mobileUploadModal .upload-status-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

#mobileUploadModal .upload-status-copy small {
  color: var(--accent);
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: .04em;
}

#mobileUploadModal .upload-status-copy strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.35;
  font-weight: var(--font-weight-semibold);
}

#mobileUploadModal .upload-status-copy > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: var(--font-weight-regular);
}

#mobileUploadModal .upload-status[data-state="success"] {
  border-color: color-mix(in srgb, #3f8f78 24%, transparent);
  background: color-mix(in srgb, #eaf6f2 88%, var(--surface-raised));
}

#mobileUploadModal .upload-status[data-state="success"] .upload-status-mark {
  background: #3f8f78;
  box-shadow: 0 0 0 8px color-mix(in srgb, #3f8f78 12%, transparent);
}

#mobileUploadModal .upload-status[data-state="success"] .upload-status-mark::after {
  inset: 11px 10px 14px 10px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  border-radius: 0;
  background: transparent;
  transform: rotate(45deg);
  animation: none;
}

#mobileUploadModal .upload-status[data-state="success"] .upload-status-copy small {
  color: #3f8f78;
}

#mobileUploadModal .upload-status[data-state="error"] {
  border-color: color-mix(in srgb, #b72f42 28%, transparent);
  background: color-mix(in srgb, #fff0f2 88%, var(--surface-raised));
}

#mobileUploadModal .upload-status[data-state="error"] .upload-status-mark {
  background: #b72f42;
  box-shadow: 0 0 0 8px color-mix(in srgb, #b72f42 12%, transparent);
}

#mobileUploadModal .upload-status[data-state="error"] .upload-status-mark::after {
  inset: 12px 19px;
  border-radius: 2px;
  animation: none;
}

#mobileUploadModal .upload-status[data-state="error"] .upload-status-copy small {
  color: #b72f42;
}

#mobileUploadModal .upload-steps {
  display: grid;
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: var(--font-weight-regular);
  list-style: none;
}

#mobileUploadModal .upload-steps li {
  display: flex;
  align-items: center;
  gap: 9px;
}

#mobileUploadModal .upload-steps li > span {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-raised));
  color: var(--accent);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
}

@keyframes mobile-upload-pulse {
  0%, 100% { opacity: .55; transform: scale(.72); }
  50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 720px) {
  #mobileUploadModal .upload-modal {
    width: min(440px, calc(100vw - 24px));
    padding: 20px 18px;
  }

  #mobileUploadModal .upload-qr-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #mobileUploadModal .upload-qr-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 20px;
  }

  #mobileUploadModal .qr-frame {
    width: 190px;
    height: 190px;
  }

  #mobileUploadModal .qr-frame img {
    width: 166px;
    height: 166px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #mobileUploadModal .upload-status-mark::after {
    animation: none;
  }
}

/* 手机上传面板：桌面端居中小浮层。 */
#mobileUploadModal {
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  padding: 0;
}

#mobileUploadModal .upload-modal {
  display: grid;
  width: min(310px, calc(100vw - 32px));
  height: min(376px, calc(100vh - 32px));
  max-height: none;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 20px 54px rgba(35, 19, 24, .12);
  padding: 0;
}

#mobileUploadModal .modal-head {
  align-items: center;
  border: 0;
  padding: 14px 20px 0;
}

#mobileUploadModal .modal-head h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 18px;
  line-height: 1.35;
  font-weight: var(--font-weight-semibold);
}

#mobileUploadModal .modal-head .compact {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  color: var(--muted);
}

#mobileUploadModal .modal-head .compact .ui-icon {
  width: 14px;
  height: 14px;
}

#mobileUploadModal .mobile-upload-internal-target {
  display: none !important;
}

#mobileUploadModal .mobile-upload-sheet-body {
  display: grid;
  min-height: 0;
  place-items: start center;
  padding: 20px 20px 24px;
}

#mobileUploadModal .mobile-upload-qr-state {
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

#mobileUploadModal .mobile-upload-limit {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  font-weight: var(--font-weight-regular);
}

#mobileUploadModal .mobile-upload-qr-link {
  display: block;
  border-radius: 11px;
}

#mobileUploadModal .qr-frame {
  display: grid;
  width: 190px;
  height: 190px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 8px;
}

#mobileUploadModal .qr-frame img {
  display: block;
  width: 174px;
  height: 174px;
  object-fit: contain;
}

#mobileUploadModal .mobile-upload-scan-caption {
  margin: 18px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  font-weight: var(--font-weight-regular);
}

#mobileUploadModal .mobile-upload-connected-state {
  display: none;
  width: 100%;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

#mobileUploadModal .mobile-upload-connected-copy {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
}

#mobileUploadModal .mobile-upload-connected-copy strong {
  color: var(--ink-strong);
  font-size: 15px;
  line-height: 1.45;
  font-weight: var(--font-weight-regular);
}

#mobileUploadModal .mobile-upload-connected-copy span {
  max-width: 460px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  font-weight: var(--font-weight-regular);
  white-space: pre-line;
}

#mobileUploadModal .mobile-upload-connected-art {
  display: block;
  width: 180px;
  height: 180px;
  margin: 10px 0 8px;
  object-fit: contain;
}

#mobileUploadModal .mobile-upload-rescan-btn {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  font-weight: var(--font-weight-regular);
  cursor: pointer;
}

#mobileUploadModal .mobile-upload-rescan-btn:hover {
  color: var(--accent);
}

#mobileUploadModal .mobile-upload-sheet-body[data-state="connected"] .mobile-upload-qr-state,
#mobileUploadModal .mobile-upload-sheet-body[data-state="success"] .mobile-upload-qr-state,
#mobileUploadModal .mobile-upload-sheet-body[data-state="error"] .mobile-upload-qr-state {
  display: none;
}

#mobileUploadModal .mobile-upload-sheet-body[data-state="connected"] .mobile-upload-connected-state,
#mobileUploadModal .mobile-upload-sheet-body[data-state="success"] .mobile-upload-connected-state,
#mobileUploadModal .mobile-upload-sheet-body[data-state="error"] .mobile-upload-connected-state {
  display: flex;
}

#mobileUploadModal .mobile-upload-sheet-body[data-state="error"] .mobile-upload-connected-copy strong {
  color: #b72f42;
}

@media (max-width: 760px) {
  #mobileUploadModal {
    padding: 0;
  }

  #mobileUploadModal .upload-modal {
    width: 100vw;
    height: 100svh;
    border: 0;
    border-radius: 0;
  }

  #mobileUploadModal .modal-head {
    padding: 22px 22px 0;
  }

  #mobileUploadModal .mobile-upload-sheet-body {
    padding: 24px 20px 40px;
  }

  #mobileUploadModal .qr-frame {
    width: min(360px, 82vw);
    height: min(360px, 82vw);
  }

  #mobileUploadModal .qr-frame img {
    width: calc(min(360px, 82vw) - 36px);
    height: calc(min(360px, 82vw) - 36px);
  }
}
