:root {
  --ink: #172421;
  --ink-soft: #52625e;
  --forest: #173f3a;
  --forest-2: #23564e;
  --mint: #dff1e8;
  --mint-2: #edf8f2;
  --paper: #ffffff;
  --canvas: #f4f2ec;
  --sand: #ebe6da;
  --gold: #c8993f;
  --danger: #9d3d48;
  --warning: #a46718;
  --line: #dfe5e1;
  --line-strong: #c8d1cc;
  --shadow: 0 18px 50px rgba(23, 63, 58, .10);
  --shadow-soft: 0 8px 24px rgba(23, 63, 58, .08);
  --radius: 16px;
  --radius-sm: 10px;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 5% 10%, rgba(223, 241, 232, .85), transparent 32%),
    var(--canvas);
  color: var(--ink);
}

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

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(35, 86, 78, .28);
  outline-offset: 2px;
}

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

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(23, 63, 58, .12);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px 12px 12px 4px;
  background: var(--forest);
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 5px 12px rgba(23, 63, 58, .18);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand strong {
  font-size: 18px;
  letter-spacing: -.02em;
}

.brand small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.main-nav {
  display: flex;
  align-self: stretch;
  gap: 4px;
}

.nav-item {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0 16px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 650;
}

.nav-item:hover,
.nav-item.active {
  color: var(--forest);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--forest);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid #cfe5d9;
  border-radius: 999px;
  background: var(--mint-2);
  color: var(--forest);
  font-size: 12px;
  font-weight: 650;
}

.privacy-pill span {
  color: #2a936c;
  font-size: 10px;
}

.suite-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(23, 63, 58, .16);
  border-radius: 999px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.suite-link:hover {
  border-color: rgba(23, 63, 58, .34);
  background: var(--mint-2);
}

.avatar-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #d6ded9;
  border-radius: 50%;
  background: white;
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Home */

.home-screen {
  min-height: calc(100vh - 72px);
  background:
    linear-gradient(115deg, rgba(23, 63, 58, .035) 1px, transparent 1px) 0 0 / 40px 40px,
    radial-gradient(circle at 10% 20%, rgba(223, 241, 232, .95), transparent 36%),
    radial-gradient(circle at 90% 75%, rgba(200, 153, 63, .10), transparent 30%),
    #f8f7f2;
}

.home-wrap {
  width: min(1260px, calc(100% - 48px));
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(520px, 1fr);
  align-items: center;
  gap: clamp(50px, 7vw, 110px);
  padding: 56px 0 72px;
}

.eyebrow,
.section-kicker,
.step-kicker {
  color: var(--forest-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
}

.eyebrow span {
  width: 26px;
  height: 2px;
  background: var(--gold);
}

.home-copy h1 {
  max-width: 650px;
  margin-bottom: 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 5vw, 72px);
  line-height: .98;
  letter-spacing: -.045em;
  font-weight: 500;
}

.home-copy h1 em {
  color: var(--forest);
  font-weight: 500;
}

.home-lead {
  max-width: 570px;
  color: #4c5c58;
  font-size: 19px;
  line-height: 1.6;
}

.trust-row {
  max-width: 540px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 34px 0;
}

.trust-row div {
  padding: 16px 18px;
  border-left: 1px solid #cbd9d1;
}

.trust-row strong,
.trust-row span {
  display: block;
}

.trust-row strong {
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
}

.trust-row span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.merlin-quote {
  max-width: 520px;
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 17px 20px;
  border: 1px solid #d5e5dc;
  border-radius: 18px 18px 18px 5px;
  background: rgba(255, 255, 255, .72);
}

.merlin-orb {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: block;
  border: 0;
  background: url("assets/merlin.gif") center / contain no-repeat;
  filter: drop-shadow(0 8px 9px rgba(23, 63, 58, .18));
  animation: merlin-float 2.7s ease-in-out infinite;
}

.merlin-orb.advice {
  background-image: url("assets/merlin-conseil.gif");
}

@keyframes merlin-float {
  50% { transform: translateY(-4px); }
}

.merlin-orb.small {
  width: 34px;
  height: 34px;
  font-size: 16px;
}

.merlin-quote strong {
  font-size: 14px;
}

.merlin-quote p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.starter-card {
  padding: 32px;
  border: 1px solid rgba(23, 63, 58, .12);
  border-radius: 24px 24px 24px 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 28px 70px rgba(23, 63, 58, .13);
}

.starter-heading h2 {
  margin: 7px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -.025em;
}

.starter-heading p {
  color: var(--ink-soft);
  font-size: 14px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0;
}

.choice-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  transition: .2s ease;
}

.choice-card:hover,
.choice-card.selected {
  border-color: var(--forest-2);
  background: var(--mint-2);
  box-shadow: 0 0 0 2px rgba(35, 86, 78, .08);
}

.choice-card input,
.template-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 9px;
  background: #eef1ef;
  color: var(--forest);
  font-size: 11px;
  font-weight: 900;
}

.choice-card.selected .choice-icon {
  background: var(--forest);
  color: white;
}

.choice-card strong {
  font-size: 13px;
}

.choice-card small {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.starter-card label > span:first-child,
.editor-content label > span:first-child {
  display: block;
  margin-bottom: 7px;
  color: #344540;
  font-size: 12px;
  font-weight: 700;
}

.starter-card input,
.starter-card select,
.editor-content input,
.editor-content select,
.editor-content textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  transition: .16s ease;
}

.starter-card input,
.starter-card select,
.editor-content input,
.editor-content select {
  min-height: 44px;
  padding: 0 12px;
}

.editor-content textarea {
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.55;
}

.starter-card input:focus,
.starter-card select:focus,
.editor-content input:focus,
.editor-content select:focus,
.editor-content textarea:focus {
  outline: none;
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(35, 86, 78, .09);
}

.form-row,
.form-grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid.three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.starter-card > label,
.starter-card .form-row {
  display: block;
  margin-top: 16px;
}

.starter-card .form-row {
  display: grid;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 750;
  transition: .18s ease;
}

.primary-button {
  border: 1px solid var(--forest);
  background: var(--forest);
  color: #fff;
  box-shadow: 0 6px 16px rgba(23, 63, 58, .15);
}

.primary-button:hover {
  background: #0f342f;
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--forest);
}

.secondary-button:hover {
  border-color: var(--forest-2);
  background: var(--mint-2);
}

.starter-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 24px;
  border-radius: 11px;
  font-size: 14px;
}

.starter-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 11px;
}

.starter-footer > span:first-child {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: var(--forest);
  font-size: 10px;
}

/* Builder */

.builder-screen {
  background: #eef0ed;
}

.builder-heading {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 28px;
  border-bottom: 1px solid #d9dfdb;
  background: #fff;
}

.back-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
}

.project-title-row h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.025em;
}

.draft-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1eee5;
  color: #746747;
  font-size: 10px;
  font-weight: 700;
}

.builder-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.autosave-switch,
.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11px;
}

.autosave-switch input,
.toggle-line input {
  position: absolute;
  opacity: 0;
}

.autosave-switch > span,
.toggle-line > span {
  width: 34px;
  height: 19px;
  position: relative;
  border-radius: 999px;
  background: #bdc7c1;
  transition: .2s ease;
}

.autosave-switch > span::after,
.toggle-line > span::after {
  content: "";
  width: 15px;
  height: 15px;
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.18);
  transition: .2s ease;
}

.autosave-switch input:checked + span,
.toggle-line input:checked + span {
  background: var(--forest-2);
}

.autosave-switch input:checked + span::after,
.toggle-line input:checked + span::after {
  transform: translateX(15px);
}

.builder-layout {
  height: calc(100vh - 164px);
  min-height: 710px;
  display: grid;
  grid-template-columns: 238px minmax(480px, 1.1fr) minmax(460px, .9fr);
  overflow: hidden;
}

.steps-panel {
  overflow-y: auto;
  padding: 24px 17px;
  border-right: 1px solid #d9dfdb;
  background: #fafbf9;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.progress-head strong {
  color: var(--forest);
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e8e5;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest), #55957e);
  transition: width .3s ease;
}

.step-nav {
  display: grid;
  gap: 4px;
  margin: 22px 0;
}

.step-button {
  width: 100%;
  display: grid;
  grid-template-columns: 29px 1fr 20px;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.step-button:hover {
  background: #f0f4f1;
}

.step-button.active {
  border-color: #d3e3da;
  background: var(--mint-2);
}

.step-number {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #d8dedb;
  border-radius: 8px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
}

.step-button.active .step-number {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}

.step-button strong,
.step-button small {
  display: block;
}

.step-button strong {
  font-size: 12px;
}

.step-button small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9px;
}

.step-state {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e4eee8;
  color: var(--forest);
  font-size: 9px;
  font-weight: 800;
}

.import-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px dashed #b7c9bf;
  border-radius: 11px;
  background: #fff;
  text-align: left;
}

.import-card:hover {
  border-color: var(--forest-2);
  background: var(--mint-2);
}

.import-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--mint);
  color: var(--forest);
  font-size: 18px;
}

.import-card strong,
.import-card small {
  display: block;
}

.import-card strong {
  font-size: 11px;
}

.import-card small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.template-link {
  display: block;
  margin-top: 9px;
  color: var(--forest-2);
  font-size: 10px;
  text-align: center;
}

.editor-panel {
  min-width: 0;
  overflow: hidden;
  background: #fff;
}

.editor-toolbar,
.preview-toolbar {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid #e2e7e3;
}

.document-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: #eef1ef;
}

.doc-tab {
  min-width: 72px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.doc-tab.active {
  background: #fff;
  color: var(--forest);
  box-shadow: 0 2px 7px rgba(23, 63, 58, .1);
}

.merlin-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid #cee0d6;
  border-radius: 8px;
  background: var(--mint-2);
  color: var(--forest);
  font-size: 10px;
  font-weight: 700;
}

.merlin-inline span {
  width: 19px;
  height: 19px;
  display: block;
  background: url("assets/merlin.gif") center / contain no-repeat;
}

.editor-content {
  height: calc(100% - 58px);
  overflow-y: auto;
  padding: 28px 30px 100px;
}

.editor-step {
  display: none;
  max-width: 860px;
  margin: 0 auto;
}

.editor-step.active {
  display: block;
  animation: reveal .25s ease;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 5px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -.025em;
}

.section-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.quality-chip {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #e0d7bf;
  border-radius: 999px;
  background: #fbf7ea;
  color: #81651f;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.quality-chip.good,
.quality-chip.safe {
  border-color: #cce3d6;
  background: var(--mint-2);
  color: var(--forest);
}

.editor-step > label,
.editor-step > .form-grid,
.repeatable-block {
  display: block;
  margin-top: 20px;
}

.editor-step .form-grid {
  margin-top: 16px;
}

.field-note {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: right;
}

.field-note.warning {
  color: var(--warning);
}

.merlin-suggestion,
.impact-coach {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid #cce2d6;
  border-radius: 12px 12px 12px 4px;
  background: linear-gradient(135deg, var(--mint-2), #fff);
}

.merlin-suggestion strong,
.impact-coach strong {
  font-size: 12px;
}

.merlin-suggestion p,
.impact-coach p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.suggestion-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.suggestion-actions button,
.text-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 800;
}

.suggestion-actions button:first-child {
  padding: 6px 9px;
  border-radius: 7px;
  background: var(--forest);
  color: white;
}

.editor-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid #e5e9e6;
  color: var(--ink-soft);
  font-size: 10px;
}

.editor-next.final {
  justify-content: flex-end;
}

.privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid #d9e7df;
  border-radius: 10px;
  background: #f7fbf8;
}

.privacy-notice > span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 700;
}

.privacy-notice p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.optional-fields {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 24px;
  padding: 16px;
  border-radius: 11px;
  background: #f6f7f5;
}

.optional-fields > div {
  margin-right: auto;
}

.optional-fields strong {
  font-size: 12px;
}

.optional-fields p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.skill-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 17px;
}

.skill-filter {
  padding: 7px 11px;
  border: 1px solid #d9e0dc;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
}

.skill-filter.active {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}

.skill-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(210px, .65fr);
  gap: 16px;
}

.library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.library-head strong {
  font-size: 12px;
}

.library-head p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.search-field input {
  min-height: 34px !important;
  width: 130px !important;
  font-size: 10px;
}

.suggested-skills {
  min-height: 260px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 7px;
  padding: 14px;
  border: 1px solid #e0e5e2;
  border-radius: 11px;
  background: #fafbf9;
}

.suggested-skill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid #d7dfda;
  border-radius: 8px;
  background: #fff;
  color: #344540;
  font-size: 9px;
  font-weight: 650;
}

.suggested-skill::before {
  content: "+";
  color: var(--forest-2);
  font-weight: 900;
}

.suggested-skill:hover,
.suggested-skill.added {
  border-color: #a9c6b7;
  background: var(--mint-2);
}

.suggested-skill.added::before {
  content: "✓";
}

.custom-skill-row {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 7px;
  margin-top: 9px;
}

.custom-skill-row input,
.custom-skill-row select {
  min-height: 38px !important;
  font-size: 10px;
}

.custom-skill-row .secondary-button {
  min-height: 38px;
}

.selected-skills-panel {
  border: 1px solid #dae2dd;
  border-radius: 11px;
  background: #fff;
}

.selected-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 13px;
  border-bottom: 1px solid #e5e9e6;
}

.selected-title strong {
  font-size: 11px;
}

.selected-title span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: var(--forest);
  font-size: 9px;
  font-weight: 800;
}

#selected-skills {
  max-height: 330px;
  overflow-y: auto;
  padding: 8px;
}

.selected-skill {
  display: grid;
  grid-template-columns: 7px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 7px;
  border-bottom: 1px solid #edf0ee;
}

.selected-skill:last-child {
  border-bottom: 0;
}

.skill-category-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4f8c79;
}

.skill-category-dot.soft { background: #b98551; }
.skill-category-dot.tool { background: #6b78a5; }
.skill-category-dot.method { background: #8a6792; }
.skill-category-dot.management { background: #b55f66; }
.skill-category-dot.compliance { background: #61776d; }

.selected-skill strong,
.selected-skill small {
  display: block;
}

.selected-skill strong {
  font-size: 9px;
}

.selected-skill small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
}

.selected-skill button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9a555a;
  font-size: 14px;
}

.experience-list {
  display: grid;
  gap: 13px;
}

.experience-card {
  border: 1px solid #dce3df;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.experience-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  background: #f7f8f6;
}

.experience-card-head span,
.experience-card-head strong {
  display: block;
}

.experience-card-head span {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.experience-card-head strong {
  margin-top: 3px;
  font-size: 11px;
}

.icon-button {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid #d6ddda;
  border-radius: 7px;
  background: #fff;
}

.experience-fields {
  display: block;
  padding: 0 15px 16px;
}

.experience-card.collapsed .experience-fields {
  display: none;
}

.experience-card label {
  display: block;
  margin-top: 14px;
}

.add-block-button {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 1px dashed #b9c8c0;
  border-radius: 10px;
  background: #f9fbf9;
  color: var(--forest);
  font-size: 10px;
  font-weight: 800;
}

.repeatable-block {
  padding: 17px;
  border: 1px solid #dce3df;
  border-radius: 12px;
}

.repeatable-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.repeatable-heading strong {
  font-size: 12px;
}

.language-row {
  display: grid;
  grid-template-columns: 1fr 140px 1fr 140px;
  gap: 10px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.template-card {
  position: relative;
  padding: 12px;
  border: 1px solid #dce2df;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: .18s ease;
}

.template-card:hover,
.template-card.selected {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 2px rgba(35, 86, 78, .08);
}

.template-preview {
  height: 128px;
  display: grid;
  grid-template-columns: 26% 1fr;
  grid-template-rows: 26px 14px 1fr;
  gap: 6px;
  margin-bottom: 11px;
  padding: 12px;
  border-radius: 7px;
  background: #eef0ed;
  overflow: hidden;
}

.template-preview i {
  grid-column: 1 / -1;
  border-radius: 3px;
  background: var(--forest);
}

.template-preview b,
.template-preview em {
  display: block;
  border-radius: 2px;
  background: #c4cec8;
}

.template-preview b:first-of-type {
  grid-column: 1 / -1;
}

.template-preview em {
  height: 5px;
  margin-bottom: 5px;
  background: #a9b7b0;
}

.mini-impact {
  background: #eee9df;
}

.mini-impact i {
  background: #263c4b;
}

.mini-expert {
  grid-template-columns: 34% 1fr;
  background: #eef2f1;
}

.mini-expert i {
  background: #52655d;
}

.mini-modern {
  grid-template-columns: 35% 1fr;
  background: linear-gradient(90deg, #dce8e2 0 35%, #f3f4f1 35%);
}

.mini-modern i {
  background: #2f675d;
}

.mini-executive {
  background: #f4f0e8;
}

.mini-executive i {
  background: #172d3e;
  box-shadow: inset 0 -3px #b78a4e;
}

.mini-timeline {
  position: relative;
  grid-template-columns: 18% 1fr;
  background: #f2f3f1;
}

.mini-timeline::after {
  content: "";
  position: absolute;
  left: 34%;
  top: 48px;
  bottom: 10px;
  width: 2px;
  background: #79958b;
}

.template-risk {
  display: inline-flex;
  width: max-content;
  margin-top: 7px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #fff0d9;
  color: #80551e;
  font-size: 7px;
  font-weight: 850;
  text-transform: uppercase;
}

.template-risk.good {
  background: #e6f4ef;
  color: #2e6e63;
}

.template-card > strong,
.template-card > small {
  display: block;
}

.template-card > strong {
  font-size: 12px;
}

.template-card > small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.recommended-label {
  position: absolute;
  top: 19px;
  right: 18px;
  padding: 4px 6px;
  border-radius: 999px;
  background: white;
  color: var(--forest);
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}

.accessibility-checks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 22px;
}

.accessibility-checks div {
  display: grid;
  grid-template-columns: 25px 1fr;
  column-gap: 8px;
  padding: 12px;
  border: 1px solid #dce6e0;
  border-radius: 10px;
  background: #f8fbf9;
}

.accessibility-checks span {
  grid-row: 1 / 3;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: var(--forest);
  font-size: 10px;
  font-weight: 900;
}

.accessibility-checks strong {
  font-size: 10px;
}

.accessibility-checks small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.35;
}

.review-score-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 1px solid #cfe2d7;
  border-radius: 14px;
  background: linear-gradient(130deg, var(--mint-2), white);
}

.score-ring {
  width: 83px;
  height: 83px;
  display: grid;
  place-content: center;
  grid-template-columns: auto auto;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, white 78%, transparent 79% 99%),
    conic-gradient(var(--forest-2) 82%, #dfe7e2 0);
}

.score-ring strong {
  font-family: Georgia, serif;
  font-size: 28px;
}

.score-ring span {
  align-self: end;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.review-score-card h3 {
  margin: 4px 0;
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 500;
}

.review-score-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.review-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.review-item {
  display: grid;
  grid-template-columns: 29px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid #dfe5e1;
  border-radius: 10px;
}

.review-item > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
}

.review-item.success > span {
  background: var(--mint);
  color: var(--forest);
}

.review-item.warning > span {
  background: #fbecd3;
  color: var(--warning);
}

.review-item strong {
  font-size: 11px;
}

.review-item p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.review-item > b {
  color: var(--forest);
  font-size: 9px;
}

.review-item > button {
  padding: 5px 8px;
  border: 1px solid #d6deda;
  border-radius: 7px;
  background: #fff;
  color: var(--forest);
  font-size: 9px;
  font-weight: 800;
}

.review-ethics {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 10px;
  background: #f6f7f5;
}

.review-ethics input {
  width: auto;
  min-height: auto;
  margin-top: 2px;
}

.review-ethics strong,
.review-ethics span {
  display: block;
}

.review-ethics strong {
  font-size: 10px;
}

.review-ethics span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

/* Preview */

.preview-panel {
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid #d9dfdb;
  background: #e4e7e4;
}

.preview-toolbar {
  background: #f8f9f7;
}

.preview-toolbar strong,
.preview-toolbar span {
  display: block;
}

.preview-toolbar strong {
  font-size: 11px;
}

.preview-toolbar > div:first-child span {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9px;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.zoom-controls button {
  width: 26px;
  height: 26px;
  border: 1px solid #d1d9d4;
  border-radius: 7px;
  background: #fff;
}

.zoom-controls span {
  min-width: 31px;
  color: var(--ink-soft);
  font-size: 9px;
  text-align: center;
}

.document-stage {
  height: calc(100% - 107px);
  overflow: auto;
  padding: 34px;
}

.document-paper {
  --accent: #1d5248;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 17mm 17mm 15mm;
  background: #fff;
  box-shadow: 0 15px 35px rgba(28, 43, 39, .16);
  color: #1a2421;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  transform: scale(.72);
  transform-origin: top center;
  margin-bottom: -82mm;
  transition: transform .2s ease;
}

.document-paper.accent-navy { --accent: #263c59; }
.document-paper.accent-plum { --accent: #674663; }
.document-paper.accent-mono { --accent: #171b1a; }

.cv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16mm;
  padding-bottom: 7mm;
  border-bottom: 1.4pt solid var(--accent);
}

.cv-header h2 {
  margin: 0;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25pt;
  font-weight: 500;
  letter-spacing: -.4pt;
}

.cv-header > div:first-child p {
  margin: 2mm 0 0;
  color: #3f514c;
  font-size: 12pt;
  font-weight: 700;
}

.cv-contact {
  display: grid;
  gap: 2mm;
  padding-top: 1mm;
  color: #4f5d59;
  font-size: 8.5pt;
  text-align: right;
}

.cv-section {
  margin-top: 7mm;
}

.cv-section h3 {
  margin: 0 0 3mm;
  padding-bottom: 1.4mm;
  border-bottom: .6pt solid #ccd4d0;
  color: var(--accent);
  font-size: 9.4pt;
  letter-spacing: 1.2pt;
  text-transform: uppercase;
}

.summary-section p {
  margin: 0;
  color: #36423f;
  line-height: 1.5;
}

.preview-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 2mm;
}

.preview-skill {
  display: inline-flex;
  padding: 1.7mm 2.4mm;
  border-radius: 2mm;
  background: #eef3f0;
  color: #283b35;
  font-size: 8.3pt;
  font-weight: 700;
}

.preview-experience {
  display: grid;
  grid-template-columns: 27mm 1fr;
  gap: 5mm;
  margin-bottom: 5.5mm;
}

.preview-experience:last-child {
  margin-bottom: 0;
}

.preview-date {
  color: #62716c;
  font-size: 8.4pt;
  font-weight: 700;
}

.preview-experience h4 {
  margin: 0;
  font-size: 10.5pt;
}

.preview-experience h4 span {
  color: var(--accent);
}

.preview-context {
  margin: 1mm 0 2mm;
  color: #687570;
  font-size: 8.3pt;
  font-style: italic;
}

.preview-experience ul {
  margin: 0;
  padding-left: 4.5mm;
}

.preview-experience li {
  margin: 0 0 1mm;
  color: #34413d;
  font-size: 8.7pt;
  line-height: 1.35;
}

.background-section {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12mm;
  padding-top: 1mm;
}

.background-section strong {
  font-size: 9pt;
}

.background-section p,
.background-section small {
  margin: 1mm 0 0;
  color: #5e6a66;
  font-size: 8.2pt;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5mm;
}

.proof-item {
  padding: 3mm;
  border: .5pt solid #d7dedb;
  border-left: 2.5pt solid var(--accent);
}

.proof-item strong {
  display: block;
  font-size: 8.7pt;
}

.proof-item small {
  display: block;
  margin-top: 1mm;
  color: #6b7673;
  font-size: 7.5pt;
}

.letter-only,
.dossier-only {
  display: none;
}

.document-paper.document-dossier .dossier-only {
  display: block;
}

.document-paper.document-letter .skills-section,
.document-paper.document-letter .experience-section,
.document-paper.document-letter .background-section,
.document-paper.document-letter .summary-section,
.document-paper.document-letter .dossier-only {
  display: none;
}

.document-paper.document-letter .letter-only {
  display: block;
}

.letter-section {
  margin-top: 15mm;
  font-size: 10.5pt;
  line-height: 1.7;
}

.letter-section p {
  margin-bottom: 6mm;
}

.document-paper.template-impact {
  padding-top: 0;
  border-top: 18mm solid var(--accent);
}

.document-paper.template-impact .cv-header {
  margin-top: -12mm;
  padding: 7mm 9mm;
  border: 0;
  background: #fff;
  box-shadow: 0 3mm 10mm rgba(0, 0, 0, .07);
}

.document-paper.template-impact .cv-section h3 {
  display: flex;
  align-items: center;
  gap: 3mm;
  border-bottom: 0;
}

.document-paper.template-impact .cv-section h3::after {
  content: "";
  height: .6pt;
  flex: 1;
  background: #cbd4d0;
}

.document-paper.template-expert .cv-header {
  padding: 8mm;
  border: 0;
  background: var(--accent);
  color: white;
}

.document-paper.template-expert .cv-header h2,
.document-paper.template-expert .cv-header p,
.document-paper.template-expert .cv-contact {
  color: white;
}

.document-paper.template-expert .summary-section {
  padding: 5mm;
  border: .6pt solid #d4ddd9;
  background: #f6f8f7;
}

.document-paper.template-modern:not(.document-letter) {
  display: grid;
  grid-template-columns: 49mm minmax(0, 1fr);
  grid-template-areas:
    "header header"
    "skills summary"
    "skills experience"
    "background experience"
    "proof proof";
  column-gap: 9mm;
  align-content: start;
}

.document-paper.template-modern .cv-header {
  grid-area: header;
  margin: -14mm -14mm 0;
  padding: 12mm 14mm 9mm;
  border: 0;
  background: var(--accent);
  color: #fff;
}

.document-paper.template-modern .cv-header h2,
.document-paper.template-modern .cv-header p,
.document-paper.template-modern .cv-contact {
  color: #fff;
}

.document-paper.template-modern .summary-section {
  grid-area: summary;
}

.document-paper.template-modern .skills-section {
  grid-area: skills;
  align-self: stretch;
  margin-left: -14mm;
  padding: 6mm 6mm 8mm 14mm;
  background: #eef3f0;
}

.document-paper.template-modern .skills-section .preview-skills {
  display: grid;
}

.document-paper.template-modern .skills-section .preview-skill {
  border-radius: 0;
  border-left: 2pt solid var(--accent);
  background: #fff;
}

.document-paper.template-modern .experience-section {
  grid-area: experience;
}

.document-paper.template-modern .background-section {
  grid-area: background;
  display: block;
  margin-left: -14mm;
  padding: 6mm 6mm 8mm 14mm;
  background: #eef3f0;
}

.document-paper.template-modern .background-section > div + div {
  margin-top: 7mm;
}

.document-paper.template-modern .proof-section {
  grid-area: proof;
}

.document-paper.template-executive {
  border-top: 5mm solid var(--accent);
  background: linear-gradient(180deg, #fbfaf7 0, #fff 45mm);
}

.document-paper.template-executive .cv-header {
  padding: 7mm 0 6mm;
  border-bottom: 1.6pt solid #b58a4f;
}

.document-paper.template-executive .cv-header h2 {
  color: #172d3e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25pt;
  letter-spacing: -.5pt;
}

.document-paper.template-executive .summary-section {
  padding: 5mm 7mm;
  border-left: 3pt solid #b58a4f;
  background: #f6f2e9;
}

.document-paper.template-executive .cv-section h3 {
  color: #172d3e;
  letter-spacing: 1.7pt;
}

.document-paper.template-executive .preview-experience h4 span {
  color: #936b35;
}

.document-paper.template-timeline .cv-header {
  border-bottom: 2pt solid var(--accent);
}

.document-paper.template-timeline .experience-section {
  position: relative;
  padding-left: 8mm;
}

.document-paper.template-timeline .experience-section::before {
  content: "";
  position: absolute;
  left: 29mm;
  top: 14mm;
  bottom: 2mm;
  width: 1pt;
  background: #aabbb4;
}

.document-paper.template-timeline .preview-experience {
  position: relative;
  grid-template-columns: 22mm 1fr;
  gap: 9mm;
}

.document-paper.template-timeline .preview-experience::before {
  content: "";
  position: absolute;
  left: 24.4mm;
  top: 1mm;
  width: 4mm;
  height: 4mm;
  border: 1.2pt solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1pt var(--accent);
}

.document-paper.template-timeline .preview-experience > div:last-child {
  padding: 0 0 4mm 4mm;
}

.document-paper.density-airy {
  font-size: 10.4pt;
}

.document-paper.density-airy .cv-section {
  margin-top: 8.5mm;
}

.document-paper.density-compact {
  font-size: 9.4pt;
}

.document-paper.density-compact .cv-section {
  margin-top: 5mm;
}

.document-paper.density-compact .preview-experience {
  margin-bottom: 3.5mm;
}

.preview-scorebar {
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  border-top: 1px solid #d9dfdb;
  background: #f8f9f7;
  font-size: 9px;
}

.preview-scorebar > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.score-dot.good {
  background: #3f9a72;
  box-shadow: 0 0 0 3px #dcefe5;
}

.preview-scorebar button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--forest);
  font-size: 9px;
  font-weight: 800;
}

/* Standalone library */

.standalone-wrap {
  width: min(1260px, calc(100% - 56px));
  margin: 0 auto;
  padding: 56px 0 90px;
}

.standalone-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.standalone-heading h1 {
  max-width: 780px;
  margin: 7px 0 10px;
  font-family: Georgia, serif;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -.03em;
}

.standalone-heading p {
  max-width: 760px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.library-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 36px 0 22px;
}

.library-stats div {
  padding: 20px;
  border: 1px solid #dce3df;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.library-stats span,
.library-stats strong,
.library-stats small {
  display: block;
}

.library-stats span {
  color: var(--forest);
  font-family: Georgia, serif;
  font-size: 29px;
}

.library-stats strong {
  margin-top: 3px;
  font-size: 12px;
}

.library-stats small {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 9px;
}

.library-browser {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #d8e0db;
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow);
}

.library-browser aside {
  padding: 22px 14px;
  border-right: 1px solid #e0e5e2;
  background: #f7f8f6;
}

.library-browser aside h2 {
  padding: 0 9px;
  font-size: 13px;
}

.library-browser aside button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 11px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: left;
}

.library-browser aside button.active {
  background: var(--forest);
  color: white;
}

.library-browser aside button span {
  font-weight: 800;
}

.library-table-wrap {
  padding: 24px;
}

.library-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.library-table-head strong {
  font-size: 15px;
}

.library-table-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.library-table-head input {
  width: 230px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #d5ddda;
  border-radius: 8px;
}

.library-table,
.rights-table {
  width: 100%;
  border-collapse: collapse;
}

.library-table th,
.library-table td,
.rights-table th,
.rights-table td {
  padding: 13px 10px;
  border-bottom: 1px solid #e6eae7;
  font-size: 10px;
  text-align: left;
}

.library-table th,
.rights-table th {
  color: var(--ink-soft);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.category-tag {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e7f1ec;
  color: var(--forest);
  font-size: 8px;
  font-weight: 800;
}

.category-tag.soft { background: #f5eadf; color: #7d4c27; }
.category-tag.tool { background: #e9ebf3; color: #4d587d; }
.category-tag.method { background: #f0e8f2; color: #6a4773; }
.category-tag.management { background: #f5e4e6; color: #8b3e46; }
.category-tag.compliance { background: #e7ecea; color: #455c52; }

/* Admin */

.admin-layout {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 230px 1fr;
  background: #f3f4f1;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  background: #173a36;
  color: white;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.admin-brand .brand-mark {
  background: white;
  color: var(--forest);
}

.admin-brand strong,
.admin-brand small {
  display: block;
}

.admin-brand strong {
  font-size: 13px;
}

.admin-brand small {
  margin-top: 3px;
  color: rgba(255,255,255,.58);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.admin-sidebar nav {
  display: grid;
  gap: 3px;
  margin-top: 22px;
}

.admin-sidebar nav button,
.admin-exit {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,.7);
  font-size: 10px;
  text-align: left;
}

.admin-sidebar nav button span {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: rgba(255,255,255,.09);
  font-size: 8px;
  font-weight: 800;
}

.admin-sidebar nav button.active,
.admin-sidebar nav button:hover {
  background: rgba(255,255,255,.1);
  color: white;
}

.admin-exit {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.12);
  border-radius: 0;
}

.admin-main {
  min-width: 0;
  padding: 30px;
}

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-heading h1 {
  margin: 5px 0;
  font-family: Georgia, serif;
  font-size: 29px;
  font-weight: 500;
}

.admin-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid #d8dfdb;
  border-radius: 10px;
  background: #fff;
}

.admin-user > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--forest);
  color: white;
  font-size: 10px;
  font-weight: 800;
}

.admin-user strong,
.admin-user small {
  display: block;
}

.admin-user strong {
  font-size: 10px;
}

.admin-user small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
}

.admin-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 15px;
  padding: 11px 13px;
  border: 1px solid #cee0d6;
  border-radius: 9px;
  background: var(--mint-2);
}

.admin-alert > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 800;
}

.admin-alert p {
  margin: 0;
  color: #41534e;
  font-size: 9px;
}

.admin-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.admin-cards article {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px;
  border: 1px solid #dfe4e1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(25, 54, 47, .04);
}

.admin-cards span,
.admin-cards strong,
.admin-cards small {
  display: block;
}

.admin-cards span {
  color: var(--ink-soft);
  font-size: 9px;
}

.admin-cards strong {
  margin-top: 6px;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
}

.admin-cards small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 8px;
}

.admin-cards small.positive {
  color: #318363;
}

.admin-cards article > b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--mint);
  color: var(--forest);
  font-size: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.35fr .85fr;
  gap: 12px;
  margin-top: 12px;
}

.admin-grid.lower {
  grid-template-columns: 1.15fr .85fr;
}

.admin-panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid #dfe4e1;
  border-radius: 12px;
  background: #fff;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 12px;
}

.panel-heading p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 8px;
}

.panel-heading select {
  min-height: 28px;
  border: 1px solid #d9dfdc;
  border-radius: 7px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 8px;
}

.bar-chart {
  height: 185px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 14px;
  margin-top: 22px;
  padding: 10px 8px 25px;
  border-bottom: 1px solid #dfe5e1;
  background:
    repeating-linear-gradient(to top, transparent 0 44px, #edf0ee 45px 46px);
}

.bar-chart div {
  height: var(--h);
  position: relative;
  border-radius: 5px 5px 1px 1px;
  background: linear-gradient(180deg, #4d8d79, var(--forest));
}

.bar-chart span {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-soft);
  font-size: 7px;
}

.status-live {
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--forest);
  font-size: 7px;
  font-weight: 900;
  text-transform: uppercase;
}

.health-panel ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.health-panel li {
  display: grid;
  grid-template-columns: 25px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid #e8ece9;
}

.health-panel li:last-child {
  border-bottom: 0;
}

.status-icon {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 8px;
  font-weight: 900;
}

.status-icon.ok {
  background: var(--mint);
  color: var(--forest);
}

.status-icon.warn {
  background: #faecd6;
  color: var(--warning);
}

.health-panel strong,
.health-panel small {
  display: block;
}

.health-panel strong {
  font-size: 9px;
}

.health-panel small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 7px;
}

.health-panel li > b {
  color: var(--ink-soft);
  font-size: 7px;
}

.rights-table {
  margin-top: 9px;
}

.rights-table td:nth-child(2),
.rights-table td:nth-child(3) {
  color: var(--forest);
  font-weight: 700;
}

.retention-list {
  margin-top: 10px;
}

.retention-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #e7ebe8;
  font-size: 9px;
}

.retention-list div:last-child {
  border-bottom: 0;
}

.retention-list span {
  color: var(--ink-soft);
}

.retention-list strong {
  color: var(--forest);
}

/* Merlin — same presence model as ValiSphere */

.merlin-transition {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 29, 47, .92);
  color: #fff;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.merlin-transition.visible {
  opacity: 1;
  pointer-events: all;
}

.merlin-transition img {
  width: min(420px, 75vw);
  height: min(360px, 55vh);
  object-fit: contain;
  animation: merlin-transition-float 1.8s ease-in-out infinite;
}

.merlin-transition strong,
.merlin-transition span {
  display: block;
}

.merlin-transition strong {
  font-size: 20px;
}

.merlin-transition span {
  margin-top: 5px;
  color: #bed0e3;
}

@keyframes merlin-transition-float {
  50% { transform: translateY(-8px); }
}

.merlin-fab {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 81;
  display: grid;
  grid-template-columns: 58px auto;
  align-items: center;
  gap: 5px;
  padding: 5px 16px 5px 5px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  background: #17283d;
  box-shadow: 0 16px 44px rgba(20, 32, 51, .34);
  color: #fff;
  text-align: left;
}

.merlin-fab .merlin-orb {
  width: 58px;
  height: 58px;
}

.merlin-fab strong,
.merlin-fab small {
  display: block;
}

.merlin-fab strong {
  font-size: 10px;
}

.merlin-fab small {
  margin-top: 2px;
  color: #bed0e3;
  font-size: 8px;
}

.merlin-fab > i {
  position: absolute;
  right: -4px;
  top: -7px;
  min-width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 99px;
  background: #bd5b64;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.merlin-panel {
  width: min(410px, calc(100vw - 30px));
  height: min(620px, 72vh);
  display: none;
  grid-template-rows: auto 1fr auto auto;
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 90;
  overflow: hidden;
  border: 1px solid #91a2b5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(20, 32, 51, .34);
}

.merlin-panel.open {
  display: grid;
  animation: panel-in .2s ease;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.merlin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  background: #17283d;
  color: white;
}

.merlin-panel-head > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.merlin-panel-head .merlin-orb {
  width: 58px;
  height: 58px;
  box-shadow: none;
}

.merlin-panel-head strong,
.merlin-panel-head small {
  display: block;
}

.merlin-panel-head strong {
  font-family: Georgia, serif;
  font-size: 14px;
}

.merlin-panel-head small {
  margin-top: 2px;
  color: rgba(255,255,255,.68);
  font-size: 8px;
}

.merlin-panel-head button {
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: white;
  font-size: 18px;
}

.merlin-chat {
  overflow-y: auto;
  padding: 15px;
  background: #f7f8f6;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 11px;
}

.chat-message > span {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
}

.chat-message.merlin > span {
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: url("assets/merlin-conseil.gif") center / contain no-repeat;
}

.chat-message p {
  max-width: 285px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid #dce5e0;
  border-radius: 4px 12px 12px 12px;
  background: white;
  color: #455450;
  font-size: 10px;
  line-height: 1.5;
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-message.user > span {
  background: #b8c3bd;
  color: var(--ink);
}

.chat-message.user p {
  border-radius: 12px 4px 12px 12px;
  background: var(--mint-2);
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-left: 33px;
}

.quick-prompts button {
  padding: 6px 8px;
  border: 1px solid #ceddd5;
  border-radius: 999px;
  background: white;
  color: var(--forest);
  font-size: 8px;
  font-weight: 700;
}

.merlin-input {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 7px;
  padding: 11px;
  border-top: 1px solid #e1e6e3;
}

.merlin-input input {
  min-width: 0;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #d3dcd7;
  border-radius: 9px;
  font-size: 10px;
}

.merlin-input button {
  border: 0;
  border-radius: 9px;
  background: var(--forest);
  color: white;
}

.merlin-disclaimer {
  margin: 0;
  padding: 0 12px 10px;
  color: #7a8581;
  font-size: 7px;
  text-align: center;
}

/* Semi-automated ChatGPT review */

.ai-check-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.button-orb {
  width: 21px;
  height: 21px;
  display: block;
  background: url("assets/merlin-conseil.gif") center / contain no-repeat;
}

.external-audit-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  margin-top: 15px;
  padding: 15px;
  border: 1px solid #cbded5;
  border-radius: 12px;
  background: linear-gradient(135deg, #f4faf7, #fff);
}

.external-audit-card strong,
.external-audit-card p,
.external-audit-card small {
  display: block;
}

.external-audit-card p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.45;
}

.external-audit-actions {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.external-audit-actions small {
  color: var(--ink-soft);
  font-size: 7px;
}

.external-audit-actions small.saved {
  color: #2f745f;
  font-weight: 800;
}

.ai-audit-modal {
  width: min(790px, calc(100vw - 30px));
}

.ai-audit-body {
  max-height: min(760px, calc(100vh - 100px));
  overflow-y: auto;
  padding: 18px;
}

.ai-state {
  margin-bottom: 15px;
}

.audit-options {
  display: grid;
  gap: 7px;
  margin: 0 0 15px;
  padding: 0;
  border: 0;
}

.audit-options legend {
  margin-bottom: 8px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 850;
}

.audit-option {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #dce4df;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.audit-option input {
  position: absolute;
  opacity: 0;
}

.audit-option > span {
  width: 31px;
  height: 18px;
  border-radius: 999px;
  background: #b8c3bd;
  transition: .18s ease;
}

.audit-option > span::after {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin: 2px;
  border-radius: 50%;
  background: #fff;
  transition: .18s ease;
}

.audit-option input:checked + span {
  background: var(--forest-2);
}

.audit-option input:checked + span::after {
  transform: translateX(13px);
}

.audit-option.locked {
  background: #f4f7f5;
  cursor: default;
}

.audit-option strong,
.audit-option small {
  display: block;
}

.audit-option strong {
  color: var(--ink);
  font-size: 10px;
}

.audit-option small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 500;
}

.audit-prompt-block,
.audit-return-block,
.custom-gpt-card {
  margin-top: 13px;
  padding: 14px;
  border: 1px solid #dce4df;
  border-radius: 12px;
}

.audit-block-heading,
.custom-gpt-card,
.audit-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.audit-block-heading strong,
.audit-block-heading span,
.custom-gpt-card strong {
  display: block;
}

.audit-block-heading > span {
  color: var(--ink-soft);
  font-size: 8px;
}

#audit-prompt-preview,
#audit-response {
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid #cbd6d0;
  border-radius: 9px;
  background: #fbfcfb;
  color: #2f3d39;
  font: 9px/1.55 Consolas, "Courier New", monospace;
  resize: vertical;
}

.audit-buttons {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 10px;
}

.audit-buttons.right {
  justify-content: flex-end;
}

.custom-gpt-card {
  align-items: center;
  background: #f8faf9;
}

.custom-gpt-card p {
  max-width: 520px;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 8px;
}

.audit-return-block label strong,
.audit-return-block label small {
  display: block;
}

.audit-return-block label small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 8px;
}

/* Functional admin views */

.admin-dynamic-view[hidden],
#admin-dashboard-content[hidden] {
  display: none;
}

.admin-dynamic-view {
  display: grid;
  gap: 14px;
}

.admin-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.admin-feature-grid > article,
.admin-feature-grid > section {
  min-height: 220px;
  padding: 20px;
  border: 1px solid #dfe5e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(28, 50, 45, .06);
}

.admin-feature-grid h2 {
  margin: 7px 0;
  font-family: Georgia, "Times New Roman", serif;
}

.admin-feature-grid p,
.admin-footnote {
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.55;
}

.admin-table-scroll {
  overflow-x: auto;
}

.admin-data-table {
  min-width: 690px;
}

.admin-data-table small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
}

.admin-data-table button {
  padding: 6px 8px;
  border: 1px solid #d2dcd6;
  border-radius: 7px;
  background: #fff;
  color: var(--forest);
  font-size: 8px;
  font-weight: 800;
}

.status-muted {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 99px;
  background: #ecefed;
  color: #68746f;
  font-size: 7px;
  font-weight: 800;
}

.admin-template-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-template-list article {
  min-height: 115px;
  padding: 14px;
  border-top: 4px solid var(--forest-2);
  border-radius: 9px;
  background: #f5f7f5;
}

.admin-template-list b,
.admin-template-list span,
.admin-template-list small {
  display: block;
}

.admin-template-list span {
  width: max-content;
  margin: 8px 0;
  padding: 3px 6px;
  border-radius: 99px;
  background: var(--mint);
  color: var(--forest);
  font-size: 7px;
  font-weight: 850;
}

.admin-template-list small {
  color: var(--ink-soft);
  font-size: 8px;
}

.admin-check-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  color: #4d5b56;
  font-size: 9px;
}

.admin-field {
  display: block;
  margin-top: 13px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}

.admin-field input {
  width: 100%;
  margin-top: 5px;
  padding: 10px;
  border: 1px solid #cbd6d0;
  border-radius: 8px;
}

.admin-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.empty-table-cell {
  padding: 28px !important;
  color: var(--ink-soft);
  text-align: center;
}

/* Dialogs and toast */

.modal {
  width: min(520px, calc(100vw - 30px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(18, 45, 40, .28);
}

.modal::backdrop {
  background: rgba(16, 35, 31, .58);
  backdrop-filter: blur(4px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 19px;
  border-bottom: 1px solid #e2e7e4;
}

.modal-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--mint);
  color: var(--forest);
  font-family: Georgia, serif;
  font-weight: 800;
}

.modal-head strong,
.modal-head small {
  display: block;
}

.modal-head strong {
  font-size: 13px;
}

.modal-head small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
}

.modal-head > button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #f1f3f1;
  font-size: 18px;
}

.modal-body {
  padding: 18px;
}

.privacy-state {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px;
  border-radius: 10px;
  background: var(--mint-2);
}

.privacy-state > span {
  color: #2e916a;
}

.privacy-state strong {
  font-size: 11px;
}

.privacy-state p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 9px;
}

.privacy-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.privacy-actions button {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid #dce2df;
  border-radius: 10px;
  background: #fff;
  text-align: left;
}

.privacy-actions button > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef3f0;
  color: var(--forest);
  font-weight: 800;
}

.privacy-actions button.danger > span {
  background: #f8e8ea;
  color: var(--danger);
}

.privacy-actions strong,
.privacy-actions small {
  display: block;
}

.privacy-actions strong {
  font-size: 10px;
}

.privacy-actions small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 8px;
}

.legal-note {
  margin: 13px 0 0;
  color: #6d7975;
  font-size: 8px;
  line-height: 1.5;
}

.success-modal {
  padding: 28px;
  text-align: center;
}

.celebration-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-size: 23px;
  font-weight: 900;
  box-shadow: 0 0 0 9px var(--mint);
}

.success-modal h2 {
  margin-bottom: 7px;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 500;
}

.success-modal > p {
  color: var(--ink-soft);
  font-size: 10px;
}

.success-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0;
}

.recommend-card {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 15px;
  border: 1px solid #d5e4dc;
  border-radius: 12px 12px 12px 4px;
  background: var(--mint-2);
  text-align: left;
}

.recommend-card strong {
  font-size: 11px;
}

.recommend-card p {
  margin: 4px 0 10px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.45;
}

.recommend-card button {
  margin: 0 5px 5px 0;
  padding: 6px 8px;
  border: 1px solid #bad1c5;
  border-radius: 7px;
  background: white;
  color: var(--forest);
  font-size: 8px;
  font-weight: 800;
}

.no-pressure {
  display: block;
  margin-top: 10px;
  color: #78837f;
  font-size: 7px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  max-width: min(520px, calc(100vw - 30px));
  padding: 11px 15px;
  border-radius: 9px;
  background: #172e2a;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  color: white;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1200px) {
  .builder-layout {
    grid-template-columns: 210px minmax(470px, 1fr) minmax(370px, .7fr);
  }

  .document-stage {
    padding: 26px 12px;
  }

  .document-paper {
    transform: scale(.58);
    margin-bottom: -124mm;
  }

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

  .selected-skills-panel {
    max-height: 230px;
  }

  #selected-skills {
    max-height: 175px;
  }
}

@media (max-width: 980px) {
  .topbar {
    padding: 0 18px;
  }

  .privacy-pill {
    display: none;
  }

  .home-wrap {
    width: min(760px, calc(100% - 32px));
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .home-copy {
    padding-top: 20px;
  }

  .home-copy h1 {
    font-size: 52px;
  }

  .builder-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .builder-layout {
    height: auto;
    min-height: calc(100vh - 200px);
    grid-template-columns: 200px 1fr;
    overflow: visible;
  }

  .steps-panel {
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
  }

  .editor-panel {
    overflow: visible;
  }

  .editor-content {
    height: auto;
  }

  .preview-panel {
    display: none;
  }

  .library-stats,
  .admin-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-grid,
  .admin-grid.lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .suite-link {
    display: none;
  }
  .topbar {
    height: 62px;
  }

  .brand small,
  .main-nav .nav-item:last-child {
    display: none;
  }

  .main-nav {
    margin-left: auto;
  }

  .top-actions {
    margin-left: 0;
  }

  .nav-item {
    padding: 0 10px;
  }

  .home-wrap {
    padding-top: 30px;
  }

  .home-copy h1 {
    font-size: 42px;
  }

  .home-lead {
    font-size: 16px;
  }

  .trust-row {
    grid-template-columns: 1fr 1fr;
  }

  .trust-row div:last-child {
    display: none;
  }

  .starter-card {
    padding: 22px;
  }

  .choice-grid,
  .form-row,
  .form-grid.two,
  .form-grid.three,
  .template-grid,
  .accessibility-checks,
  .language-row {
    grid-template-columns: 1fr;
  }

  .builder-heading {
    padding: 14px 16px;
  }

  .builder-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .autosave-switch {
    width: 100%;
  }

  .builder-layout {
    display: block;
  }

  .steps-panel {
    height: auto;
    position: static;
    padding: 11px;
    border-right: 0;
    border-bottom: 1px solid #d9dfdb;
  }

  .progress-head,
  .progress-track,
  .import-card,
  .template-link {
    display: none;
  }

  .step-nav {
    grid-auto-flow: column;
    grid-auto-columns: 44px;
    overflow-x: auto;
    margin: 0;
  }

  .step-button {
    display: block;
    padding: 7px;
  }

  .step-button > span:nth-child(2),
  .step-state {
    display: none;
  }

  .editor-toolbar {
    padding: 0 12px;
  }

  .merlin-inline {
    padding: 7px;
    font-size: 0;
  }

  .editor-content {
    padding: 23px 18px 100px;
  }

  .section-heading {
    display: block;
  }

  .quality-chip {
    display: inline-flex;
    margin-top: 11px;
  }

  .optional-fields {
    align-items: flex-start;
    flex-direction: column;
  }

  .custom-skill-row {
    grid-template-columns: 1fr;
  }

  .editor-next {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-next .primary-button,
  .editor-next .secondary-button {
    width: 100%;
  }

  .standalone-wrap {
    width: calc(100% - 30px);
    padding-top: 32px;
  }

  .standalone-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .standalone-heading h1 {
    font-size: 31px;
  }

  .library-stats {
    grid-template-columns: 1fr 1fr;
  }

  .library-browser {
    grid-template-columns: 1fr;
  }

  .library-browser aside {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 12px;
  }

  .library-browser aside h2 {
    display: none;
  }

  .library-browser aside button {
    min-width: 190px;
  }

  .library-table-wrap {
    padding: 14px;
    overflow-x: auto;
  }

  .library-table-head {
    align-items: stretch;
    flex-direction: column;
  }

  .library-table-head input {
    width: 100%;
  }

  .admin-layout {
    display: block;
  }

  .admin-sidebar {
    display: block;
    min-height: 0;
    padding: 12px;
    position: static;
  }

  .admin-sidebar .admin-brand {
    display: none;
  }

  .admin-sidebar nav {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin: 0;
  }

  .admin-sidebar nav button {
    min-width: 160px;
  }

  .admin-exit {
    width: auto;
    margin-top: 9px;
  }

  .admin-main {
    padding: 18px;
  }

  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-cards {
    grid-template-columns: 1fr 1fr;
  }

  .admin-feature-grid,
  .admin-template-list {
    grid-template-columns: 1fr;
  }

  .external-audit-card {
    grid-template-columns: 40px 1fr;
  }

  .external-audit-actions {
    grid-column: 1 / -1;
    justify-items: stretch;
  }

  .audit-block-heading,
  .custom-gpt-card,
  .audit-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .merlin-fab {
    right: 12px;
    bottom: 12px;
  }

  .merlin-fab > span:nth-child(2) {
    display: none;
  }

  .merlin-fab {
    grid-template-columns: 48px;
    padding: 4px;
  }

  .merlin-fab .merlin-orb {
    width: 48px;
    height: 48px;
  }

  .merlin-panel {
    right: 8px;
    bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .merlin-orb,
  .merlin-transition img {
    animation: none !important;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body {
    background: #fff;
  }

  .topbar,
  .builder-heading,
  .steps-panel,
  .editor-panel,
  .preview-toolbar,
  .preview-scorebar,
  .merlin-fab,
  .merlin-panel,
  .toast {
    display: none !important;
  }

  .screen,
  .builder-screen,
  .preview-panel {
    display: block !important;
  }

  .home-screen,
  .library-screen,
  .admin-screen {
    display: none !important;
  }

  .builder-layout {
    display: block;
    height: auto;
    min-height: 0;
  }

  .preview-panel {
    border: 0;
    background: #fff;
  }

  .document-stage {
    height: auto;
    overflow: visible;
    padding: 0;
  }

  .document-paper {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    box-shadow: none;
    transform: none !important;
  }
}
