@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Literata-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Literata-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Literata-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Literata-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Onest-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/Onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  --color-background: #111110;
  --color-surface: #1e1d1b;
  --color-surface-raised: #262422;
  --color-border: #2e2c29;
  --color-border-strong: #4a4640;
  --color-text: #e8e1d8;
  --color-text-secondary: #c2b9ae;
  --color-text-muted: #948a82;
  --color-accent: #c47c3a;
  --color-accent-hover: #d08a44;
  --color-accent-active: #a9652f;
  --color-accent-contrast: #17120e;
  --color-success: #5c9e42;
  --color-danger: #b83030;
  --color-danger-hover: #cf3a3a;
  --color-danger-soft: rgba(184, 48, 48, 0.16);
  --color-overlay: rgba(8, 8, 7, 0.78);

  --font-sans: "Onest", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Literata", Georgia, "Times New Roman", serif;
  --font-size-sm: 13px;
  --font-size-base: 16px;
  --font-size-lg: 17px;
  --font-size-xl: 28px;
  --font-size-2xl: 32px;
  --line-height-tight: 1.15;
  --line-height-body: 1.5;

  --space-1: 4px;
  --space-2: 6px;
  --space-3: 8px;
  --space-4: 10px;
  --space-5: 12px;
  --space-6: 14px;
  --space-7: 16px;
  --space-8: 18px;
  --space-9: 20px;
  --space-10: 24px;
  --space-12: 32px;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-pill: 999px;
  --border-width: 1px;
  --border-subtle: var(--border-width) solid var(--color-border);
  --shadow-raised: 0 18px 60px rgba(0, 0, 0, 0.38);
  --shadow-focus: 0 0 0 3px rgba(196, 124, 58, 0.34);
  --focus-ring: 2px solid var(--color-accent-hover);
  --control-height: 40px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--color-background);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
}

a {
  color: var(--color-accent-hover);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-text);
  text-decoration: underline;
}

a:active {
  color: var(--color-accent);
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
  box-shadow: var(--shadow-focus);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: var(--control-height);
  padding: 0 var(--space-9);
  border: var(--border-width) solid var(--color-accent);
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  border-color: var(--color-accent-hover);
  background: var(--color-accent-hover);
}

button:active {
  border-color: var(--color-accent-active);
  background: var(--color-accent-active);
}

button:disabled,
button[aria-disabled="true"],
fieldset:disabled button,
.htmx-request button {
  cursor: not-allowed;
  opacity: 0.58;
}

.button-secondary {
  border-color: var(--color-border-strong);
  background: var(--color-surface-raised);
  color: var(--color-text);
}

.button-secondary:hover {
  border-color: var(--color-text-muted);
  background: #302d2a;
}

.button-secondary:active {
  background: var(--color-surface);
}

.button-danger {
  border-color: var(--color-danger);
  background: var(--color-danger-soft);
  color: #f0d2cc;
}

.button-danger:hover {
  border-color: var(--color-danger-hover);
  background: rgba(207, 58, 58, 0.22);
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  color: var(--color-text);
}

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

input:hover,
select:hover,
textarea:hover {
  border-color: var(--color-text-muted);
}

input:disabled,
select:disabled,
textarea:disabled,
fieldset:disabled input,
fieldset:disabled select,
fieldset:disabled textarea,
.htmx-request input,
.htmx-request select,
.htmx-request textarea {
  cursor: not-allowed;
  opacity: 0.62;
}

input:user-invalid,
select:user-invalid,
textarea:user-invalid,
[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.topbar {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  left: 0;
  min-height: 49px;
  border-bottom: var(--border-subtle);
  background: transparent;
}

.topbar::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(17, 17, 16, 0.94);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  position: relative;
  width: min(1440px, 100%);
  min-width: 0;
  min-height: 48px;
  margin: 0 auto;
  padding: 0 var(--space-9);
  display: flex;
  align-items: center;
  gap: var(--space-10);
}

.brand {
  flex: 0 0 auto;
  min-width: 0;
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  white-space: nowrap;
}

.brand:hover {
  color: var(--color-text);
  text-decoration: none;
}

.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;
}

.nav-toggle {
  display: none;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.nav-toggle-icon {
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-icon::before {
  top: -6px;
}

.nav-toggle-icon::after {
  top: 6px;
}

.app-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.nav-menu {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

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

.nav-links,
.nav-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-actions {
  margin-left: auto;
  padding-left: var(--space-3);
}

.nav-link {
  position: relative;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--color-text);
}

.nav-link[aria-current="page"] {
  color: var(--color-accent);
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -3px;
  left: 0;
  height: 1.5px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
}

.nav-mobile-header {
  display: none;
}

.nav-close {
  display: none;
}

.user,
.user-menu-name {
  display: block;
  max-width: clamp(96px, 13vw, 180px);
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu {
  position: relative;
  display: block;
}

.user-menu-trigger {
  min-height: 24px;
  padding: 3px var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  font-weight: 400;
}

.user-menu-trigger:hover,
.user-menu-trigger[aria-expanded="true"] {
  color: var(--color-text);
}

.user-menu-trigger:focus-visible,
.user-menu-item:focus-visible,
.nav-mobile-user-link:focus-visible,
.profile-secret-toggle:focus-visible,
.profile-modal-close:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.user-menu-name {
  max-width: 140px;
}

.user-menu-chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  flex: 0 0 auto;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 140ms ease;
}

.user-menu-trigger[aria-expanded="true"] .user-menu-chevron {
  transform: translateY(1px) rotate(225deg);
}

.user-menu-dropdown {
  position: absolute;
  z-index: 60;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 180px;
  padding: var(--space-2);
  border: var(--border-subtle);
  border-radius: 12px;
  background: var(--color-surface-raised);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.user-menu-dropdown[hidden] {
  display: none;
}

.user-menu-fullname {
  max-width: 220px;
  margin: 0 0 var(--space-1);
  padding: var(--space-2) var(--space-3) var(--space-3);
  overflow: hidden;
  border-bottom: var(--border-subtle);
  color: var(--color-text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-items {
  display: grid;
  gap: var(--space-1);
}

.user-menu-item {
  width: 100%;
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
}

.user-menu-item:hover,
.user-menu-item[aria-current="page"] {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  text-decoration: none;
}

.user-menu-divider {
  height: 1px;
  margin: var(--space-1) 0;
  background: var(--color-border);
}

.user-menu-logout {
  margin: 0;
}

.user-menu-logout .user-menu-item {
  color: var(--color-text-muted);
}

.nav-mobile-user {
  display: none;
}

.logout-form {
  margin: 0;
}

.logout-form button {
  min-height: 26px;
  padding: 0 10px;
  border-color: var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 400;
}

.logout-form button:hover {
  border-color: var(--color-text-muted);
  background: transparent;
  color: var(--color-text);
}

.user-menu-logout .user-menu-item {
  width: 100%;
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  justify-content: flex-start;
  font-size: 13px;
  text-align: left;
}

.user-menu-logout .user-menu-item:hover,
.user-menu-logout .user-menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
}

body.nav-menu-open {
  overflow: hidden;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: calc(49px + var(--space-10)) var(--space-10) var(--space-10);
}

.auth-body {
  min-height: 100vh;
  overflow-x: hidden;
}

.auth-page {
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  background: var(--color-background);
  color: var(--color-text);
}

.auth-visual {
  position: relative;
  flex: 0 0 46%;
  min-height: 100vh;
  overflow: hidden;
  background: var(--color-background);
}

.auth-visual picture,
.auth-visual img {
  display: block;
  width: 100%;
  height: 100%;
}

.auth-visual img {
  position: absolute;
  inset: 0;
  z-index: 0;
  object-fit: cover;
  object-position: left center;
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-visual::before {
  z-index: 1;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.04) 0%,
    rgba(0, 0, 0, 0.08) 62%,
    rgba(17, 17, 16, 0.38) 78%,
    rgba(17, 17, 16, 0.78) 92%,
    var(--color-background) 100%
  );
}

.auth-visual::after {
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 0%,
    transparent 18%,
    transparent 78%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

.auth-form-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100vh;
  padding: max(env(safe-area-inset-top), 0px) var(--space-10) max(env(safe-area-inset-bottom), 0px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-background);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-10) 0;
}

.auth-lockup {
  margin-bottom: 36px;
}

.auth-wordmark {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: clamp(22px, 2vw, 27px);
  font-weight: 600;
  line-height: 1;
}

.auth-descriptor {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.auth-card h1 {
  margin: 0 0 28px;
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  line-height: var(--line-height-tight);
}

.auth-form {
  gap: var(--space-7);
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 400;
}

.field label span {
  opacity: 0.6;
}

.auth-form input {
  min-height: 42px;
  padding: 10px 14px;
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 14px;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.auth-form input:hover {
  border-color: var(--color-border-strong);
}

.auth-form input:focus-visible {
  outline: 0;
  border-color: var(--color-accent);
  box-shadow: none;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-text);
  caret-color: var(--color-text);
  box-shadow: 0 0 0 1000px var(--color-surface) inset, var(--shadow-focus);
  transition: background-color 9999s ease-out;
}

.auth-error {
  margin: 0 0 var(--space-7);
  padding: var(--space-4) var(--space-7);
  border: var(--border-width) solid #4a1c1c;
  border-radius: var(--radius-md);
  background: #1a0808;
  color: #d88a80;
  font-size: 14px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.auth-submit {
  width: 100%;
  min-height: 40px;
  margin-top: var(--space-2);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
}

.auth-submit[data-submitting="true"] {
  cursor: wait;
}

.auth-switch,
.auth-secondary-link {
  margin: var(--space-5) 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
  text-align: center;
}

.auth-secondary-link {
  margin-top: var(--space-3);
}

.auth-switch a,
.auth-secondary-link a {
  color: var(--color-accent);
}

.auth-panel {
  max-width: 420px;
  margin: 48px auto;
  padding: var(--space-10);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.form {
  display: grid;
  gap: var(--space-7);
}

.form label {
  display: grid;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-weight: 600;
}

.auth-form .field label {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 400;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.error {
  color: #f0d2cc;
  font-weight: 600;
}

.success {
  color: var(--color-success);
  font-weight: 600;
}

.content-head {
  margin-bottom: var(--space-9);
}

.recommendation-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-7);
}

.recommendation-toolbar form {
  flex: 0 0 auto;
}

.queue-status {
  margin: -6px 0 0;
  color: var(--color-success);
  font-weight: 700;
}

.content-head h1,
.auth-panel h1 {
  margin: 0 0 var(--space-7);
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: var(--font-size-xl);
  line-height: var(--line-height-tight);
}

.llm-search-page {
  width: 100%;
}

.llm-search-workspace {
  width: min(860px, 100%);
}

.llm-search-page:not(.is-compact) .llm-search-workspace {
  margin: 71px auto 0;
}

.llm-search-page.is-compact .llm-search-workspace,
.llm-search-page.is-submitting .llm-search-workspace {
  margin: 7px 0 0;
}

.llm-search-copy {
  margin: 0 0 var(--space-10);
}

.llm-search-page h1 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.25;
}

.llm-search-lead,
.llm-query-help,
.llm-examples-title,
.llm-results-head p,
.llm-search-meta {
  margin: 0;
  color: var(--color-text-muted);
}

.llm-search-lead {
  margin-top: var(--space-5);
  max-width: none;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.625;
}

.llm-search-form {
  display: grid;
  gap: 0;
  padding: var(--space-7) var(--space-9) var(--space-9);
  border: var(--border-subtle);
  border-radius: 12px;
  background: var(--color-surface);
}

.llm-search-page.is-compact .llm-search-form,
.llm-search-page.is-submitting .llm-search-form {
  padding: var(--space-6) var(--space-9) var(--space-7);
}

.llm-query-field {
  display: grid;
  gap: var(--space-4);
}

.llm-query-field label {
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 400;
}

.llm-query-field textarea {
  min-height: 96px;
  padding: 12px var(--space-6);
  border-color: var(--color-border);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  resize: none;
}

.llm-search-page.is-compact .llm-query-field textarea,
.llm-search-page.is-submitting .llm-query-field textarea {
  min-height: 68px;
}

.llm-query-field textarea:focus {
  border-color: var(--color-accent);
  outline: 0;
  box-shadow: none;
}

.llm-query-help {
  margin-top: 2px;
  font-size: 12px;
}

.llm-search-controls {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-7);
}

.llm-search-controls button {
  min-width: 149px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
}

.llm-examples {
  margin-top: var(--space-9);
}

.llm-examples-title {
  margin-bottom: var(--space-5);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.llm-example-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.llm-example {
  min-height: 0;
  padding: 12px var(--space-6);
  border: var(--border-subtle);
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
}

.llm-example:hover,
.llm-example:focus-visible {
  border-color: var(--color-text-muted);
  background: transparent;
  color: var(--color-text);
}

.llm-search-page.is-submitting .llm-search-copy,
.llm-search-page.is-submitting .llm-examples {
  display: none;
}

.llm-search-error,
.llm-empty {
  padding: var(--space-6) var(--space-7);
}

.llm-search-error {
  border: 1px solid #4a1c1c;
  border-radius: var(--radius-md);
  background: #1a0808;
  color: var(--color-danger);
  font-size: 14px;
  font-weight: 400;
}

.llm-empty {
  padding-right: 0;
  padding-left: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.llm-empty p {
  margin: 0;
}

.llm-empty p:first-child {
  color: var(--color-text-secondary);
  font-weight: 600;
}

.llm-empty p + p {
  margin-top: var(--space-1);
}

.llm-search-meta {
  max-width: 860px;
  font-size: 13px;
}

.llm-results-region {
  margin-top: var(--space-10);
}

.llm-search-page:not(.is-compact) .llm-results-region {
  margin-top: 0;
}

.llm-results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-8);
  margin-bottom: var(--space-10);
}

.llm-results-head h2 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
}

.llm-results-head p {
  font-size: 13px;
}

.llm-results-head span {
  color: var(--color-text-secondary);
}

.profile-page {
  width: min(680px, 100%);
  padding-bottom: calc(var(--space-12) * 2);
}

.profile-page h1 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.32;
}

.profile-lead {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.profile-section {
  margin-top: var(--space-12);
  padding-top: var(--space-12);
  border-top: var(--border-subtle);
}

.profile-section h2,
.profile-modal-panel h2 {
  margin: 0;
  color: var(--color-text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.profile-section-copy,
.profile-subtle-copy,
.profile-helper,
.profile-empty-note,
.profile-modal-panel p {
  margin: 0;
  color: var(--color-text-muted);
}

.profile-section-copy {
  margin-top: var(--space-1);
  font-size: 14px;
  line-height: 1.5;
}

.profile-subtle-copy {
  margin-top: var(--space-1);
  opacity: 0.72;
  font-size: 11px;
  line-height: 1.45;
}

.profile-kicker {
  margin: var(--space-7) 0 var(--space-1);
  color: var(--color-text-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
}

.profile-identity {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.profile-empty-note {
  margin-top: var(--space-4);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.profile-form {
  margin-top: var(--space-9);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.profile-field {
  position: relative;
  min-width: 0;
  display: grid;
  gap: var(--space-2);
}

.profile-field label {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.profile-field input {
  width: 100%;
  min-height: 42px;
  padding: 10px var(--space-6);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.profile-field input:focus {
  border-color: var(--color-accent);
  outline: 0;
  box-shadow: none;
}

.profile-field input::placeholder {
  color: rgba(148, 138, 130, 0.72);
}

.profile-secret-field input {
  padding-right: 42px;
}

.profile-secret-toggle {
  position: absolute;
  right: var(--space-3);
  bottom: 9px;
  width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-secret-toggle:hover {
  color: var(--color-text-secondary);
}

.profile-eye {
  position: relative;
  width: 15px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.profile-eye::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.profile-secret-toggle[aria-pressed="true"] .profile-eye::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 6px;
  width: 1.5px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: currentColor;
  transform: rotate(-45deg);
}

.profile-helper {
  font-size: 11px;
  line-height: 1.4;
}

.profile-feedback {
  padding: var(--space-3) var(--space-5);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.profile-feedback[hidden] {
  display: none;
}

.profile-feedback-success {
  border-color: rgba(92, 158, 66, 0.42);
  color: #a9d59a;
}

.profile-feedback-error {
  border-color: #4a1c1c;
  background: #1a0808;
  color: var(--color-danger);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
}

.profile-primary,
.profile-secondary,
.profile-danger-secondary,
.profile-danger-button {
  min-height: 40px;
  border-radius: var(--radius-md);
  font-size: 14px;
}

.profile-secondary {
  color: var(--color-text-secondary);
}

.profile-secondary:hover {
  border-color: var(--color-text-muted);
  background: transparent;
  color: var(--color-text);
}

.profile-danger-secondary,
.profile-danger-button {
  border-color: #4a1c1c;
  background: transparent;
  color: var(--color-danger);
}

.profile-danger-secondary:hover,
.profile-danger-button:hover {
  border-color: var(--color-danger);
  background: #1a0808;
  color: var(--color-danger);
}

.profile-danger-zone {
  margin-top: 40px;
  border-top-color: #4a1c1c;
}

.profile-danger-zone h2 {
  color: var(--color-danger);
}

.profile-danger-zone .profile-danger-button {
  margin-top: var(--space-9);
}

body.profile-modal-open {
  overflow: hidden;
}

.profile-modal-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  padding: var(--space-10);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-modal-backdrop[hidden] {
  display: none;
}

.profile-modal-panel {
  width: min(448px, 100%);
  max-height: min(720px, calc(100dvh - 48px));
  border: var(--border-subtle);
  border-radius: 16px;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.profile-modal-small {
  width: min(384px, 100%);
  padding: var(--space-10);
  gap: var(--space-9);
}

.profile-modal-small p {
  margin-top: var(--space-2);
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.profile-modal-header {
  padding: var(--space-7) var(--space-9);
  border-bottom: var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.profile-modal-close {
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.profile-modal-body {
  padding: var(--space-9);
  display: grid;
  gap: var(--space-7);
}

.profile-modal-body p {
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.profile-modal-actions {
  padding: 0 var(--space-9) var(--space-9);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-5);
}

.profile-modal-small .profile-modal-actions {
  padding: 0;
}

.profile-delete-confirm {
  background: var(--color-danger);
  color: #fff;
}

.profile-delete-confirm:not(:disabled):hover {
  background: var(--color-danger-hover);
}

.profile-delete-confirm:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.movie-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
}

.movie-grid > li {
  min-width: 0;
}

.movie-card {
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.movie-main {
  min-width: 0;
}

.movie-poster-column {
  min-width: 0;
}

.poster-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.poster-link:hover {
  text-decoration: none;
}

.poster-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--color-surface-raised);
}

.poster-link:hover .poster,
.poster-link:hover .poster-placeholder {
  filter: brightness(0.9);
}

.poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  aspect-ratio: 2 / 3;
  display: block;
  object-fit: cover;
  background: var(--color-surface-raised);
}

.poster-frame:not([data-poster-state="loaded"]) .poster {
  opacity: 0;
}

.poster-frame[data-poster-state="loaded"] .poster-placeholder {
  opacity: 0;
}

.poster-frame[data-poster-state="fallback"] .poster {
  display: none;
}

.poster-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 32%, rgba(232, 225, 216, 0.06), transparent 36%),
    linear-gradient(160deg, #25231f 0%, #181715 58%, #111110 100%);
  color: var(--color-text-secondary);
}

.poster-fallback-motif {
  width: 86%;
  height: 100%;
  display: block;
  object-fit: contain;
  opacity: 0.52;
}

.poster-palette-0 {
  background:
    radial-gradient(circle at 50% 32%, rgba(228, 187, 132, 0.08), transparent 38%),
    linear-gradient(160deg, #29231c 0%, #191612 58%, #111110 100%);
}

.poster-palette-1 {
  background:
    radial-gradient(circle at 50% 32%, rgba(194, 185, 174, 0.07), transparent 38%),
    linear-gradient(160deg, #232322 0%, #171716 58%, #111110 100%);
}

.poster-palette-2 {
  background:
    radial-gradient(circle at 50% 32%, rgba(133, 151, 132, 0.08), transparent 38%),
    linear-gradient(160deg, #1f261d 0%, #151914 58%, #101110 100%);
}

.poster-palette-3 {
  background:
    radial-gradient(circle at 50% 32%, rgba(159, 129, 111, 0.08), transparent 38%),
    linear-gradient(160deg, #2a211d 0%, #1a1513 58%, #11100f 100%);
}

.poster-palette-4 {
  background:
    radial-gradient(circle at 50% 32%, rgba(125, 143, 150, 0.08), transparent 38%),
    linear-gradient(160deg, #1d2528 0%, #14191a 58%, #101111 100%);
}

.poster-palette-5 {
  background:
    radial-gradient(circle at 50% 32%, rgba(156, 133, 151, 0.08), transparent 38%),
    linear-gradient(160deg, #261f24 0%, #181417 58%, #111011 100%);
}

.rank-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 var(--space-2);
  border: 1px solid rgba(232, 225, 216, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(8, 8, 7, 0.64);
  color: rgba(232, 225, 216, 0.88);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.poster-placeholder-large {
  min-height: 420px;
  font-family: var(--font-serif);
  font-size: var(--font-size-2xl);
  font-weight: 700;
}

.movie-info {
  min-width: 0;
  padding: var(--space-5) var(--space-5) 0;
}

.rank {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.movie-info h2 {
  margin: 0 0 var(--space-3);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.movie-info h2 a {
  display: -webkit-box;
  overflow: hidden;
  color: var(--color-text);
  text-decoration: none;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-info h2 a:hover {
  color: var(--color-accent-hover);
  text-decoration: none;
}

.meta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  min-width: 0;
  min-height: 18px;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.overview {
  min-width: 0;
  margin: var(--space-3) var(--space-5) 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.movie-action-block {
  min-width: 0;
  margin-top: auto;
  padding: 0;
}

.action-status-row,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 0;
}

.action-status-row {
  padding: 0 var(--space-5) var(--space-3);
}

.movie-actions {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 0;
  margin-top: 0;
}

.movie-actions.htmx-request,
.movie-actions[aria-busy="true"],
.movie-actions:has(.htmx-request) {
  opacity: 0.78;
}

.movie-actions[aria-busy="true"]::after,
.movie-actions:has(.htmx-request)::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: rgba(17, 17, 16, 0.32);
  cursor: progress;
}

.movie-actions[aria-busy="true"] .action-state,
.movie-actions:has(.htmx-request) .action-state {
  pointer-events: none;
}

.action-feedback {
  margin: 0;
  font-size: 12px;
}

.action-feedback-success {
  color: var(--color-success);
}

.action-feedback[data-feedback-hidden] {
  display: none;
}

.action-state {
  min-width: 0;
}

.actions-enhanced .movie-actions[data-action-state="default"] .action-state-rating,
.actions-enhanced .movie-actions[data-action-state="default"] .action-state-radarr-remove,
.actions-enhanced .movie-actions[data-action-state="default"] .action-state-more,
.actions-enhanced .movie-actions[data-action-state="rating"] .action-state-default,
.actions-enhanced .movie-actions[data-action-state="rating"] .action-state-radarr-remove,
.actions-enhanced .movie-actions[data-action-state="rating"] .action-state-more,
.actions-enhanced .movie-actions[data-action-state="radarr-remove"] .action-state-default,
.actions-enhanced .movie-actions[data-action-state="radarr-remove"] .action-state-rating,
.actions-enhanced .movie-actions[data-action-state="radarr-remove"] .action-state-more,
.actions-enhanced .movie-actions[data-action-state="more"] .action-state-default,
.actions-enhanced .movie-actions[data-action-state="more"] .action-state-radarr-remove,
.actions-enhanced .movie-actions[data-action-state="more"] .action-state-rating {
  display: none;
}

.action-state-default {
  min-height: 51px;
  display: grid;
  grid-template-columns: auto minmax(0, auto) 1fr auto;
  align-items: center;
  gap: 2px;
  position: relative;
  padding: var(--space-3) var(--space-5);
  border-top: var(--border-subtle);
}

.action-inline-form {
  min-width: 0;
}

.action-control {
  min-width: 0;
  min-height: 34px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}

.action-control:hover {
  background: rgba(232, 225, 216, 0.05);
  color: var(--color-text-secondary);
  text-decoration: none;
}

.action-control-rating {
  color: var(--color-text-muted);
}

.movie-actions:has(.state-pill-rating) .action-control-rating {
  color: var(--color-accent);
  background: rgba(196, 124, 58, 0.1);
}

.action-control-watchlist.is-active {
  color: var(--color-accent-hover);
}

.action-control-watchlist {
  color: var(--color-text);
}

.action-control-more {
  justify-self: end;
  width: 34px;
  padding: 0;
  grid-column: 4;
}

.action-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  min-width: 180px;
  padding: var(--space-1) 0;
  overflow: hidden;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  box-shadow: var(--shadow-raised);
  display: none;
}

.action-state-default[data-menu-open="true"] .action-menu {
  display: grid;
}

.action-menu-item {
  width: 100%;
  min-height: 34px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary);
  justify-content: flex-start;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}

.action-menu-item:hover {
  background: rgba(232, 225, 216, 0.05);
}

.action-menu-item.is-danger {
  color: var(--color-danger);
}

.action-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  fill: currentColor;
}

.action-mode-button {
  display: none;
}

.actions-enhanced .action-mode-button {
  display: inline-flex;
}

.action-state-rating,
.action-state-radarr-remove,
.action-state-more {
  display: grid;
  gap: var(--space-2);
  min-height: 72px;
  padding: var(--space-3) var(--space-5);
  border-top: var(--border-subtle);
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-1);
}

.rating-digit {
  width: 100%;
  min-height: 30px;
  padding: 0;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.rating-digit:hover,
.rating-digit:focus-visible {
  border-color: var(--color-accent);
  background: rgba(196, 124, 58, 0.15);
  color: var(--color-accent-hover);
}

.rating-digit.is-active {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #0e0a06;
}

.action-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}

.action-cancel {
  justify-self: end;
  min-height: 30px;
  padding: 0 var(--space-3);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.action-cancel:hover {
  border-color: var(--color-border-strong);
  background: rgba(232, 225, 216, 0.05);
  color: var(--color-text-primary);
}

.suppress-form {
  min-width: 0;
  margin: 0;
}

.suppression-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-1);
}

.suppression-option {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 0 var(--space-2);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.suppression-option:hover,
.suppression-option:focus-visible {
  border-color: var(--color-accent);
  background: rgba(196, 124, 58, 0.12);
  color: var(--color-accent-hover);
}

.menu-action {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
}

.secondary-actions {
  display: grid;
  gap: var(--space-2);
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 100%;
  min-height: 26px;
  padding: 0 var(--space-3);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  overflow-wrap: anywhere;
}

.state-pill-rating {
  min-height: 24px;
  padding: 0 var(--space-3);
  border-color: rgba(196, 124, 58, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(196, 124, 58, 0.14);
  color: var(--color-accent-hover);
  font-size: 12px;
  font-weight: 800;
}

.state-pill-watchlist {
  border-color: #274020;
  background: #152210;
  color: #78b563;
}

.state-pill-suppression {
  border-color: #382020;
  background: #211414;
  color: #bd807a;
}

@media (min-width: 640px) {
  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .movie-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .auth-shell {
    display: block;
  }

  .auth-visual {
    display: none;
  }

  .auth-form-panel {
    min-height: 100vh;
    padding: max(0px, env(safe-area-inset-top)) var(--space-10)
      max(var(--space-10), env(safe-area-inset-bottom));
  }
}

@media (min-width: 1360px) {
  .movie-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

.detail-shell:empty {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: start center;
  padding: var(--space-10);
  padding-top: 56px;
  background: var(--color-overlay);
}

.modal-panel {
  width: min(1080px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-raised);
}

.detail-layout {
  padding: var(--space-10);
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: var(--space-10);
}

.detail-poster {
  align-self: start;
}

.detail-copy h1 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-tight);
}

.detail-title-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-7);
}

.close-link {
  flex: 0 0 auto;
  align-self: start;
  padding-top: var(--space-3);
}

.alt-title,
.tagline {
  margin: var(--space-3) 0 0;
  color: var(--color-text-muted);
}

.fact-grid,
.detail-list {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-8) 0 0;
}

.fact-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.fact-grid div,
.detail-list div {
  min-width: 0;
}

dt {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 700;
}

dd {
  margin: 2px 0 0;
}

.detail-overview {
  max-width: 760px;
  margin: var(--space-8) 0 0;
  color: var(--color-text-secondary);
  line-height: var(--line-height-body);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-8) 0 0;
}

.chips span {
  padding: 5px 9px;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-raised);
  color: var(--color-text-secondary);
}

@media (max-width: 900px) {
  .topbar-inner {
    min-height: 48px;
    padding: 0 var(--space-9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
  }

  .brand {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.55;
  }

  .nav-toggle {
    width: 32px;
    min-height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-toggle:hover,
  .nav-toggle:active {
    background: transparent;
    color: var(--color-text);
  }

  .app-nav {
    position: fixed;
    z-index: 50;
    inset: 0;
    width: auto;
    min-width: 0;
    background: rgba(0, 0, 0, 0.6);
  }

  .nav-menu {
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: var(--border-subtle);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: var(--color-surface-raised);
    box-shadow: none;
  }

  .nav-mobile-header {
    min-height: 48px;
    padding: 0 var(--space-9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: var(--border-subtle);
  }

  .nav-mobile-brand {
    color: var(--color-text);
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
  }

  .nav-close {
    width: 32px;
    min-height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-close:hover,
  .nav-close:active {
    background: transparent;
    color: var(--color-text);
  }

  .nav-close-icon,
  .nav-close-icon::after {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: var(--radius-pill);
    background: currentColor;
  }

  .nav-close-icon {
    position: relative;
    transform: rotate(45deg);
  }

  .nav-close-icon::after {
    content: "";
    position: absolute;
    left: 0;
    transform: rotate(90deg);
  }

  .nav-links,
  .nav-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
  }

  .nav-links {
    padding: var(--space-5);
  }

  .nav-actions {
    margin-left: 0;
    padding: var(--space-4) var(--space-5) var(--space-5);
    border-top: var(--border-subtle);
    border-left: 0;
    display: block;
  }

  .nav-link {
    min-height: 41px;
    padding: 0 var(--space-3);
    display: flex;
    align-items: center;
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
  }

  .nav-link[aria-current="page"] {
    color: var(--color-accent);
    background: #2a1c08;
  }

  .nav-link[aria-current="page"]::after {
    display: none;
  }

  .user-menu {
    display: none;
  }

  .nav-mobile-user {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  .nav-mobile-user .user {
    max-width: min(200px, 48vw);
    padding: 0;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-mobile-user-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
  }

  .nav-mobile-user-link {
    min-height: 30px;
    padding: 0 var(--space-4);
    border: var(--border-subtle);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    font: inherit;
    font-size: 12px;
    text-align: center;
  }

  .nav-mobile-user-link:hover,
  .nav-mobile-user-link[aria-current="page"] {
    border-color: var(--color-accent);
    background: #2a1c08;
    color: var(--color-accent);
    text-decoration: none;
  }

  .logout-form .nav-mobile-user-link {
    min-height: 30px;
    color: var(--color-text-muted);
  }

  .page {
    padding: calc(49px + var(--space-7)) var(--space-7) var(--space-7);
  }

  .auth-page {
    padding: 0;
  }

  .auth-form-panel {
    padding-right: var(--space-10);
    padding-left: var(--space-10);
  }

  .llm-search-workspace {
    width: min(860px, calc(100% - 16px));
  }

  .llm-search-page:not(.is-compact) .llm-search-workspace {
    margin-top: 79px;
  }

  .llm-query-field textarea {
    min-height: 96px;
  }

  .llm-search-page.is-compact .llm-search-controls button,
  .llm-search-page.is-submitting .llm-search-controls button {
    width: auto;
  }

  .llm-search-page.is-compact .llm-search-workspace,
  .llm-search-page.is-submitting .llm-search-workspace {
    margin-top: var(--space-7);
  }

  .llm-example-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .movie-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .movie-card {
    display: grid;
    grid-template-columns: minmax(112px, 124px) minmax(0, 1fr);
  }

  .movie-main {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(112px, 124px) minmax(0, 1fr);
    align-items: start;
  }

  .movie-poster-column {
    width: 100%;
  }

  .poster-frame {
    border-radius: var(--radius-md) 0 var(--radius-md) 0;
  }

  .rank-badge {
    top: var(--space-2);
    left: var(--space-2);
    min-height: 20px;
    font-size: 10px;
  }

  .movie-info {
    padding: var(--space-5);
  }

  .movie-info h2 {
    margin-bottom: var(--space-2);
    font-size: 14px;
  }

  .meta {
    font-size: 11px;
  }

  .overview {
    grid-column: 1 / -1;
    margin: var(--space-4) var(--space-5) 0;
    -webkit-line-clamp: 2;
  }

  .movie-action-block {
    grid-column: 1 / -1;
    padding: 0;
  }

  .movie-actions {
    gap: 0;
  }

  .action-state-default {
    grid-template-columns: auto minmax(0, auto) 1fr auto;
  }

  .action-control {
    min-height: 38px;
    padding: 0 var(--space-2);
  }

  .state-pill {
    min-height: 24px;
    font-size: 12px;
  }

  .recommendation-toolbar {
    display: grid;
  }

  .recommendation-toolbar form {
    width: 100%;
  }

  .recommendation-toolbar button {
    width: 100%;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    padding: var(--space-7);
  }

  .modal-backdrop {
    padding: var(--space-4);
    padding-top: var(--space-4);
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
  }

  .detail-copy h1 {
    font-size: 26px;
  }

  .detail-title-row {
    display: block;
  }
}

@media (max-width: 639px) {
  .llm-search-workspace {
    width: 100%;
  }

  .llm-search-page:not(.is-compact) .llm-search-workspace {
    margin-top: 55px;
  }

  .llm-search-controls button {
    width: 100%;
  }

  .llm-search-page.is-compact .llm-search-controls button,
  .llm-search-page.is-submitting .llm-search-controls button {
    width: auto;
  }

  .profile-page {
    width: 100%;
  }

  .profile-actions {
    align-items: stretch;
  }

  .profile-radarr-actions {
    flex-direction: column;
  }

  .profile-radarr-actions .profile-primary,
  .profile-radarr-actions .profile-secondary,
  .profile-radarr-actions .profile-danger-secondary {
    width: 100%;
    justify-content: center;
  }

  .profile-modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .profile-modal-panel {
    width: 100%;
    max-height: min(720px, calc(100dvh - 24px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }

  .profile-modal-small {
    width: 100%;
    border-radius: 16px 16px 0 0;
  }

  .profile-modal-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 639px) and (prefers-reduced-motion: no-preference) {
  .nav-menu {
    transition: opacity 120ms ease, transform 120ms ease;
  }
}
