.cms {
  --ink: #101b2d;
  --muted: #465466;
  --line: #d9e0ea;
  --accent: #2168ce;
  --deep: #101b2d;
  --surface: #fff;
  --radius: 14px;
  --cms-soft: #f4f7fc;
  --cms-rule: #e5ebf3;
  --cms-shadow: 0 8px 28px rgba(27, 53, 93, .07);
  color: var(--ink);
  position: relative;
  isolation: isolate;
  background: #f9fbfe;
  min-height: 100vh;
}

.cms::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 28rem;
  background: radial-gradient(circle, rgba(33, 104, 206, .16) 1px, transparent 1.3px) 0 0 / 22px 22px,
    linear-gradient(132deg, #deebfc, #f0f6fc 68%, #fff);
  mask-image: linear-gradient(#000 25%, transparent);
  pointer-events: none;
  content: "";
}

.cms-shell {
  width: min(100% - clamp(2rem, 8vw, 7rem), 74rem);
  min-height: 100vh;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
}

.cms-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem clamp(.8rem, 2vw, 1.75rem);
  padding-block: 1.4rem 1rem;
  border-bottom: 1px solid var(--line);
}

.cms-wordmark {
  display: inline-flex;
  gap: .65rem;
  align-items: center;
  color: var(--ink);
  white-space: nowrap;
}
.cms-mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid #2168ce;
  border-radius: 12px;
  background: linear-gradient(145deg, #3279dd, #2168ce);
  box-shadow: 0 4px 11px rgba(28, 86, 168, .18);
}
.cms-mark::before, .cms-mark::after { position: absolute; content: ""; }
.cms-mark::before {
  inset: 8px 10px;
  border: 1.5px solid #fff;
  border-radius: 3px;
}
.cms-mark::after {
  inset: 14px 14px auto;
  height: 1.5px;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 4px 0 #fff, 0 8px 0 #fff;
}
.cms-wordmark-text { display: grid; gap: .2rem; }
.cms-wordmark strong { font-size: 1rem; letter-spacing: -.04em; line-height: 1.08; }
.cms-wordmark small { color: #465466; font-size: .7rem; font-weight: 550; }
.cms-wordmark b { color: #1655ac; }

.cms-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.4rem; }
.cms-nav a {
  display: inline-block;
  min-height: 34px;
  padding: .4rem 0 .25rem;
  border-bottom: 2px solid transparent;
  color: #31496b;
  font-size: .88rem;
  font-weight: 580;
  white-space: nowrap;
}
.cms-nav a:hover { border-color: #9dbce9; color: #1655ac; }
.cms-nav a[aria-current="page"] { border-color: var(--accent); color: #1655ac; font-weight: 740; }

.cms-account { display: flex; align-items: center; gap: .5rem .85rem; min-width: 0; flex-wrap: wrap; }
.cms-account-identity { min-width: 0; overflow-wrap: anywhere; }
.cms-account-identity strong { display: block; font-size: .84rem; }
.cms-account-identity small { margin-top: .15rem; color: var(--muted); font-size: .73rem; }
.cms-account-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.cms-account-actions .button { min-height: 35px; padding: 5px 9px; font-size: .78rem; }

.cms-login {
  width: min(100%, 28rem);
  margin: clamp(1rem, 8vh, 5rem) auto 1.5rem;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  display: grid;
  gap: .85rem;
  box-shadow: var(--cms-shadow);
}
.cms-login h1 { font-size: clamp(1.8rem, 4vw, 2.3rem); }
.cms-login > p, .cms-account-chooser > p { color: var(--muted); line-height: 1.5; }
.cms-login .cms-google-button { width: 100%; min-height: 46px; gap: .65rem; margin-top: .35rem; color: var(--ink); }
.cms-login .cms-login-note { font-size: .8rem; text-align: center; }

.cms-account-chooser {
  width: min(100% - 2rem, 30rem);
  max-height: calc(100dvh - 2rem);
  padding: clamp(1rem, 4vw, 1.6rem);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 22px 65px #142d5440;
}
.cms-account-chooser::backdrop { background: #14244080; }
.cms-account-chooser h2 { font-size: 1.25rem; }
.cms-account-chooser > p { margin: .5rem 0 1rem; font-size: .86rem; }
.cms-account-options { display: grid; gap: .45rem; }
.cms-account-option.button { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: .25rem .65rem; text-align: left; overflow-wrap: anywhere; }
.cms-account-option strong { color: var(--ink); font-weight: 680; }
.cms-account-option small { margin-top: .2rem; color: var(--muted); font-size: .76rem; font-weight: 470; }
.cms-account-chooser form { display: flex; justify-content: flex-end; margin-top: .8rem; }

.cms .cms-screen {
  width: 100%;
  max-width: none;
  flex: 1 0 auto;
  padding: clamp(1.8rem, 4.5vw, 3.4rem) 0 2.75rem;
}

.cms-footer {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1.2rem;
  padding-block: .8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .83rem;
}

.cms-reset {
  background: transparent;
  border: 0;
  color: #1655ac;
  padding: .4rem .3rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

.cms :focus-visible { outline: 3px solid #2168ce; outline-offset: 3px; }
.cms #screen:focus { outline: none; }
.cms h1 { margin: 0; color: var(--ink); font-size: clamp(2.25rem, 4.25vw, 3.4rem); letter-spacing: -.055em; }
.cms h2 { font-size: 1.22rem; letter-spacing: -.024em; }
.cms .page-heading { align-items: flex-end; gap: .95rem 1.4rem; margin-bottom: 1.45rem; }
.cms .page-heading p { margin-top: .6rem; line-height: 1.55; font-size: .98rem; }
.cms .editorial-heading { margin-bottom: 0; }
.cms .editorial-heading > div:first-child button + h1 { margin-top: .7rem; }

.cms .card {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--cms-shadow);
}
.cms .button {
  border-color: #ccd9eb;
  border-radius: 10px;
  color: #234673;
  font-size: .86rem;
}
.cms .button:hover { background: #edf4fd; border-color: #acc5e7; }
.cms .button.primary { min-height: 46px; padding-inline: 1rem; background: var(--accent); border-color: var(--accent); color: #fff; }
.cms .button.primary:hover { background: #1655ac; border-color: #1655ac; }
.cms .input { background: #fff; border: 1px solid #bac9dd; border-radius: 10px; min-height: 44px; }
.cms textarea.input { padding-block: .64rem; }

.cms .editorial-page { gap: 1.25rem; }

.cms .cms-workflow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  padding: .85rem 1.1rem;
  border: 1px solid #d5e1f1;
  border-radius: 12px;
  background: #eff5fc;
  color: #36547c;
  font-size: .88rem;
  font-weight: 680;
}
.cms-workflow span { display: inline-flex; align-items: center; gap: 1rem; }
.cms-workflow span + span::before {
  width: 1.2rem;
  height: 1px;
  background: #8ba6ca;
  content: "";
}

.cms .editorial-filters { gap: .43rem; padding: .85rem 1.05rem; }
.cms .editorial-filters .button {
  min-height: 36px;
  padding: .4rem .68rem;
  border-color: transparent;
  color: #465976;
}
.cms .editorial-filters [aria-pressed="true"] {
  background: #e9f1fd;
  border-color: #c3d6f1;
  color: #1655ac;
}
.cms .editorial-count { color: #465466; font-variant-numeric: tabular-nums; }
.cms .editorial-queue th, .cms .cms-published th {
  background: #eef3fa;
  color: #495e7a;
}
.cms .editorial-queue td, .cms .cms-published td { padding-block: .85rem; }
.cms .editorial-queue tr:hover, .cms .cms-published tr:hover { background: #f6f9fe; }
.cms .editorial-queue th, .cms .editorial-queue td, .cms .cms-published th, .cms .cms-published td {
  border-top-color: var(--cms-rule);
}
.cms .editorial-record-link {
  min-height: 25px;
  color: #1655ac;
  font-size: .95rem;
  font-weight: 730;
  overflow-wrap: anywhere;
}
.cms .editorial-status { gap: .37rem; font-size: .77rem; }
.cms .editorial-status::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.cms .editorial-guide-status { font-size: .77rem; }
.cms .editorial-guide-status[data-guide-status="in-progress"] { background: #e6effe; color: #194f9c; }
.cms .editorial-live { display: block; margin-top: .25rem; }
.cms .editorial-note { margin: 0 .2rem; font-size: .86rem; }

.cms .editorial-editor-layout { grid-template-columns: minmax(0, 1fr) minmax(17rem, .44fr); gap: 1.1rem; }
.cms .editorial-panel { padding: clamp(1rem, 2.1vw, 1.65rem); gap: .86rem; }
.cms .editorial-form-grid { gap: .95rem 1.1rem; }
.cms .editorial-step { padding: .9rem; border-radius: 12px; background: var(--cms-soft); }
.cms .editorial-step .button { border-radius: 8px; min-height: 32px; }
.cms .editorial-review-note { background: #edf2fa; }
.editorial-step-media { display: grid; gap: .5rem; padding-top: .7rem; margin-top: .2rem; border-top: 1px solid var(--cms-rule); }
.editorial-shot-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.editorial-upload { position: relative; cursor: pointer; }
.editorial-upload:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.editorial-upload-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.editorial-screenshot { width: min(100%, 40rem); margin: 0; overflow: hidden; border: 1px solid #bfd0e6; border-radius: 10px; background: #fff; }
.editorial-screenshot img { display: block; width: 100%; height: auto; }
.editorial-screenshot figcaption { padding: .55rem .7rem; border-top: 1px solid var(--cms-rule); font-size: .84rem; color: var(--muted); }
.editorial-screenshot-note { font-size: .82rem; }
.cms .editorial-side .card:first-child { border-top: 3px solid #74a5eb; }
.cms .editorial-more > summary {
  width: fit-content;
  color: #214f8e;
  font-size: .9rem;
  font-weight: 680;
  cursor: pointer;
}
.cms .editorial-more > summary:hover { color: var(--accent); }
.cms .editorial-more[open] > .editorial-more-content { margin-top: .9rem; }
.cms .editorial-revisions div, .cms .editorial-review-details div {
  grid-template-columns: minmax(0, 8rem) minmax(0, 1fr);
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--cms-rule);
}
.cms .editorial-revisions dd { font-variant-numeric: tabular-nums; font-weight: 680; }
.cms .editorial-activity li + li { margin-top: .625rem; }
.cms .editorial-activity small { margin-top: .125rem; }
.cms .editorial-published-link { color: #1655ac; font-weight: 680; }
.cms .editorial-published-link:hover { text-decoration: underline; text-underline-offset: .2em; }

.cms-asset-fields {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.2rem;
  min-width: 0;
  margin: 0;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cms-asset-fields legend, .cms-asset-fields label { font-size: .9rem; }
.cms-asset-fields legend { padding-inline: .25rem; font-weight: 650; }
.cms-asset-fields label { display: flex; align-items: center; gap: .3rem; }
.cms-asset-fields input { accent-color: var(--accent); }

.cms-published .editorial-panel-header { padding: 1rem 1.125rem; }
.cms-published td:last-child, .cms-published th:last-child { text-align: left; }
.cms-release { max-width: 36rem; min-width: 11rem; overflow-wrap: anywhere; }
.cms-release summary { color: #1655ac; font-weight: 700; cursor: pointer; }
.cms-release > p, .cms-release li + li { margin-top: .4rem; }
.cms-release .editorial-screenshot { margin-block: .45rem; }
.cms-release ol { margin: .7rem 0; padding-inline-start: 1.35rem; }

@media (max-width: 820px) {
  .cms .editorial-editor-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .cms-header { padding-block: .95rem .5rem; flex-wrap: wrap; gap: .5rem 1rem; }
  .cms-nav { gap: .25rem 1rem; }
  .cms-account { order: 1; flex-basis: 100%; }
  .cms .editorial-page { gap: 1rem; }
  .cms .editorial-editor-layout { gap: .9rem; }
  .cms :is(.editorial-queue, .cms-published) .table-wrap { overflow: visible; }
  .cms :is(.editorial-queue, .cms-published) table { display: block; min-width: 0; }
  .cms :is(.editorial-queue, .cms-published) thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .cms :is(.editorial-queue, .cms-published) tbody { display: block; }
  .cms :is(.editorial-queue, .cms-published) tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem .75rem;
    border-top: 1px solid var(--cms-rule);
    padding: .75rem .9rem;
  }
  .cms :is(.editorial-queue, .cms-published) tbody tr:last-child { border-radius: 0 0 var(--radius) var(--radius); }
  .cms :is(.editorial-queue, .cms-published) td { padding: 0; border: 0; overflow-wrap: anywhere; }
  .cms .editorial-queue td:first-child { grid-column: 1; grid-row: 1; }
  .cms .editorial-queue td:last-child { grid-column: 2; grid-row: 1; text-align: right; }
  .cms .editorial-queue td:nth-child(3), .cms .editorial-queue td:nth-child(5) { text-align: right; }
  .cms .editorial-queue td:nth-child(3)::before { content: "Researcher · "; }
  .cms .editorial-queue td:nth-child(6)::before { content: "Updated · "; }
  .cms .editorial-queue .editorial-guide-cell::before, .cms-published-guide::before { content: "Guide · "; }
  .cms .cms-published .cms-published-date::before { content: "Published · "; }
  .cms .editorial-queue td:only-child, .cms .cms-published .empty, .cms .cms-published-opportunity { grid-column: 1 / -1; }
  .cms .editorial-queue td:only-child { text-align: left; }
  .cms .cms-published-guide, .cms .cms-published td.cms-published-date { text-align: right; }
  .cms-published .cms-release { min-width: 0; }
  .cms .editorial-queue .input, .cms .editorial-editor-form .input { font-size: 1rem; }
}
