@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap");

:root {
  --bg: #f3f5f8;
  --bg-elevated: #ffffff;
  --panel: #f8fafc;
  --ink: #132034;
  --muted: #5d6b7f;
  --line: #d6dfea;
  --line-strong: #b8c5d8;
  --accent: #ff8a3d;
  --accent-strong: #f56b1f;
  --accent-soft: #fff0e7;
  --teal-soft: #e7f8f5;
  --shadow-sm: 0 8px 20px rgba(17, 35, 63, 0.08);
  --shadow-md: 0 18px 38px rgba(17, 35, 63, 0.13);
  --radius-md: 14px;
  --radius-lg: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  line-height: 1.55;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 138, 61, 0.12), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(12, 180, 148, 0.1), transparent 35%),
    linear-gradient(180deg, #f9fbff 0%, #eef3f9 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  height: 100vh;
  display: grid;
  grid-template-rows: 78px 1fr;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(184, 197, 216, 0.65);
  backdrop-filter: blur(8px);
  background: rgba(248, 251, 255, 0.82);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  justify-self: start;
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: center;
}

.brand img {
  height: 38px;
  width: 38px;
  filter: drop-shadow(0 7px 14px rgba(245, 107, 31, 0.25));
}

.brand-name {
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 600;
  color: var(--muted);
}

.topnav a {
  padding: 9px 6px;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.topnav a:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}

.button {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--ink);
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: #a9b9d1;
  box-shadow: var(--shadow-sm);
}

.button-orange {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 20px rgba(245, 107, 31, 0.28);
}

.button-orange:hover {
  box-shadow: 0 14px 24px rgba(245, 107, 31, 0.33);
}

.button-ghost {
  background: rgba(255, 255, 255, 0.8);
}

#sidebarToggle {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
}

.layout {
  display: grid;
  grid-template-columns: 292px 1fr;
  height: calc(100vh - 78px);
  min-height: 0;
}

.sidebar {
  background: linear-gradient(180deg, #f4f7fc 0%, #eff4fb 100%);
  border-right: 1px solid rgba(184, 197, 216, 0.65);
  display: flex;
  flex-direction: column;
  width: 292px;
  min-height: 0;
  overflow-y: auto;
  transition: width 0.2s ease;
}

.sidebar.collapsed {
  width: 92px;
}

.menu {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.menu-group {
  display: grid;
  gap: 8px;
}

.menu-divider {
  height: 1px;
  background: var(--line-strong);
  margin: 8px 12px;
}

.menu-header {
  padding: 0 16px 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #37465d;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.menu-item:hover {
  background: #e9f0fa;
  color: var(--ink);
  transform: translateX(2px);
}

.menu-item.active {
  background: linear-gradient(135deg, #ffeede 0%, #fff8f1 100%);
  color: var(--accent-strong);
  font-weight: 700;
}

.menu-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.menu-label {
  white-space: nowrap;
}

.sidebar.collapsed .menu-label,
.sidebar.collapsed .meta,
.sidebar.collapsed .user-name,
.sidebar.collapsed .user-role {
  display: none;
}

.sidebar.collapsed .menu-header,
.sidebar.collapsed .menu-divider {
  display: none;
}

.sidebar.collapsed .menu-item {
  justify-content: center;
}

.sidebar.collapsed .credit-block,
.sidebar.collapsed .sidebar-login {
  display: none;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

.credit-block,
.user-block,
.sidebar-login {
  margin: 8px 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.credit-block {
  padding: 14px 16px;
}

.credit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}

.credit-amount {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  margin: 8px 0;
}

.credit-meter {
  height: 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px;
  background: #fff;
}

.credit-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, #4ec8a7 0%, #0eb58f 100%);
  transition: width 0.3s ease;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.user-block {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.user-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-login {
  width: calc(100% - 20px);
  padding: 14px 16px;
  text-align: left;
  border-radius: var(--radius-md);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, #fff8f2 100%);
  border: 1px solid #ffcfaf;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.user-name {
  font-weight: 700;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  color: var(--muted);
  font-size: 13px;
}

.user-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.logout {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #355178;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.logout:hover {
  text-decoration: underline;
}

.content {
  padding: 30px 34px;
  display: grid;
  gap: 22px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #c7d7eb;
  background: #fff;
  font-weight: 700;
  color: #355178;
}

.signal-dot {
  width: 10px;
  height: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-radius: 50%;
}

.hero {
  border: 1px solid #cdd9ea;
  border-radius: var(--radius-lg);
  padding: 26px;
  background:
    radial-gradient(circle at 80% 18%, rgba(245, 107, 31, 0.2), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #fff9f4 100%);
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: rise-in 0.5s ease both;
}

.hero h1 {
  margin: 0;
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  font-size: clamp(1.7rem, 2.3vw, 2.2rem);
  line-height: 1.25;
}

.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 88ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #3c506f;
  padding-top: 10px;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #c9d5e8 0%, rgba(201, 213, 232, 0) 100%);
}

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

.card {
  border: 1px solid #d4dfef;
  border-radius: var(--radius-md);
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  animation: rise-in 0.55s ease both;
}

.grid .card:nth-child(2) {
  animation-delay: 0.06s;
}

.grid .card:nth-child(3) {
  animation-delay: 0.12s;
}

.card h3 {
  margin: 0;
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  font-size: 18px;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.price-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--accent-strong);
  font-weight: 800;
}

.placeholder-pane {
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.view {
  display: grid;
  gap: 16px;
}

.view[hidden] {
  display: none;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.view-header h1 {
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
  margin: 0;
}

.table-wrap {
  border: 1px solid #d3deef;
  border-radius: var(--radius-md);
  background: #fff;
  overflow: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #ebf0f7;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b6287;
  background: #f7faff;
}

.data-table tbody tr:nth-child(even) {
  background: #fcfdff;
}

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

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-filters th {
  background: #edf3fc;
}

.table-filters input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}

.button-small {
  padding: 6px 10px;
  font-size: 12px;
}

.button.danger {
  border-color: #df6583;
  color: #b43756;
}

.button.danger:hover {
  background: #ffeaf0;
}

.empty-state {
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

#settingsTable .settings-value-cell {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.panel,
.credits-balance-card,
.placeholder-card {
  border: 1px solid #d3deef;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.panel,
.placeholder-card {
  padding: 16px;
}

.credits-balance-card {
  padding: 18px;
  background: linear-gradient(150deg, #ffffff 0%, #f6fcfb 100%);
}

.credits-balance-label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.credits-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.credits-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.credits-balance-value {
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
}

#stripePaymentElement {
  margin-top: 12px;
  border: 1px solid #d6e1ef;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

#stripeAutoRefillPaymentElement {
  margin-top: 12px;
  border: 1px solid #d6e1ef;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-form .form-field {
  margin: 0;
}

.placeholder-card {
  display: grid;
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 30, 49, 0.38);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  backdrop-filter: blur(3px);
  overflow-y: auto;
}

.modal-backdrop.visible {
  display: flex;
}

.modal {
  background: #fff;
  border: 1px solid #ccd9eb;
  border-radius: 18px;
  padding: 20px;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 48px rgba(19, 32, 52, 0.22);
  animation: rise-in 0.22s ease both;
}

.modal.modal-wide {
  width: min(760px, 100%);
}

.modal h2 {
  margin: 0 0 10px;
  font-family: "Sora", "Plus Jakarta Sans", sans-serif;
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: none;
  background: transparent;
  color: #5f6f89;
  font-size: 20px;
  cursor: pointer;
}

.form-field {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  font-weight: 700;
}

.checkbox-field span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.form-field[hidden] {
  display: none !important;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px;
  border: 1px solid #cad7ea;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible,
.button:focus-visible,
.tab-button:focus-visible,
.file-drop-zone:focus-visible,
.logout:focus-visible,
.sidebar-login:focus-visible {
  outline: 2px solid #7ea7ff;
  outline-offset: 2px;
}

.form-field input[type="file"] {
  padding: 8px;
}

.form-field select[multiple] {
  min-height: 180px;
}

.form-field textarea {
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  resize: vertical;
}

.home-models-section {
  margin: 10px 0;
}

.home-section-label {
  font-weight: 700;
  margin-bottom: 8px;
}

.home-models-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-model-card {
  text-align: left;
  border: 1px solid #d2deee;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
  cursor: pointer;
  transition: box-shadow 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.home-model-card:hover {
  transform: translateY(-1px);
  border-color: #becde4;
  box-shadow: var(--shadow-sm);
}

.home-model-card.selected {
  background: linear-gradient(145deg, var(--accent-soft) 0%, #fff9f4 100%);
  border-color: #ffcfb0;
  box-shadow: 0 0 0 2px rgba(255, 138, 61, 0.16);
}

.home-model-card-title {
  font-weight: 800;
  font-size: 15px;
}

.home-model-card-media {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.home-model-card-description {
  font-size: 13px;
  color: var(--muted);
}

.home-model-card-cost {
  font-weight: 800;
  color: var(--accent-strong);
  font-size: 13px;
}

.home-input-mode {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
  font-weight: 700;
}

.tenant-type-row {
  margin-top: 10px;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 26px;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  border: 1px solid #bfcde0;
  border-radius: 999px;
  background: #fff;
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9e62 0%, #f5742f 100%);
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.visually-hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(100%);
  overflow: hidden;
  white-space: nowrap;
}

.file-drop-zone {
  border: 1px dashed #b7c9e0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fcfdff 0%, #f5f9ff 100%);
  min-height: 180px;
  padding: 18px;
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.file-drop-zone.dragging {
  border-color: #8eb0df;
  background: #eaf2ff;
}

.file-drop-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #c7d8ee;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-drop-icon svg {
  width: 24px;
  height: 24px;
  stroke: #4f6789;
  stroke-width: 1.8;
}

.file-drop-text {
  font-weight: 700;
  color: #2e4567;
}

.file-drop-or {
  color: var(--muted);
  font-size: 13px;
}

.file-browse-button {
  min-width: 108px;
  padding: 8px 16px;
}

.file-browse-button:hover {
  border-color: #9fb7d5;
  color: #27456e;
}

.file-drop-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.form-actions input[type="search"] {
  min-width: min(320px, 100%);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.api-token-actions,
.section-actions-right {
  justify-content: flex-end;
}

.section-actions-right input[type="search"],
.section-actions-split input[type="search"] {
  min-width: min(320px, 100%);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.section-actions-split {
  justify-content: space-between;
  align-items: center;
}

#tenantSettingsUsersPanel .section-actions-right {
  margin-bottom: 8px;
}

.form-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  gap: 12px;
}

.form-meta a {
  color: #2965d8;
}

.form-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.form-status.error {
  color: #b43756;
}

.form-status.success {
  color: #148058;
}

.home-code-tabs {
  margin-top: 18px;
}

.tablist {
  display: flex;
  gap: 2px;
  margin-bottom: 0;
  border-bottom: 1px solid #d4dfef;
  padding: 0 4px;
}

.tab-button {
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: transparent;
  padding: 9px 14px;
  font-weight: 700;
  color: #546583;
  cursor: pointer;
  margin-bottom: -1px;
}

.tab-button.active {
  background: #fff;
  border-color: #d4dfef;
  color: #1a2a43;
}

.tab-button:hover:not(.active) {
  background: #f3f7fd;
  color: #324665;
}

.result-json-details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.result-json-details > summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  list-style: none;
}

.result-json-details > summary::-webkit-details-marker {
  display: none;
}

.result-json-details > summary::before {
  content: "▸";
  color: #516482;
  margin-right: 8px;
}

.result-json-details[open] > summary::before {
  content: "▾";
}

.result-json-details .result-json {
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
}

.code-pane {
  padding-top: 10px;
}

.tab-pane {
  animation: rise-in 0.2s ease both;
}

.code-pane pre,
.result-json {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.code-pane pre {
  overflow: auto;
}

.code-pane code {
  display: block;
  padding: 14px;
  font-size: 13px;
}

.result-json {
  padding: 14px;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #253247;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.home-prediction-summary {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  margin-bottom: 12px;
  display: grid;
  gap: 12px;
}

.home-prediction-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.home-verdict-card {
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d8e2f0;
  background: #f8fbff;
}

.home-verdict-card.is-ai {
  border-color: #f5c6cf;
  background: #fff6f8;
}

.home-verdict-card.is-real {
  border-color: #bfe7cc;
  background: #f4fff8;
}

.home-verdict-card.is-unknown {
  border-color: #d8e2f0;
  background: #f8fbff;
}

.home-verdict-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: #eef4fd;
  color: #1f3f68;
  flex: 0 0 44px;
}

.home-verdict-card.is-ai .home-verdict-icon {
  background: #ffe9ee;
  color: #b43756;
}

.home-verdict-card.is-real .home-verdict-icon {
  background: #e8f8ef;
  color: #148058;
}

.home-verdict-label {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.home-verdict-meta {
  display: none;
}

.home-confidence-card {
  border-radius: 12px;
  border: 1px solid #d8e2f0;
  background: #f8fbff;
  min-width: 120px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
}

.home-confidence-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #667993;
}

.home-confidence-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.home-analysis-card {
  border-radius: 12px;
  border: 1px solid #d8e2f0;
  background: #f9fbff;
  padding: 10px 12px;
}

.home-analysis-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5f7390;
  margin-bottom: 6px;
  font-weight: 700;
}

.home-analysis-body {
  color: #22344b;
}

.home-timeline-section {
  border-radius: 12px;
  border: 1px solid #d8e2f0;
  background: #f9fbff;
  padding: 10px 12px;
}

.home-timeline-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5f7390;
  margin-bottom: 8px;
  font-weight: 700;
}

.home-timeline {
  position: relative;
  height: 28px;
}

.home-timeline-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ebf1fa 0%, #dbe6f5 100%);
}

.home-timeline-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(39, 65, 100, 0.15);
  z-index: 1;
}

.home-timeline-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  color: #667993;
  font-size: 12px;
}

.json-node {
  min-width: 0;
}

.json-row {
  display: flex;
  align-items: flex-start;
  min-width: 0;
}

.json-children {
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px dashed #d4dfef;
}

.json-toggle {
  border: none;
  background: transparent;
  color: #516482;
  width: 18px;
  min-width: 18px;
  height: 18px;
  padding: 0;
  margin-right: 4px;
  cursor: pointer;
  line-height: 1;
}

.json-toggle:hover {
  color: #1a2a43;
}

.json-toggle-spacer {
  width: 18px;
  min-width: 18px;
  display: inline-block;
  margin-right: 4px;
}

.json-key {
  color: #8b3fa8;
}

.json-string {
  color: #147f42;
}

.json-number {
  color: #1f6acb;
}

.json-boolean {
  color: #aa5b00;
}

.json-null {
  color: #b43756;
}

.json-value {
  color: #324665;
}

.json-bracket,
.json-punctuation {
  color: #516482;
}

.json-collapsed-summary {
  color: #67799a;
  margin: 0 4px;
}

.home-result-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(28, 57, 96, 0.16);
  border-top-color: var(--accent-strong);
  animation: spin 0.8s linear infinite;
}

.spinner[hidden] {
  display: none;
}

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

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1040px) {
  .layout {
    grid-template-columns: 228px 1fr;
  }

  .sidebar {
    width: 228px;
  }

  .sidebar.collapsed {
    width: 78px;
  }

  .topnav {
    display: none;
  }
}

@media (max-width: 720px) {
  .page {
    grid-template-rows: 72px 1fr;
  }

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

  .sidebar {
    position: fixed;
    top: 72px;
    left: 0;
    height: calc(100vh - 72px);
    z-index: 9;
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }

  body.sidebar-collapsed .sidebar {
    transform: translateX(-110%);
  }

  .sidebar.collapsed {
    width: 260px;
  }

  .content {
    padding: 18px;
    gap: 18px;
  }

  .hero {
    padding: 20px;
  }

  .home-models-grid {
    grid-template-columns: 1fr;
  }

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

  .home-prediction-header {
    grid-template-columns: 1fr;
  }

  .home-confidence-card {
    min-width: 0;
  }
}
