/* ========================================================================
   Scutum Maestro — Design System
   ======================================================================== */

/* --- Design Tokens --- */
:root {
  /* Sidebar */
  --sidebar-bg: #111827;
  --sidebar-border: #1f2937;
  --sidebar-text: #9ca3af;
  --sidebar-text-hover: #f3f4f6;
  --sidebar-active-bg: rgba(59, 130, 246, 0.12);
  --sidebar-active-text: #60a5fa;
  --sidebar-group-text: #6b7280;
  --sidebar-width: 264px;

  /* Top bar */
  --topbar-height: 56px;
  --topbar-bg: #ffffff;
  --topbar-border: #e5e7eb;

  /* Page */
  --page-bg: #f3f4f6;
  --card-bg: #ffffff;
  --card-border: #e5e7eb;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);

  /* Text */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-inverse: #f9fafb;

  /* Accents */
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #06b6d4;
  --info-bg: #ecfeff;

  /* Spacing & Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

body.feedback-pick-mode,
body.feedback-pick-mode * {
  cursor: crosshair !important;
}

/* ========================================================================
   Layout Shell
   ======================================================================== */
.shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.2s ease;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 4px;
}

.brand {
  padding: 20px 20px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f9fafb;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.brand small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--sidebar-group-text);
  margin-top: 2px;
  letter-spacing: 0.03em;
}

/* Menu */
.menu {
  padding: 12px 10px;
  flex: 1;
}

.menu-group-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-group-text);
  padding: 10px 10px 3px 10px;
  opacity: 0.55;
}

.menu-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--sidebar-text);
  margin-right: 3px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}

.menu-group {
  margin-bottom: 4px;
}

.menu-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sidebar-text);
  cursor: pointer;
  border-radius: var(--radius);
  user-select: none;
  transition: background 0.15s, color 0.15s;
}

.menu-group-label:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text-hover);
}

.menu-group-label .icon {
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-group-label .icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.menu-group-label .label {
  flex: 1;
}

.menu-group-label .chevron {
  font-size: 0.65rem;
  transition: transform 0.2s;
  color: var(--sidebar-group-text);
  transform: rotate(90deg);
}

.menu-group.closed>.menu-group-label .chevron {
  transform: rotate(0deg);
}

.menu-sub {
  display: block;
  padding: 2px 0 4px 0;
}

.menu-group.closed>.menu-sub {
  display: none;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 42px;
  font-size: 0.82rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.menu-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text-hover);
}

.menu-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 500;
}

/* Top-level menu link (no sub) */
.menu-top-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
  margin-bottom: 4px;
}

.menu-top-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text-hover);
}

.menu-top-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

.menu-top-link .icon {
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-top-link .icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

/* --- Main Content Area --- */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Top Bar --- */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  z-index: 30;
  flex-shrink: 0;
}

.topbar .spacer {
  flex: 1;
}

.topbar .user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.topbar .user-info .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

#sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* --- Content --- */
.content {
  padding: 24px;
  flex: 1;
}

/* ========================================================================
   Page Header
   ======================================================================== */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-header .subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ========================================================================
   Cards
   ======================================================================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--card-border);
  background: #f9fafb;
}

/* Grid layouts */
.grid-1 {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.grid-2 {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, 1fr);
}

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

.grid-4 {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, 1fr);
}

/* ========================================================================
   KPI Cards (Dashboard)
   ======================================================================== */
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.kpi-card .kpi-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.kpi-card .kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-card .kpi-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

.kpi-card .kpi-icon {
  float: right;
  font-size: 1.5rem;
  opacity: 0.6;
}

.kpi-card .kpi-icon svg {
  width: 1.4rem;
  height: 1.4rem;
  stroke-width: 1.8;
}

/* ========================================================================
   Status Badges
   ======================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 99px;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-bg);
  color: #065f46;
}

.badge-warning {
  background: var(--warning-bg);
  color: #92400e;
}

.badge-danger {
  background: var(--danger-bg);
  color: #991b1b;
}

.badge-info {
  background: var(--info-bg);
  color: #155e75;
}

.badge-neutral {
  background: #f3f4f6;
  color: #4b5563;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success .badge-dot {
  background: var(--success);
}

.badge-warning .badge-dot {
  background: var(--warning);
}

.badge-danger .badge-dot {
  background: var(--danger);
}

.badge-info .badge-dot {
  background: var(--info);
}

/* ========================================================================
   Tables
   ======================================================================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: #f9fafb;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--text-secondary);
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

.data-table td.mono {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.8rem;
}

.data-table .empty-row td {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

/* ========================================================================
   Forms
   ======================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label,
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group .form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder {
  color: var(--text-muted);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.checkbox-row span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ========================================================================
   Buttons
   ======================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

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

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

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

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

.btn-success:hover:not(:disabled) {
  background: #059669;
}

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

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

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

.btn-outline {
  background: #fff;
  color: var(--text-secondary);
  border-color: var(--card-border);
}

.btn-outline:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-secondary {
  background: #eef4ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.btn-secondary:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #93c5fd;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: #f3f4f6;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.btn-xs {
  padding: 2px 8px;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 10px 20px;
  font-size: 0.95rem;
}

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

/* ========================================================================
   Toast Notifications
   ======================================================================== */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 320px;
  max-width: 480px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--card-border);
  animation: toastIn 0.25s ease;
  font-size: 0.85rem;
}

.toast.leaving {
  animation: toastOut 0.2s ease forwards;
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
}

.toast-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  stroke-width: 2;
}

.toast-body {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-msg {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--text-primary);
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-warning {
  border-left: 3px solid var(--warning);
}

.toast-info {
  border-left: 3px solid var(--info);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ========================================================================
   Loading States
   ======================================================================== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

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

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
  height: 16px;
}

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

  100% {
    background-position: -200% 0;
  }
}

/* ========================================================================
   Modal / Confirm Dialog
   ======================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: min(460px, calc(100vw - 40px));
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--card-border);
  position: relative;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-muted);
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

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

.modal-body {
  padding: 12px 24px 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.modal-footer {
  padding: 12px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-lg {
  width: min(640px, calc(100vw - 40px));
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal-lg .modal-body {
  overflow-y: auto;
  flex: 1;
}

.detail-section {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
}

.detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.guide-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

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

.guide-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.guide-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 1px 6px;
  background: var(--page-bg);
  color: var(--text-muted);
  border-radius: 4px;
  margin-right: 6px;
  font-weight: normal;
}



/* ========================================================================
   Status Dot (inline)
   ======================================================================== */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.running {
  background: var(--success);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.status-dot.stopped {
  background: var(--text-muted);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

/* ========================================================================
   Empty State
   ======================================================================== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.empty-state .empty-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state .empty-desc {
  font-size: 0.8rem;
}

/* ========================================================================
   Auth Page (Login)
   ======================================================================== */
.auth-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
}

.login-card {
  width: min(400px, calc(100vw - 40px));
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-card h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-card .muted {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.login-card .form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card .error {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.85rem;
}

.login-card button[type="submit"] {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.login-card button[type="submit"]:hover {
  background: var(--accent-hover);
}

.pw-wrap {
  position: relative;
}

.pw-wrap input {
  width: 100%;
  padding-right: 40px;
}

.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
}

.pw-toggle:hover {
  color: var(--text-primary);
}

.login-footer {
  text-align: center;
  margin-top: 12px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.link-btn:hover {
  color: var(--accent);
}

/* ========================================================================
   Utility
   ======================================================================== */
.text-success {
  color: var(--success) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

.text-mono {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.82rem;
}

.mt-0 {
  margin-top: 0;
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

.gap-1 {
  gap: 8px;
}

.gap-2 {
  gap: 16px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

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

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

.flex-1 {
  flex: 1;
}

.flex-wrap {
  flex-wrap: wrap;
}

.hidden {
  display: none !important;
}

.divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 16px 0;
}

.text-sm {
  font-size: 0.85rem;
}

.text-xs {
  font-size: 0.75rem;
}

.gap-3 {
  gap: 20px;
}

.gap-4 {
  gap: 24px;
}

/* Feed entry (standardized log items) */
.feed-entry {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}

.feed-entry--error {
  border-color: var(--danger);
}

.feed-entry--success {
  border-color: var(--success);
}

.feed-entry--accent {
  border-color: var(--accent);
}

/* Form section label */
.section-label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
}

.section-label--danger {
  color: var(--danger);
}

/* Lucide icon in notification bell */
.notif-bell svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

/* JSON / Code output (temporary, for pages not yet migrated) */
.output {
  margin-top: 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: #f9fafb;
  padding: 12px;
  min-height: 80px;
  overflow: auto;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}


/* ========================================================================
   Notification Bell (Header)
   ======================================================================== */
.notif-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  text-decoration: none;
  border-radius: 50%;
  transition: background 0.15s;
  cursor: pointer;
  flex-shrink: 0;
}

.notif-bell:hover {
  background: #f3f4f6;
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: var(--danger);
  border-radius: 99px;
  border: 2px solid var(--topbar-bg);
}

/* ========================================================================
   Responsive
   ======================================================================== */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
}

.modal-backdrop>.card {
  width: 100%;
  animation: modal-in 0.2s ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 35;
    display: none;
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .main {
    margin-left: 0;
  }

  #sidebar-toggle {
    display: inline-flex;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

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

  .content {
    padding: 16px;
  }
}

/* ========================================================================
   Floating AI Coach Chat Widget
   ======================================================================== */
#float-chat-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent, #1d4ed8);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(29, 78, 216, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  font-size: 1.3rem;
}

#float-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(29, 78, 216, 0.45);
}

#float-chat-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

#float-chat-badge.hidden {
  display: none;
}

#float-chat-panel {
  position: fixed;
  bottom: 90px;
  right: 28px;
  z-index: 199;
  width: 480px;
  max-width: calc(100vw - 32px);
  height: 620px;
  min-height: 300px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#float-chat-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

#float-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: var(--accent, #1d4ed8);
  color: #fff;
  flex-shrink: 0;
  cursor: ns-resize;
  user-select: none;
}

#float-chat-header .fc-drag-hint {
  font-size: 0.6rem;
  opacity: 0.5;
  letter-spacing: 2px;
  text-align: center;
  margin-top: -4px;
  pointer-events: none;
}

#float-chat-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

#float-chat-header .fc-sub {
  font-size: 0.72rem;
  opacity: 0.78;
  margin-top: 2px;
}

#float-chat-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  opacity: 0.8;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

#float-chat-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

#float-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.fc-bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fc-bubble-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.fc-bubble {
  max-width: 88%;
  padding: 9px 11px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.fc-bubble.user {
  align-self: flex-end;
  background: #dbeafe;
  color: #1e3a8a;
  border-bottom-right-radius: 4px;
}

.fc-bubble.assistant {
  align-self: flex-start;
  background: #f8fafc;
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  border-bottom-left-radius: 4px;
}

.fc-bubble-actions {
  display: flex;
  gap: 2px;
  margin-top: 3px;
  align-self: flex-start;
}
.fc-bubble-actions button {
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
}
.fc-bubble-actions button:hover {
  background: #f1f5f9;
  color: var(--text-primary);
  border-color: #94a3b8;
}
.fc-bubble-actions button.copied {
  color: #16a34a;
  border-color: #16a34a;
}
.fc-bubble-actions button.reported {
  color: #2563eb;
  border-color: #2563eb;
}

.fc-bubble.thinking {
  align-self: flex-start;
  background: #f1f5f9;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.78rem;
  border: 1px solid var(--card-border);
}

#float-chat-quick {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.fc-quick-btn {
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: #f8fafc;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}

.fc-quick-btn:hover {
  background: #e0e7ff;
  color: var(--accent);
  border-color: var(--accent);
}

#float-chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--card-border);
  flex-shrink: 0;
}

#float-chat-input {
  font-size: 0.84rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  outline: none;
  height: 36px;
  min-height: 36px;
  max-height: 80px;
  overflow-y: auto;
}

#float-chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.10);
}

#float-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent, #1d4ed8);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.15s;
  flex-shrink: 0;
}

#float-chat-send:hover {
  background: #1e40af;
}

#float-chat-send:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* ========================================================================
   Timeline (Vertical Stepper)
   ======================================================================== */
.timeline {
  position: relative;
  padding-left: 28px;
  margin: 16px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 2px;
  background: var(--card-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-ring {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.timeline-item.active .timeline-ring {
  background: var(--accent);
  border-color: var(--accent);
}

.timeline-item.active .timeline-ring::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

/* ========================================================================
   Dark Monospace Code Container
   ======================================================================== */
.code-block {
  background: #111827;
  color: #e5e7eb;
  border-radius: var(--radius-lg);
  padding: 16px;
  font-size: 0.8rem;
  overflow-x: auto;
  border: 1px solid #374151;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #374151;
  font-family: inherit;
  font-size: 0.78rem;
  color: #9ca3af;
}

.code-block-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.code-block-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.code-block-label {
  font-size: 0.72rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.code-block-val {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-weight: 500;
  font-size: 0.9rem;
}

/* ========================================================================
   Business Proposal Page
   ======================================================================== */
.proposal-shell {
  display: grid;
  gap: 16px;
}

.proposal-hero,
.proposal-section-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.proposal-hero {
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.18), transparent 38%),
    radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.16), transparent 34%),
    linear-gradient(135deg, #0b1220 0%, #111c34 48%, #07111d 100%);
  color: #e5eefc;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr);
  gap: 20px;
  align-items: end;
}

.proposal-hero__glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.55;
}

.proposal-hero__glow--mint {
  top: -120px;
  left: -60px;
  background: rgba(45, 212, 191, 0.28);
}

.proposal-hero__glow--blue {
  right: -80px;
  bottom: -120px;
  background: rgba(59, 130, 246, 0.26);
}

.proposal-hero__content,
.proposal-hero__rail {
  position: relative;
  z-index: 1;
}

.proposal-hero__content h1 {
  margin: 10px 0 0;
  max-width: 10.2em;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.97;
  letter-spacing: -0.06em;
  color: #f8fbff;
  text-wrap: balance;
  word-break: keep-all;
}

.proposal-hero__title-note {
  margin-top: 14px;
  color: rgba(226, 238, 252, 0.8);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.proposal-hero__content p {
  max-width: 700px;
  margin: 14px 0 0;
  color: rgba(226, 238, 252, 0.84);
  line-height: 1.7;
  font-size: 0.96rem;
}

.proposal-hero__eyebrow,
.proposal-section-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.proposal-hero__eyebrow {
  color: #7dd3fc;
}

.proposal-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.proposal-hero__chips span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #d8e7fb;
  font-size: 0.79rem;
  font-weight: 600;
}

.proposal-hero__rail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-self: stretch;
}

.proposal-stat-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(191, 219, 254, 0.12);
  backdrop-filter: blur(8px);
}

.proposal-stat-card__label {
  color: rgba(186, 207, 236, 0.8);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.proposal-stat-card__value {
  margin-top: 8px;
  color: #ffffff;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.proposal-stat-card p {
  margin: 8px 0 0;
  color: rgba(218, 230, 247, 0.78);
  line-height: 1.6;
  font-size: 0.84rem;
}

.proposal-section-card {
  padding: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 252, 0.98) 100%);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
}

.proposal-section-card--soft {
  background: linear-gradient(180deg, #f4f8ff 0%, #eef6f7 100%);
}

.proposal-section-card--dark {
  background:
    radial-gradient(circle at right top, rgba(37, 99, 235, 0.15), transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #111827 55%, #0c1220 100%);
  border-color: rgba(96, 165, 250, 0.16);
}

.proposal-section-card--dark h2,
.proposal-section-card--dark h3,
.proposal-section-card--dark p,
.proposal-section-card--dark .proposal-section-card__eyebrow {
  color: #edf4ff;
}

.proposal-section-card--compact {
  padding-bottom: 22px;
}

.proposal-section-card__intro {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.proposal-section-card__eyebrow {
  color: #2563eb;
}

.proposal-section-card__intro h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.45rem, 2.6vw, 2.2rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
  text-wrap: balance;
  word-break: keep-all;
}

.proposal-section-card__intro p {
  max-width: 760px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.95rem;
}

.proposal-problem-grid,
.proposal-solution-grid,
.proposal-architecture-grid,
.proposal-fit-grid,
.proposal-feedback-list,
.proposal-outcome-grid {
  display: grid;
  gap: 12px;
}

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

.proposal-problem-card,
.proposal-solution-card,
.proposal-architecture-node,
.proposal-fit-card,
.proposal-feedback-item {
  border-radius: 18px;
  padding: 16px;
}

.proposal-problem-card {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.proposal-problem-card h3,
.proposal-solution-card h3,
.proposal-fit-card h3,
.proposal-feedback-item h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.98rem;
  line-height: 1.38;
}

.proposal-problem-card p,
.proposal-solution-card p,
.proposal-architecture-node p,
.proposal-fit-card li,
.proposal-feedback-item p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.92rem;
}

.proposal-solution-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(191, 219, 254, 0.14);
}

.proposal-solution-card__kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #67e8f9;
}

.proposal-solution-card h3 {
  margin-top: 8px;
  color: #f8fbff;
}

.proposal-solution-card p {
  color: rgba(226, 238, 252, 0.8);
}

.proposal-section-card--dark .proposal-section-card__intro {
  max-width: 780px;
}

.proposal-section-card--dark .proposal-section-card__intro p {
  color: rgba(226, 238, 252, 0.8);
}

.proposal-compare-table {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  overflow: hidden;
}

.proposal-compare-table__head,
.proposal-compare-table__cell {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.proposal-compare-table__head {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.proposal-compare-table__cell {
  background: #fff;
  color: var(--text-secondary);
  line-height: 1.7;
}

.proposal-compare-table__cell--label {
  font-weight: 700;
  color: var(--text-primary);
  background: #f8fafc;
}

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

.proposal-architecture-node {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  border: 1px solid rgba(96, 165, 250, 0.18);
}

.proposal-architecture-node__title {
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

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

.proposal-fit-card {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.proposal-fit-card ul {
  margin: 10px 0 0;
  padding-left: 1.1rem;
}

.proposal-feedback-item {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.proposal-feedback-item__priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #dbeafe 0%, #cffafe 100%);
  color: #0f172a;
  font-weight: 800;
  letter-spacing: -0.03em;
}

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

.proposal-doc-list code {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 14px;
  background: #0f172a;
  color: #dbeafe;
  border: 1px solid rgba(59, 130, 246, 0.18);
}

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

.proposal-outcome-card {
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(96, 165, 250, 0.16);
}

.proposal-outcome-card h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.98rem;
  line-height: 1.38;
}

.proposal-outcome-card p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.92rem;
}

.proposal-section-card--cta {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    linear-gradient(135deg, #eff6ff 0%, #f8fafc 56%, #ecfeff 100%);
}

.proposal-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proposal-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: #0f172a;
  color: #eff6ff;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.proposal-cta-button--secondary {
  background: #fff;
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.16);
}

@media (max-width: 1180px) {
  .proposal-hero {
    grid-template-columns: 1fr;
  }

  .proposal-hero__rail,
  .proposal-architecture-grid,
  .proposal-outcome-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .proposal-problem-grid,
  .proposal-solution-grid,
  .proposal-fit-grid,
  .proposal-architecture-grid,
  .proposal-outcome-grid,
  .proposal-hero__rail,
  .proposal-compare-table {
    grid-template-columns: 1fr;
  }

  .proposal-compare-table__head {
    display: none;
  }

  .proposal-compare-table__cell {
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  }
}

@media (max-width: 640px) {
  .proposal-hero,
  .proposal-section-card {
    padding: 20px;
    border-radius: 22px;
  }

  .proposal-feedback-item {
    grid-template-columns: 1fr;
  }
}

.proposal-public-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.09), transparent 22%),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.09), transparent 24%),
    linear-gradient(180deg, #eff6ff 0%, #f8fafc 32%, #eef5ff 100%);
  color: var(--text-primary);
}

.proposal-public-main {
  width: min(1080px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.proposal-public-topbar,
.proposal-public-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
}

.proposal-public-topbar__name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.proposal-public-topbar__sub {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.proposal-public-topbar__actions,
.proposal-public-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proposal-public-topbar__actions a,
.proposal-public-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.16);
  background: #fff;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.84rem;
}

.proposal-public-footer {
  margin-top: 14px;
  margin-bottom: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .proposal-public-topbar,
  .proposal-public-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .proposal-public-main {
    width: min(1320px, calc(100vw - 20px));
    padding-top: 18px;
    padding-bottom: 26px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  html,
  body,
  .proposal-public-body {
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .proposal-public-main {
    width: 190mm;
    padding: 0;
  }

  .proposal-public-topbar,
  .proposal-public-footer {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .proposal-public-topbar__actions,
  .proposal-public-footer__links {
    display: none;
  }

  .proposal-shell {
    gap: 8px;
  }

  .proposal-hero,
  .proposal-section-card {
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .proposal-hero {
    padding: 18px;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
    gap: 14px;
  }

  .proposal-hero__content h1 {
    font-size: 28pt;
    max-width: none;
    text-wrap: pretty;
  }

  .proposal-section-card {
    padding: 16px;
  }

  .proposal-problem-grid,
  .proposal-solution-grid,
  .proposal-fit-grid,
  .proposal-outcome-grid {
    gap: 8px;
  }

  .proposal-problem-card,
  .proposal-solution-card,
  .proposal-fit-card,
  .proposal-outcome-card {
    padding: 12px;
    border-radius: 12px;
  }
}

.page-feedback-button {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e 0%, #0f766e 35%, #14b8a6 100%);
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.25);
  cursor: pointer;
}

.page-feedback-button__badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f766e;
  font-size: 0.74rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-feedback-button:hover {
  transform: translateY(-1px);
}

.page-feedback-panel {
  position: fixed;
  top: 72px;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  z-index: 46;
  display: none;
  overflow: hidden;
}

.page-feedback-panel.open {
  display: flex;
  flex-direction: column;
}

.page-feedback-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.96) 0%, rgba(255, 255, 255, 0.96) 100%);
}

.page-feedback-panel__header h3 {
  font-size: 1rem;
  font-weight: 800;
}

.page-feedback-panel__header p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.page-feedback-panel__close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
}

.page-feedback-panel__body {
  flex: 1;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.page-feedback-form {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(248, 250, 252, 0.7);
}

.page-feedback-form__row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.page-feedback-form__row label,
.page-feedback-list-section__head h4 {
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
}

.page-feedback-form__row select,
.page-feedback-form__row textarea,
.page-feedback-card__admin textarea,
.page-feedback-card__admin select {
  width: 100%;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  color: var(--text-primary);
  font: inherit;
}

.page-feedback-form__row textarea,
.page-feedback-card__admin textarea {
  resize: vertical;
  min-height: 92px;
}

.page-feedback-form__actions,
.page-feedback-card__admin-actions,
.page-feedback-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-feedback-target-chip {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 700;
}

.page-feedback-screenshot-preview {
  margin-top: 10px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  position: relative;
}

.page-feedback-screenshot-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.page-feedback-annotation-toolbar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-feedback-screenshot-stage {
  position: relative;
  line-height: 0;
}

.page-feedback-screenshot-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.page-feedback-list-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page-feedback-list-section__head {
  padding: 14px 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.page-feedback-list {
  flex: 1;
  overflow: auto;
  padding: 0 18px 18px;
  display: grid;
  gap: 12px;
}

.page-feedback-empty,
.page-feedback-loading {
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 16px;
  color: var(--text-secondary);
  background: rgba(248, 250, 252, 0.9);
}

.page-feedback-card {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.page-feedback-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.page-feedback-card__badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.page-feedback-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.page-feedback-badge.type-bug {
  background: #fef2f2;
  color: #b91c1c;
}

.page-feedback-badge.priority-p0 {
  background: #7f1d1d;
  color: #fef2f2;
}

.page-feedback-badge.priority-p1 {
  background: #78350f;
  color: #fff7ed;
}

.page-feedback-badge.priority-p2 {
  background: #334155;
  color: #f8fafc;
}

.page-feedback-badge.type-improvement {
  background: #eff6ff;
  color: #1d4ed8;
}

.page-feedback-badge.type-question {
  background: #fff7ed;
  color: #c2410c;
}

.page-feedback-badge.status-new {
  background: #f8fafc;
  color: #334155;
}

.page-feedback-badge.status-reviewing {
  background: #eef2ff;
  color: #4338ca;
}

.page-feedback-badge.status-planned {
  background: #ecfeff;
  color: #0f766e;
}

.page-feedback-badge.status-resolved,
.page-feedback-badge.status-explained {
  background: #ecfdf5;
  color: #047857;
}

.page-feedback-badge.status-on_hold {
  background: #fff7ed;
  color: #9a3412;
}

.page-feedback-card__message,
.page-feedback-card__response {
  white-space: pre-wrap;
  font-size: 0.88rem;
}

.page-feedback-card__message {
  color: #0f172a;
}

.page-feedback-card__response {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  color: #334155;
}

.page-feedback-card__confirm {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.82rem;
  font-weight: 700;
}

.page-feedback-card__meta {
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.page-feedback-card__target {
  font-weight: 700;
  color: #0f766e;
}

.page-feedback-card__screenshot {
  display: block;
  margin-top: 10px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
}

.page-feedback-card__screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.page-feedback-card__admin {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  display: grid;
  gap: 8px;
}

.page-feedback-target-overlay {
  position: fixed;
  z-index: 47;
  border: 2px solid #14b8a6;
  border-radius: 12px;
  background: rgba(20, 184, 166, 0.12);
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.1);
}

.hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .page-feedback-button {
    right: 16px;
    bottom: 84px;
  }

  .page-feedback-panel {
    top: 64px;
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
  }
}
