.hidden { display: none; }

:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: rgba(148, 163, 184, 0.18);
  --text: #111827;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: rgba(79, 70, 229, 0.08);
  --primary-border: rgba(79, 70, 229, 0.25);
  --accent: #eef2ff;
  --accent-strong: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --radius-shell: 12px;
  --radius-panel: 10px;
  --radius-card-lg: 10px;
  --radius-card: 8px;
  --radius-card-sm: 8px;
  --radius-control: 8px;
  --radius-control-sm: 6px;
  --radius-control-xs: 6px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Apple SD Gothic Neo', 'Avenir Next', 'Segoe UI', sans-serif;
  color: var(--text);
  background: #fff;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

.auth-screen,
.onboarding-screen {
  min-height: 100vh;
  padding: 32px;
}

.auth-screen {
  display: grid;
  place-items: center;
}

.onboarding-screen {
  display: grid;
  place-items: start center;
}

.auth-card,
.onboarding-shell {
  width: min(100%, 860px);
  border-radius: var(--radius-shell);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.auth-card {
  width: min(100%, 480px);
  padding: 32px;
  display: grid;
  gap: 20px;
}

.auth-brand {
  display: grid;
  gap: 2px;
}

.auth-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 11pt;
  line-height: 1.1;
}

.auth-logo-wrap {
  display: flex;
  align-items: center;
}

.auth-logo {
  display: block;
  width: min(187px, 53vw);
  height: auto;
}

.auth-copy {
  display: grid;
  gap: 8px;
}

.auth-copy h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
}

.onboarding-hero h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
}

.auth-copy p,
.onboarding-copy,
.guide-completion p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.auth-submit-btn {
  width: 100%;
  justify-content: center;
}

.auth-status {
  min-height: 24px;
}

.signup-card {
  width: min(100%, 480px);
}

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

.phone-verify-btn {
  padding: 14px 14px;
  white-space: nowrap;
  font-size: 13px;
}

.verification-timer {
  font-size: 13px;
  color: #dc2626;
  font-weight: 600;
  margin-left: 8px;
}

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

.verification-status.is-error {
  color: #dc2626;
}

.verification-status.is-verified {
  color: #059669;
}

.auth-toggle {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
}

.auth-toggle-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  text-decoration: underline;
  padding: 0;
}

.auth-trial {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.auth-trial-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: var(--radius-control);
  transition: background 0.15s, color 0.15s;
}

.auth-trial-btn:hover {
  background: var(--primary);
  color: #fff;
}

.onboarding-shell {
  width: 100%;
  max-width: 1220px;
  padding: 28px;
  display: grid;
  gap: 24px;
  transition: padding 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.onboarding-hero {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  justify-items: stretch;
  text-align: left;
}

.onboarding-hero .eyebrow {
  justify-self: start;
}

.onboarding-hero-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
}

.guide-stack {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.guide-card {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0;
  scroll-margin-top: 40px;
  border-radius: var(--radius-panel);
  border: 0 solid var(--line);
  background: rgba(248, 250, 252, 0.82);
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  box-shadow: none;
  transition:
    grid-template-rows 980ms cubic-bezier(0.22, 1, 0.36, 1),
    border-width 420ms ease,
    opacity 420ms ease,
    transform 980ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 520ms ease,
    border-color 520ms ease,
    background-color 520ms ease,
    visibility 0s linear 980ms;
}

.guide-card.is-active,
.guide-card.is-complete {
  visibility: visible;
  opacity: 1;
  border-width: 1px;
  transition-delay: 0s;
  grid-template-rows: 1fr;
}

.guide-card.is-active {
  border-color: var(--primary-border);
  background: #fff;
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.guide-card.is-locked {
  pointer-events: none;
}

.guide-card.is-complete {
  background: #f9fafb;
  border-color: var(--line);
  transform: translateY(0);
}

.guide-card-inner {
  min-height: 0;
  overflow: hidden;
  padding: 24px;
  transition:
    padding 680ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 380ms ease,
    transform 980ms cubic-bezier(0.22, 1, 0.36, 1);
}

.guide-card.is-complete .guide-card-inner {
  padding: 18px 20px;
}

.guide-period-row,
.field-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-shift-row,
.field-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shift-editor-card-row {
  gap: 12px;
}

.guide-card .hint,
.guide-card .field-row,
.guide-card .guide-team-section,
.guide-card .chip-panel,
.guide-card .table-section,
.guide-card .guide-actions .primary-btn,
.guide-card .guide-action-buttons .ghost-btn {
  opacity: 1;
  max-height: 1200px;
  transition:
    opacity 280ms ease,
    max-height 680ms cubic-bezier(0.22, 1, 0.36, 1),
    margin 420ms ease;
}

.guide-card.is-complete .hint,
.guide-card.is-complete .field-row,
.guide-card.is-complete .guide-team-section,
.guide-card.is-complete .chip-panel,
.guide-card.is-complete .table-section,
.guide-card.is-complete .guide-actions .primary-btn,
.guide-card.is-complete .guide-action-buttons .ghost-btn {
  opacity: 0;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

.guide-card.is-complete .card-head {
  margin-bottom: 0;
}

.guide-card.is-complete .guide-actions {
  margin-top: 10px;
  justify-content: flex-start;
}

.guide-card.is-complete .guide-action-buttons .ghost-btn,
.guide-card.is-complete .guide-action-buttons .primary-btn {
  display: none;
}

.guide-step-badge {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.guide-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 22px;
}

.guide-action-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.guide-completion {
  padding: 22px 24px;
  border-radius: var(--radius-card-lg);
  background: rgba(236, 253, 245, 0.92);
  border: 1px solid rgba(74, 222, 128, 0.34);
}

.guide-completion strong {
  display: block;
  margin-bottom: 6px;
  font-size: 20px;
}

.onboarding-table-section {
  margin-top: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  padding-bottom: 72px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 14px 92px;
  background: #f8fafc;
  color: var(--text);
  border-right: 1px solid var(--line);
}

.sidebar-main {
  display: grid;
  gap: 14px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  min-height: 18px;
}

.sidebar-brand-logo {
  display: block;
  width: 60px;
  height: auto;
}

.eyebrow {
  margin: 0;
  font-family: 'Avenir Next Condensed', 'Arial Narrow', sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar h1,
.panel-header h2,
.card-head h3 {
  margin: 0;
  line-height: 1.15;
}

.sidebar h1 {
  font-size: 34px;
}

.sidebar-copy {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.step-list {
  display: grid;
  gap: 4px;
}

.step-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  cursor: pointer;
  overflow: hidden;
  transition: background 0.12s, color 0.12s;
}

.step-item:hover {
  background: #fff;
  color: var(--text);
}

.step-item span {
  font-family: 'Avenir Next Condensed', 'Arial Narrow', sans-serif;
  font-size: 12.5px;
  color: var(--muted);
  flex: 0 0 auto;
}

.step-item strong {
  display: inline;
  font-size: 13px;
  font-weight: 600;
}

.step-complete-badge {
  position: absolute;
  right: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateX(8px) scale(0.92);
  pointer-events: none;
}

.step-item.is-active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
  box-shadow: none;
}

.step-item.is-completion-celebrating {
  animation: step-completion-glow 2.3s ease forwards;
}

.step-item.is-completion-celebrating .step-complete-badge {
  animation: step-complete-badge-pop 2.3s ease forwards;
}

@keyframes step-completion-glow {
  0% {
    border-color: var(--line);
    box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0), 0 0 0 rgba(34, 197, 94, 0);
    background: rgba(255, 255, 255, 0.72);
  }
  18% {
    border-color: rgba(34, 197, 94, 0.52);
    box-shadow: inset 0 0 0 1px rgba(187, 247, 208, 0.88), 0 10px 24px rgba(34, 197, 94, 0.16);
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.94));
  }
  72% {
    border-color: rgba(74, 222, 128, 0.42);
    box-shadow: inset 0 0 0 1px rgba(187, 247, 208, 0.6), 0 4px 10px rgba(34, 197, 94, 0.08);
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(255, 255, 255, 0.92));
  }
  100% {
    border-color: var(--line);
    box-shadow: inset 0 0 0 1px rgba(203, 213, 225, 0);
    background: rgba(255, 255, 255, 0.72);
  }
}

@keyframes step-complete-badge-pop {
  0% {
    opacity: 0;
    transform: translateX(8px) scale(0.92);
  }
  16%,
  58% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(2px) scale(0.96);
  }
}

.history-toolbar-head {
  display: flex;
  align-items: center;
  min-width: 0;
}

.history-toolbar-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #64748b;
  white-space: nowrap;
}

.history-graph {
  display: flex;
  align-items: center;
  gap: 6px;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 0 5px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.history-empty {
  min-width: max-content;
  min-height: 28px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-control-xs);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.history-node-item {
  position: relative;
  flex: 0 0 auto;
  min-width: 92px;
  overflow: visible;
}

.history-node-item::before,
.history-node-item::after {
  display: none;
}

.history-node-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 92px;
  min-height: 34px;
  padding: 7px 24px 7px 10px;
  border-radius: var(--radius-control-xs);
  border: 1px solid rgba(100, 116, 139, 0.22);
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.98), rgba(226, 232, 240, 0.9));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  z-index: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 1px 2px rgba(15, 23, 42, 0.06);
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.history-node-btn:hover,
.history-node-btn:focus-visible {
  border-color: rgba(71, 85, 105, 0.32);
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.98), rgba(203, 213, 225, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 6px 14px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.history-node-btn.is-selected,
.history-node-btn.is-current {
  border: 2px solid var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary-border);
}

.history-node-btn.is-editing {
  cursor: text;
}

.history-node-copy {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.history-node-copy strong {
  display: block;
  font-size: 11px;
  line-height: 1.05;
}

.history-node-rename-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--text);
  outline: none;
}

.history-node-badges {
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.history-node-badge {
  padding: 1px 4px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.history-node-delete {
  display: none;
}

/* 시트 탭 메뉴 트리거 버튼 (▲) */
.history-node-menu-trigger {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  z-index: 2;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  color: #6b7280;
  padding: 0;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.history-node-item:hover .history-node-menu-trigger,
.history-node-btn.is-selected ~ .history-node-menu-trigger,
.history-node-btn.is-current ~ .history-node-menu-trigger,
.history-node-btn.is-editing ~ .history-node-menu-trigger,
.history-node-item:has(.is-editing) .history-node-menu-trigger {
  opacity: 1;
  pointer-events: auto;
}

.history-node-menu-trigger:hover,
.history-node-menu-trigger:focus {
  outline: none;
  color: #374151;
}

/* 드롭업 메뉴 */
.history-node-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  right: -4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  min-width: 128px;
  z-index: 200;
}

.history-node-menu[hidden] {
  display: none;
}

.history-node-menu li button {
  display: block;
  width: 100%;
  padding: 7px 14px;
  text-align: left;
  background: none;
  border: none;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  color: #374151;
  white-space: nowrap;
}

.history-node-menu li button:hover {
  background: #f3f4f6;
}

.history-node-menu li:last-child button {
  color: #ef4444;
}

.main-panel {
  display: grid;
  gap: 20px;
  padding: 0 0 92px;
  align-content: start;
  background: #fff;
}

.panel {
  display: none;
  background: #fff;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 24px;
}

.panel.is-active {
  display: block;
}

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

.period-preview {
  min-width: 160px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.period-preview-readonly {
  display: inline-flex;
  align-items: center;
  min-width: 228px;
  border: 1px solid var(--line);
  text-align: left;
}

.period-preview-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 228px;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.period-preview-button:hover,
.period-preview-button:focus-visible {
  background: rgba(226, 232, 240, 0.92);
  border-color: rgba(148, 163, 184, 0.34);
  outline: none;
}

.period-preview-copy {
  display: grid;
  gap: 4px;
}

.period-preview-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.period-preview-value {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}

.period-preview-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
  color: #475569;
  flex: 0 0 auto;
}

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

.card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card-large {
  grid-column: 1 / -1;
}

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

.card-head-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.hint {
  margin: 0;
  max-width: 400px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.field-row {
  display: grid;
  gap: 16px;
}

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

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

.field span {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.12s;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.summary-box,
.placeholder-card,
.insight-card,
.table-section {
  padding: 14px;
  margin-top: 14px;
  border-radius: var(--radius);
  background: #f9fafb;
  border: 1px solid var(--line);
  line-height: 1.6;
}

.summary-box strong,
.placeholder-title {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.chip-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.chip-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shift-editor-field {
  align-content: start;
}

.shift-editor-card {
  --guide-shift-card-accent: rgba(79, 70, 229, 0.1);
  --guide-shift-card-line: var(--line);
  gap: 6px;
  padding: 10px 10px 8px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94)),
    linear-gradient(90deg, var(--guide-shift-card-accent), transparent 72%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 6px 18px rgba(15, 23, 42, 0.035);
}

.shift-editor-card > span {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--guide-shift-card-line);
  font-size: 14px;
}

.shift-editor-card .shift-editor {
  gap: 6px;
}

.shift-editor-card .shift-editor-chips {
  min-height: 32px;
}

.shift-editor-card .shift-editor-input-row {
  gap: 6px;
}

.shift-editor-card .shift-editor-input {
  padding: 9px 12px;
}

.shift-editor-card .shift-editor-add-btn {
  padding-inline: 12px;
}

.shift-editor-card--work {
  --guide-shift-card-accent: rgba(14, 165, 233, 0.16);
}

.shift-editor-card--off {
  --guide-shift-card-accent: rgba(16, 185, 129, 0.16);
}

.shift-editor-card--other {
  --guide-shift-card-accent: rgba(245, 158, 11, 0.18);
}

.shift-editor {
  display: grid;
  gap: 12px;
}

.shift-editor-chips {
  min-height: 42px;
  align-items: flex-start;
}

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

.shift-editor-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.shift-editor-add-btn {
  padding-inline: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}

.chip.is-fixed {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.chip-removable {
  padding-right: 8px;
}

.chip-remove-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.chip-remove-btn:hover {
  color: var(--text);
}

.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.96), rgba(226, 232, 240, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  border-radius: calc(var(--radius-card) + 2px);
}

.validation-message {
  color: var(--muted);
  line-height: 1.6;
}

.validation-message.is-error {
  color: #dc2626;
}

.validation-message.is-warn {
  color: #f59e0b;
}

.actions {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.primary-btn,
.ghost-btn {
  border: 0;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.12s, box-shadow 0.12s;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover {
  background: var(--primary-hover);
}

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

.ghost-btn:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

.inline-action-btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.inline-action-btn:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

.inline-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.team-config-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.team-config-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}

.team-config-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.team-config-title {
  display: grid;
  gap: 3px;
}

.team-config-title strong {
  font-size: 18px;
}

.team-label-input {
  font-size: 18px;
  font-weight: 700;
  border: none;
  background: transparent;
  padding: 0;
  width: 100%;
  color: inherit;
  cursor: text;
  outline: none;
}

.team-label-input:focus {
  outline: 2px solid var(--primary, #6366f1);
  outline-offset: 2px;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.06);
}

.team-remove-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.team-count-input {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.team-card-preview {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.guide-team-section {
  display: grid;
  gap: 14px;
}

.guide-team-toolbar {
  display: flex;
  justify-content: flex-end;
}

.guide-team-section .team-card-preview {
  display: none;
}

.primary-btn.is-disabled,
.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.table-preview {
  margin-top: 16px;
  overflow-x: auto;
}

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

.table-section {
  padding: 22px;
}

.table-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: var(--radius-card-sm);
  border: 1px solid var(--line);
  background: #fff;
}

#step3AssignmentTable {
  transition: opacity 180ms ease;
}

.preview-table,
.matrix-table,
.assignment-table,
.skill-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius-control);
  overflow: hidden;
  table-layout: fixed;
}

.preview-table th,
.preview-table td,
.matrix-table th,
.matrix-table td,
.assignment-table th,
.assignment-table td,
.skill-table th,
.skill-table td {
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  text-align: center;
  font-size: 12px;
}

.preview-table th:first-child,
.preview-table td:first-child,
.matrix-table th:first-child,
.matrix-table td:first-child {
  width: 74px;
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 1;
}

.assignment-table th:first-child,
.assignment-table td:first-child {
  width: 97px;
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 1;
}

.matrix-table thead th,
.assignment-table thead th,
.preview-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 2;
}

.matrix-table thead th:first-child,
.assignment-table thead th:first-child,
.preview-table thead th:first-child {
  z-index: 3;
}

.day-total {
  font-size: 10px;
  color: var(--muted);
}

.date-head {
  display: grid;
  gap: 2px;
  justify-items: center;
  line-height: 1.1;
}

.date-number {
  font-weight: 700;
}

.weekday-label {
  font-size: 10px;
  color: var(--muted);
}

.is-holiday .date-number,
.is-holiday .weekday-label {
  color: #dc2626;
}

.holiday-name {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  color: #dc2626;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matrix-table th:not(:first-child),
.matrix-table td:not(:first-child),
.assignment-table th:not(:first-child):not(.assignment-summary-head):not(.dedicated-col),
.assignment-table td:not(:first-child):not(.assignment-summary-cell):not(.dedicated-col) {
  width: calc((100% - 125px) / var(--day-count, 31));
}

.matrix-table td {
  height: 42px;
}
.assignment-table td {
  height: 28px;
}

.assignment-summary-head,
.assignment-summary-cell {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  white-space: nowrap;
  padding: 4px 1px;
  font-size: 11px;
}

.assignment-summary-head {
  background: #eef4ff;
}

.assignment-summary-head.is-summary-start,
.assignment-summary-cell.is-summary-start {
  border-left-width: 2px;
  border-left-color: rgba(79, 70, 229, 0.22);
}

.skill-table th:first-child,
.skill-table td:first-child {
  position: static;
  left: auto;
  width: 60%;
  background: #ffffff;
  z-index: auto;
}

.skill-table.has-proficiency th:first-child,
.skill-table.has-proficiency td:first-child {
  width: 45%;
}

.skill-table th:not(:first-child),
.skill-table td:not(:first-child) {
  width: 40%;
}

.skill-table.has-proficiency th:nth-child(2),
.skill-table.has-proficiency td:nth-child(2) {
  width: 30%;
}

.skill-table.has-proficiency th:nth-child(3),
.skill-table.has-proficiency td:nth-child(3) {
  width: 25%;
}

.proficiency-cell {
  text-align: center;
}

.proficiency-input {
  width: 56px;
  text-align: center;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 2px 4px;
  font-size: 0.875rem;
  appearance: textfield;
}

.proficiency-input::-webkit-inner-spin-button,
.proficiency-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.proficiency-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.proficiency-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.toggle-input:checked + .toggle-track {
  background: var(--primary);
}

.toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
}

.skill-table thead th {
  position: static;
  top: auto;
  background: #f8fafc;
  z-index: auto;
}

.skill-table td {
  height: 32px;
}

.matrix-cell {
  cursor: cell;
  user-select: none;
  padding: 0;
}

.assignment-cell {
  cursor: cell;
  user-select: none;
  padding: 0;
}

.assignment-name-cell {
  padding: 0;
  min-width: 97px;
  background: rgba(255, 255, 255, 0.9);
}

.skill-name-cell {
  padding: 0;
  min-width: 0;
  background: rgba(255, 255, 255, 0.9);
}

.skill-cell {
  cursor: cell;
  user-select: none;
  padding: 0;
}

.matrix-cell.is-selected {
  background: rgba(226, 232, 240, 0.7);
}

.assignment-cell.is-selected {
  background: rgba(219, 234, 254, 0.72);
}

.skill-cell.is-selected {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.78);
}

.matrix-cell.is-active {
  box-shadow: inset 0 0 0 2px rgba(100, 116, 139, 0.7);
}

.matrix-table th.is-over-capacity {
  background: rgba(254, 226, 226, 0.9);
  box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.38);
}

.matrix-cell.is-over-capacity {
  background: rgba(254, 242, 242, 0.92);
  box-shadow: inset 0 0 0 2px rgba(248, 113, 113, 0.34);
}

.matrix-cell.is-over-capacity.is-selected {
  background: rgba(254, 226, 226, 0.92);
}

.matrix-cell.is-over-capacity.is-active {
  box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.7);
}

.assignment-cell.is-active {
  box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.7);
}

.assignment-name-cell.is-active,
.skill-name-cell.is-active {
  box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.7);
  background: rgba(239, 246, 255, 0.92);
}

.skill-cell.is-active {
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    inset 0 0 0 3px rgba(29, 78, 216, 0.98),
    inset 0 0 0 5px rgba(191, 219, 254, 0.72);
}

.matrix-cell:focus {
  outline: none;
}

.assignment-cell:focus {
  outline: none;
}

.assignment-name-input,
.skill-name-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.assignment-name-input::placeholder,
.skill-name-input::placeholder {
  color: rgba(100, 116, 139, 0.72);
}

.assignment-name-input:focus,
.skill-name-input:focus {
  outline: none;
}

.skill-cell:focus {
  outline: none;
}

.matrix-value {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 40px;
  font-weight: 600;
}

.assignment-value {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 28px;
  padding: 2px 2px;
  font-size: 11px;
  font-weight: 700;
}

.assignment-value.is-multi {
  color: #1e293b;
}

.assignment-value.is-empty {
  color: var(--muted);
  font-weight: 500;
}

.assignment-value .protected-shift {
  opacity: 0.45;
  font-weight: 500;
}

.assignment-value .wanted-source {
  color: #0284c7;
}

.assignment-value .manual-source {
  color: #7c3aed;
}

.generated-schedule-cell {
  padding: 0;
  overflow: visible;
}

.generated-schedule-cell .assignment-value {
  position: relative;
  z-index: 0;
  isolation: isolate;
  box-sizing: border-box;
  height: 100%;
  min-height: 28px;
  padding: 0 2px;
  transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.generated-schedule-cell.is-pattern-cell .assignment-value.is-pattern-highlight {
  color: var(--pattern-text, #0f172a);
}

.generated-schedule-cell.is-pattern-cell .assignment-value.is-pattern-highlight::before {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  right: 2px;
  z-index: -1;
  box-sizing: border-box;
  background: var(--pattern-surface, rgba(226, 232, 240, 0.94));
}

.generated-schedule-cell.is-pattern-cell .assignment-value.is-pattern-start::before {
  right: -4px;
  border-top: 2px solid var(--pattern-accent, #475569);
  border-bottom: 2px solid var(--pattern-accent, #475569);
  border-left: 2px solid var(--pattern-accent, #475569);
  border-radius: 12px 0 0 12px;
}

.generated-schedule-cell.is-pattern-cell .assignment-value.is-pattern-middle::before {
  left: -4px;
  right: -4px;
  border-top: 2px solid var(--pattern-accent, #475569);
  border-bottom: 2px solid var(--pattern-accent, #475569);
  border-radius: 0;
}

.generated-schedule-cell.is-pattern-cell .assignment-value.is-pattern-end::before {
  left: -4px;
  border-top: 2px solid var(--pattern-accent, #475569);
  border-right: 2px solid var(--pattern-accent, #475569);
  border-bottom: 2px solid var(--pattern-accent, #475569);
  border-radius: 0 12px 12px 0;
}

.generated-schedule-cell.is-pattern-cell .assignment-value.is-pattern-single::before {
  border: 2px solid var(--pattern-accent, #475569);
  border-radius: 12px;
}

.pattern-tone-nod {
  --pattern-accent: #b91c1c;
  --pattern-surface: rgba(254, 226, 226, 0.94);
  --pattern-text: #7f1d1d;
}

.pattern-tone-wanted {
  --pattern-accent: #be185d;
  --pattern-surface: rgba(252, 231, 243, 0.96);
  --pattern-text: #9d174d;
}

.pattern-tone-o {
  --pattern-accent: #0369a1;
  --pattern-surface: rgba(224, 242, 254, 0.96);
  --pattern-text: #075985;
}

.pattern-tone-eod {
  --pattern-accent: #c2410c;
  --pattern-surface: rgba(255, 237, 213, 0.94);
  --pattern-text: #9a3412;
}

.pattern-tone-noe {
  --pattern-accent: #0f766e;
  --pattern-surface: rgba(204, 251, 241, 0.94);
  --pattern-text: #115e59;
}

.pattern-tone-alternating {
  --pattern-accent: #7c3aed;
  --pattern-surface: rgba(237, 233, 254, 0.94);
  --pattern-text: #5b21b6;
}

.pattern-tone-streak {
  --pattern-accent: #1d4ed8;
  --pattern-surface: rgba(219, 234, 254, 0.94);
  --pattern-text: #1e3a8a;
}

.pattern-tone-nd {
  --pattern-accent: #dc2626;
  --pattern-surface: rgba(254, 226, 226, 0.94);
  --pattern-text: #991b1b;
}

.pattern-tone-ed {
  --pattern-accent: #ea580c;
  --pattern-surface: rgba(255, 247, 237, 0.94);
  --pattern-text: #c2410c;
}

.pattern-tone-ne {
  --pattern-accent: #4338ca;
  --pattern-surface: rgba(238, 242, 255, 0.94);
  --pattern-text: #3730a3;
}

.pattern-tone-isolated-off {
  --pattern-accent: #a16207;
  --pattern-surface: rgba(254, 249, 195, 0.94);
  --pattern-text: #854d0e;
}

.pattern-tone-same-shift {
  --pattern-accent: #be123c;
  --pattern-surface: rgba(255, 228, 230, 0.94);
  --pattern-text: #9f1239;
}

.skill-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.skill-team-section {
  margin-top: 0;
}

.skill-team-head {
  margin-bottom: 8px;
}

.skill-team-summary {
  max-width: none;
  text-align: right;
}

.skill-team-label-input {
  font-size: 1rem;
}

.skill-table-wrap {
  max-height: 72vh;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.personal-preference-grid {
  grid-template-columns: 1fr;
}

.personal-preference-table-wrap {
  max-height: none;
}

.skill-table th,
.skill-table td {
  padding: 4px 3px;
  font-size: 11px;
}

.skill-value {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 30px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
}

.skill-value.is-skill-lead,
.skill-palette-main.is-skill-lead,
.skill-palette-input.is-skill-lead,
.skill-palette-menu-toggle.is-skill-lead {
  color: #1e3a8a;
  background: #dbeafe;
}

.skill-value.is-skill-senior,
.skill-palette-main.is-skill-senior,
.skill-palette-input.is-skill-senior,
.skill-palette-menu-toggle.is-skill-senior {
  color: #0f766e;
  background: #ccfbf1;
}

.skill-value.is-skill-staff,
.skill-palette-main.is-skill-staff,
.skill-palette-input.is-skill-staff,
.skill-palette-menu-toggle.is-skill-staff {
  color: #92400e;
  background: #fef3c7;
}

.skill-value.is-skill-support,
.skill-palette-main.is-skill-support,
.skill-palette-input.is-skill-support,
.skill-palette-menu-toggle.is-skill-support {
  color: #475569;
  background: #e2e8f0;
}

.skill-value.is-skill-reserve,
.skill-palette-main.is-skill-reserve,
.skill-palette-input.is-skill-reserve,
.skill-palette-menu-toggle.is-skill-reserve {
  color: #9a3412;
  background: #ffedd5;
}

.skill-palette {
  align-items: center;
}

.skill-palette-item {
  position: relative;
  display: inline-flex;
  flex-direction: column;
}

.skill-palette-chip {
  display: inline-flex;
  align-items: stretch;
  min-height: 38px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.skill-palette-main,
.skill-palette-input,
.skill-palette-menu-toggle {
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.skill-palette-main,
.skill-palette-input {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 999px 0 0 999px;
}

.skill-palette-main {
  cursor: pointer;
}

.skill-palette-input {
  width: 84px;
  text-align: center;
}

.skill-palette-input:focus {
  outline: none;
}

.skill-palette-menu-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  padding: 0;
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0 999px 999px 0;
  cursor: pointer;
}

.skill-palette-main:hover,
.skill-palette-main:focus,
.skill-palette-input:focus,
.skill-palette-menu-toggle:hover,
.skill-palette-menu-toggle:focus {
  filter: brightness(0.98);
  outline: none;
}

.skill-palette-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 24;
  display: grid;
  gap: 4px;
  min-width: 108px;
  padding: 6px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.skill-palette-menu-item {
  border: 0;
  border-radius: var(--radius-control-xs);
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.skill-palette-menu-item:hover,
.skill-palette-menu-item:focus {
  outline: none;
  background: rgba(241, 245, 249, 0.92);
}

.skill-palette-menu-item.is-danger {
  color: #b91c1c;
}

.skill-palette-menu-item.is-danger:hover,
.skill-palette-menu-item.is-danger:focus {
  background: rgba(254, 242, 242, 0.96);
}

.skill-palette-menu-item:disabled,
.skill-palette-add-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.skill-palette-add-btn {
  background: #f8fafc;
}

.skill-palette-btn {
  min-width: 64px;
}

.skill-palette-main.skill-palette-btn {
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  padding: 8px 12px;
}

.skill-palette-add-btn.skill-palette-btn {
  border-radius: var(--radius-pill);
}

.skill-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  align-items: start;
  margin-top: 16px;
}

.skill-layout-table .skill-editor-grid {
  grid-template-columns: minmax(0, 1fr);
}

.skill-layout-rules .skill-constraint-panel:first-child {
  margin-top: 0;
}

.skill-constraint-panel.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.skill-constraint-panel.is-disabled .proficiency-toggle-label {
  pointer-events: all;
  opacity: 1;
}

.skill-constraint-card.is-ai-issue {
  border-color: rgba(248, 113, 113, 0.5);
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.15);
}

.skill-rule-validation-result {
  margin-bottom: 8px;
}

.skill-rule-validation-pending {
  padding: 8px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #6b7280;
  font-size: 12px;
}

.skill-rule-validation-ok {
  padding: 8px 12px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(34, 197, 94, 0.3);
  background: rgba(240, 253, 244, 0.9);
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
}

.skill-constraint-panel {
  margin: 18px 0 22px;
  padding: 18px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.skill-constraint-head {
  margin-bottom: 14px;
}

.skill-constraint-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-constraint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.skill-constraint-warning-list,
.skill-constraint-inline-warnings {
  display: grid;
  gap: 8px;
}

.skill-constraint-warning,
.skill-constraint-inline-warning {
  padding: 10px 12px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(248, 113, 113, 0.24);
  background: rgba(254, 242, 242, 0.92);
  color: #991b1b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.skill-constraint-inline-warning {
  padding: 8px 10px;
}

.skill-constraint-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.skill-constraint-card {
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}

.skill-constraint-card.is-selected {
  border-color: rgba(79, 70, 229, 0.28);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.08);
}

.skill-constraint-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 2.2;
  padding: 8px 0;
}

.skill-constraint-shift-chips {
  display: inline-flex;
  gap: 4px;
}

.skill-constraint-shift-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.skill-constraint-shift-btn:hover,
.skill-constraint-shift-btn:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.26);
  background: rgba(239, 246, 255, 0.94);
}

.skill-constraint-shift-btn.is-active {
  border-color: rgba(79, 70, 229, 0.28);
  background: rgba(219, 234, 254, 0.88);
  color: #1d4ed8;
}

.skill-constraint-text {
  color: var(--muted);
  white-space: nowrap;
}

.skill-constraint-inline-select {
  border: 1px solid var(--line);
  border-radius: var(--radius-control-xs);
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.skill-constraint-inline-input {
  border: 1px solid var(--line);
  border-radius: var(--radius-control-xs);
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  width: 52px;
  text-align: center;
  background: #fff;
  color: var(--text);
}

.skill-constraint-delete-btn {
  flex: 0 0 auto;
  margin-left: 8px;
}

.assignment-tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.assignment-tab-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-right: 6px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.assignment-tab-btn {
  padding: 6px 18px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.assignment-tab-btn.is-active {
  background: var(--accent-strong);
  color: #fff;
  border-color: var(--accent-strong);
}

.assignment-tab-btn:hover:not(.is-active) {
  background: #f1f5f9;
  color: var(--text-primary);
}

.assignment-toolbar {
  margin-bottom: 16px;
  padding: 10px 14px 12px;
  border-radius: var(--radius-control);
  background: #f8fafc;
  border: 1px solid var(--line);
}

.assignment-toolbar-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.assignment-toolbar-row + .assignment-toolbar-row {
  margin-top: 8px;
}

.assignment-toolbar-nav-row {
  min-height: 28px;
}

.personal-preference-table th:first-child,
.personal-preference-table td:first-child {
  width: 18%;
}

.personal-preference-table th:nth-child(2),
.personal-preference-table td:nth-child(2) {
  width: 20%;
}

.personal-preference-table th:nth-child(3),
.personal-preference-table td:nth-child(3) {
  width: 20%;
}

.personal-preference-table th:nth-child(4),
.personal-preference-table td:nth-child(4) {
  width: 32%;
}

.personal-preference-table th:nth-child(5),
.personal-preference-table td:nth-child(5) {
  width: 10%;
}

.personal-preference-name {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  font-weight: 600;
  color: var(--text);
}

.personal-preference-select-field {
  gap: 0;
  min-width: 0;
}

.personal-preference-select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-control-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.personal-preference-select:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.4);
  box-shadow: 0 0 0 3px rgba(191, 219, 254, 0.6);
}

.personal-preference-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 42px;
  align-items: center;
  padding: 0 8px;
}

.personal-preference-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: rgba(219, 234, 254, 0.78);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.personal-preference-chip--pattern {
  background: rgba(254, 226, 226, 0.78);
  color: #b91c1c;
}

.personal-preference-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.personal-preference-clear-btn {
  width: 100%;
}

.personal-preference-clear-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.relationship-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 18px;
}

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

.relation-empty {
  padding: 14px;
  border-radius: var(--radius-control);
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
}

.relation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.relation-row.is-with-count {
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) minmax(78px, auto) auto;
}

.relation-field {
  gap: 0;
}

.relation-select-field {
  position: relative;
}

.relation-select-field::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #6b7280;
  border-bottom: 1.5px solid #6b7280;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.relation-select {
  width: 100%;
  padding: 12px 34px 12px 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
}

.relation-count-field {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 78px;
  padding: 0 8px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: #fff;
  cursor: text;
}

.relation-count-input {
  width: 28px;
  min-width: 0;
  padding: 12px 0 12px 2px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: right;
  appearance: textfield;
  -moz-appearance: textfield;
}

.relation-count-input::-webkit-outer-spin-button,
.relation-count-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.relation-count-input:focus {
  outline: none;
}

.relation-count-suffix {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.relation-link {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.relationship-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.relation-delete-btn {
  border: 1px solid rgba(248, 113, 113, 0.2);
  background: rgba(255, 255, 255, 0.96);
  color: #b91c1c;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.relation-delete-btn:hover,
.relation-delete-btn:focus {
  outline: none;
  background: rgba(254, 242, 242, 0.96);
  border-color: rgba(248, 113, 113, 0.34);
}

.shift-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shift-palette-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.shift-palette-btn.is-clear {
  background: #f8fafc;
}

.shift-palette-btn:hover,
.shift-palette-btn:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.32);
  background: rgba(219, 234, 254, 0.72);
}

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

.rules-list.is-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rule-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-control-sm);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
}

.rule-chip strong {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rule-chip.is-hard strong {
  color: #334155;
}

.rule-chip.is-soft strong {
  color: var(--primary);
}

.rule-empty {
  padding: 18px;
  border-radius: var(--radius-control);
  background: rgba(248, 250, 252, 0.95);
  border: 1px dashed var(--line);
  color: var(--muted);
  line-height: 1.6;
}

.result-layout {
  display: grid;
  gap: 14px;
}

/* ─── Grade Info Bar ─── */
.grade-info-bar {
  padding: 4px 0 14px;
}

.grade-info-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border: 2px solid var(--border-secondary, #d0d0d0);
  border-radius: var(--radius-card, 8px);
  background: var(--bg-card, #fff);
}

.grade-info-card.grade-1 { border-color: #22c55e; background: #f0fdf4; }
.grade-info-card.grade-2 { border-color: #84cc16; background: #f7fee7; }
.grade-info-card.grade-3 { border-color: #eab308; background: #fefce8; }
.grade-info-card.grade-4 { border-color: #f97316; background: #fff7ed; }
.grade-info-card.grade-5 { border-color: #ef4444; background: #fef2f2; }
.grade-info-card.grade-6 { border-color: #dc2626; background: #fef2f2; }

.grade-info-badge {
  font-weight: 700;
  font-size: 14px;
  padding: 2px 10px;
  border-radius: 4px;
  background: var(--bg-base, #f5f5f5);
  white-space: nowrap;
}

.grade-info-detail {
  font-size: 13px;
  color: var(--text-secondary, #666);
}

.grade-info-adjusted {
  font-size: 11px;
  color: var(--warning, #f59e0b);
  font-weight: 500;
}

.grade-info-relaxed {
  font-size: 11px;
  color: var(--error, #ef4444);
  font-weight: 500;
}

@media (max-width: 640px) {
  .grade-info-card {
    padding: 8px 12px;
    gap: 6px;
  }
  .grade-info-badge {
    font-size: 13px;
  }
}

.result-pattern-block {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background:
    radial-gradient(circle at top right, rgba(191, 219, 254, 0.36), transparent 42%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 0.96));
}

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

.result-pattern-head h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}

.result-pattern-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-pattern-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--pattern-text, var(--text));
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.result-pattern-badge strong {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--pattern-surface, rgba(226, 232, 240, 0.94));
  color: inherit;
  font-size: 11px;
}

.result-pattern-badge:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--pattern-accent, rgba(79, 70, 229, 0.36));
  box-shadow: 0 10px 18px var(--line);
}

.result-pattern-badge.is-selected {
  border-color: var(--pattern-accent, rgba(79, 70, 229, 0.36));
  background: var(--pattern-surface, rgba(226, 232, 240, 0.94));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.result-pattern-badge:disabled {
  cursor: default;
  opacity: 0.5;
  box-shadow: none;
}

.result-pattern-empty {
  font-size: 12px;
  color: var(--muted);
}

.result-control-section {
  margin-top: 0;
}

.result-control-head {
  align-items: center;
}

.result-rule-block {
  max-height: min(56vh, 560px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.result-rule-block::-webkit-scrollbar {
  width: 10px;
}

.result-rule-block::-webkit-scrollbar-track {
  background: #f8fafc;
}

.result-rule-block::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border: 2px solid #f8fafc;
  border-radius: var(--radius-pill);
}

.result-control-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.result-control-note {
  min-height: 20px;
}

.result-generate-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  width: auto;
  justify-content: center;
  min-height: 54px;
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.2);
  flex: 0 0 auto;
}

.result-generate-btn-progress {
  position: absolute;
  inset: 0;
  width: var(--generate-progress, 0%);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, #38bdf8, #22c55e);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.18);
  transition: width 320ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: -1;
}

.result-generate-btn-content {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 0 14px;
}

.result-generate-btn-label,
.result-generate-btn-value {
  position: relative;
  z-index: 1;
}

.result-generate-btn-label {
  text-align: center;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.result-generate-btn-value {
  display: none;
  margin-left: 8px;
  font-size: 0.85em;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-generate-btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: generate-spinner-rotate 0.75s linear infinite;
}

.result-generate-btn.is-loading .result-generate-btn-spinner {
  display: block;
}

@keyframes generate-spinner-rotate {
  to { transform: rotate(360deg); }
}

@keyframes generate-vibe-fade {
  0% { opacity: 0; transform: translateY(3px); }
  100% { opacity: 1; transform: translateY(0); }
}

.result-generate-btn.is-loading .result-generate-btn-label {
  animation: generate-vibe-fade 0.3s ease both;
}

.result-generate-btn.is-loading:disabled {
  opacity: 1;
  cursor: progress;
}

.result-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.result-note {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

.floating-status-panel {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 0;
  width: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(210px, 0.6fr) auto;
  align-items: stretch;
  gap: 12px;
  z-index: 40;
  padding: 0 12px;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  background: #fff;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
}

.history-toolbar,
.sidebar-status-panel {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}

.history-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.sidebar-history-panel {
  width: 100%;
}

.sidebar-status-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.sidebar-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #64748b;
  flex: 0 0 auto;
}

.sidebar-status-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-settings-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 48px;
}

.footer-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.footer-settings-btn:hover,
.footer-settings-btn:focus-visible {
  color: #64748b;
  transform: translateY(-1px);
  outline: none;
  opacity: 0.92;
}

.footer-settings-btn svg,
.account-settings-logout-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-status-message {
  min-height: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-rule-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #fff;
  overflow: hidden;
}

.compact-rule-block.result-rule-block {
  max-height: min(56vh, 560px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.sidebar-rule-block {
  max-height: 46vh;
  overflow: auto;
}

.rules-table {
  display: grid;
}

.rules-table-header,
.rules-table-row {
  display: grid;
  grid-template-columns: 58px minmax(160px, 0.8fr) minmax(360px, 1.9fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}

.rules-table-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  font-weight: 700;
  color: var(--text);
}

.rules-table-row {
  border-top: 1px solid rgba(226, 232, 240, 0.92);
}

.rules-table-type {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rules-table-type.is-hard {
  color: #334155;
}

.rules-table-type.is-soft {
  color: var(--primary);
}

.rules-table-type.is-relaxed {
  color: #d97706;
}

.rules-table-row.is-relaxed {
  background-color: #fffbeb;
}

.relaxed-badge {
  font-weight: 600;
  font-size: 0.75em;
  letter-spacing: 0;
  text-transform: none;
}

.rule-type-select {
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.rule-type-select:focus {
  outline: none;
  border-color: var(--primary);
}

.rules-table-main {
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
}

.rules-table-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

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

.placeholder-copy {
  margin: 8px 0 0;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .auth-screen,
  .onboarding-screen {
    padding: 20px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: 0;
  }

  .sidebar {
    padding: 12px 16px;
    background: #fff;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

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

  .sidebar-main {
    display: grid;
  }

  .floating-status-panel {
    position: static;
    width: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 20px 16px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
  }

  .history-toolbar,
  .sidebar-status-panel,
  .footer-settings-slot {
    padding: 10px 11px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow);
  }

  .history-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 6px;
  }

  .history-toolbar-head {
    display: flex;
  }

  .history-graph {
    padding: 1px 0 2px;
  }

  .sidebar-status-panel {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding-left: 10px;
    border-left: 0;
  }

  .footer-settings-slot {
    justify-content: flex-end;
  }

  .account-settings-popover {
    right: 0;
    bottom: calc(100% + 10px);
  }

  .result-rule-block {
    max-height: 44vh;
  }

}

@media (max-width: 760px) {
  .onboarding-hero-head,
  .guide-actions,
  .guide-action-buttons,
  .result-control-footer {
    grid-template-columns: 1fr;
    display: grid;
  }

  .setup-grid,
  .guide-period-row,
  .guide-shift-row,
  .field-row-2,
  .field-row-3,
  .chip-panel,
  .insight-row,
  .page-footer,
  .panel-header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .result-pattern-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .page-footer,
  .panel-header,
  .guide-actions {
    align-items: stretch;
  }

  .card-head-actions {
    justify-items: stretch;
  }

  .actions {
    flex-direction: column;
  }

  .panel,
  .card {
    border-radius: var(--radius-card-lg);
  }

  .relationship-editor-grid,
  .relation-row,
  .relation-row.is-with-count {
    grid-template-columns: 1fr;
  }

  .personal-preference-table-wrap {
    overflow-x: auto;
  }

  .personal-preference-table {
    min-width: 720px;
  }

  .skill-constraint-head,
  .skill-constraint-grid,
  .skill-constraint-grid.is-with-count {
    grid-template-columns: 1fr;
    display: grid;
  }

  .skill-constraint-actions {
    justify-content: stretch;
  }

  .relation-link {
    display: none;
  }

  .shift-editor-input-row {
    grid-template-columns: 1fr;
  }

  .rules-table-header,
  .rules-table-row {
    grid-template-columns: 56px minmax(140px, 0.8fr) minmax(260px, 1.6fr);
    gap: 8px;
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* ── Dedicated Duty ── */
.dedicated-col {
  width: 42px !important;
  min-width: 42px;
  max-width: 42px;
  text-align: center;
  padding: 0 2px !important;
  position: sticky;
  left: 97px;
  background: #ffffff;
  z-index: 1;
}

.assignment-table thead .dedicated-col {
  background: #f8fafc;
  z-index: 3;
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

.dedicated-duty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 22px;
  font-size: 10px;
  font-weight: 500;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #b0b8c4;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  line-height: 1;
}

.dedicated-duty-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: scale(1.05);
}

.dedicated-duty-btn:active {
  transform: scale(0.97);
}

.dedicated-duty-btn.has-value {
  border-color: transparent;
  background: transparent;
}

.ded-btn-label {
  font-size: 11px;
  color: #b0b8c4;
}

.ded-btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 20px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  border: 1.5px solid;
  letter-spacing: 0.03em;
}


/* 전담 메뉴 (팝업) */
.dedicated-menu {
  position: fixed;
  z-index: 9999;
  min-width: 100px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 4px;
  animation: dedicatedMenuIn 0.12s ease-out;
}

@keyframes dedicatedMenuIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dedicated-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-control-xs);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: background 0.1s ease;
}

.dedicated-menu-item:hover {
  background: #f9fafb;
}

.dedicated-menu-item.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.dedicated-menu-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid transparent;
}

.dedicated-menu-dot-empty {
  border-color: #cbd5e1;
  background: #fff;
}


/* 전담 행 스타일 */
.dedicated-row {
  background: rgba(100, 116, 139, 0.04);
}

/* border-left color is set inline per duty type */

.dedicated-row .dedicated-col {
  background: rgba(100, 116, 139, 0.04);
}

.dedicated-disabled-label {
  color: #94a3b8;
  font-style: italic;
  font-size: 13px;
}

/* Trial mode banner */
.trial-banner {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 66%;
  max-width: 720px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 5px 24px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
}

.trial-banner-text {
  letter-spacing: 0.02em;
}

.trial-signup-btn.ghost-btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-control-xs);
  transition: background 0.12s, border-color 0.12s;
}

.trial-signup-btn.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

/* ─── 병원 규정 사이드바 버튼 ─── */

.sidebar-legal-rules {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.sidebar-legal-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.sidebar-legal-btn:hover {
  background: #fff;
  color: var(--text);
}

.sidebar-legal-btn.is-active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
  box-shadow: none;
}

.sidebar-legal-btn svg {
  flex-shrink: 0;
  color: var(--muted);
}

/* ─── 병원 규정 설정 패널 ─── */

.legal-rules-panel {
  padding: 24px;
}

.legal-rules-description {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.legal-rules-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
}

.legal-rules-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-control-sm);
  overflow: hidden;
}

.legal-rules-group-title {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(241, 245, 249, 0.6);
  border-bottom: 1px solid var(--line);
}

.legal-rules-group-items {
  display: flex;
  flex-direction: column;
}

.legal-rule-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--line);
}

.legal-rule-item:last-child {
  border-bottom: none;
}

.legal-rule-item:hover {
  background: rgba(241, 245, 249, 0.5);
}

.legal-rule-item:has(.legal-rule-checkbox:checked) {
  background: var(--primary-soft);
}

.legal-rule-checkbox {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

.legal-rule-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.legal-rule-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.legal-rule-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.legal-rules-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

/* ─── Step 6 병원 규정 뱃지 ─── */

.legal-rule-badge {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 6px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.rules-table-row.is-legal {
  background-color: #f0f7ff;
}

/* ─── Dashboard ─── */

/* Period Selector Dropdown */

.period-selector {
  position: relative;
  margin-bottom: 8px;
}

.period-selector-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-control);
  cursor: pointer;
  text-align: left;
}

.period-selector-trigger:hover {
  background: rgba(79, 70, 229, 0.12);
}

.period-selector-trigger[aria-expanded="true"] {
  background: rgba(79, 70, 229, 0.12);
}

.period-selector-chevron {
  flex-shrink: 0;
  transition: transform 150ms ease;
}

.period-selector-trigger[aria-expanded="true"] .period-selector-chevron {
  transform: rotate(180deg);
}

.period-selector-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.period-selector-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-control-sm);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.period-selector-list {
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
}

.period-selector-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 100ms;
}

.period-selector-item:hover {
  background: var(--primary-soft);
}

.period-selector-item.is-active {
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
}

.period-selector-item-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.period-selector-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.period-selector-item-delete {
  padding: 2px 6px;
  font-size: 11px;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 100ms;
}

.period-selector-item:hover .period-selector-item-delete {
  opacity: 1;
}

.period-selector-item-delete {
  color: #ef4444;
}

.period-selector-item-delete:hover {
  border-color: #fca5a5;
  background: #fff1f2;
}

.period-selector-footer {
  padding: 6px 8px;
  border-top: 1px solid var(--line);
}

.period-selector-new-btn {
  width: 100%;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: var(--radius-control-xs);
  cursor: pointer;
}

.period-selector-new-btn:hover {
  background: var(--accent-soft);
  color: var(--text);
}

/* Modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
}

.modal-card {
  width: 90%;
  max-width: 420px;
  padding: 24px;
  border-radius: var(--radius-shell);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.modal-title {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
}

.modal-description {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.account-settings-popover {
  position: absolute;
  right: -8px;
  bottom: calc(100% + 14px);
  z-index: 80;
  width: min(340px, calc(100vw - 32px));
  padding: 18px;
  border-radius: var(--radius-shell);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 14px;
}

.account-settings-popover::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 100%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translateY(-8px) rotate(45deg);
}

.account-settings-head {
  display: flex;
  align-items: center;
}

.account-settings-head .modal-title {
  margin: 0;
  font-size: 16px;
}

.account-settings-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: var(--radius);
  background: #f9fafb;
  border: 1px solid var(--line);
}

.account-settings-label {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-settings-name,
.account-settings-email {
  margin: 0;
  word-break: break-word;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.account-settings-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.account-settings-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.account-settings-logout-btn:hover,
.account-settings-logout-btn:focus-visible {
  color: #64748b;
  opacity: 0.92;
  outline: none;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.checkbox-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}


.history-node-badge.is-finalized {
  background: #dcfce7;
  color: #16a34a;
}

.history-node-dot.is-finalized {
  background: #16a34a !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* Carry-over navigation */

.carry-over-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.carry-over-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
}

.carry-over-nav-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 60px;
  text-align: center;
}

/* Carry-over cells in assignment table */

.carry-over-col-header {
  background: #f1f5f9 !important;
  color: var(--muted) !important;
}

.carry-over-col-header:last-of-type {
  border-right: 3px solid var(--accent-strong) !important;
}

.assignment-cell.carry-over-zone {
  background: #f8fafc;
}

.assignment-cell.carry-over-zone .assignment-value {
  color: var(--muted);
  font-size: 0.85em;
}

.assignment-cell.carry-over-zone.carry-over-last {
  border-right: 3px solid var(--accent-strong) !important;
}

/* 선택/활성 스타일이 carry-over 배경을 오버라이드 */
.assignment-cell.carry-over-zone.is-selected {
  background: rgba(219, 234, 254, 0.72);
}

.assignment-cell.carry-over-zone.is-active {
  box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.7);
}

/* 수동 수정된 셀: 노란색 배경 */
.assignment-cell.carry-over-zone.is-manual {
  background: #fef3c7;
}

.assignment-cell.carry-over-zone.is-manual .assignment-value {
  color: #92400e;
}

/* 수동 수정 셀이 선택되었을 때도 노란색 우선 */
.assignment-cell.carry-over-zone.is-manual.is-selected {
  background: #fde68a;
}

/* ─── AI Chat Layout ─── */
.chat-layout {
  display: flex;
  min-height: 70vh;
  gap: 0;
}

.chat-schedule-panel {
  flex: 1 1 0;
  overflow-y: auto;
  max-height: 80vh;
  min-width: 0;
}

.chat-resizer {
  width: 6px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  flex-shrink: 0;
  z-index: 2;
  transition: background 0.15s;
}
.chat-resizer::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 40px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.28);
  transition: background 0.15s, height 0.15s;
}
.chat-resizer:hover::after,
.chat-resizer.is-dragging::after {
  background: rgba(79, 70, 229, 0.5);
  height: 60px;
}

.chat-schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.chat-schedule-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.chat-save-btn {
  padding: 6px 14px;
  font-size: 12px;
}

/* Chat panel */
.chat-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #fff;
  overflow: hidden;
  max-height: 80vh;
  flex: 0 0 40%;
  min-width: 20%;
  max-width: 40%;
  margin-left: 10px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-message.is-user {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.is-assistant {
  align-self: flex-start;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.chat-message.is-status {
  align-self: center;
  background: var(--primary-soft);
  color: var(--muted, #64748b);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
}

/* Guide buttons */
.chat-guide-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}

.chat-guide-btn {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: all 140ms ease;
  color: var(--text, #1e293b);
}

.chat-guide-btn:hover {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

.chat-guide-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Input area */
.chat-input-area {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.chat-input {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-size: 13px;
  outline: none;
  transition: border-color 140ms ease;
}

.chat-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}

.chat-send-btn {
  padding: 8px 16px;
  font-size: 13px;
  white-space: nowrap;
}

/* Comparison panel */
.chat-comparison {
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: rgba(248, 250, 252, 0.95);
}

.chat-comparison h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.chat-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.chat-comparison-table th,
.chat-comparison-table td {
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.chat-comparison-table th {
  font-weight: 600;
  color: var(--muted, #64748b);
}

.chat-comparison-improved {
  color: #16a34a;
}

.chat-comparison-worsened {
  color: #dc2626;
}

.chat-comparison-same {
  color: var(--muted, #64748b);
}

.chat-comparison-header {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary, #1e293b);
}

/* Rule change card in chat */
.chat-rule-changes {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(79, 70, 229, 0.04);
  border: 1px solid rgba(79, 70, 229, 0.12);
  border-radius: 8px;
  font-size: 12px;
}

.chat-rule-changes .rule-change-item {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 2px 0;
}

.chat-rule-changes .rule-change-label {
  font-weight: 500;
}

.chat-rule-changes .rule-change-value {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 1000px) {
  .chat-layout {
    flex-direction: column;
  }
  .chat-resizer {
    display: none;
  }
  .chat-panel {
    flex: none;
    width: 100% !important;
    max-width: 100%;
    min-width: 100%;
    margin-left: 0;
    max-height: 50vh;
  }
  .chat-schedule-panel {
    max-height: 50vh;
  }
}

[data-step="6"] {
  position: relative;
}

.generate-cancel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.generate-cancel-modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px 28px 20px;
  width: 280px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.generate-cancel-modal p {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 20px;
  line-height: 1.5;
}

.generate-cancel-actions {
  display: flex;
  gap: 8px;
}

.generate-cancel-btn-cancel,
.generate-cancel-btn-confirm {
  flex: 1;
  padding: 10px 0;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.generate-cancel-btn-cancel {
  background: #f0f0f0;
  color: #333;
}

.generate-cancel-btn-confirm {
  background: #e53e3e;
  color: #fff;
}

.generate-cancel-btn-cancel:hover,
.generate-cancel-btn-confirm:hover {
  opacity: 0.85;
}

/* ─── 내 성향 설정하기 (Step 6) ─── */

.preference-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.preference-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
}

.preference-text-field {
  margin-top: 16px;
}

.preference-text-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-control, 12px);
  padding: 12px 14px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  background: var(--panel-strong, #fff);
  color: var(--text, #111827);
}

.preference-text-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.preference-analyze-btn {
  margin-top: 12px;
  position: relative;
}

.preference-analyze-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.preference-analyze-btn.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.preference-result {
  margin-top: 16px;
}

.preference-result-card {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  padding: 16px;
}

.preference-result-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.preference-result-card p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text, #111827);
  margin: 0 0 12px;
}

.preference-details {
  margin-bottom: 14px;
}

.preference-details summary {
  font-size: 12px;
  color: var(--muted, #6b7280);
  cursor: pointer;
  user-select: none;
}

.preference-details pre {
  font-size: 11px;
  background: var(--panel-strong, #fff);
  border-radius: var(--radius-control-xs, 8px);
  padding: 10px 12px;
  overflow-x: auto;
  margin-top: 8px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.preference-result-actions {
  display: flex;
  gap: 8px;
}

.preference-applied-badge {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
  font-size: 13px;
  font-weight: 600;
}

.preference-clear-btn {
  border: 0;
  background: none;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.preference-clear-btn:hover {
  color: #14532d;
}

.bottom-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  white-space: nowrap;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.bottom-toast.is-visible {
  opacity: 1;
}
