:root {
  --ink: #162033;
  --muted: #607086;
  --line: #d9e3ee;
  --paper: #f3f7fb;
  --panel: #ffffff;
  --blue: #195b9b;
  --teal: #13756f;
  --soft-blue: #e8f1fb;
  --shadow: 0 22px 60px rgba(22, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #edf4fb;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a,
button,
input {
  font: inherit;
}

a {
  text-decoration: none;
}

.library-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.library-sidebar {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 0.75rem;
  max-height: 100vh;
  padding: 0.75rem;
  color: #ffffff;
  background: #111c2f;
}

.library-brand {
  padding: 0.65rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.library-sidebar .eyebrow {
  color: #5eead4;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.45rem;
  font-size: 1.85rem;
  line-height: 1;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.05;
}

.library-brand p,
.stage-header p {
  color: #aab6c8;
  line-height: 1.45;
}

.stage-header p {
  color: var(--muted);
}

.nav-links,
.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.nav-links a,
.secondary-action,
.primary-action {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  border-radius: 8px;
  padding: 0.46rem 0.66rem;
  font-size: 0.78rem;
  font-weight: 850;
}

.nav-links a {
  border: 1px solid rgba(94, 234, 212, 0.45);
  color: #ccfbf1;
}

.nav-links a:hover {
  background: rgba(20, 184, 166, 0.16);
}

.primary-action {
  border: 1px solid var(--blue);
  color: #ffffff;
  background: var(--blue);
}

.secondary-action {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
}

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

.library-search {
  display: grid;
  gap: 0.35rem;
  padding: 0 0.65rem;
  color: #aab6c8;
  font-size: 0.75rem;
  font-weight: 850;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0.68rem 0.75rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

input::placeholder {
  color: #7f8da3;
}

.category-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  max-height: 8.4rem;
  overflow: auto;
  padding: 0 0.65rem;
}

.category-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.3rem 0.46rem;
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 850;
}

.category-button.active {
  border-color: rgba(94, 234, 212, 0.75);
  color: #ccfbf1;
  background: rgba(20, 184, 166, 0.18);
}

.category-button strong {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  color: #111c2f;
  background: #5eead4;
  font-size: 0.65rem;
}

.visual-list {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  overflow: auto;
}

.visual-button {
  display: grid;
  gap: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 0.66rem;
  color: #dbeafe;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.visual-button.active {
  border-color: rgba(94, 234, 212, 0.75);
  background: rgba(20, 184, 166, 0.16);
}

.visual-button span {
  color: #5eead4;
  font-size: 0.67rem;
  font-weight: 950;
  text-transform: uppercase;
}

.visual-button strong {
  color: #ffffff;
  font-size: 0.86rem;
  line-height: 1.18;
}

.visual-button small {
  color: #aab6c8;
  font-size: 0.78rem;
  font-weight: 700;
}

.empty-list {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 0.82rem;
  color: #aab6c8;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  font-weight: 750;
}

.library-stage {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100vh;
  min-width: 0;
  padding: 0.65rem;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.stage-actions {
  align-items: flex-start;
  justify-content: flex-end;
}

.signal-strip {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1rem;
  margin-bottom: 0.55rem;
  border: 1px solid #c9d9e8;
  border-left: 6px solid var(--blue);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: #f8fbfe;
}

.signal-strip span,
.signal-strip strong {
  overflow-wrap: anywhere;
  color: #2f3b4b;
  font-size: 0.84rem;
  line-height: 1.35;
}

iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

@media (max-width: 1120px) {
  .library-shell {
    grid-template-columns: 1fr;
  }

  .visual-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-header,
  .signal-strip {
    display: grid;
  }
}

@media (max-width: 720px) {
  .visual-list {
    grid-template-columns: 1fr;
  }
}
