:root {
  --bg: #efeae4;
  --bg-subtle: #e7dfd7;
  --surface: #fcf8f4;
  --surface-muted: #f7f1eb;
  --surface-raised: #fffaf6;
  --surface-input: rgba(255, 252, 247, 0.96);
  --frame-bg: rgba(252, 248, 244, 0.74);
  --frame-border: rgba(255, 255, 255, 0.48);
  --panel-bg: rgba(255, 252, 247, 0.92);
  --panel-muted-bg: rgba(247, 241, 235, 0.84);
  --line: #ddd0c2;
  --line-strong: #cbb8a6;
  --text: #584c43;
  --text-strong: #201a16;
  --muted: #7b6b5f;
  --brand-start: #ca7f68;
  --brand-mid: #a2859f;
  --brand-end: #7683a1;
  --brand-solid: #433731;
  --brand-on-solid: #fbf6f0;
  --brand-soft: rgba(202, 127, 104, 0.08);
  --brand-ring: rgba(147, 122, 104, 0.16);
  --waiting: #a9b09e;
  --waiting-strong: #6f7667;
  --waiting-soft: rgba(169, 176, 158, 0.14);
  --waiting-line: #c8cebe;
  --accent: #a9b09e;
  --accent-strong: #6f7667;
  --accent-soft: rgba(169, 176, 158, 0.14);
  --accent-ring: rgba(169, 176, 158, 0.18);
  --success: #7fa28f;
  --success-soft: rgba(127, 162, 143, 0.14);
  --running: #8f9985;
  --running-soft: rgba(169, 176, 158, 0.18);
  --review: #bc7c62;
  --review-soft: rgba(188, 124, 98, 0.13);
  --error: #b3574a;
  --error-soft: rgba(179, 87, 74, 0.12);
  --shadow-soft: 0 1px 2px rgba(54, 40, 29, 0.03), 0 18px 38px rgba(102, 78, 57, 0.1);
  --shadow-card: 0 1px 2px rgba(54, 40, 29, 0.03), 0 8px 20px rgba(102, 78, 57, 0.06);
  --radius-frame: 28px;
  --radius-panel: 22px;
  --radius-control: 14px;
  --radius-button: 12px;
  --radius-soft: 18px;
  --font-sans: "SF Pro Text", "SF Pro Display", "Segoe UI Variable", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-heading: "SF Pro Display", "Avenir Next", "PingFang SC", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Menlo", monospace;
  --type-display: clamp(1.6rem, 3.1vw, 2.1rem);
  --type-page: 1.25rem;
  --type-panel: 1.125rem;
  --type-card: 1.0625rem;
  --type-body: 0.9375rem;
  --type-body-sm: 0.875rem;
  --type-label: 0.9375rem;
  --type-meta: 0.8125rem;
  --type-caption: 0.75rem;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
}

body[data-theme="dark"] {
  --bg: #161210;
  --bg-subtle: #1d1815;
  --surface: #231d1a;
  --surface-muted: #2b2420;
  --surface-raised: #342b27;
  --surface-input: rgba(51, 43, 38, 0.94);
  --frame-bg: rgba(28, 23, 20, 0.78);
  --frame-border: rgba(255, 255, 255, 0.07);
  --panel-bg: rgba(37, 31, 27, 0.92);
  --panel-muted-bg: rgba(44, 37, 33, 0.84);
  --line: #45392f;
  --line-strong: #5c4d42;
  --text: #d8cec2;
  --text-strong: #f6f0e8;
  --muted: #b0a092;
  --brand-start: #da9680;
  --brand-mid: #b190a9;
  --brand-end: #8a94af;
  --brand-solid: #d6c4b7;
  --brand-on-solid: #201913;
  --brand-ring: rgba(214, 196, 183, 0.16);
  --waiting: #b7beab;
  --waiting-strong: #d2d6c8;
  --waiting-soft: rgba(183, 190, 171, 0.16);
  --waiting-line: #707863;
  --accent: #b7beab;
  --accent-strong: #d2d6c8;
  --accent-soft: rgba(183, 190, 171, 0.16);
  --accent-ring: rgba(183, 190, 171, 0.2);
  --success: #96b7a6;
  --success-soft: rgba(150, 183, 166, 0.16);
  --running: #b4bca9;
  --running-soft: rgba(183, 190, 171, 0.2);
  --review: #d29a82;
  --review-soft: rgba(210, 154, 130, 0.18);
  --error: #de7b6f;
  --error-soft: rgba(222, 123, 111, 0.16);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.24), 0 18px 42px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.22), 0 10px 24px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 164, 126, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(194, 156, 172, 0.07), transparent 22%),
    linear-gradient(180deg, var(--bg), var(--bg-subtle));
}

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

button {
  cursor: pointer;
}

.app-shell {
  padding: 20px 18px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 14px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-block.compact {
  gap: 10px;
}

.brand-mark {
  font-family: var(--font-heading);
  font-size: var(--type-display);
  line-height: 1.04;
  font-weight: 700;
  background: linear-gradient(90deg, var(--brand-start) 0%, var(--brand-mid) 52%, var(--brand-end) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-note {
  color: var(--muted);
  font-size: var(--type-body-sm);
  line-height: 1.45;
  max-width: 700px;
}

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

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.workspace-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(247, 241, 235, 0.82), rgba(252, 248, 244, 0.8));
  border: 1px solid rgba(221, 208, 194, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

body[data-theme="dark"] .segmented {
  background: linear-gradient(180deg, rgba(44, 37, 33, 0.78), rgba(37, 31, 27, 0.74));
  border-color: rgba(92, 77, 66, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.segmented button {
  min-height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.segmented button:hover {
  background: rgba(255, 255, 255, 0.4);
  color: var(--text);
}

.segmented button.active {
  background: linear-gradient(180deg, rgba(244, 247, 241, 0.96), rgba(237, 241, 233, 0.92));
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px rgba(169, 176, 158, 0.34), 0 1px 2px rgba(54, 40, 29, 0.08);
}

body[data-theme="dark"] .segmented button.active {
  background: linear-gradient(180deg, rgba(66, 72, 59, 0.44), rgba(55, 61, 50, 0.38));
  box-shadow: inset 0 0 0 1px rgba(183, 190, 171, 0.3);
}

.segmented button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.nav-switch {
  gap: 4px;
  padding: 4px;
  border-radius: 18px;
}

body[data-theme="dark"] .nav-switch {
  border-color: rgba(92, 77, 66, 0.74);
}

.nav-switch button {
  min-height: 38px;
  padding: 0 14px;
  font-weight: 600;
}

.ui-nav-tabs {
  padding: 4px;
  gap: 4px;
}

.ui-nav-tabs button {
  min-height: 38px;
  font-weight: 600;
}

.mode-switch {
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
}

body[data-theme="dark"] .mode-switch {
  border-color: rgba(92, 77, 66, 0.74);
}

.mode-switch button {
  min-height: 40px;
  min-width: 84px;
  padding: 0 16px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.mode-switch button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.24);
  color: var(--text-strong);
}

body[data-theme="dark"] .mode-switch button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.mode-switch button.active {
  background: rgba(202, 127, 104, 0.1);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px rgba(202, 127, 104, 0.22), 0 1px 2px rgba(54, 40, 29, 0.06);
}

body[data-theme="dark"] .mode-switch button.active {
  background: rgba(218, 150, 128, 0.16);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px rgba(218, 150, 128, 0.24);
}

.layout-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 16px;
}

.standard-test-set-layout {
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
}

.panel {
  border: 1px solid rgba(221, 208, 194, 0.72);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.94), rgba(252, 248, 244, 0.9));
  box-shadow: var(--shadow-card);
}

.panel.muted {
  background: linear-gradient(180deg, rgba(248, 244, 239, 0.9), rgba(244, 238, 231, 0.86));
}

body[data-theme="dark"] .panel {
  border-color: rgba(92, 77, 66, 0.82);
  background: linear-gradient(180deg, rgba(39, 33, 29, 0.94), rgba(34, 29, 25, 0.9));
  box-shadow: var(--shadow-card);
}

body[data-theme="dark"] .panel.muted {
  background: linear-gradient(180deg, rgba(45, 38, 34, 0.92), rgba(39, 33, 29, 0.88));
}

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

.panel-header-start {
  justify-content: flex-start;
}

.ui-card-shell {
  overflow: visible;
}

.ui-card-header-shell {
  padding-bottom: 0;
}

.ui-card-content-shell {
  gap: 16px;
}

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

.ui-card-header-row.compact {
  gap: 8px;
}

.panel-title {
  margin: 0;
  color: var(--text-strong);
  font-size: var(--type-panel);
  font-weight: var(--weight-bold);
  line-height: 1.35;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--type-body-sm);
  line-height: 1.5;
  max-width: 56ch;
}

.panel-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.run-panel-body {
  gap: 12px;
}

.run-panel-body .panel-section + .panel-section {
  padding-top: 12px;
}

.run-panel-body .panel-section > .form-grid,
.run-panel-body .panel-section > .tool-stack {
  padding: 12px;
}

.run-panel-body .button-row {
  gap: 8px;
}

.ui-form-section {
  display: grid;
  gap: 14px;
}

.ui-field-grid {
  gap: 12px;
}

.ui-field {
  gap: 8px;
}

.ui-static-value {
  background: var(--surface-muted);
  color: var(--text-strong);
}

.ui-card-footer-shell {
  padding-top: 2px;
}

.ui-toolbar {
  padding: 2px 0;
}

.ui-list-shell {
  border-radius: 18px;
}

.ui-list-item {
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.ui-list-item:not(.static):hover {
  transform: translateY(-1px);
}

.ui-section-head {
  padding-bottom: 2px;
}

.ui-stack-shell {
  border: 1px solid rgba(221, 208, 194, 0.54);
  border-radius: 18px;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(250, 245, 240, 0.62), rgba(255, 252, 247, 0.54));
}

.ui-card-section {
  border: 1px solid rgba(221, 208, 194, 0.54);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(250, 245, 240, 0.62), rgba(255, 252, 247, 0.54));
}

.ui-footer-note {
  padding-top: 2px;
}

.ui-alert {
  border-radius: 16px;
}

.ui-empty-card {
  border-radius: 18px;
}

.ui-auth-card {
  gap: 22px;
}

.ui-auth-actions {
  align-items: center;
}

.ui-auth-actions .btn.wide {
  flex: 1;
}

.single-column {
  grid-template-columns: 1fr;
}

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

.form-grid.single-run-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: start;
}

.form-grid.batch-run-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  align-items: start;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text);
  font-size: var(--type-label);
  font-weight: var(--weight-semibold);
  line-height: 1.45;
}

.field.full {
  grid-column: 1 / -1;
}

.eyebrow {
  font-size: var(--type-caption);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-size: var(--type-body);
  font-weight: var(--weight-regular);
  padding: 12px 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 250, 244, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
  color: var(--text);
  outline: none;
  transition: box-shadow 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.field select {
  appearance: none;
  cursor: pointer;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 252, 248, 0.96), rgba(255, 249, 243, 0.92));
  background-position:
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 14px) calc(50% - 2px),
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--waiting-line);
  background: linear-gradient(180deg, rgba(255, 254, 251, 0.99), rgba(253, 251, 246, 0.96));
  box-shadow: 0 0 0 4px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.field select:focus {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--waiting-strong) 50%),
    linear-gradient(135deg, var(--waiting-strong) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 254, 251, 0.99), rgba(253, 251, 246, 0.96));
}

.field textarea {
  min-height: 124px;
  line-height: 1.65;
  resize: vertical;
}

body[data-theme="dark"] .field input,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .field textarea {
  background: linear-gradient(180deg, rgba(49, 41, 37, 0.94), rgba(42, 36, 32, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .field select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(180deg, rgba(49, 41, 37, 0.94), rgba(42, 36, 32, 0.92));
}

body[data-theme="dark"] .field input:focus,
body[data-theme="dark"] .field select:focus,
body[data-theme="dark"] .field textarea:focus {
  background: linear-gradient(180deg, rgba(52, 44, 39, 0.96), rgba(45, 39, 35, 0.94));
}

body[data-theme="dark"] .field select:focus {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--waiting-strong) 50%),
    linear-gradient(135deg, var(--waiting-strong) 50%, transparent 50%),
    linear-gradient(180deg, rgba(52, 44, 39, 0.96), rgba(45, 39, 35, 0.94));
}

.ui-select {
  position: relative;
}

.ui-select[open] {
  z-index: 24;
}

.ui-select-trigger {
  list-style: none;
  width: 100%;
  min-height: 48px;
  font-size: var(--type-body);
  padding: 12px 42px 12px 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 250, 244, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
  color: var(--text);
  display: flex;
  align-items: center;
  line-height: 1.5;
  font-weight: var(--weight-medium);
  cursor: pointer;
  position: relative;
  transition: box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.ui-select-trigger::-webkit-details-marker {
  display: none;
}

.ui-select-trigger::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 140ms ease, border-color 140ms ease;
}

.ui-select[open] .ui-select-trigger {
  border-color: var(--waiting-line);
  background: linear-gradient(180deg, rgba(255, 254, 251, 0.99), rgba(253, 251, 246, 0.96));
  box-shadow: 0 0 0 4px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.ui-select[open] .ui-select-trigger::after {
  transform: translateY(-25%) rotate(-135deg);
  border-color: var(--waiting-strong);
}

.ui-select-trigger.is-disabled {
  cursor: default;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(247, 241, 235, 0.9), rgba(243, 236, 228, 0.82));
  box-shadow: none;
}

.ui-select-trigger.is-disabled::after {
  opacity: 0.52;
}

.ui-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(221, 208, 194, 0.78);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(252, 248, 244, 0.96));
  box-shadow: 0 16px 34px rgba(102, 78, 57, 0.12);
  max-height: 280px;
  overflow: auto;
  overscroll-behavior: contain;
}

.ui-select-option {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.ui-select-option-label {
  min-width: 0;
  font-size: var(--type-body);
  line-height: 1.5;
}

.ui-select-option:hover,
.ui-select-option.is-selected {
  background: var(--waiting-soft);
  border-color: rgba(169, 176, 158, 0.22);
}

.ui-select-option.is-selected {
  color: var(--text-strong);
}

.ui-select-option.is-selected::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--waiting-strong);
  box-shadow: 0 0 0 3px var(--accent-ring);
  flex-shrink: 0;
}

.ui-select-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

body[data-theme="dark"] .ui-select-trigger {
  background: linear-gradient(180deg, rgba(49, 41, 37, 0.94), rgba(42, 36, 32, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .ui-select[open] .ui-select-trigger {
  background: linear-gradient(180deg, rgba(52, 44, 39, 0.96), rgba(45, 39, 35, 0.94));
}

body[data-theme="dark"] .ui-select-trigger.is-disabled {
  background: var(--surface-muted);
}

body[data-theme="dark"] .ui-select-menu {
  border-color: rgba(80, 67, 58, 0.82);
  background: linear-gradient(180deg, rgba(38, 32, 28, 0.98), rgba(34, 29, 25, 0.96));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

body[data-theme="dark"] .ui-select-option:hover,
body[data-theme="dark"] .ui-select-option.is-selected {
  background: var(--waiting-soft);
  border-color: rgba(183, 190, 171, 0.22);
}

.field-preview {
  min-height: 48px;
  font-size: var(--type-body);
  font-weight: var(--weight-medium);
  padding: 12px 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(247, 241, 235, 0.9), rgba(243, 236, 228, 0.82));
  color: var(--text-strong);
  display: flex;
  align-items: center;
  line-height: 1.5;
}

.field-preview.compact {
  min-height: 44px;
  background: rgba(246, 240, 233, 0.68);
}

.case-name-field {
  gap: 6px;
}

.case-name-preview {
  min-height: 40px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(246, 240, 233, 0.42);
}

body[data-theme="dark"] .case-name-preview {
  background: rgba(49, 41, 37, 0.28);
}

.run-textarea {
  min-height: 52px;
  line-height: 1.5;
}

.utterance-textarea {
  min-height: 52px;
}

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

.ui-mode-card {
  border-color: rgba(221, 208, 194, 0.68);
  background: linear-gradient(180deg, rgba(247, 241, 235, 0.84), rgba(255, 252, 247, 0.74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.ui-badge-row {
  align-items: center;
}

.ui-tabs-list {
  gap: 4px;
  padding: 4px;
}

.ui-tabs-list button {
  min-height: 38px;
}

.ui-file-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 7px 10px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 250, 244, 0.94));
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.ui-file-input:focus {
  outline: none;
  border-color: var(--waiting-line);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.ui-file-input::file-selector-button {
  margin-right: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(247, 241, 235, 0.9), rgba(243, 236, 228, 0.82));
  color: var(--text-strong);
  cursor: pointer;
}

.ui-field-note {
  margin-top: 2px;
}

.ui-table-shell {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.62);
}

.ui-result-panel {
  min-height: 100%;
}

.ui-result-panel-body {
  gap: 16px;
}

.run-actions {
  align-items: center;
  justify-content: flex-end;
}

.run-actions .btn.secondary {
  margin-right: auto;
}

body[data-theme="dark"] .ui-mode-card {
  border-color: rgba(92, 77, 66, 0.74);
  background: linear-gradient(180deg, rgba(43, 36, 31, 0.76), rgba(38, 33, 29, 0.7));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .ui-file-input {
  background: rgba(49, 41, 37, 0.94);
}

body[data-theme="dark"] .ui-file-input::file-selector-button {
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .ui-table-shell {
  border-color: rgba(92, 77, 66, 0.78);
  background: rgba(43, 36, 31, 0.6);
}

body[data-theme="dark"] .ui-stack-shell,
body[data-theme="dark"] .ui-card-section {
  border-color: rgba(92, 77, 66, 0.78);
  background: rgba(43, 36, 31, 0.44);
}

.field-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.subview-switch {
  width: fit-content;
}

.history-switch,
.system-switch {
  gap: 4px;
  padding: 4px;
  background: rgba(255, 252, 247, 0.74);
  border-color: rgba(212, 196, 179, 0.56);
}

body[data-theme="dark"] .history-switch,
body[data-theme="dark"] .system-switch {
  background: rgba(43, 36, 31, 0.76);
  border-color: rgba(80, 67, 58, 0.82);
}

.history-switch button,
.system-switch button {
  min-height: 34px;
  padding: 0 12px;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.history-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  flex-wrap: wrap;
}

.history-time-shell {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
}

.history-time-shell.is-open {
  z-index: 12;
}

.history-timebar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.history-time-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  flex: 0 1 420px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 250, 244, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, transform 140ms ease;
}

.history-time-label {
  color: var(--muted);
  font-size: var(--type-meta);
  white-space: nowrap;
}

.history-time-range-trigger {
  width: clamp(280px, 34vw, 420px);
  max-width: 100%;
}

.history-time-trigger:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.history-time-trigger.is-open {
  border-color: var(--waiting-line);
  background: linear-gradient(180deg, rgba(255, 254, 251, 0.99), rgba(253, 251, 246, 0.96));
  box-shadow: 0 0 0 4px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.history-time-value {
  color: var(--text-strong);
  font-size: var(--type-body);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.history-time-separator {
  color: var(--muted);
  font-size: 0.84rem;
  flex: 0 0 auto;
}

.history-time-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 2px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.history-time-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(100%, 560px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 18px;
  border: 1px solid rgba(221, 208, 194, 0.86);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.995), rgba(248, 242, 236, 0.985));
  box-shadow: var(--shadow-soft);
  z-index: 14;
}

.history-time-popover-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.history-time-range-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 1 1 280px;
}

.history-time-range-tab {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(221, 208, 194, 0.54);
  background: rgba(255, 252, 247, 0.68);
  color: var(--text);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.history-time-range-tab.is-active {
  border-color: var(--waiting-line);
  background: var(--waiting-soft);
  box-shadow: inset 0 0 0 1px rgba(169, 176, 158, 0.12);
}

.history-time-range-tab-label {
  color: var(--muted);
  font-size: var(--type-caption);
}

.history-time-range-tab-value {
  color: var(--text-strong);
  font-size: var(--type-body-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
}

.history-time-nav {
  margin-left: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
}

.history-time-month {
  min-width: 88px;
  text-align: center;
  color: var(--text-strong);
  font-weight: 600;
}

.history-time-popover-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 152px;
  gap: 14px;
  align-items: start;
}

.history-calendar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-calendar-weekdays,
.history-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.history-calendar-weekdays span {
  color: var(--muted);
  font-size: var(--type-caption);
  text-align: center;
}

.history-calendar-day,
.history-hour-option {
  min-height: 34px;
  padding: 0 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.history-calendar-day:hover:not(:disabled),
.history-hour-option:hover:not(:disabled) {
  background: rgba(246, 240, 233, 0.82);
  border-color: rgba(200, 206, 190, 0.32);
}

.history-calendar-day.is-muted {
  color: rgba(123, 107, 95, 0.54);
}

.history-calendar-day.is-today {
  border-color: rgba(169, 176, 158, 0.42);
}

.history-calendar-day.is-selected,
.history-hour-option.is-selected {
  background: var(--waiting-soft);
  border-color: var(--waiting-line);
  color: var(--waiting-strong);
  box-shadow: inset 0 0 0 1px rgba(169, 176, 158, 0.14);
}

.history-calendar-day:disabled,
.history-hour-option:disabled {
  opacity: 0.34;
  cursor: not-allowed;
}

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

.history-hour-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 2px;
}

.history-hour-title {
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: var(--weight-medium);
}

.history-toolbar .hint {
  font-size: var(--type-meta);
}

.history-layout {
  gap: 12px;
}

.history-list-shell {
  margin-top: 2px;
}

.history-toolbar-time {
  flex: 1 1 auto;
  min-width: min(360px, 100%);
}

.history-toolbar-switch {
  flex: 0 1 auto;
}

body[data-theme="dark"] .history-timebar {
  background: transparent;
}

.history-time-trigger,
body[data-theme="dark"] .history-time-trigger {
  cursor: pointer;
}

body[data-theme="dark"] .history-time-trigger {
  background: linear-gradient(180deg, rgba(49, 41, 37, 0.94), rgba(42, 36, 32, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .history-time-trigger.is-open {
  background: linear-gradient(180deg, rgba(52, 44, 39, 0.96), rgba(45, 39, 35, 0.94));
}

body[data-theme="dark"] .history-time-popover {
  border-color: rgba(80, 67, 58, 0.9);
  background: linear-gradient(180deg, rgba(38, 32, 28, 0.995), rgba(34, 29, 25, 0.985));
}

body[data-theme="dark"] .history-time-range-tab {
  border-color: rgba(92, 77, 66, 0.72);
  background: rgba(49, 41, 37, 0.34);
}

body[data-theme="dark"] .history-time-range-tab.is-active {
  background: var(--waiting-soft);
}

body[data-theme="dark"] .history-calendar-day:hover:not(:disabled),
body[data-theme="dark"] .history-hour-option:hover:not(:disabled) {
  background: rgba(63, 53, 46, 0.86);
  border-color: rgba(183, 190, 171, 0.24);
}

body[data-theme="dark"] .history-calendar-day.is-muted {
  color: rgba(176, 160, 146, 0.48);
}

.mode-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(221, 208, 194, 0.58);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.82), rgba(248, 242, 236, 0.74));
}

body[data-theme="dark"] .mode-hero {
  border-color: rgba(92, 77, 66, 0.74);
  background: linear-gradient(180deg, rgba(44, 37, 33, 0.74), rgba(39, 33, 29, 0.68));
}

.mode-hero.batch {
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.8), rgba(245, 239, 233, 0.76));
}

body[data-theme="dark"] .mode-hero.batch {
  background: linear-gradient(180deg, rgba(44, 37, 33, 0.74), rgba(40, 34, 30, 0.72));
}

.mode-hero.compact {
  gap: 8px;
  padding: 13px 15px;
}

.mode-hero.compact .mode-title {
  margin-top: 0;
}

.mode-kicker {
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-title {
  margin-top: 2px;
  color: var(--text-strong);
  font-size: var(--type-card);
  font-weight: var(--weight-bold);
  line-height: 1.35;
}

.mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: var(--type-body-sm);
  line-height: 1.5;
}

.mode-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mode-meta-item::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(169, 176, 158, 0.54);
  box-shadow: 0 0 0 3px rgba(169, 176, 158, 0.08);
  flex: 0 0 auto;
}

body[data-theme="dark"] .mode-meta-item::before {
  background: rgba(183, 190, 171, 0.46);
  box-shadow: 0 0 0 3px rgba(183, 190, 171, 0.08);
}

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

.mode-step {
  display: flex;
  gap: 10px;
  padding: 12px 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(212, 196, 179, 0.5);
  background: rgba(255, 252, 248, 0.5);
}

body[data-theme="dark"] .mode-step {
  border-color: rgba(80, 67, 58, 0.78);
  background: rgba(49, 41, 37, 0.34);
}

.mode-step-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(202, 127, 104, 0.14);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.mode-step-title {
  color: var(--text-strong);
  font-weight: 600;
  line-height: 1.4;
}

.panel-section > .form-grid,
.panel-section > .tool-stack {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(221, 208, 194, 0.44);
  background: rgba(255, 252, 247, 0.56);
}

body[data-theme="dark"] .panel-section > .form-grid,
body[data-theme="dark"] .panel-section > .tool-stack {
  border-color: rgba(92, 77, 66, 0.7);
  background: rgba(50, 42, 38, 0.32);
}

.control-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--text);
}

.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.action-title {
  color: var(--text-strong);
  font-weight: 600;
  line-height: 1.45;
}

.btn {
  min-height: 46px;
  font-size: var(--type-body);
  font-weight: var(--weight-semibold);
  padding: 0 16px;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease, border-color 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.btn.primary {
  background: var(--brand-solid);
  color: var(--brand-on-solid);
}

.btn.primary.action-primary {
  min-height: 50px;
  padding: 0 20px;
  box-shadow: 0 8px 18px rgba(67, 55, 49, 0.16);
}

body[data-theme="dark"] .btn.primary.action-primary {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
}

.btn.secondary {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.92), rgba(247, 241, 235, 0.86));
  color: var(--text);
}

body[data-theme="dark"] .btn.secondary {
  background: linear-gradient(180deg, rgba(49, 41, 37, 0.94), rgba(42, 36, 32, 0.9));
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}

.btn.ghost.danger {
  border-color: rgba(194, 70, 61, 0.2);
  color: var(--error);
}

.btn.ghost.danger:hover {
  background: var(--error-soft);
  border-color: rgba(194, 70, 61, 0.28);
}

.btn.small {
  min-height: 36px;
  padding: 0 12px;
}

.btn.icon {
  min-width: 46px;
  padding: 0 14px;
}

.icon-glyph {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}

.icon-glyph svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
}

.hint {
  color: var(--muted);
  font-size: var(--type-body-sm);
  line-height: 1.55;
}

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

.summary-grid-metrics {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.summary-item {
  border-radius: 15px;
  padding: 14px;
  border: 1px solid rgba(221, 208, 194, 0.62);
  background: rgba(255, 252, 247, 0.74);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-metric-card {
  min-height: 176px;
  padding: 18px;
  gap: 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 250, 0.96), rgba(251, 246, 240, 0.88));
  box-shadow: 0 1px 2px rgba(54, 40, 29, 0.03), 0 10px 24px rgba(102, 78, 57, 0.05);
}

.summary-metric-card .summary-label {
  color: var(--text-strong);
  opacity: 0.78;
  font-size: var(--type-card);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
}

.summary-metric-value {
  display: flex;
  align-items: flex-end;
  min-height: 58px;
}

.summary-metric-value .value-text,
.summary-metric-value .value-empty {
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  font-weight: var(--weight-semibold);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.summary-metric-note {
  margin-top: auto;
  font-size: var(--type-body);
  line-height: 1.55;
}

.summary-item.success {
  border-color: rgba(127, 162, 143, 0.34);
  background: var(--success-soft);
}

.summary-item.error {
  border-color: rgba(179, 87, 74, 0.26);
  background: var(--error-soft);
}

.summary-item.neutral {
  border-color: rgba(169, 176, 158, 0.24);
  background: var(--waiting-soft);
}

.summary-item.waiting {
  border-color: rgba(169, 176, 158, 0.24);
  background: var(--waiting-soft);
}

.summary-item.running {
  border-color: rgba(81, 109, 126, 0.24);
  background: var(--running-soft);
}

.summary-item.review {
  border-color: rgba(143, 104, 58, 0.24);
  background: var(--review-soft);
}

body[data-theme="dark"] .summary-item {
  border-color: rgba(92, 77, 66, 0.78);
  background: rgba(50, 42, 38, 0.46);
}

body[data-theme="dark"] .summary-metric-card {
  background:
    linear-gradient(180deg, rgba(48, 41, 36, 0.92), rgba(40, 34, 30, 0.88));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22), 0 10px 26px rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"] .summary-item.success {
  background: var(--success-soft);
}

body[data-theme="dark"] .summary-item.error {
  background: var(--error-soft);
}

body[data-theme="dark"] .summary-item.neutral {
  background: var(--waiting-soft);
}

body[data-theme="dark"] .summary-item.running {
  background: var(--running-soft);
}

body[data-theme="dark"] .summary-item.review {
  background: var(--review-soft);
}

.summary-item.success .value-text,
.summary-item.success .value-empty {
  color: var(--success);
  font-weight: 700;
}

.summary-item.error .value-text,
.summary-item.error .value-empty {
  color: var(--error);
  font-weight: 700;
}

.summary-item.neutral .value-text,
.summary-item.neutral .value-empty {
  color: var(--waiting-strong);
  font-weight: 700;
}

.summary-item.waiting .value-text,
.summary-item.waiting .value-empty {
  color: var(--waiting-strong);
  font-weight: 700;
}

.summary-item.running .value-text,
.summary-item.running .value-empty {
  color: var(--running);
  font-weight: 700;
}

.summary-item.review .value-text,
.summary-item.review .value-empty {
  color: var(--review);
  font-weight: 700;
}

.summary-label {
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: var(--weight-medium);
}

.summary-note {
  color: var(--muted);
  font-size: var(--type-meta);
  line-height: 1.5;
}

.value-text,
.value-empty {
  color: var(--text-strong);
  line-height: 1.6;
  word-break: break-word;
}

.value-empty {
  color: var(--muted);
}

.mini-pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--type-caption);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}

.result-card {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(221, 208, 194, 0.68);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.9), rgba(252, 248, 244, 0.82));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body[data-theme="dark"] .result-card {
  border-color: rgba(92, 77, 66, 0.78);
  background: linear-gradient(180deg, rgba(46, 39, 35, 0.86), rgba(39, 33, 29, 0.82));
}

.result-card.success {
  border-color: rgba(127, 162, 143, 0.38);
  box-shadow: inset 0 0 0 1px rgba(127, 162, 143, 0.12);
}

.result-card.waiting {
  border-color: rgba(169, 176, 158, 0.3);
  box-shadow: inset 0 0 0 1px rgba(169, 176, 158, 0.1);
}

.result-card.running {
  border-color: rgba(169, 176, 158, 0.34);
  box-shadow: inset 0 0 0 1px rgba(169, 176, 158, 0.12);
}

.result-card.review {
  border-color: rgba(188, 124, 98, 0.32);
  box-shadow: inset 0 0 0 1px rgba(188, 124, 98, 0.1);
}

.result-card.error {
  border-color: rgba(179, 87, 74, 0.28);
  background: linear-gradient(180deg, rgba(255, 250, 247, 0.9), rgba(251, 243, 239, 0.82));
}

body[data-theme="dark"] .result-card.error {
  background: linear-gradient(180deg, rgba(56, 32, 28, 0.82), rgba(43, 26, 24, 0.84));
}

.result-card.loading {
  min-height: 152px;
  justify-content: center;
}

.result-card.neutral {
  border-color: rgba(169, 176, 158, 0.24);
  background: linear-gradient(180deg, rgba(250, 246, 241, 0.86), rgba(244, 238, 231, 0.82));
}

body[data-theme="dark"] .result-card.neutral {
  background: linear-gradient(180deg, rgba(45, 38, 33, 0.84), rgba(38, 33, 29, 0.86));
}

.result-card.compact {
  padding: 14px;
}

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

.batch-skill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 196, 179, 0.64);
  background: rgba(255, 252, 247, 0.74);
  color: var(--muted);
  font-size: var(--type-caption);
  line-height: 1.4;
}

body[data-theme="dark"] .metric-chip {
  border-color: rgba(92, 77, 66, 0.78);
  background: rgba(50, 42, 38, 0.46);
}

.loading-inline {
  display: flex;
  align-items: center;
  gap: 14px;
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid var(--line);
  border-top-color: var(--brand-solid);
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.result-title {
  color: var(--text-strong);
  font-weight: var(--weight-bold);
  font-size: var(--type-card);
  line-height: 1.4;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}

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

.review-slot {
  border-radius: 15px;
  padding: 14px;
  border: 1px solid rgba(221, 208, 194, 0.6);
  background: rgba(255, 252, 247, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 104px;
}

body[data-theme="dark"] .review-slot {
  border-color: rgba(92, 77, 66, 0.78);
  background: rgba(50, 42, 38, 0.46);
}

.review-slot.wide {
  grid-column: 1 / -1;
  min-height: unset;
}

.review-slot.success {
  border-color: rgba(127, 162, 143, 0.34);
  background: var(--success-soft);
}

.review-slot.waiting {
  border-color: rgba(169, 176, 158, 0.24);
  background: var(--waiting-soft);
}

.review-slot.running {
  border-color: rgba(81, 109, 126, 0.24);
  background: var(--running-soft);
}

.review-slot.review {
  border-color: rgba(143, 104, 58, 0.24);
  background: var(--review-soft);
}

.review-slot.error {
  border-color: rgba(179, 87, 74, 0.24);
  background: var(--error-soft);
}

body[data-theme="dark"] .review-slot.success {
  background: var(--success-soft);
}

body[data-theme="dark"] .review-slot.waiting {
  background: var(--waiting-soft);
}

body[data-theme="dark"] .review-slot.running {
  background: var(--running-soft);
}

body[data-theme="dark"] .review-slot.review {
  background: var(--review-soft);
}

body[data-theme="dark"] .review-slot.error {
  background: var(--error-soft);
}

.review-value {
  color: var(--text-strong);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.review-value.multiline {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.65;
}

.review-slot.success .review-value {
  color: var(--success);
}

.review-slot.waiting .review-value {
  color: var(--waiting-strong);
}

.review-slot.running .review-value {
  color: var(--running);
}

.review-slot.review .review-value {
  color: var(--review);
}

.review-slot.error .review-value {
  color: var(--error);
}

.review-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}

.skeleton-line {
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(212, 196, 179, 0.28), rgba(255, 255, 255, 0.72), rgba(212, 196, 179, 0.28));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

body[data-theme="dark"] .skeleton-line {
  background: linear-gradient(90deg, rgba(80, 67, 58, 0.4), rgba(255, 255, 255, 0.08), rgba(80, 67, 58, 0.4));
  background-size: 200% 100%;
}

.skeleton-line.w-60 {
  width: 60%;
}

.skeleton-line.w-80 {
  width: 80%;
}

.skeleton-line.w-100 {
  width: 100%;
}

.analysis-action {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.14);
  color: var(--waiting-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.analysis-action:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.26);
}

.analysis-action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.table-action-cell {
  text-align: center;
  width: 76px;
}

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.history-pagination {
  justify-content: flex-end;
  padding-top: 2px;
}

.history-pagination .hint {
  min-width: 150px;
  text-align: center;
}

.table-main {
  color: var(--text-strong);
  font-weight: 600;
  line-height: 1.5;
}

.table-main-truncate {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: var(--type-body-sm);
  font-weight: var(--weight-medium);
  background: var(--surface-muted);
  color: var(--text);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.status-pill.success {
  color: var(--success);
}

.status-pill.waiting {
  color: var(--waiting-strong);
  background: var(--waiting-soft);
  border-color: rgba(169, 176, 158, 0.24);
}

.status-pill.running {
  color: var(--running);
  background: var(--running-soft);
  border-color: rgba(169, 176, 158, 0.26);
}

.status-pill.review {
  color: var(--review);
  background: var(--review-soft);
  border-color: rgba(188, 124, 98, 0.24);
}

.status-pill.error {
  color: var(--error);
  background: var(--error-soft);
  border-color: rgba(179, 87, 74, 0.24);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.notice {
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(139, 115, 96, 0.08);
  border: 1px solid rgba(139, 115, 96, 0.16);
  border-left: 3px solid rgba(139, 115, 96, 0.42);
  color: var(--accent-strong);
}

.notice.error {
  background: rgba(217, 45, 32, 0.08);
  color: var(--error);
  border-color: rgba(217, 45, 32, 0.16);
  border-left-color: rgba(217, 45, 32, 0.52);
  box-shadow: none;
}

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(221, 208, 194, 0.64);
  background: rgba(255, 252, 247, 0.58);
}

body[data-theme="dark"] .table-wrap {
  border-color: rgba(92, 77, 66, 0.78);
  background: rgba(43, 36, 31, 0.56);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  font-size: var(--type-body);
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface-raised);
  color: var(--muted);
  text-transform: uppercase;
  font-size: var(--type-caption);
  letter-spacing: 0.08em;
}

tr:last-child td {
  border-bottom: none;
}

.batch-skill-table th:not(:first-child),
.batch-skill-table td:not(:first-child) {
  text-align: center;
  white-space: nowrap;
}

.batch-case-table {
  min-width: 760px;
  table-layout: fixed;
}

.batch-case-table th:nth-child(1),
.batch-case-table td:nth-child(1) {
  width: 32%;
}

.batch-case-table th:nth-child(2),
.batch-case-table td:nth-child(2),
.batch-case-table th:nth-child(3),
.batch-case-table td:nth-child(3) {
  width: 16%;
}

.batch-case-table th:nth-child(4),
.batch-case-table td:nth-child(4) {
  width: 14%;
}

.batch-case-table th:nth-child(5),
.batch-case-table td:nth-child(5) {
  width: 11%;
  white-space: nowrap;
}

.batch-case-main {
  max-width: 100%;
}

.batch-case-draft-table {
  min-width: 640px;
}

.batch-case-draft-table th:nth-child(1),
.batch-case-draft-table td:nth-child(1) {
  width: 46%;
}

.batch-case-draft-table th:nth-child(2),
.batch-case-draft-table td:nth-child(2) {
  width: 28%;
}

.batch-case-draft-table th:nth-child(3),
.batch-case-draft-table td:nth-child(3) {
  width: 26%;
}

.batch-import-error {
  background: var(--error-soft);
}

.batch-field-error {
  color: var(--error);
}

.batch-case-status-cell {
  min-width: 180px;
}

.result-pagination {
  justify-content: flex-end;
  padding-top: 2px;
}

.batch-progress-card {
  gap: 14px;
}

.batch-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: var(--type-body-sm);
}

.batch-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(169, 176, 158, 0.24);
  overflow: hidden;
}

.batch-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(139, 115, 96, 0.92), rgba(185, 155, 121, 0.96));
  transition: width 220ms ease;
}

body[data-theme="dark"] .batch-progress-track {
  background: rgba(92, 77, 66, 0.78);
}

.cell-input {
  width: 100%;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.96), rgba(255, 249, 243, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
  color: var(--text);
  outline: none;
  transition: box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.cell-input:focus {
  border-color: var(--waiting-line);
  background: linear-gradient(180deg, rgba(255, 254, 251, 0.99), rgba(253, 251, 246, 0.96));
  box-shadow: 0 0 0 4px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

body[data-theme="dark"] .cell-input {
  background: linear-gradient(180deg, rgba(49, 41, 37, 0.94), rgba(42, 36, 32, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .cell-input:focus {
  background: linear-gradient(180deg, rgba(52, 44, 39, 0.96), rgba(45, 39, 35, 0.94));
}

.config-table-wrap {
  border-radius: 18px;
}

.config-table {
  min-width: 760px;
}

.config-table.general-skill-table {
  min-width: 680px;
}

.standard-case-table {
  min-width: 1080px;
}

.standard-test-set-rail .summary-grid {
  grid-template-columns: 1fr;
}

.standard-test-set-editor-panel .panel-body,
.standard-test-set-rail .panel-body {
  gap: 14px;
}

.config-table .narrow-col {
  width: 88px;
}

.config-table .action-col {
  width: 112px;
}

.config-table .ui-select {
  width: 100%;
}

.config-table .ui-select-trigger {
  width: 100%;
  min-height: 42px;
}

.config-cell-textarea {
  min-height: 74px;
  resize: vertical;
}

.batch-editor-textarea {
  min-height: 56px;
  resize: vertical;
}

.number-cell-input {
  min-width: 88px;
  text-align: center;
}

.config-table-check {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  white-space: nowrap;
}

.config-table-check input {
  margin: 0;
}

.menu-item {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.menu-item:hover {
  background: var(--waiting-soft);
  border-color: rgba(169, 176, 158, 0.22);
}
.menu-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 17, 14, 0.34);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: flex;
}

.drawer-backdrop {
  justify-content: flex-end;
}

.drawer-panel {
  width: min(760px, 100vw);
  height: 100vh;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(252, 248, 244, 0.96));
  border-left: 1px solid rgba(221, 208, 194, 0.72);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.ui-dialog-panel {
  box-shadow: var(--shadow-soft);
}

body[data-theme="dark"] .drawer-panel {
  background: linear-gradient(180deg, rgba(39, 33, 29, 0.98), rgba(34, 29, 25, 0.96));
  border-left-color: rgba(92, 77, 66, 0.78);
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(212, 196, 179, 0.52);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body[data-theme="dark"] .drawer-header {
  border-bottom-color: rgba(80, 67, 58, 0.76);
}

.drawer-title {
  color: var(--text-strong);
  font-size: var(--type-card);
  font-weight: var(--weight-bold);
}

.drawer-body {
  padding: 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-backdrop {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  width: min(960px, calc(100vw - 32px));
  max-height: min(86vh, 920px);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(252, 248, 244, 0.96));
  border: 1px solid rgba(221, 208, 194, 0.72);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card,
.drawer-panel {
  border-radius: 22px 0 0 22px;
}

.modal-card {
  border-radius: 22px;
}

body[data-theme="dark"] .modal-card {
  background: linear-gradient(180deg, rgba(39, 33, 29, 0.98), rgba(34, 29, 25, 0.96));
  border-color: rgba(92, 77, 66, 0.78);
}

.modal-body {
  padding: 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-card {
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.log-title {
  color: var(--text-strong);
  font-weight: 600;
}

.pre {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(212, 196, 179, 0.6);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.84), rgba(248, 242, 236, 0.76));
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

body[data-theme="dark"] .pre {
  border-color: rgba(80, 67, 58, 0.82);
  background: linear-gradient(180deg, rgba(41, 35, 31, 0.82), rgba(36, 31, 27, 0.76));
}

.list-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-panel.list-rail {
  gap: 0;
  border: 1px solid rgba(221, 208, 194, 0.64);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.7), rgba(248, 242, 236, 0.56));
}

body[data-theme="dark"] .list-panel.list-rail {
  border-color: rgba(92, 77, 66, 0.78);
  background: linear-gradient(180deg, rgba(41, 35, 31, 0.7), rgba(36, 31, 27, 0.6));
}

.list-item {
  text-align: left;
  border: 1px solid rgba(221, 208, 194, 0.64);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.86), rgba(252, 248, 244, 0.78));
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

body[data-theme="dark"] .list-item {
  border-color: rgba(92, 77, 66, 0.78);
  background: linear-gradient(180deg, rgba(46, 39, 35, 0.84), rgba(39, 33, 29, 0.76));
}

.list-panel.list-rail .list-item {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 10px 14px;
}

.list-panel.list-rail .list-item + .list-item {
  border-top: 1px solid rgba(212, 196, 179, 0.58);
}

body[data-theme="dark"] .list-panel.list-rail .list-item + .list-item {
  border-top-color: rgba(80, 67, 58, 0.78);
}

.list-item.active {
  border-color: var(--waiting-line);
  background: var(--waiting-soft);
  box-shadow: inset 0 0 0 1px rgba(169, 176, 158, 0.12);
}

.list-panel.list-rail .list-item.active {
  background: var(--waiting-soft);
  box-shadow: inset 2px 0 0 rgba(169, 176, 158, 0.56);
}

.list-item.static {
  cursor: default;
}

.list-item:not(.static):hover {
  background: rgba(255, 255, 255, 0.42);
}

.list-panel.list-rail .list-item:not(.static):hover {
  background: rgba(255, 255, 255, 0.26);
}

.list-item-title {
  font-size: var(--type-card);
  font-weight: var(--weight-bold);
  color: var(--text-strong);
  line-height: 1.4;
}

.list-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: var(--type-body-sm);
  line-height: 1.5;
}

.list-item-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.list-item-meta span + span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(139, 115, 96, 0.42);
}

.list-item-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-list-head {
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(212, 196, 179, 0.58);
  background: rgba(250, 244, 238, 0.46);
}

body[data-theme="dark"] .history-list-head {
  border-bottom-color: rgba(80, 67, 58, 0.78);
  background: rgba(46, 39, 35, 0.52);
}

.history-list-item {
  display: block;
  padding-top: 12px;
  padding-bottom: 12px;
}

.history-list-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(144px, 0.85fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 10px 14px;
}

.history-list-grid-head {
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
}

.history-cell {
  min-width: 0;
  color: var(--text);
  font-size: var(--type-body);
  line-height: 1.45;
}

.history-cell-main {
  color: var(--text-strong);
}

.history-cell-time,
.history-list-grid-head .history-cell {
  color: var(--muted);
  font-size: var(--type-body-sm);
}

.history-cell-time,
.history-time-value,
.history-time-range-tab-value,
.field-preview,
.case-name-preview {
  font-variant-numeric: tabular-nums;
}

.history-run-meta {
  margin-top: 2px;
}

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

.history-cell-summary {
  display: flex;
  justify-content: flex-start;
}

.history-cell-status {
  display: flex;
  justify-content: flex-end;
}

.status-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.list-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state {
  padding: 16px 15px;
  border-radius: 16px;
  border: 1px solid rgba(221, 208, 194, 0.54);
  background: linear-gradient(180deg, rgba(248, 242, 236, 0.74), rgba(244, 238, 231, 0.66));
  color: var(--muted);
  line-height: 1.6;
}

body[data-theme="dark"] .empty-state {
  border-color: rgba(92, 77, 66, 0.78);
  background: rgba(43, 36, 31, 0.62);
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
}

.profile-layout.profile-layout-compact {
  grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.profile-rail-panel,
.profile-editor-panel {
  min-width: 0;
}

.profile-rail-panel .panel-header,
.profile-editor-panel .panel-header {
  padding: 16px 16px 0;
}

.profile-rail-body,
.profile-editor-body {
  padding: 14px 16px 16px;
  gap: 12px;
}

.profile-editor-body .panel-title,
.profile-rail-panel .panel-title {
  font-size: 1rem;
}

.profile-editor-body .panel-subtitle,
.profile-rail-panel .panel-subtitle {
  margin-top: 4px;
  line-height: 1.45;
}

.profile-section {
  gap: 10px;
}

.profile-section + .profile-section {
  padding-top: 12px;
}

.profile-rail-actions {
  gap: 8px;
}

.profile-rail-actions .btn {
  min-height: 34px;
  padding: 0 12px;
}

.profile-list-rail .list-item {
  padding: 9px 12px;
  gap: 4px;
}

.profile-list-rail .list-item-title {
  font-size: 0.95rem;
  line-height: 1.35;
}

.profile-list-rail .hint {
  font-size: 0.76rem;
  line-height: 1.4;
}

.profile-status-row {
  gap: 8px;
}

.profile-config-subtabs-row {
  display: flex;
  align-items: center;
}

.profile-config-subtabs {
  width: fit-content;
  background: rgba(255, 252, 247, 0.74);
  border-color: rgba(212, 196, 179, 0.56);
}

body[data-theme="dark"] .profile-config-subtabs {
  background: rgba(43, 36, 31, 0.76);
  border-color: rgba(80, 67, 58, 0.82);
}

.profile-config-subtabs button {
  min-height: 34px;
  padding: 0 12px;
}

.compact-section-head {
  gap: 10px;
  padding-bottom: 0;
}

.profile-editor-body .section-head .btn {
  min-height: 34px;
  padding: 0 12px;
}

.profile-editor-body .panel-section > .form-grid,
.profile-editor-body .panel-section > .tool-stack,
.profile-editor-body .panel-section > .table-wrap {
  padding: 12px;
  border-radius: 14px;
  border-color: rgba(221, 208, 194, 0.42);
  background: rgba(255, 252, 247, 0.5);
}

body[data-theme="dark"] .profile-editor-body .panel-section > .form-grid,
body[data-theme="dark"] .profile-editor-body .panel-section > .tool-stack,
body[data-theme="dark"] .profile-editor-body .panel-section > .table-wrap {
  border-color: rgba(92, 77, 66, 0.62);
  background: rgba(50, 42, 38, 0.26);
}

.profile-config-grid {
  gap: 10px;
}

.profile-basic-grid {
  grid-template-columns: minmax(150px, 0.72fr) minmax(0, 1fr) minmax(220px, 1fr);
}

.profile-request-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-local-grid {
  grid-template-columns: minmax(160px, 0.7fr) minmax(160px, 0.7fr) minmax(0, 1.6fr);
}

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

.profile-editor-body .field {
  gap: 5px;
}

.profile-editor-body .eyebrow {
  letter-spacing: 0.08em;
}

.profile-editor-body .field input,
.profile-editor-body .field select,
.profile-editor-body .field textarea,
.profile-editor-body .ui-select-trigger,
.profile-editor-body .field-preview {
  min-height: 40px;
  padding: 9px 11px;
}

.profile-editor-body textarea {
  line-height: 1.45;
}

.profile-prompt-grid textarea {
  min-height: 220px;
}

.profile-prompt-grid .field:last-child textarea {
  min-height: 160px;
}

.profile-prompt-note {
  margin-top: 2px;
}

.profile-editor-body .field-preview.compact,
.profile-editor-body .case-name-preview {
  min-height: 38px;
  padding: 8px 11px;
}

.profile-editor-body .button-row {
  gap: 8px;
}

.profile-action-row .btn {
  min-height: 40px;
}

.profile-editor-body .config-table {
  min-width: 680px;
}

.profile-editor-body .config-table.general-skill-table {
  min-width: 620px;
}

.profile-editor-body .config-table .cell-input,
.profile-editor-body .config-table .ui-select-trigger {
  min-height: 38px;
  padding: 8px 10px;
}

.profile-editor-body .config-table .config-cell-textarea {
  min-height: 64px;
}

.profile-editor-body .config-table-check {
  min-height: 38px;
}

.schema-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-section + .panel-section {
  padding-top: 16px;
  border-top: 1px solid rgba(212, 196, 179, 0.46);
}

body[data-theme="dark"] .panel-section + .panel-section {
  border-top-color: rgba(80, 67, 58, 0.78);
}

.tool-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tool-card {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-card + .tool-card {
  border-top: 1px solid rgba(212, 196, 179, 0.46);
}

body[data-theme="dark"] .tool-card + .tool-card {
  border-top-color: rgba(80, 67, 58, 0.78);
}

.tool-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-card-title {
  color: var(--text-strong);
  font-weight: 700;
}

.footer-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

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

.login-card {
  width: min(100%, 520px);
  border-radius: 24px;
  border: 1px solid rgba(212, 196, 179, 0.68);
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.92), rgba(252, 248, 243, 0.88));
  box-shadow: 0 10px 28px rgba(128, 98, 72, 0.12);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

body[data-theme="dark"] .login-card {
  border-color: rgba(80, 67, 58, 0.82);
  background: linear-gradient(180deg, rgba(35, 29, 25, 0.94), rgba(30, 25, 22, 0.9));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.btn.wide {
  flex: 1;
}

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

.account-menu {
  position: relative;
}

.account-trigger {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(212, 196, 179, 0.58);
  background: rgba(255, 251, 246, 0.52);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(128, 98, 72, 0.1);
}

.account-trigger:hover {
  transform: translateY(-1px);
}

body[data-theme="dark"] .account-trigger {
  border-color: rgba(80, 67, 58, 0.82);
  background: rgba(37, 32, 28, 0.72);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.account-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(221, 208, 194, 0.78);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(252, 248, 244, 0.96));
  box-shadow: 0 16px 34px rgba(102, 78, 57, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

body[data-theme="dark"] .account-dropdown {
  border-color: rgba(92, 77, 66, 0.82);
  background: linear-gradient(180deg, rgba(39, 33, 29, 0.98), rgba(34, 29, 25, 0.96));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.account-dropdown-head {
  padding: 6px 6px 10px;
  border-bottom: 1px solid rgba(212, 196, 179, 0.52);
}

body[data-theme="dark"] .account-dropdown-head {
  border-bottom-color: rgba(80, 67, 58, 0.76);
}

.menu-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
}

.account-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-card);
}

.account-logo.small {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

.account-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-name {
  color: var(--text-strong);
  font-weight: 600;
}

.field-table td .mini-pre,
.field-table td .value-text,
.field-table td .value-empty {
  min-width: 180px;
}

.login-footnote {
  margin-top: -4px;
}

@media (max-width: 1100px) {
  .split-grid,
  .profile-layout,
  .mode-steps,
  .review-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .profile-layout.profile-layout-compact {
    grid-template-columns: 1fr;
  }

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

  .profile-basic-grid,
  .profile-request-grid,
  .profile-local-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: max(16px, env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  }

  .summary-grid-metrics {
    grid-template-columns: 1fr;
  }

  .summary-metric-card {
    min-height: 0;
    padding: 16px;
  }

  .summary-metric-value {
    min-height: 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .utility-row {
    width: 100%;
    justify-content: space-between;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .account-dropdown {
    right: auto;
    left: 0;
  }

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

  .profile-rail-panel .panel-header,
  .profile-editor-panel .panel-header {
    padding: 14px 14px 0;
  }

  .profile-rail-body,
  .profile-editor-body {
    padding: 12px 14px 14px;
  }

  .profile-basic-grid,
  .profile-request-grid,
  .profile-local-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .history-pagination {
    justify-content: stretch;
  }

  .history-pagination .hint {
    min-width: 0;
    text-align: left;
  }

  .history-timebar {
    align-items: stretch;
  }

  .history-time-trigger {
    width: 100%;
    flex: 1 1 100%;
  }

  .history-time-value {
    text-align: right;
  }

  .history-time-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .history-time-popover {
    width: 100%;
    left: 0;
  }

  .history-time-range-tabs {
    grid-template-columns: 1fr;
  }

  .history-time-popover-body {
    grid-template-columns: 1fr;
  }

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

  .history-time-nav {
    width: 100%;
    justify-content: space-between;
  }

  .section-head,
  .field-group-head,
  .tool-card-head,
  .result-card-head,
  .action-bar,
  .drawer-header,
  .pagination-row {
    flex-direction: column;
    align-items: stretch;
  }

  .history-filter-bar {
    align-items: stretch;
  }

  .history-toolbar-time,
  .history-toolbar-switch {
    width: 100%;
  }

  .history-list-head {
    display: none;
  }

  .history-list-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .history-cell-status {
    justify-content: flex-start;
  }

  .segmented {
    width: 100%;
    overflow: auto;
  }

  .segmented button {
    flex: 1;
  }

  .login-shell {
    padding: 16px;
  }

  .login-card {
    padding: 22px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-card {
    width: 100%;
    max-height: 92vh;
  }

  .drawer-panel {
    width: 100%;
  }
}
