/*
 * Shared design system imported from Bytebeam Hiring.
 * Source: review_app/static/styles.css at 1461e872c9d0a5a3b6a89c3d7685b1c89d45007f.
 * Theme tokens and selected control rules retain the source cascade order.
 * See DESIGN.md for the design contract and import scope.
 */

:root {
  color-scheme: light;

  --linear-background: #ffffff;
  --linear-foreground: #44494d;
  --linear-sidebar: #edeef3;
  --linear-sidebar-foreground: #44494d;
  --linear-accent: #475ba1;
  --linear-accent-foreground: #ffffff;
  --bg: var(--linear-background);
  --panel: var(--linear-background);
  --surface-subtle: var(--linear-sidebar);
  --surface-hover: color-mix(in oklab, var(--linear-foreground) 9%, var(--linear-background));
  --surface-raised: color-mix(in oklab, var(--linear-sidebar) 44%, var(--linear-background));
  --ink: var(--linear-foreground);
  --ink-secondary: color-mix(in oklab, var(--linear-foreground) 86%, var(--linear-background));
  --muted: color-mix(in oklab, var(--linear-foreground) 66%, var(--linear-background));
  --line: color-mix(in oklab, var(--linear-foreground) 18%, var(--linear-background));
  --line-strong: color-mix(in oklab, var(--linear-foreground) 34%, var(--linear-background));
  --accent: var(--linear-accent);
  --accent-hover: color-mix(in oklab, var(--linear-accent) 84%, var(--linear-foreground));
  --accent-soft: color-mix(in oklab, var(--linear-accent) 13%, var(--linear-background));
  --on-accent: var(--linear-accent-foreground);
  --input-bg: var(--linear-background);
  --viewer-bg: var(--linear-sidebar);
  --pdf-canvas: color-mix(in oklab, var(--linear-sidebar) 76%, var(--linear-foreground));
  --document-bg: var(--linear-accent-foreground);
  --toast-bg: var(--linear-foreground);
  --toast-ink: var(--linear-background);
  --danger: #b42318;
  --danger-soft: #ffe6e2;
  --warn: #8a5d00;
  --warn-soft: #fff3c4;
  --medium: #7257a8;
  --medium-soft: #ece7f7;
  --high: #166534;
  --high-soft: #ddf7e7;
  --edu: #1f5f9f;
  --edu-soft: #eef6ff;
  --work: #0f766e;
  --work-soft: #eaf7f4;
  --project: #8b5a10;
  --project-soft: #fff8ed;
  --shadow: 0 1px 2px rgba(18, 18, 23, 0.08);
  --shadow-soft: none;
  --shadow-popover: 0 12px 32px rgba(18, 18, 23, 0.14);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --linear-background: #0f0f10;
  --linear-foreground: #eeeff1;
  --linear-sidebar: #151516;
  --linear-sidebar-foreground: #eeeff1;
  --linear-accent: #d25e65;
  --linear-accent-foreground: #ffffff;
  --danger: color-mix(in oklab, #b42318 62%, var(--linear-foreground));
  --danger-soft: color-mix(in oklab, #b42318 22%, var(--linear-background));
  --warn: color-mix(in oklab, #8a5d00 58%, var(--linear-foreground));
  --warn-soft: color-mix(in oklab, #8a5d00 20%, var(--linear-background));
  --medium: color-mix(in oklab, #7257a8 62%, var(--linear-foreground));
  --medium-soft: color-mix(in oklab, #7257a8 22%, var(--linear-background));
  --high: color-mix(in oklab, #166534 58%, var(--linear-foreground));
  --high-soft: color-mix(in oklab, #166534 22%, var(--linear-background));
  --edu: color-mix(in oklab, #1f5f9f 58%, var(--linear-foreground));
  --edu-soft: color-mix(in oklab, #1f5f9f 22%, var(--linear-background));
  --work: color-mix(in oklab, #0f766e 58%, var(--linear-foreground));
  --work-soft: color-mix(in oklab, #0f766e 22%, var(--linear-background));
  --project: color-mix(in oklab, #8b5a10 58%, var(--linear-foreground));
  --project-soft: color-mix(in oklab, #8b5a10 22%, var(--linear-background));
  --shadow: 0 1px 2px color-mix(in oklab, black 36%, transparent);
  --shadow-popover: 0 16px 36px color-mix(in oklab, black 52%, transparent);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Variable", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  border-radius: 6px;
  min-height: 34px;
  padding: 7px 11px;
  cursor: pointer;
}

button:hover {
  border-color: var(--line-strong);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.bytebeam-logo {
  display: block;
  width: 109px;
  height: 29px;
  flex: 0 0 auto;
  object-fit: contain;
}

:root[data-theme="dark"] .bytebeam-logo {
  filter: invert(1);
}

.aiequ-logo {
  display: none;
  width: 109px;
  height: 29px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  line-height: 1;
  white-space: nowrap;
}

.aiequ-logo-name {
  font-size: 15px;
  font-weight: 750;
}

.aiequ-logo-mobility {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

:root[data-brand="aiequ"] .bytebeam-logo {
  display: none;
}

:root[data-brand="aiequ"] .aiequ-logo {
  display: inline-flex;
}

.theme-switcher {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.theme-switcher button {
  min-height: 26px;
  padding: 3px 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.theme-switcher button:hover {
  color: var(--ink);
}

.theme-switcher button.active {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.primary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 650;
  text-decoration: none;
}

.primary-link-button:hover {
  background: var(--accent-hover);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  font-weight: 650;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  white-space: nowrap;
}

.toolbar-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.toolbar-field span {
  flex: 0 0 auto;
}

label {
  display: grid;
  gap: 5px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

select,
input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 7px 9px;
}

.nav-controls {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0;
  border-top: 0;
}

.workspace-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  min-height: 34px;
  padding: 6px 12px;
}

.tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

h1,
h2 {
  font-family: "Inter Display", "Inter Variable", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.top-controls {
  min-height: 44px;
  gap: 8px;
  padding: 5px 8px;
  background: var(--surface-subtle);
}

.toolbar-field {
  gap: 5px;
}

.toolbar-field > span,
label span {
  font-size: 11px;
  font-weight: 550;
  text-transform: none;
}

.top-controls select,
.top-controls input {
  min-height: 32px;
  border-color: transparent;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.top-controls select:hover,
.top-controls input:hover {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.nav-controls {
  gap: 4px;
}

.nav-controls button {
  min-height: 30px;
  padding: 5px 9px;
  border-color: transparent;
  background: transparent;
}

.nav-controls button:not(:disabled):hover {
  background: var(--surface-hover);
}

.workspace-tabs {
  min-height: 38px;
  gap: 3px;
  padding: 4px 8px;
}

.tab {
  min-height: 28px;
  padding: 4px 9px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

.tab:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.tab.active {
  border: 0;
  background: var(--surface-subtle);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.theme-switcher {
  border-color: transparent;
}

.theme-switcher button {
  min-height: 24px;
  padding: 2px 6px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 36px));
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--toast-bg);
  color: var(--toast-ink);
  box-shadow: var(--shadow-popover);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Syncup document/branding defaults, using the inherited palette. */
body {
  line-height: 1.45;
  letter-spacing: 0;
}

textarea {
  font: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
    transform: none;
  }
}
