﻿:root {
  --brand-primary: #0b4f8d;
  --brand-primary-strong: #083766;
  --brand-accent: #ff7b36;
  --brand-accent-soft: #ffb07a;
  --bg: #eef3f9;
  --bg-panel: #f8fbff;
  --surface: #ffffff;
  --surface-muted: #f4f7fc;
  --text: #172536;
  --text-soft: #4d627c;
  --text-muted: #70849e;
  --line: #d8e3f1;
  --line-strong: #b9cae0;
  --success: #148a55;
  --warning: #b26e12;
  --danger: #c93f3f;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --shadow-xs: 0 6px 16px rgba(11, 54, 99, 0.08);
  --shadow-sm: 0 12px 28px rgba(11, 54, 99, 0.12);
  --shadow-md: 0 20px 44px rgba(7, 37, 69, 0.18);
  --focus: 0 0 0 3px rgba(255, 123, 54, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Source Sans Pro", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -20%, rgba(11, 79, 141, 0.14) 0, transparent 42%),
    radial-gradient(circle at 92% -10%, rgba(255, 123, 54, 0.08) 0, transparent 28%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.65rem;
  background: linear-gradient(96deg, #062a50 0%, #0a4b83 70%, #0c5f9a 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(6, 33, 63, 0.28);
}

.brand a {
  font-size: 1.3rem;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}
.btn, .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.58rem 1.02rem;
  border-radius: var(--radius-xs);
  text-decoration: none;
  margin: 0.15rem 0.1rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn {
  background: var(--surface-muted);
  border-color: var(--line-strong);
  color: var(--brand-primary-strong);
}
.btn-primary {
  background: linear-gradient(135deg, #0d5ea4 0%, #0a467a 100%);
  border-color: #0a467a;
  color: #fff;
  box-shadow: 0 10px 20px rgba(10, 70, 122, 0.25);
}
.btn:hover {
  background: #edf3fb;
  border-color: #9cb5d2;
  transform: translateY(-1px);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #0b528f 0%, #083c69 100%);
  transform: translateY(-1px);
}
.btn:active, .btn-primary:active {
  transform: translateY(0);
}
.btn:disabled, .btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn:focus-visible,
.btn-primary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.flash { list-style: none; padding: 0; }
.flash li { margin: 0.5rem 0; padding: 0.6rem 0.8rem; border-radius: 6px; }
.flash li.success { background: #e3fcef; }
.flash li.danger { background: #ffe3e3; }
.flash li.info { background: #e0f2ff; }
.hero { background: var(--surface); padding: 2rem; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 1rem; }
.card { background: var(--surface); padding: 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: 0.68rem 0.82rem; border-bottom: 1px solid var(--line); }
.table th { font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.table-compact td { padding: 0.3rem 0.5rem; }
.form-grid { display: grid; gap: 0.7rem; background: var(--surface); padding: 1.2rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); border: 1px solid var(--line); }
.form-grid fieldset { border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 0.6rem; }
.form-grid legend { padding: 0 0.4rem; }
.form-grid label { display: flex; flex-direction: column; font-weight: 700; font-size: 0.86rem; color: var(--text-soft); }
.form-compact { display: flex; flex-direction: column; gap: 0.6rem; background: var(--surface); padding: 1.2rem; border-radius: var(--radius-sm); width: 320px; border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
input, select, textarea {
  padding: 0.58rem 0.68rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-strong);
  background: #fbfdff;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
input:hover, select:hover, textarea:hover {
  border-color: #95afcf;
}
.checkbox { flex-direction: row; align-items: center; gap: 0.5rem; }
.designer { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; margin: 2rem 0; background: white; padding: 1.5rem; border-radius: 12px; box-shadow: 0 6px 24px rgba(3,31,61,0.15); }
.designer .charts { display: flex; gap: 1rem; }
.designer figure { background: #0a4e8b0d; padding: 0.5rem; border-radius: 10px; text-align: center; }
.designer .controls label { display: flex; flex-direction: column; font-size: 0.85rem; margin-bottom: 0.7rem; }
.designer input[type=range] { width: 100%; }
.footer {
  text-align: center;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(95deg, #062a50 0%, #0a4b83 100%);
  color: rgba(255, 255, 255, 0.88);
  margin-top: 2.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.color-samples { list-style: none; padding: 0; display: flex; gap: 1rem; }
.color-samples span { display: inline-block; width: 32px; height: 32px; border-radius: 50%; margin-right: 0.5rem; }
.separator td { background: #f4f7fb; height: 6px; }
@media (max-width: 900px) { .designer { grid-template-columns: 1fr; } .designer .charts { flex-direction: column; align-items: center; } }

.brand {
  display: flex;
  align-items: center;
}

.brand-logo img {
  height: 38px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(3, 26, 52, 0.32));
}

.brand span {
  margin-left: 0.8rem;
  font-size: 0.9rem;
  color: rgba(229, 239, 255, 0.86);
  letter-spacing: 0.02em;
}

.form-grid-wide { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-field { display: flex; flex-direction: column; gap: 0.35rem; }
.form-field-span { grid-column: span 2; }
.form-field.checkbox { flex-direction: row; align-items: center; gap: 0.5rem; grid-column: span 2; }
.form-field.checkbox input { margin: 0; }
.required { color: #d12c2c; margin-left: 0.25rem; }
.error { color: #d12c2c; font-size: 0.85rem; }
.help { font-size: 0.8rem; color: #4b5563; }
.password-field { display: flex; align-items: center; gap: 0.5rem; }
.password-field input { flex: 1; }
.password-toggle { border: 1px solid #c7d2e0; background: #f4f7fb; color: #0A4E8B; padding: 0.35rem 0.6rem; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }
.password-toggle:hover { background: #dbe2ef; }
.password-toggle[aria-pressed="true"] { background: #0A4E8B; color: #fff; }
.form-compact .form-field { margin-bottom: 0.75rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 31, 61, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.dialog-backdrop[hidden] {
  display: none;
}
.dialog {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(3, 31, 61, 0.25);
  max-width: 420px;
  text-align: center;
}
.dialog p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  color: #1f2933;
}
.antenna-use-dialog {
  position: relative;
  width: min(560px, calc(100vw - 2rem));
  max-width: 560px;
  text-align: left;
}
.antenna-use-close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: #eef2f7;
  color: #0f172a;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.antenna-use-eyebrow {
  margin: 0 0 0.35rem;
  color: #0a4e8b;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.antenna-use-dialog h2 {
  margin: 0 2rem 0.55rem 0;
  font-size: 1.35rem;
  color: #102033;
}
.antenna-use-dialog .antenna-use-summary {
  margin: 0 0 1rem;
  color: #475467;
  font-size: 0.95rem;
}
.antenna-use-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.6rem 0 1rem;
}
.antenna-use-projects {
  border-top: 1px solid #e5edf7;
  padding-top: 0.9rem;
}
.antenna-use-projects h3 {
  margin: 0 0 0.2rem;
  color: #102033;
  font-size: 1rem;
}
.antenna-use-list {
  display: grid;
  gap: 0.55rem;
  max-height: min(44vh, 320px);
  overflow: auto;
  padding-right: 0.2rem;
}
.antenna-use-project {
  display: grid;
  gap: 0.18rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  background: #f8fbff;
  color: #102033;
  text-decoration: none;
}
.antenna-use-project:hover {
  border-color: #9cb5d2;
  background: #edf5ff;
}
.antenna-use-project span,
.antenna-use-empty,
.antenna-use-status {
  color: #64748b;
  font-size: 0.86rem;
}
.antenna-use-status {
  min-height: 1.1rem;
  margin: 0.85rem 0 0;
}
.antenna-duplicate-dialog {
  position: relative;
  width: min(500px, calc(100vw - 2rem));
  max-width: 500px;
  text-align: left;
}
.antenna-duplicate-dialog h2 {
  margin: 0 2rem 0.45rem 0;
  color: #102033;
  font-size: 1.35rem;
}
.antenna-duplicate-close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: #eef2f7;
  color: #0f172a;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.antenna-duplicate-dialog .antenna-duplicate-summary {
  margin: 0 0 1rem;
  color: #475467;
  font-size: 0.95rem;
}
.antenna-duplicate-dialog form,
.antenna-duplicate-dialog label {
  display: grid;
  gap: 0.45rem;
}
.antenna-duplicate-dialog label {
  color: #26384d;
  font-weight: 700;
}
.antenna-duplicate-dialog input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.75rem;
  border: 1px solid #b8c7d9;
  border-radius: 8px;
  color: #102033;
  font: inherit;
}
.antenna-duplicate-dialog input[type="text"]:focus {
  border-color: #0d5ea4;
  outline: 3px solid rgba(13, 94, 164, 0.16);
}
.antenna-duplicate-dialog .help {
  margin: 0;
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.4;
}
.antenna-duplicate-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.55rem;
}
.modal-global-close-host {
  position: relative;
}
.modal-global-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 20;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
}
.modal-global-close:hover {
  background: #1e293b;
  border-color: rgba(59, 130, 246, 0.45);
}
@media (max-width: 720px), (pointer: coarse) {
  .modal-global-close {
    top: 0.45rem;
    right: 0.45rem;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 1.18rem;
  }
  .modal :is(.btn, .btn-primary),
  [role="dialog"] :is(.btn, .btn-primary),
  [role="alertdialog"] :is(.btn, .btn-primary),
  .ds-modal :is(.btn-primary, .btn-secondary, .secondary),
  .dialog :is(.btn, .btn-primary) {
    min-height: 34px;
    padding: 0.38rem 0.58rem;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.15;
  }
}
.password-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.password-toggle .icon-eye::before {
  content: '\1F441';
}
.password-toggle.is-active .icon-eye::before {
  content: '\1F648';
}
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-top: 1rem;
}
.pattern-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: start;
}
.pattern-preview-grid figure {
  background: #fff;
  border: 1px solid #dbe2ef;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(3, 31, 61, 0.08);
  padding: 0.75rem;
  display: grid;
  gap: 0.35rem;
}
.pattern-preview-grid img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e5ecf5;
}
.pattern-preview-grid figcaption {
  font-weight: 600;
  color: #0A4E8B;
}
.pattern-preview-grid ul {
  margin: 0;
  padding-left: 1rem;
  color: #4a5568;
  font-size: 0.9rem;
}
.pattern-preview-grid li {
  margin-bottom: 0.2rem;
}
.pattern-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(3, 31, 61, 0.12);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pattern-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.pattern-card canvas {
  width: 100%;
  height: 200px;
}
.pattern-upload label {
  font-weight: 600;
}

.inline-info { font-size: 0.9rem; color: #0A4E8B; margin: 0.4rem 0; }
.inline-info strong { font-weight: 600; }


.form-section { border: 1px solid #dbe2ef; border-radius: 12px; padding: 1rem; background: #fff; box-shadow: 0 6px 14px rgba(3,31,61,0.08); margin: 0.8rem 0; }
.form-section legend { font-weight: 600; padding: 0 0.5rem; color: #0A4E8B; }

.project-autosave-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #dbe2ef;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.92rem;
  line-height: 1.3;
}
.project-autosave-bar[hidden] {
  display: none;
}
.project-autosave-dot {
  width: 0.58rem;
  height: 0.58rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #64748b;
}
.project-autosave-bar.is-saving .project-autosave-dot {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}
.project-autosave-bar.is-saved .project-autosave-dot {
  background: #15803d;
}
.project-autosave-bar.is-warn .project-autosave-dot {
  background: #b45309;
}
.project-autosave-bar.is-error .project-autosave-dot {
  background: #b91c1c;
}



.pattern-visuals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.pattern-figure {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(3, 31, 61, 0.12);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.pattern-figure header h2,
.pattern-figure header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0A4E8B;
}

.pattern-figure img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #dbe2ef;
  background: #f7f9fc;
}
.pattern-entry__titles {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.pattern-entry__badge {
  display: inline-block;
  background: #ffe3e3;
  color: #9b1b1b;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}
.pattern-entry--removed {
  opacity: 0.65;
  border: 1px dashed #f87171;
}
.btn-danger {
  background: #f06565;
  color: #fff;
}

.eftx-inline-form {
  display: inline;
}

.eftx-inline-block-form {
  display: inline-block;
  margin-top: 0.5rem;
}

.eftx-opacity-label {
  display: inline-block;
  min-width: 110px;
}

.rf-catalog .rf-catalog-sidebar {
  top: 84px;
}

.metric-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #1f2933;
}

.metric-list li {
  background: #f4f7fb;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
}
.app-shell {
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 72px;
  --shell-height: calc(100vh - 160px);
  display: grid;
  grid-template-columns: var(--sidebar-width) 8px 1fr;
  gap: 0;
  min-height: 420px;
  height: var(--shell-height);
  overflow: hidden;
}
.app-shell.sidebar-collapsed {
  --sidebar-width: var(--sidebar-collapsed-width);
}
.app-public .app-shell {
  display: block;
  min-height: 0;
  height: auto;
}
.sidebar {
  width: 100%;
  min-width: 200px;
  background:
    radial-gradient(circle at 18% -8%, rgba(255, 255, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #062448 0%, #0a3f73 62%, #0b5a98 100%);
  color: #ccdaf2;
  padding: 1.25rem 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  height: 100%;
  overflow: auto;
}
.app-shell.sidebar-collapsed .sidebar {
  min-width: var(--sidebar-collapsed-width);
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  overflow-x: hidden;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
}
.sidebar-group-title {
  margin: 0.2rem 0 0.38rem;
  padding: 0 0.65rem;
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(204, 218, 242, 0.62);
  font-weight: 700;
}
.app-shell.sidebar-collapsed .sidebar-group-title,
.app-shell.sidebar-collapsed .sidebar-label,
.app-shell.sidebar-collapsed .sidebar-footer {
  display: none;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  padding: 0.62rem 0.7rem;
  border-radius: 10px;
  color: #d5e5ff;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.14s ease;
}
.app-shell.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding-left: 0.52rem;
  padding-right: 0.52rem;
}
.sidebar-icon {
  width: 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(217, 230, 255, 0.92);
}
.app-shell.sidebar-collapsed .sidebar-icon {
  width: 1.55rem;
}
.sidebar-label {
  flex: 1;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateX(1px);
}
.sidebar-link.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: inset 2px 0 0 rgba(255, 176, 122, 0.95), 0 8px 20px rgba(3, 21, 40, 0.22);
}
.sidebar-link.active .sidebar-icon {
  color: #fff;
}
.sidebar-footer {
  margin-top: auto;
  font-size: 0.75rem;
  opacity: 0.82;
  letter-spacing: 0.08em;
  color: rgba(221, 232, 250, 0.72);
  padding: 0.8rem 0.7rem 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.workspace {
  padding: 2rem 2.4rem 2.2rem;
  max-width: none;
  width: 100%;
  margin: 0;
  min-width: 0;
  height: 100%;
  overflow: auto;
}

.app-shell-splitter {
  width: 8px;
  cursor: col-resize;
  background: rgba(3, 31, 61, 0.08);
}

.app-shell-splitter:hover {
  background: rgba(3, 31, 61, 0.2);
}

.app-shell-hsplitter {
  height: 8px;
  cursor: row-resize;
  background: rgba(3, 31, 61, 0.08);
}

.app-shell-hsplitter:hover {
  background: rgba(3, 31, 61, 0.2);
}
.app-public .workspace {
  padding: 2rem;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.topbar-actions a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.topbar-actions a:hover {
  color: #fff;
  opacity: 0.95;
}
.topbar-actions .btn-primary {
  padding: 0.45rem 1rem;
}
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}
.topbar-news-link {
  background: rgba(255, 255, 255, 0.14);
}
.language-switcher {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.language-switcher select {
  min-height: 38px;
  max-width: 132px;
  padding: 0.42rem 1.85rem 0.42rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.language-switcher select option {
  color: #172536;
  background: #ffffff;
}
.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.logout-form {
  margin: 0;
}
.logout-button {
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.topbar-actions .logout-button {
  color: #ffffff;
}
.sidebar-logout-form,
.sidebar-logout-form .sidebar-link {
  width: 100%;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.16);
  padding: 0.4rem 0.86rem;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.02em;
}
.logout-link {
  border: 1px solid rgba(255, 255, 255, 0.38);
  padding: 0.38rem 0.82rem;
  border-radius: 8px;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.logout-link:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.56);
  transform: translateY(-1px);
}
.topbar-logout {
  background: rgba(220, 68, 68, 0.16);
  border-color: rgba(255, 170, 170, 0.46);
}
.dashboard-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: stretch;
  background: #fff;
  border-radius: 18px;
  padding: 2rem;
  box-shadow: 0 24px 60px rgba(3, 31, 61, 0.18);
  margin-bottom: 2.5rem;
}
.hero-intro {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.hero-intro h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--brand-primary);
}
.hero-intro p {
  margin: 0;
  color: #475569;
  line-height: 1.6;
}
.metric-grid {
  flex: 1 1 260px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.metric-card {
  background: linear-gradient(135deg, #0a4e8b 0%, #133b67 100%);
  color: #fff;
  padding: 1.2rem 1.4rem;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(10, 78, 139, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.metric-card span {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}
.metric-card strong {
  font-size: 1.8rem;
}
.dashboard-section {
  background: #fff;
  border-radius: 16px;
  padding: 1.8rem;
  box-shadow: 0 14px 32px rgba(3, 31, 61, 0.15);
  margin-bottom: 2.5rem;
}
.dashboard-section h2 {
  margin-top: 0;
  color: var(--brand-primary);
}
.dashboard-activity .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.activity-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
  background: #f8fbff;
  display: grid;
  gap: 0.5rem;
}
.activity-card h3 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}
.activity-card .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}
.activity-card p {
  margin: 0;
  color: #475569;
  font-size: 0.85rem;
}
.activity-card time {
  font-size: 0.75rem;
  color: #64748b;
}
.activity-card .muted {
  font-size: 0.75rem;
  color: #94a3b8;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.summary-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
}
.summary-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.summary-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.summary-card li {
  display: grid;
  gap: 0.35rem;
}
.summary-card li small {
  color: #64748b;
  font-size: 0.75rem;
}
.summary-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.85rem;
}
.dashboard-export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.dashboard-export-meta {
  margin: 0 0 1rem;
  color: #475569;
  font-size: 0.9rem;
}
.dashboard-export-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
  display: grid;
  gap: 0.55rem;
  background: #f8fbff;
}
.dashboard-export-card.is-pending {
  background: #fff7ed;
  border-color: #fdba74;
}
.dashboard-export-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.dashboard-export-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
}
.dashboard-export-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
}
.dashboard-export-pill.is-pending {
  background: #ffedd5;
  color: #9a3412;
}
.dashboard-export-card p {
  margin: 0;
  color: #475569;
  font-size: 0.85rem;
}
.dashboard-export-card small {
  color: #64748b;
  font-size: 0.78rem;
}
.dashboard-export-card time {
  color: #64748b;
  font-size: 0.75rem;
}
.btn-primary.btn-disabled {
  opacity: 0.6;
  pointer-events: none;
}
.project-table {
  width: 100%;
  border-collapse: collapse;
}
.project-table th {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #64748b;
}
.project-table td,
.project-table th {
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}
.project-table tbody tr:hover {
  background: #f8fbff;
}
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(10, 78, 139, 0.12);
  color: var(--brand-primary);
}
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.quick-actions .btn-primary {
  margin: 0;
}
.admin-access-section p {
  margin: 0;
  color: #475569;
}
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.admin-metric-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
  background: #f8fbff;
  display: grid;
  gap: 0.4rem;
}
.admin-metric-card span {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 700;
}
.admin-metric-card strong {
  color: #0f172a;
  font-size: 1.7rem;
  line-height: 1.1;
}
.admin-online-block {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
  background: #ffffff;
}
.admin-online-block h3 {
  margin: 0 0 0.85rem;
  color: #0f172a;
  font-size: 1rem;
}
.admin-online-list {
  margin: 0;
}
.admin-online-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-online-list li div {
  display: grid;
  gap: 0.2rem;
}
.admin-online-list li small {
  color: #64748b;
}
.admin-online-list li span {
  color: #334155;
  font-size: 0.9rem;
}
.pb-import-banner {
  display: grid;
  gap: 0.25rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  background: #f8fafc;
  color: #0f172a;
}
.pb-import-banner.is-running {
  border-color: #f59e0b;
  background: #fffbeb;
}
.pb-import-banner.is-error {
  border-color: #ef4444;
  background: #fef2f2;
}
.pb-summary-grid .card ul.pb-summary-list {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}
.pb-summary-list li code {
  display: inline-block;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.pb-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.58rem;
  font-weight: 700;
  font-size: 0.78rem;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pb-status-pill.is-success {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.pb-status-pill.is-running {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.pb-status-pill.is-error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.pb-status-pill.is-busy {
  background: #e0f2fe;
  color: #0c4a6e;
  border-color: #7dd3fc;
}
.pb-history-section .table td code {
  font-size: 0.78rem;
}
.app-auth .footer {
  margin-top: 2rem;
}
@media (max-width: 1080px) {
  .workspace {
    padding: 2rem;
  }
}
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .app-shell.sidebar-collapsed {
    grid-template-rows: auto;
  }
  .app-shell-splitter,
  .app-shell-hsplitter {
    display: none;
  }
  .sidebar {
    width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.8rem;
    max-height: calc(100dvh - 76px);
    overflow: auto;
  }
  .app-shell.sidebar-collapsed .sidebar {
    display: none;
  }
  .sidebar-nav {
    width: 100%;
    flex-direction: column;
    gap: 0.65rem;
    flex-wrap: nowrap;
    overflow: visible;
    padding-bottom: 0.2rem;
  }
  .sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: stretch;
  }
  .sidebar-group-title {
    display: block;
    padding: 0 0.2rem;
  }
  .sidebar-link {
    min-width: 0;
    padding: 0.55rem 0.78rem;
  }
  .app-shell.sidebar-collapsed .sidebar-label,
  .app-shell.sidebar-collapsed .sidebar-group-title {
    display: none;
  }
  .sidebar-footer {
    display: none;
  }
  .dashboard-hero {
    flex-direction: column;
  }
  .metric-grid {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}
.export-card {
  background: #f8fbff;
  border-radius: 14px;
  padding: 1.2rem;
  box-shadow: 0 12px 24px rgba(3, 31, 61, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.export-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.export-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--brand-primary);
}
.export-card time {
  font-size: 0.85rem;
  color: #64748b;
}
.header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-with-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-badge-dev {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(234, 179, 8, 0.55);
  color: #7a5200;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.export-panel {
  margin: 2.5rem 0;
}

.export-panel h2 {
  margin-bottom: 1.2rem;
  color: var(--brand-primary);
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
  perspective: 1200px;
}

.export-history-list {
  display: grid;
  gap: 1.5rem;
}

.export-batch {
  display: grid;
  gap: 0.9rem;
}

.export-batch-header h3 {
  margin: 0;
  color: var(--brand-primary);
}

.export-card {
  position: relative;
  padding: 1.6rem;
  border-radius: 18px;
  color: #fff;
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 25px 45px rgba(10, 78, 139, 0.25);
  background: linear-gradient(135deg, #0a4e8b 0%, #143b67 100%);
}

.export-card::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.export-card:hover {
  transform: rotateY(-6deg) rotateX(4deg);
  box-shadow: 0 35px 55px rgba(10, 78, 139, 0.35);
}

.export-card header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.export-icon {
  font-size: 1.8rem;
}

.export-card p {
  margin: 0 0 1.2rem 0;
  color: rgba(255, 255, 255, 0.85);
}

.export-action {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease;
}

.export-action:hover {
  background: rgba(255, 255, 255, 0.3);
}

.export-card--pdf {
  background: linear-gradient(135deg, #ff6a3d 0%, #d94b1c 100%);
}

.export-card--pat {
  background: linear-gradient(135deg, #00a7c4 0%, #006f93 100%);
}

.export-card--prn {
  background: linear-gradient(135deg, #8a5cf6 0%, #5a38c4 100%);
}

.export-card--bundle {
  background: linear-gradient(135deg, #31c46b 0%, #1f8c49 100%);
}

@media (max-width: 720px) {
  .export-card {
    transform: none !important;
  }
}

.assistant-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: #0a4e8b;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(3, 31, 61, 0.28);
  z-index: 2200;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.assistant-page-help {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(10, 78, 139, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: #0a4e8b;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(3, 31, 61, 0.18);
  z-index: 2200;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.assistant-page-help:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(3, 31, 61, 0.24);
  background: #f5f9ff;
}

.assistant-page-help:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

html.assistant-panel-open .assistant-page-help {
  display: none;
}

.assistant-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(3, 31, 61, 0.32);
}

.assistant-toggle .assistant-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb347 0%, #ff6a3d 100%);
  color: #031f3d;
  font-size: 1.25rem;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.assistant-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: min(780px, calc(100% - 3rem));
  height: min(620px, calc(100vh - 7rem));
  min-width: 520px;
  min-height: 380px;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  display: none;
  flex-direction: column;
  background: #fefefe;
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(3, 31, 61, 0.28);
  overflow: hidden;
  z-index: 2200;
  border: 1px solid rgba(10, 78, 139, 0.12);
}

.assistant-panel.is-open {
  display: flex;
}

html.assistant-panel-open,
html.assistant-panel-open body {
  overflow: hidden;
}

.assistant-panel.is-loading {
  opacity: 0.8;
}

.assistant-panel.is-moving,
.assistant-panel.is-resizing {
  user-select: none;
}

.assistant-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 0.9rem 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(10, 78, 139, 0.96), rgba(3, 31, 61, 0.96));
  color: #fff;
  cursor: move;
  touch-action: none;
}

.assistant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.assistant-title {
  min-width: 0;
  flex: 1 1 auto;
}

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

.assistant-title span {
  font-size: 0.75rem;
  opacity: 0.85;
}

.assistant-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}

.assistant-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.assistant-conversation-sidebar {
  width: 210px;
  flex: 0 0 210px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f7fafc;
  border-right: 1px solid rgba(10, 78, 139, 0.12);
}

.assistant-conversation-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid rgba(10, 78, 139, 0.12);
  color: #12324f;
}

.assistant-icon-button,
.assistant-mic-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(10, 78, 139, 0.18);
  border-radius: 8px;
  background: #fff;
  color: #0a4e8b;
  cursor: pointer;
  flex: 0 0 auto;
}

.assistant-icon-button:hover,
.assistant-mic-button:hover,
.assistant-mic-button.is-recording {
  background: #e8f2ff;
  color: #063762;
}

.assistant-mic-button.is-recording {
  border-color: #d12c2c;
  color: #d12c2c;
  box-shadow: 0 0 0 3px rgba(209, 44, 44, 0.12);
}

.assistant-conversation-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem;
  overflow-y: auto;
}

.assistant-conversation-item {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #1f2933;
  text-align: left;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
}

.assistant-conversation-item:hover,
.assistant-conversation-item.is-active {
  background: #fff;
  border-color: rgba(10, 78, 139, 0.18);
}

.assistant-conversation-item strong,
.assistant-conversation-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-conversation-item strong {
  font-size: 0.84rem;
}

.assistant-conversation-item span {
  font-size: 0.72rem;
  color: rgba(31, 41, 51, 0.66);
}

.assistant-chat-area {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.assistant-window-button,
.assistant-close,
.assistant-back-button {
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
}

.assistant-window-button,
.assistant-close {
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.assistant-close {
  font-size: 1.5rem;
  padding: 0;
  line-height: 1;
}

.assistant-window-button:hover,
.assistant-close:hover,
.assistant-back-button:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.assistant-messages {
  flex: 1;
  min-height: 0;
  padding: 1rem 1.2rem;
  overflow-y: auto;
  background: linear-gradient(180deg, #f5f9ff 0%, #ffffff 45%);
}

.assistant-message {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  max-width: 100%;
}

.assistant-message.from-user {
  align-items: flex-end;
}

.assistant-message.from-assistant {
  align-items: flex-start;
}

.assistant-bubble {
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(3, 31, 61, 0.12);
  background: #0a4e8b;
  color: #fff;
  max-width: min(92%, 34rem);
  white-space: pre-wrap;
  word-break: break-word;
}

.assistant-message.from-assistant .assistant-bubble {
  background: #ffffff;
  color: #1f2933;
  border: 1px solid rgba(10, 78, 139, 0.12);
  box-shadow: 0 12px 24px rgba(3, 31, 61, 0.12);
}

.assistant-meta {
  font-size: 0.7rem;
  color: rgba(31, 41, 51, 0.6);
}

.assistant-message.from-user .assistant-meta {
  color: rgba(255, 255, 255, 0.75);
}

.assistant-status {
  min-height: 1.3rem;
  padding: 0 1.2rem 0.4rem;
  font-size: 0.8rem;
  color: #0a4e8b;
}

.assistant-status.error {
  color: #d12c2c;
}

.assistant-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem 1.2rem 1.15rem;
  background: #fff;
  border-top: 1px solid rgba(10, 78, 139, 0.12);
  flex: 0 0 auto;
}

.assistant-form textarea {
  min-height: 64px;
  resize: none;
  border-radius: 12px;
  border: 1px solid rgba(10, 78, 139, 0.25);
  padding: 0.75rem;
  font-family: inherit;
  line-height: 1.35;
}

.assistant-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.assistant-form button {
  border: none;
  cursor: pointer;
}

.assistant-audio-cancel[hidden] {
  display: none;
}

.assistant-audio-cancel {
  color: #9f1d1d;
  border-color: rgba(209, 44, 44, 0.28);
  background: #fff7f7;
}

.assistant-audio-cancel:hover {
  background: #ffe8e8;
  border-color: rgba(209, 44, 44, 0.45);
}

.assistant-action-highlight {
  outline: 3px solid #f59e0b !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.22) !important;
  transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

.assistant-feedback {
  display: flex;
  gap: 0.35rem;
  margin-top: -0.1rem;
}

.assistant-feedback button {
  border: 1px solid rgba(10, 78, 139, 0.18);
  border-radius: 999px;
  background: #fff;
  color: #0a4e8b;
  cursor: pointer;
  font-size: 0.72rem;
  padding: 0.22rem 0.5rem;
}

.assistant-feedback button:hover,
.assistant-feedback button.is-selected {
  background: #e8f2ff;
}

.assistant-feedback button:disabled {
  cursor: default;
  opacity: 0.72;
}

.assistant-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  cursor: nwse-resize;
  touch-action: none;
  z-index: 2;
}

.assistant-resize-handle::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(10, 78, 139, 0.45);
  border-bottom: 2px solid rgba(10, 78, 139, 0.45);
}

@media (max-width: 720px), (pointer: coarse) {
  html.assistant-panel-open .assistant-toggle,
  html.assistant-panel-open .assistant-page-help {
    display: none;
  }
  .assistant-page-help {
    left: calc(max(0.85rem, env(safe-area-inset-left)) + 70px);
    right: auto;
    top: calc(100dvh - 58px - max(0.85rem, env(safe-area-inset-bottom)) + 10px);
    bottom: auto;
    min-height: 40px;
    max-width: calc(100vw - 150px);
    padding: 0 0.8rem;
  }
  .assistant-page-help span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .assistant-toggle {
    left: max(0.85rem, env(safe-area-inset-left));
    right: auto;
    top: calc(100vh - 72px);
    top: calc(100dvh - 58px - max(0.85rem, env(safe-area-inset-bottom)));
    bottom: auto;
    width: 58px;
    height: 58px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .assistant-toggle .assistant-label {
    display: none;
  }
  .assistant-toggle .assistant-icon {
    width: 38px;
    height: 38px;
  }
  .assistant-panel {
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: 0;
    z-index: 2600;
  }
  .assistant-panel.is-mobile-layout {
    width: 100vw !important;
    height: 100dvh !important;
  }
  .assistant-header {
    cursor: default;
    touch-action: auto;
    padding: calc(0.72rem + env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) 0.72rem max(0.75rem, env(safe-area-inset-left));
    gap: 0.65rem;
  }
  .assistant-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }
  .assistant-title strong {
    font-size: 0.92rem;
  }
  .assistant-title span {
    font-size: 0.68rem;
  }
  .assistant-header-actions {
    gap: 0.25rem;
  }
  .assistant-window-button[data-role="reset-layout"],
  .assistant-resize-handle {
    display: none;
  }
  .assistant-body {
    flex-direction: column;
    min-height: 0;
  }
  .assistant-conversation-sidebar {
    width: 100%;
    flex: 0 0 auto;
    max-height: 104px;
    border-right: 0;
    border-bottom: 1px solid rgba(10, 78, 139, 0.12);
  }
  .assistant-conversation-sidebar-header {
    padding: 0.5rem 0.7rem 0.35rem;
    min-height: 38px;
  }
  .assistant-icon-button,
  .assistant-mic-button {
    width: 44px;
    height: 44px;
    border-radius: 10px;
  }
  .assistant-conversation-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.45rem;
    padding: 0.35rem 0.65rem 0.6rem;
    -webkit-overflow-scrolling: touch;
  }
  .assistant-conversation-item {
    min-width: 150px;
    max-width: 210px;
    padding: 0.5rem 0.55rem;
    background: #fff;
    border-color: rgba(10, 78, 139, 0.12);
  }
  .assistant-chat-area {
    min-height: 0;
  }
  .assistant-messages {
    padding: 0.78rem 0.72rem;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .assistant-bubble {
    max-width: 94%;
    border-radius: 12px;
    padding: 0.68rem 0.74rem;
    font-size: 0.92rem;
  }
  .assistant-status {
    min-height: 1.15rem;
    padding: 0 0.78rem 0.25rem;
    font-size: 0.74rem;
  }
  .assistant-form {
    gap: 0.55rem;
    padding: 0.72rem max(0.72rem, env(safe-area-inset-right)) max(0.78rem, env(safe-area-inset-bottom)) max(0.72rem, env(safe-area-inset-left));
  }
  .assistant-form textarea {
    min-height: 58px;
    max-height: 112px;
    font-size: 16px;
    border-radius: 10px;
  }
  .assistant-actions {
    display: grid;
    grid-template-columns: 44px minmax(74px, 1fr) minmax(86px, 1.2fr);
    gap: 0.45rem;
    align-items: stretch;
  }
  .assistant-panel.is-recording-audio .assistant-actions {
    grid-template-columns: 44px minmax(82px, 1fr) minmax(72px, 0.8fr) minmax(84px, 1fr);
  }
  .assistant-actions .btn-primary,
  .assistant-actions .btn-secondary {
    min-height: 44px;
    margin: 0;
    padding: 0 0.72rem;
    border-radius: 10px;
    font-size: 0.84rem;
    white-space: nowrap;
  }
  .assistant-agent-selection-title {
    padding: 0.65rem 0.78rem;
  }
  .assistant-agent-selection-list {
    padding: 0.55rem 0.7rem;
  }
  .assistant-agent-item {
    padding: 0.68rem 0.75rem;
    border-radius: 8px;
  }
}
/* Admin data manager enhancements */
.data-manager .section-intro {
  margin: 0;
}
.data-manager-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.data-manager-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.data-export-status {
  min-width: 11rem;
  font-size: 0.82rem;
  color: #64748b;
}
.data-export-status[data-state="pending"] {
  color: #b45309;
}
.data-export-status[data-state="success"] {
  color: #047857;
}
.data-export-status[data-state="error"] {
  color: #b91c1c;
}
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}
.data-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: #f9fbff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.data-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(3, 31, 61, 0.16);
}
.data-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}
.data-card h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--brand-primary);
}
.data-card h2 a {
  color: inherit;
  text-decoration: none;
}
.data-card h2 a:hover {
  text-decoration: underline;
}
.data-card-pill {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(10, 78, 139, 0.12);
  color: var(--brand-primary);
}
.data-card dl {
  display: flex;
  gap: 1.6rem;
  margin: 0 0 0.6rem;
}
.data-card dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.data-card dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.data-card-action {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-primary);
  text-decoration: none;
}
.data-card-action:hover {
  text-decoration: underline;
}
.data-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
}
.data-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.data-list-toolbar .toolbar-left,
.data-list-toolbar .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.filter-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #64748b;
}
.filter-field input[type="search"] {
  padding: 0.45rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  min-width: 220px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.filter-field input[type="search"]:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.data-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}
.data-summary-grid article {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: linear-gradient(145deg, #f8fbff, #fff);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.data-summary-grid article span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}
.data-summary-grid article strong {
  font-size: 1.05rem;
  color: #1f2937;
}
.data-list-count {
  font-size: 0.85rem;
  color: #64748b;
}
.admin-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin: 0 0 1.2rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff7f7, #fff);
}
.admin-bulk-status {
  font-size: 0.9rem;
  color: #475569;
}
.admin-bulk-status.is-ready {
  color: #475569;
}
.admin-bulk-status.is-pending {
  color: #b45309;
}
.admin-bulk-status.is-success {
  color: #047857;
}
.admin-bulk-status.is-error {
  color: #b91c1c;
}
.admin-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.admin-bulk-count {
  font-size: 0.82rem;
  color: #64748b;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
  background: #f8fbff;
  color: #1f2937;
  font-size: 0.8rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  margin-right: 0.4rem;
}
.btn-secondary:hover {
  background: #e2ecff;
  border-color: #94a3b8;
}
.btn-secondary.copied {
  background: #16a34a;
  border-color: #15803d;
  color: #fff;
}
.ds-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 25, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 1.5rem;
}
.ds-modal {
  background: #0f1c2e;
  border-radius: 18px;
  width: 720px;
  max-width: 96vw;
  max-height: 96vh;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.ds-modal.ds-modal-large {
  width: 960px;
}
.ds-modal-header,
.ds-modal-footer {
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.ds-modal-header h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #f1f5ff;
}
.ds-modal-body {
  padding: 1rem 1.4rem;
  overflow: auto;
  display: flex;
  gap: 1rem;
  flex: 1;
}
.ds-modal-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}
.ds-modal-footer .btn-primary,
.ds-modal-footer .secondary {
  min-width: 120px;
}
.asset-body {
  flex-wrap: wrap;
}
.ds-asset-grid {
  flex: 1 1 55%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  padding: 0.25rem;
}
.ds-asset-card {
  background: rgba(15, 28, 46, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: #e2e8f0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.ds-asset-card img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}
.ds-asset-card.selected {
  border-color: #3b82f6;
  transform: translateY(-2px);
}
.ds-asset-preview {
  flex: 1 1 40%;
  min-width: 240px;
  background: rgba(15, 28, 46, 0.7);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.ds-asset-preview img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.ds-asset-preview dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0;
}
.ds-asset-preview dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}
.ds-asset-placeholder {
  color: #94a3b8;
}
.ds-dataset-options {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ds-dataset-option {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 28, 46, 0.8);
  color: #e2e8f0;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ds-dataset-option.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
}
.ds-dataset-preview {
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(7, 13, 24, 0.6);
  padding: 1rem;
  overflow: auto;
}
.ds-dataset-preview pre {
  margin: 0;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.ds-diagram-list {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.ds-diagram-card {
  padding: 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 28, 46, 0.75);
  color: #e2e8f0;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.ds-diagram-card.selected {
  border-color: #3b82f6;
  transform: translateY(-2px);
}
.ds-diagram-preview {
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(7, 13, 24, 0.6);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}
.ds-diagram-preview img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.ds-modal-footer .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.table-wrapper {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}
.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}
.data-table thead {
  background: #f8fbff;
}
.data-table th,
.data-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
.data-table tbody tr:hover {
  background: #f8fbff;
}
.data-table tbody tr.is-updated {
  background: #eef6ff;
}
.data-table tbody tr.is-dirty {
  background: #fff4f4;
}
.column-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: #94a3b8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.actions-column {
  white-space: nowrap;
  text-align: right;
}
.admin-inline-input,
.admin-inline-select,
.admin-inline-textarea {
  width: 100%;
  min-width: 120px;
  padding: 0.48rem 0.56rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-size: 0.84rem;
}
.admin-inline-textarea {
  min-height: 82px;
  resize: vertical;
}
.admin-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}
.admin-inline-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}
.data-cell.is-muted {
  color: #94a3b8;
}
.data-cell.is-code code {
  display: inline-block;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.85rem;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 0.2rem 0.35rem;
}
.data-cell.is-json details {
  cursor: pointer;
}
.data-cell.is-json summary {
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 0.45rem;
}
.data-cell.is-json summary::-webkit-details-marker {
  display: none;
}
.data-cell.is-json pre {
  margin: 0;
  padding: 0.75rem;
  background: rgba(10, 78, 139, 0.07);
  border-radius: 10px;
  max-height: 220px;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.35;
}
.data-cell.is-json code {
  display: block;
  font-family: "Consolas", "SFMono-Regular", monospace;
}
.data-cell.is-multiline span {
  white-space: pre-line;
  display: block;
}
.badge-positive {
  background: rgba(16, 185, 129, 0.2);
  color: #047857;
}
.badge-neutral {
  background: rgba(148, 163, 184, 0.25);
  color: #475569;
}
.field-hint {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin: 0.25rem 0 0.6rem;
}
.form-field.is-readonly input {
  background: #f1f5f9;
  color: #64748b;
}
.record-id code {
  font-family: "Consolas", "SFMono-Regular", monospace;
  background: #f1f5f9;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}
.form-actions {
  margin-top: 1.2rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}
.admin-data-modal[hidden] {
  display: none;
}
.admin-user-modal {
  width: min(1120px, 96vw);
}
.admin-user-modal .ds-modal-body {
  padding-top: 0.75rem;
}
.admin-user-modal-subtitle {
  margin: 0.35rem 0 0;
  color: #94a3b8;
  font-size: 0.88rem;
}
.admin-user-modal-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.admin-user-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}
.admin-user-modal-chip {
  min-width: 180px;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.admin-user-modal-chip span {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.admin-user-modal-chip strong {
  display: block;
  margin-top: 0.35rem;
  color: #f8fafc;
  font-size: 0.9rem;
  word-break: break-word;
}
.admin-user-status.is-ready {
  color: #cbd5e1;
}
.admin-user-status.is-pending {
  color: #fbbf24;
}
.admin-user-status.is-success {
  color: #34d399;
}
.admin-user-status.is-error {
  color: #f87171;
}
.admin-user-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.admin-user-field {
  display: flex;
  flex-direction: column;
}
.admin-user-field.is-wide {
  grid-column: 1 / -1;
}
.admin-user-field label {
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 0.2rem;
}
.admin-user-field input,
.admin-user-field select,
.admin-user-field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  padding: 0.8rem 0.9rem;
  font-size: 0.92rem;
}
.admin-user-field textarea {
  min-height: 108px;
  resize: vertical;
}
.admin-user-field input[readonly],
.admin-user-field textarea[readonly],
.admin-user-field select:disabled {
  background: rgba(30, 41, 59, 0.58);
  color: #94a3b8;
  cursor: not-allowed;
}
.admin-toggle-button {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.admin-toggle-button.is-on {
  background: rgba(22, 163, 74, 0.18);
  border-color: rgba(74, 222, 128, 0.45);
  color: #dcfce7;
}
.admin-toggle-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.admin-toggle-pill {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.5);
  position: relative;
  flex: 0 0 auto;
}
.admin-toggle-pill::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.admin-toggle-button.is-on .admin-toggle-pill {
  background: rgba(34, 197, 94, 0.9);
}
.admin-toggle-button.is-on .admin-toggle-pill::after {
  transform: translateX(20px);
}
.admin-toggle-text {
  flex: 1;
  text-align: left;
  font-weight: 600;
}
.admin-user-modal-note {
  max-width: 430px;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.45;
}
.admin-user-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
@media (max-width: 768px) {
  .data-table {
    min-width: 100%;
  }
  .admin-user-modal-grid {
    grid-template-columns: 1fr;
  }
  .admin-user-modal-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

.rf-formula-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rf-formula-pill {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.55), rgba(148, 163, 184, 0.25));
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-family: "JetBrains Mono", "Fira Code", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.rf-formula-pill strong {
  font-weight: 600;
}
/* ========= Portfolio Grid & Cards (escopo local) ========= */
.portfolio .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* colunas consistentes */
  gap: 16px;
  align-items: start; /* não esticar cards */
}

/* Card vira um flex container vertical com rodapé fixo */
.portfolio .card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid rgba(2, 6, 23, 0.06);
  border-radius: 12px;
  padding: 0;                        /* conteúdo controlado pelas seções abaixo */
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  overflow: hidden;
}

.portfolio .card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f2f4f7;
  border-bottom: 1px solid #eef2f7;
  overflow: hidden;
}

/* Imagem normalizada dentro do cabeçalho de mídia. */
.portfolio .card .thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;                  /* corta sem deformar */
  background: #f2f4f7;                /* placeholder de fundo enquanto carrega */
}

/* Placeholder explícito para preservar o layout em todos os navegadores. */
.portfolio .card .thumb-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #f2f4f7;
  color: #98a2b3;
  font-size: 0.9rem;
}

.portfolio .antenna-visibility-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.portfolio .antenna-visibility-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.42rem 0.58rem;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(5px);
}

.portfolio .antenna-visibility-toggle input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #0a7f55;
}

.portfolio .antenna-visibility-toggle label span {
  display: inline;
  margin: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Área de conteúdo do card */
.portfolio .card h3,
.portfolio .card p,
.portfolio .card small,
.portfolio .card span {
  padding: 0 14px;
}

.portfolio .card h3 {
  margin: 12px 0 6px;
  font-size: 1rem;
  line-height: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;             /* evita títulos compridos quebrarem o layout */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portfolio .card p {
  margin: 0 0 8px;
  color: #475467;
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;             /* limita descrição a 3 linhas */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portfolio .card small,
.portfolio .card span {
  display: block;
  color: #667085;
  font-size: 0.85rem;
  margin-bottom: 2px;
}

/* Ações sempre no rodapé do card */
.portfolio .card .card-actions {
  margin-top: auto;                   /* empurra para baixo */
  padding: 10px 14px 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid #eef2f7;
}

.portfolio .card .btn {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  text-decoration: none;
  font-size: .9rem;
}
.portfolio .card .btn:hover { background: #f9fafb; }
.portfolio .card .btn-use-antenna {
  background: #0d5ea4;
  border-color: #0a467a;
  color: #fff;
}
.portfolio .card .btn-use-antenna:hover {
  background: #0a4e8b;
  color: #fff;
}

/* Títulos de seção mais próximos do grid */
.portfolio > h3 {
  margin: 1.25rem 0 0.75rem;
}

/* Agent Selection */
.assistant-panel[data-view="chat"] .assistant-agent-selection {
  display: none;
}
.assistant-panel[data-view="agent-selection"] .assistant-messages,
.assistant-panel[data-view="agent-selection"] .assistant-form {
  display: none;
}

.assistant-agent-selection {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.assistant-agent-selection-title {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  margin: 0;
  border-bottom: 1px solid #eee;
}

.assistant-agent-selection-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.assistant-agent-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  background: #f9f9f9;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.2s, border-color 0.2s;
}

.assistant-agent-item:hover {
  background-color: #f0f0f0;
  border-color: #ccc;
}

.assistant-agent-item-role {
  font-weight: 600;
  color: #333;
}

.assistant-agent-item-desc {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.25rem;
}

.assistant-back-button {
  width: auto;
  padding: 0 0.55rem;
  font-size: 0.75rem;
  white-space: nowrap;
}
