:root {
  --ink: #102233;
  --muted: #6b7b88;
  --line: #dbe4e8;
  --surface: #fff;
  --canvas: #f4f7f7;
  --teal: #0d776e;
  --green: #62d8b4;
  --mint: #dff8ee;
  --navy: #0b2f45;
  --danger: #ba3e4a;
  --radius: 18px;
  --shadow: 0 16px 48px rgba(20, 49, 62, 0.08);
}
* {
  box-sizing: border-box;
}
html {
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
body {
  margin: 0;
  min-width: 320px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 800;
  color: var(--teal);
  margin: 0 0 8px;
}
.muted {
  color: var(--muted);
}
.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(140deg, #0a2f45 0 48%, #52d4aa 48%);
  color: #fff;
  display: grid;
  place-items: center;
  font: 800 24px Manrope;
  box-shadow: 0 12px 28px rgba(8, 55, 70, 0.2);
}
.brand-mark.small {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 18px;
}
.login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(460px, 1.15fr) minmax(380px, 0.85fr);
  background: #fff;
}
.login-visual {
  background:
    radial-gradient(
      circle at 70% 18%,
      rgba(98, 216, 180, 0.22),
      transparent 24%
    ),
    linear-gradient(145deg, #092a3e, #0b4051);
  color: #fff;
  padding: 64px clamp(48px, 8vw, 120px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-visual .eyebrow {
  color: #72dfbf;
}
.login-visual h1 {
  font: 800 clamp(42px, 5vw, 72px) / 1.04 Manrope;
  margin: 0;
  letter-spacing: -0.045em;
}
.login-visual h1 span {
  color: #7be0c1;
}
.login-intro {
  font-size: 17px;
  line-height: 1.65;
  max-width: 620px;
  color: #c9d8dd;
}
.visual-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 28px;
  gap: 20px;
}
.visual-metrics div {
  display: flex;
  flex-direction: column;
}
.visual-metrics strong {
  font: 700 28px Manrope;
}
.visual-metrics span {
  font-size: 12px;
  color: #abc1c9;
}
.login-card {
  align-self: center;
  width: min(440px, calc(100% - 64px));
  margin: auto;
  padding: 44px;
}
.login-card h2 {
  font: 800 31px/1.2 Manrope;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}
.login-card label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 22px;
}
.login-card input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  outline: none;
}
.login-card input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 119, 110, 0.12);
}
.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  transition: 0.18s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--teal);
  color: #fff;
}
.btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.dark {
  background: var(--navy);
  color: #fff;
  align-self: end;
}
.btn.wide {
  width: 100%;
  margin-top: 24px;
  padding: 13px;
}
.form-error {
  color: var(--danger);
  min-height: 18px;
  font-size: 13px;
}
.security-note {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  margin-top: 18px;
}
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.btn.google { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 42px; background: #fff; color: #3c4043; border: 1px solid #dadce0; border-radius: 4px; box-shadow: 0 1px 2px rgba(60,64,67,.08); font: 600 14px Arial, sans-serif; }
.btn.google:hover { background: #f8faff; border-color: #d2e3fc; box-shadow: 0 1px 3px rgba(60,64,67,.18); }
.btn.google:focus-visible { outline: 2px solid #4285f4; outline-offset: 2px; }
.google-g { width: 18px; height: 18px; flex: 0 0 18px; }
.mobile-brand {
  display: none;
}
.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: #f9fbfb;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.logo-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 5px;
}
.logo-row div:last-child {
  display: flex;
  flex-direction: column;
}
.logo-row strong {
  font: 800 15px Manrope;
}
.logo-row span {
  font-size: 11px;
  color: var(--muted);
}
nav {
  display: grid;
  gap: 5px;
}
.nav-item {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 11px 12px;
  text-align: left;
  color: #647580;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.guide-main {
  max-width: 1040px;
}
.guide-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #f4fbf8, #fff);
  margin-bottom: 20px;
}
.guide-hero h2 { margin: 5px 0 9px; font: 800 30px Manrope; }
.guide-hero p { margin: 0; color: var(--muted); max-width: 680px; }
.connected-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #13755f;
  background: #dff5ed;
  border: 1px solid #b7e3d5;
  border-radius: 999px;
  padding: 9px 13px;
  font-weight: 700;
  white-space: nowrap;
}
.connected-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #18a47f; }
.guide-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 18px; }
.guide-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 22px;
}
.guide-card h3 { margin: 0 0 15px; font: 800 18px Manrope; }
.setup-steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.setup-step { display: grid; grid-template-columns: 32px 1fr; gap: 12px; }
.step-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #e4f5ef; color: var(--teal); font-weight: 800; }
.setup-step strong { display: block; margin: 3px 0 4px; }
.setup-step p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.connector-url { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.connector-url code, .test-prompt {
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7faf9;
  padding: 11px;
  color: #234453;
}
.guide-list { margin: 0; padding-left: 19px; color: var(--muted); }
.guide-list li { margin: 8px 0; }
.security-box { margin-top: 16px; padding: 13px; border-radius: 10px; background: #f5faf8; border-left: 4px solid #1a9b7c; font-size: 12px; color: #45616d; }
.test-prompt { display: block; white-space: pre-wrap; margin: 10px 0; font: 500 12px/1.5 DM Sans; }
.guide-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 820px) {
  .guide-hero, .guide-grid { grid-template-columns: 1fr; }
  .guide-hero h2 { font-size: 24px; }
}
.nav-item span {
  width: 21px;
  text-align: center;
}
.nav-item.active,
.nav-item:hover {
  background: #e8f5f1;
  color: var(--teal);
}
.sidebar-section {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.sidebar-section > p {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #87959e;
}
.select-label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 13px;
}
.select-label select {
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--ink);
}
.api-card,
.admin-card {
  display: flex;
  align-items: center;
  gap: 10px;
}
.api-card {
  margin-top: auto;
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 12px;
}
.api-card div,
.admin-card div:nth-child(2) {
  display: flex;
  flex-direction: column;
}
.api-card strong,
.admin-card strong {
  font-size: 12px;
}
.api-card span:last-child,
.admin-card span {
  font-size: 10px;
  color: var(--muted);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f0a84e;
  display: inline-block;
}
.status-dot.online {
  background: #38bb8f;
}
.status-dot.offline {
  background: #c25361;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #e1f1ed;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}
.admin-card button {
  margin-left: auto;
  border: 1px solid #d8e2e8;
  border-radius: 9px;
  background: #fff;
  color: #a3262a;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
}
.admin-card button:hover,
.admin-card button:focus-visible {
  background: #fff3f3;
  border-color: #e4b8ba;
  outline: none;
}
.admin-card button strong {
  color: inherit;
  font-size: inherit;
}
.main {
  padding: 24px clamp(22px, 3vw, 44px) 50px;
  min-width: 0;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.topbar h1 {
  font: 800 28px Manrope;
  margin: 0;
  letter-spacing: -0.03em;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.model-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  border-right: 1px solid var(--line);
  padding-right: 16px;
  margin-right: 7px;
}
.score-strip {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1.5fr repeat(5, 1fr);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.score-comparison {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px;
  border-right: 1px solid var(--line);
}
.score-ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: conic-gradient(#f0aa92 var(--score, 0%), #eef1f2 0);
  position: relative;
}
.score-ring:before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
}
.score-ring.after {
  background: conic-gradient(var(--green) var(--score, 0%), #eef1f2 0);
}
.score-ring strong,
.score-ring span {
  z-index: 1;
}
.score-ring strong {
  font: 800 17px Manrope;
}
.score-ring span {
  font-size: 8px;
  text-transform: uppercase;
  color: var(--muted);
}
.arrow {
  color: #99a6ad;
}
.metric {
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}
.metric:last-child {
  border: 0;
}
.metric span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.metric strong {
  font: 700 18px Manrope;
  margin-top: 4px;
}
.keyword-bar {
  display: grid;
  grid-template-columns: 1fr 1.6fr auto;
  gap: 12px;
  margin: 18px 0;
}
.keyword-bar label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: grid;
  gap: 6px;
}
.keyword-bar input {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 11px 13px;
  color: var(--ink);
}
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.editor-card {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.output-card {
  border-color: #badfd4;
}
.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
}
.pane-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pane-head h2 {
  font: 700 14px Manrope;
  margin: 0;
}
.pane-index {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #f9e7df;
  color: #a45c42;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
}
.pane-index.green {
  background: var(--mint);
  color: var(--teal);
}
.pane-status {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.pane-status.success {
  color: var(--teal);
}
textarea,
.output-editor {
  width: 100%;
  height: 420px;
  border: 0;
  resize: none;
  padding: 22px;
  font: 400 15px/1.75 "DM Sans";
  color: #243a46;
  outline: none;
  overflow: auto;
}
.output-editor .placeholder {
  color: #9ba8ae;
}
.output-editor mark {
  background: #d9f4ce;
  color: #245e43;
  padding: 1px 2px;
  border-radius: 3px;
}
.output-editor h1,
.output-editor h2,
.output-editor h3 {
  font-family: Manrope;
  margin: 1.3em 0 0.5em;
  line-height: 1.3;
}
.output-editor h1 {
  font-size: 24px;
}
.output-editor h2 {
  font-size: 19px;
}
.output-editor h3 {
  font-size: 16px;
}
.output-editor p {
  margin: 0.7em 0;
}
.output-editor ul {
  padding-left: 22px;
}
.pane-foot {
  padding: 10px 17px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
}
.pane-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9fa;
  color: #697780;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease,
    transform 160ms ease;
}
.icon-btn:hover {
  background: #eef6f4;
  border-color: #bddbd4;
  color: var(--teal);
}
.icon-btn:active {
  transform: scale(0.96);
}
.icon-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
button.has-help-dot {
  position: relative;
}
button.has-help-dot::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d84b55;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 4px rgba(142, 25, 35, 0.28);
  pointer-events: none;
  z-index: 2;
}
.button-help-tooltip {
  position: fixed;
  z-index: 10000;
  padding: 10px 12px;
  border-radius: 9px;
  background: #102a43;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(16, 42, 67, 0.24);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  pointer-events: none;
}
.button-help-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.text-btn {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 700;
}
.action-row {
  display: grid;
  grid-template-columns: 1.45fr repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.action-primary,
.action-tile {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 15px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.action-primary {
  background: linear-gradient(135deg, #0b3448, #0a5360);
  color: #fff;
  border: 0;
}
.action-primary > span,
.action-tile > span {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.13);
  font-weight: 800;
}
.action-tile > span {
  background: #eaf5f2;
  color: var(--teal);
}
.action-primary div,
.action-tile div {
  display: flex;
  flex-direction: column;
}
.action-primary strong,
.action-tile strong {
  font-size: 12px;
}
.action-primary small,
.action-tile small {
  font-size: 9px;
  opacity: 0.72;
  margin-top: 3px;
}
.action-primary b {
  margin-left: auto;
}
.action-primary:hover,
.action-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.insights-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 14px;
  margin-top: 14px;
}
.insight-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-title h3 {
  font: 700 14px Manrope;
  margin: 0;
}
.panel-title span {
  font-size: 9px;
  color: var(--muted);
}
.signals {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 17px;
}
.signal {
  text-align: center;
}
.signal-ring {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: auto;
  background: conic-gradient(var(--teal) var(--score), #e8edef 0);
  position: relative;
}
.signal-ring:before {
  content: "";
  position: absolute;
  inset: 5px;
  background: #fff;
  border-radius: 50%;
}
.signal-ring b {
  z-index: 1;
  font-size: 11px;
}
.signal span {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-top: 6px;
}
.recommendations {
  margin: 14px 0 0;
  padding-left: 24px;
  display: grid;
  gap: 8px;
}
.recommendations li {
  font-size: 11px;
  color: #506470;
  padding-left: 5px;
}
.recommendations li::marker {
  color: var(--teal);
  font-weight: 800;
}
dialog {
  width: min(680px, calc(100% - 32px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 28px 90px rgba(10, 38, 50, 0.3);
}
dialog::backdrop {
  background: rgba(8, 28, 38, 0.55);
  backdrop-filter: blur(4px);
}
dialog form {
  padding: 28px;
  max-height: 80dvh;
  overflow: auto;
}
.dialog-close {
  position: absolute;
  right: 16px;
  top: 14px;
  border: 0;
  background: transparent;
  font-size: 26px;
  color: var(--muted);
}
#dialogBody {
  font-size: 13px;
  line-height: 1.6;
}
#dialogBody pre {
  background: #102c3b;
  color: #dff8ee;
  padding: 16px;
  border-radius: 12px;
  white-space: pre-wrap;
  overflow: auto;
}
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #102e3e;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s;
}
#toast.show {
  opacity: 1;
  transform: none;
}
.loading {
  opacity: 0.6;
  pointer-events: none;
}
.api-card-button {
  width: 100%;
  text-align: left;
  color: var(--ink);
}
.api-card-button:hover {
  border-color: #9ecbc0;
}
.score-disclaimer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 0;
  color: var(--muted);
  font-size: 10px;
}
.score-disclaimer strong {
  color: #8a5b27;
}
.credential-form,
.credential-output {
  display: grid;
  gap: 10px;
}
.credential-form label,
.credential-row label {
  font-weight: 700;
}
.credential-form input,
.credential-output input {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.credential-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}
.credential-warning,
.honesty-note {
  padding: 10px 12px;
  border-radius: 9px;
}
.credential-warning {
  background: #fff4dd;
  color: #744d17;
}
.honesty-note {
  border: 1px solid var(--line);
  background: #f7faf9;
}
.keyword-discovery {
  margin: -8px 0 16px;
  padding: 11px 13px;
  border: 1px solid #cfe3dd;
  border-radius: 10px;
  background: #f5fbf9;
  color: var(--muted);
  font-size: 11px;
}
.keyword-discovery strong {
  color: var(--teal);
}
.keyword-chip {
  display: inline-block;
  margin: 3px 3px 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: #dff4ed;
  color: #245e52;
}
.nav-label {
  margin: 17px 10px 7px;
  color: #83959c;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}
.nav-copy strong { font-size: 13px; }
.nav-copy small { color: var(--muted); font-size: 9px; font-weight: 500; }
.nav-item.active .nav-copy small { color: #4c7c72; }
.keyword-table,
.publishing-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.keyword-decision {
  border: 1px solid var(--line);
  border-left: 4px solid #bdc8c5;
  border-radius: 10px;
  padding: 11px 13px;
}
.keyword-decision.selected { border-left-color: #1a9b7c; background: #f3fbf8; }
.keyword-decision > div { display: flex; justify-content: space-between; gap: 12px; }
.keyword-decision span { color: var(--teal); font-size: 11px; font-weight: 700; }
.keyword-decision p { margin: 5px 0; }
.keyword-decision small { color: var(--muted); }
.publishing-form label { display: grid; gap: 4px; font-weight: 700; }
.publishing-form input { padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
@media (max-width: 1100px) {
  .score-strip {
    grid-template-columns: 1.6fr repeat(3, 1fr);
  }
  .metric:nth-last-child(-n + 2) {
    display: none;
  }
  .action-row {
    grid-template-columns: 1fr 1fr;
  }
  .signals {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 13px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
  }
  .sidebar nav,
  .sidebar-section,
  .api-card {
    display: none;
  }
  .admin-card {
    grid-column: 2;
  }
  .main {
    padding: 18px 14px 40px;
  }
  .topbar {
    align-items: flex-start;
  }
  .model-badge,
  .header-actions .secondary {
    display: none;
  }
  .score-strip {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
  .metric:nth-of-type(n + 4) {
    display: none;
  }
  .keyword-bar {
    grid-template-columns: 1fr;
  }
  .btn.dark {
    width: 100%;
  }
  .workspace,
  .insights-grid {
    grid-template-columns: 1fr;
  }
  textarea,
  .output-editor {
    height: 340px;
  }
  .action-row {
    grid-template-columns: 1fr 1fr;
  }
  .action-primary {
    grid-column: 1/-1;
  }
}
@media (max-width: 650px) {
  .login-shell {
    display: block;
    background: #f4f7f7;
    padding: 24px 0;
    min-height: 100dvh;
  }
  .login-visual {
    display: none;
  }
  .login-card {
    width: calc(100% - 28px);
    padding: 28px 24px;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 38px;
    font-weight: 800;
  }
  .mobile-brand .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .topbar {
    display: block;
  }
  .header-actions {
    margin-top: 14px;
  }
  .score-strip {
    grid-template-columns: 1fr 1fr;
  }
  .score-comparison {
    grid-column: 1/-1;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .metric {
    border-bottom: 0;
  }
  .workspace {
    gap: 10px;
  }
  .action-row {
    grid-template-columns: 1fr;
  }
  .action-primary {
    grid-column: auto;
  }
  .action-tile {
    display: none;
  }
  .signals {
    grid-template-columns: repeat(5, 1fr);
  }
}
.provider-status {
  margin: 8px 0 0;
  color: #9a4e43;
  font-size: 12px;
  font-weight: 700;
}
.provider-status.connected {
  color: #157b69;
}
.login-brand-lockup { display: flex; align-items: center; gap: 14px; }
.login-brand-copy { display: grid; gap: 5px; }
.login-brand-copy strong { color: #fff; font: 800 24px/1 Manrope, sans-serif; letter-spacing: -.025em; }
.login-brand-copy span { color: #a9cbd2; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.plan-badge { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid #cfe4de; border-radius: 999px; background: #eff9f6; color: #14725f; font-size: 11px; font-weight: 800; }
.paywall-dialog { width: min(520px, calc(100% - 28px)); border: 0; border-radius: 22px; padding: 0; box-shadow: 0 30px 80px rgba(12, 43, 57, .24); }
.paywall-dialog::backdrop { background: rgba(7, 24, 35, .62); backdrop-filter: blur(4px); }
.paywall-card { padding: 34px; }
.paywall-card h2 { margin: 8px 0; }
.paywall-card ul { display: grid; gap: 9px; margin: 20px 0; padding-left: 20px; color: var(--muted); }
.account-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.account-grid article { display: grid; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfa; }
.account-grid small, .document-list small { color: var(--muted); }
.document-list { display: grid; gap: 9px; margin-top: 14px; }
.document-list article { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.document-list article div { display: grid; gap: 4px; }
.document-list time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.usage-meter { height: 9px; overflow: hidden; margin: 16px 0; border-radius: 99px; background: #e8eeec; }
.usage-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #5ed7b5); }
@media (max-width: 650px) {
  .account-grid { grid-template-columns: 1fr; }
  .plan-badge { margin-top: 8px; }
}
