@font-face {
  font-family: "Audiowide";
  src: url("../fonts/Audiowide-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/Nunito-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --navy: #101828;
  --navy-2: #15243a;
  --gold: #ff815e;
  --gold-pale: #fff0eb;
  --teal: #006d77;
  --paper: #ffffff;
  --ink: #101828;
  --muted: #475467;
  --line: #d8e2e2;
  --serif: "Nunito", Arial, sans-serif;
  --sans: "Nunito", Arial, sans-serif;
  --shadow: 0 16px 42px rgba(8, 30, 38, .16);
  --frame-bg: #e8f5f3;
  --frame-panel: #ffffff;
  --frame-line: #d8e2e2;
  --frame-shadow: 0 22px 62px rgba(3, 25, 30, .22);
  --ocean: #006d77;
  --fresh-green: #006d77;
  --orange: #ff815e;
}

/* Preserve the semantic hidden state even when a component normally sets display. */
[hidden] {
  display: none !important;
}

html {
  background: var(--frame-bg);
  font-family: var(--sans);
}

.portal-body,
.login-body,
.portal-body button,
.portal-body input,
.portal-body select,
.portal-body textarea,
.login-body button,
.login-body input {
  font-family: var(--sans);
}

.portal-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 6%, #ffffff 0, transparent 36rem),
    radial-gradient(circle at 7% 95%, #d2ece8 0, transparent 34rem),
    linear-gradient(138deg, #f1faf8 0%, #e1f1ef 52%, #d6ebe8 100%);
  background-attachment: fixed;
}

.frame-header.app-header {
  height: auto;
  padding: 18px 20px;
  background: transparent;
  border: 0;
  backdrop-filter: none;
}

.glass-nav {
  width: 100%;
  min-height: 72px;
  padding: 10px 14px 10px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  background: #ffffff;
  border: 1px solid var(--frame-line);
  border-radius: 28px;
  box-shadow: 0 12px 34px rgba(24, 77, 73, .12);
}

.frame-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
  flex: none;
}

.portal-logo {
  display: block;
  width: 88px;
  height: 42px;
  object-fit: contain;
  flex: none;
}

.sgt-logo-crop {
  display: block;
  width: 68px;
  height: 31px;
  overflow: hidden;
  flex: none;
}

.sgt-logo-crop img {
  display: block;
  width: 68px;
  height: auto;
  transform: translateY(-1px);
}

.frame-word {
  color: var(--teal);
  font: 400 30px/1 "Audiowide", "Arial Rounded MT Bold", sans-serif;
  letter-spacing: -.035em;
}

.glass-nav .primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: auto;
}

.glass-nav .primary-nav a {
  padding: 12px 18px;
  border-radius: 999px;
  color: #475464;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: color .2s, background .2s, transform .2s;
}

.glass-nav .primary-nav a:hover {
  color: var(--navy);
  background: #f2f4f7;
}

.glass-nav .primary-nav a.active {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 8px 20px rgba(0, 109, 119, .2);
}

.account-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.account-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff0eb;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 129, 94, .3);
}

.account-copy {
  min-width: 110px;
}

.account-copy b,
.account-copy small {
  display: block;
}

.account-copy b {
  color: var(--navy);
  font-size: 13px;
}

.account-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.account-cluster form {
  margin: 0;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f2f4f7;
  color: var(--navy);
  cursor: pointer;
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 20px 40px;
}

.portal-body .page-title {
  width: 100%;
  max-width: none;
  margin: 18px 0 28px;
  text-align: left;
  padding: 24px 28px;
  border: 1px solid var(--frame-line);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(8, 30, 38, .12);
}

.portal-body .page-title h1,
.portal-body .split-title h1,
.portal-body .preview-toolbar h1 {
  color: var(--ink);
  text-shadow: none;
}

.portal-body .page-title p,
.portal-body .split-title p {
  color: var(--muted);
  font-size: 15px;
}

.portal-body .wizard-card,
.portal-body .editor-card,
.portal-body .audit-card {
  width: 100%;
  max-width: none;
  margin-right: 0;
  margin-left: 0;
  border: 1px solid var(--frame-line);
  background: #ffffff;
}

.portal-body .job-card,
.portal-body .settings-card,
.portal-body .template-card,
.portal-body .plan-page,
.portal-body .asset-card,
.portal-body .output-list article {
  border-color: var(--frame-line);
  background: #ffffff;
}

.portal-body .job-grid,
.portal-body .template-grid,
.portal-body .asset-grid,
.portal-body .settings-grid,
.portal-body .plan-list,
.portal-body .output-list {
  gap: 20px;
}

.portal-body textarea:focus,
.portal-body input:focus,
.portal-body select:focus,
.login-body input:focus {
  border-color: var(--orange);
  outline: 3px solid rgba(255, 129, 94, .25);
}

.portal-body .toggle input {
  width: 18px;
  height: 18px;
}

.portal-body .page-enter {
  animation: none;
}

.portal-body .eyebrow,
.login-body .eyebrow {
  color: #d85f3d;
  font-size: 11px;
}

.portal-body .status.completed,
.portal-body .status.ready {
  background: #e2f2f3;
  color: #00545c;
}

.portal-body .status.needs_review {
  background: #fff0eb;
  color: #a34229;
}

.portal-body .status.draft {
  background: #e5eff2;
  color: #334d64;
}

.workspace-frame {
  width: 100%;
  min-height: calc(100vh - 130px);
  padding: 30px;
  border: 1px solid var(--frame-line);
  border-radius: 38px;
  background: #ffffff;
  box-shadow: var(--frame-shadow);
}

.dashboard-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 6px 14px 28px;
}

.dashboard-welcome h1 {
  margin: 8px 0 6px;
  color: var(--ink);
  font: 800 38px/1.08 var(--serif);
  text-shadow: none;
}

.dashboard-welcome p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.welcome-actions {
  display: flex;
  gap: 10px;
}

.dashboard-grid {
  display: grid;
  gap: 20px;
}

.top-grid {
  grid-template-columns: 1.85fr 1fr;
}

.lower-grid {
  grid-template-columns: 1.4fr .8fr .8fr;
  margin-top: 20px;
}

.glass-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--frame-line);
  border-radius: 25px;
  background: var(--frame-panel);
  box-shadow: 0 12px 32px rgba(24, 77, 73, .09);
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-title h2 {
  margin: 5px 0 0;
  color: var(--navy);
  font: 800 23px/1.15 var(--serif);
}

.panel-title > a {
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.metric-card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.metric-card {
  min-height: 176px;
  padding: 17px;
  display: flex;
  flex-direction: column;
  border-radius: 19px;
  color: var(--navy);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(11, 35, 65, .1);
}

.pastel-blue { background: #ffffff; border: 1px solid var(--frame-line); border-top: 4px solid var(--ocean); }
.pastel-gold { background: #ffffff; border: 1px solid var(--frame-line); border-top: 4px solid var(--orange); }
.pastel-teal { background: #ffffff; border: 1px solid var(--frame-line); border-top: 4px solid var(--fresh-green); }

.metric-card span {
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f3f8f7;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.metric-card b {
  margin-top: 18px;
  font: 800 42px/1 var(--serif);
}

.metric-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.metric-card > i {
  position: relative;
  height: 4px;
  margin-top: auto;
  overflow: hidden;
  border-radius: 10px;
  background: #e4e7ec;
}

.metric-card > i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: max(8%, var(--progress));
  border-radius: inherit;
  background: var(--teal);
}

.ring-layout {
  min-height: 176px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 24px;
}

.progress-ring {
  position: relative;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf1f2;
  box-shadow: inset 0 0 0 1px rgba(0, 109, 119, .05);
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: inherit;
  background: conic-gradient(var(--teal) calc(var(--complete) * 1%), #d9e2e2 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 13px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 13px), #000 0);
}

.progress-ring span {
  position: relative;
  z-index: 1;
  text-align: center;
}

.progress-ring b,
.progress-ring small {
  display: block;
}

.progress-ring b {
  font: 800 29px var(--serif);
}

.progress-ring small {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.ring-legend p {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  font-size: 12px;
}

.ring-legend p b {
  color: var(--navy);
}

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

.dot.teal { background: var(--teal); }
.dot.gold { background: var(--gold); }
.dot.navy { background: var(--teal); }

.compact-job-list,
.admin-job-table {
  display: grid;
  gap: 5px;
}

.compact-job-list > a,
.admin-job-table > a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  color: var(--navy);
  text-decoration: none;
}

.compact-job-list > a:hover,
.admin-job-table > a:hover {
  background: #f2f7f7;
}

.compact-job-list b,
.compact-job-list small,
.admin-job-table b,
.admin-job-table small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-job-list b,
.admin-job-table b {
  font-size: 12px;
}

.compact-job-list small,
.admin-job-table small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.compact-job-list > a > i,
.admin-job-table > a > i {
  font-style: normal;
}

.doc-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--teal);
  color: #ffffff;
  font: 800 11px var(--serif);
}

.pipeline-list {
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 13px;
  list-style: none;
}

.pipeline-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
}

.pipeline-list li > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(11, 35, 65, .12);
  border-radius: 50%;
  background: #ffffff;
  font-size: 11px;
}

.pipeline-list li.done > span {
  background: var(--gold);
  border-color: var(--gold);
}

.pipeline-list b,
.pipeline-list small {
  display: block;
}

.pipeline-list b { font-size: 12px; }
.pipeline-list small { color: var(--muted); font-size: 10px; margin-top: 2px; }

.quick-links {
  display: grid;
  gap: 10px;
}

.quick-links a {
  padding: 13px;
  display: grid;
  grid-template-columns: 31px 1fr;
  gap: 1px 10px;
  border-radius: 14px;
  background: #f8faf9;
  border: 1px solid var(--frame-line);
  color: var(--navy);
  text-decoration: none;
}

.quick-links a > span {
  grid-row: 1 / 3;
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--gold-pale);
}

.quick-links b { font-size: 12px; }
.quick-links small { color: var(--muted); font-size: 10px; }
.mini-empty { padding: 28px; display: grid; gap: 5px; text-align: center; color: var(--muted); font-size: 12px; }

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.stat-tile {
  min-height: 142px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid var(--frame-line);
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(24, 77, 73, .08);
}

.stat-tile.navy { border-top: 4px solid var(--ocean); color: var(--navy); }
.stat-tile.teal { border-top: 4px solid var(--fresh-green); color: var(--navy); }
.stat-tile.gold { border-top: 4px solid var(--orange); color: var(--navy); }
.stat-tile.pale { border-top: 4px solid #c7d8d4; color: var(--navy); }
.stat-tile span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.stat-tile b { margin-top: 18px; font: 800 40px var(--serif); }
.stat-tile small { margin-top: auto; color: inherit; opacity: .8; font-size: 11px; }

.admin-grid {
  grid-template-columns: 1.7fr .75fr .75fr;
}

.admin-job-table > a {
  grid-template-columns: 42px minmax(0, 1fr) 130px auto 16px;
}

.admin-job-table > a > span:nth-child(3) {
  color: var(--muted);
  font-size: 10px;
}

.health-bars {
  display: grid;
  gap: 19px;
  margin: 29px 0;
}

.health-bars p {
  display: grid;
  grid-template-columns: 70px 1fr 20px;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 10px;
}

.health-bars p > i {
  height: 8px;
  overflow: hidden;
  border-radius: 20px;
  background: #edf2f2;
}

.health-bars p > i > b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.health-bars p > i > b.gold { background: var(--gold); }
.health-bars p > i > b.navy { background: var(--teal); }
.health-bars strong { color: var(--navy); }

.account-list {
  display: grid;
  gap: 14px;
}

.account-list > div {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 9px;
}

.account-list b,
.account-list small {
  display: block;
}

.account-list b { font-size: 12px; }
.account-list small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.account-list em { color: #b9482a; font-size: 10px; font-style: normal; font-weight: 850; text-transform: uppercase; }

.user-management-grid {
  display: grid;
  grid-template-columns: .7fr 1.6fr;
  gap: 20px;
}

.create-user-card form,
.login-card form {
  display: grid;
  gap: 15px;
}

.create-user-card label,
.login-card label {
  display: grid;
  gap: 7px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}

.create-user-card label small { color: var(--muted); font-size: 10px; font-weight: 400; }

.user-directory {
  display: grid;
  gap: 7px;
}

.user-directory article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 78px 70px 80px;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border-radius: 14px;
}

.user-directory article:hover { background: #f2f7f7; }
.user-directory b, .user-directory small { display: block; }
.user-directory b { font-size: 12px; }
.user-directory small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.role-badge { width: max-content; padding: 5px 8px; border-radius: 20px; background: #e3eff1; color: #00545c; font-size: 10px; font-style: normal; font-weight: 850; text-transform: uppercase; }
.role-badge.admin { background: var(--gold-pale); color: #9d3e24; }

.list-tools {
  margin: -5px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-search {
  position: relative;
  width: min(420px, 100%);
  display: block;
}

.list-search > span {
  position: absolute;
  left: 15px;
  top: 50%;
  z-index: 1;
  color: var(--teal);
  font-size: 18px;
  transform: translateY(-52%);
  pointer-events: none;
}

.list-search input {
  min-height: 42px;
  padding: 10px 15px 10px 42px;
  border-color: #d8e4e2;
  border-radius: 14px;
  background: #f8fbfa;
  font-size: 12px;
}

.list-search input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(0, 109, 119, .12);
}

.list-tools > small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.bounded-list {
  max-height: 390px;
  padding-right: 7px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #a8cfcb #edf7f5;
  scrollbar-width: thin;
}

.compact-bounded-list { max-height: 310px; }

.bounded-list::-webkit-scrollbar,
.bounded-image-library::-webkit-scrollbar,
.custom-select-options::-webkit-scrollbar { width: 8px; }

.bounded-list::-webkit-scrollbar-thumb,
.bounded-image-library::-webkit-scrollbar-thumb,
.custom-select-options::-webkit-scrollbar-thumb {
  border: 2px solid #edf7f5;
  border-radius: 999px;
  background: #9bc9c5;
}

.filter-empty {
  padding: 30px 14px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.user-report-panel {
  margin-bottom: 20px;
}

.user-report-list {
  display: grid;
  gap: 7px;
}

.user-report-list article {
  min-width: 760px;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: 42px minmax(190px, 1.4fr) repeat(4, minmax(64px, .45fr)) minmax(130px, .75fr) 88px;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 15px;
  transition: background .18s ease, border-color .18s ease;
}

.user-report-list article:hover {
  border-color: #d7e8e5;
  background: #f4faf8;
}

.user-report-identity b,
.user-report-identity small,
.report-metric b,
.report-metric small,
.report-completion small {
  display: block;
}

.user-report-identity b { font-size: 12px; }
.user-report-identity small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.report-metric b { color: var(--ink); font: 800 18px/1 var(--serif); }
.report-metric small { margin-top: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.report-completion i { height: 7px; display: block; overflow: hidden; border-radius: 999px; background: #e6eded; }
.report-completion i b { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--fresh-green)); }
.health-bars i > b,
.report-completion i > b { transform-origin: left center; }
.report-completion small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.user-report-list time { color: var(--muted); font-size: 10px; text-align: right; }

.mobile-nav {
  display: none;
}

.wide { width: 100%; }

.login-body {
  min-height: 100vh;
  padding: 20px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 92% 8%, #ffffff 0, transparent 36rem),
    radial-gradient(circle at 8% 94%, #d2ece8 0, transparent 34rem),
    linear-gradient(138deg, #f1faf8 0%, #e1f1ef 52%, #d6ebe8 100%);
}

.login-shell {
  width: 100%;
  min-height: calc(100vh - 40px);
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 20px;
  padding: 20px;
  overflow: visible;
  border: 1px solid var(--frame-line);
  border-radius: 40px;
  background: #ffffff;
  box-shadow: var(--frame-shadow);
}

.login-story {
  padding: 55px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--navy);
  border: 1px solid var(--frame-line);
  border-radius: 28px;
  background: #f3f8f7;
}

.frame-brand.large .portal-logo { width: 124px; height: 58px; }
.frame-brand.large .frame-word { color: var(--teal); font-size: 47px; }
.login-story h1 { max-width: 580px; margin: 14px 0; font: 700 49px/1.02 var(--serif); }
.login-story p { max-width: 510px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.login-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.login-pills span { padding: 8px 12px; border: 1px solid var(--frame-line); border-radius: 999px; background: #fff; color: var(--navy); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

.login-card {
  padding: 58px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 28px;
  border: 1px solid var(--frame-line);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(24, 77, 73, .08);
}

.login-card h2 { margin: 9px 0 5px; color: var(--navy); font: 700 32px var(--serif); }
.login-card > div > p { margin: 0 0 27px; color: var(--muted); font-size: 13px; }
.remember { grid-template-columns: 18px 1fr; align-items: center; font-weight: 500!important; }
.remember input { width: auto; accent-color: var(--navy); }
.login-help { margin-top: 24px; color: var(--muted); font-size: 11px; text-align: center; }

/* Solid portal surfaces and shared rounded control language. */
.portal-body .button,
.login-body .button {
  border-radius: 16px;
  background: var(--teal);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 109, 119, .16);
}

.portal-body .button.gold,
.login-body .button.gold {
  background: var(--orange);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(255, 129, 94, .18);
}

.portal-body .button.ghost,
.login-body .button.ghost {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--frame-line);
  box-shadow: none;
}

.portal-body input:not([type="checkbox"]):not([type="radio"]),
.portal-body textarea,
.portal-body select,
.login-body input:not([type="checkbox"]):not([type="radio"]) {
  border-radius: 14px;
}

.portal-body select,
.login-body select {
  appearance: none;
  padding-right: 50px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%23006D77' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 14px 9px;
  color: var(--ink);
}

.portal-body select option,
.login-body select option {
  padding: 12px 16px;
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-native {
  position: absolute !important;
  left: 1px;
  bottom: 1px;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.custom-select-trigger {
  position: relative;
  width: 100%;
  min-height: 48px;
  padding: 12px 54px 12px 15px;
  overflow: hidden;
  border: 1px solid var(--frame-line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.custom-select-trigger:hover,
.custom-select-trigger:focus-visible,
.custom-select.open .custom-select-trigger {
  border-color: var(--teal);
  outline: 3px solid #d8efec;
}

.custom-select-trigger[aria-invalid="true"] {
  border-color: var(--orange);
  outline-color: #ffe5dd;
}

.custom-select-trigger[data-placeholder] .custom-select-value { color: var(--muted); }

.custom-select-value {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-chevron {
  position: absolute;
  right: 20px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s ease;
}

.custom-select.open .custom-select-chevron {
  transform: translateY(-25%) rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 200;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 360px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--frame-line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(0, 82, 90, .17);
  scrollbar-color: #a8cfcb #edf7f5;
  scrollbar-width: thin;
}

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

.custom-select-search {
  min-height: 42px;
  margin-bottom: 7px;
  padding: 9px 12px !important;
  border-radius: 11px !important;
  background: #f2f8f7 !important;
  font-size: 12px !important;
}

.custom-select-options {
  max-height: 286px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #a8cfcb #edf7f5;
  scrollbar-width: thin;
}

.custom-select-option {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 0;
  border-radius: 11px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  background: #edf8f6;
  color: #005c64;
  outline: none;
}

.custom-select-option[aria-selected="true"] {
  background: #dff2ef;
  color: #00545c;
  font-weight: 850;
}

.portal-body .steps .active {
  color: var(--teal);
}

.portal-body .steps .active span {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.portal-body .steps .done span {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--ink);
}

.portal-body .steps li:not(:last-child)::after {
  border-color: #9dcac6;
}

.portal-body .split-title,
.portal-body .preview-toolbar {
  padding: 22px 26px;
  border: 1px solid var(--frame-line);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(8, 30, 38, .12);
}

.portal-body .drop-icon,
.portal-body .format-icon {
  background: var(--teal);
}

.portal-body .text-button {
  color: var(--teal);
}

.portal-body .code-editor {
  border-radius: 16px;
  background: #064d54;
}

.portal-body .job-card,
.portal-body .settings-card,
.portal-body .template-card,
.portal-body .plan-page,
.portal-body .asset-card,
.portal-body .audit-card,
.portal-body .wizard-card,
.portal-body .editor-card,
.portal-body .output-list article,
.portal-body .empty-state,
.portal-body .dropzone,
.portal-body .toggle,
.portal-body .source-chip,
.portal-body .flash {
  border-radius: 20px;
  background-color: #ffffff;
}

.portal-body .template-card {
  position: relative;
  min-height: 222px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--frame-line);
  isolation: isolate;
  transform: translateZ(0);
  transition: transform .22s cubic-bezier(.22, 1, .36, 1), border-color .18s ease, box-shadow .24s ease, background-color .18s ease;
}

.portal-body .template-card:hover {
  transform: translateY(-2px) translateZ(0);
  border-color: #acd3cf;
  box-shadow: 0 16px 34px rgba(8, 70, 73, .1);
}

.portal-body .template-card:has(input:checked) {
  padding: 16px;
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255, 129, 94, .18), 0 16px 34px rgba(8, 70, 73, .1);
}

.portal-body .template-card > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.portal-body .template-card:has(input:focus-visible) {
  outline: 3px solid rgba(0, 109, 119, .24);
  outline-offset: 3px;
}

.template-select-dot {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 4;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(16, 24, 40, .38);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(16, 24, 40, .13);
}

.template-card:has(input:checked) .template-select-dot {
  border: 5px solid var(--teal);
}

.portal-body .template-preview {
  position: relative;
  width: 100%;
  height: 132px;
  padding: 0;
  display: block;
  overflow: hidden;
  border-radius: 15px;
  background: #dff1ef;
}

.portal-body .template-preview.square { width: 132px; }
.portal-body .template-preview.portrait { width: 105px; }
.portal-body .template-preview.story { width: 76px; }

.template-preview > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .65s cubic-bezier(.22, 1, .36, 1), filter .35s ease;
}

.template-card:hover .template-preview > img {
  transform: scale(1.035);
  filter: saturate(1.04) contrast(1.02);
}

.template-preview-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 28%, rgba(6, 47, 64, .08) 52%, rgba(6, 36, 55, .76) 100%);
}

.template-preview-copy {
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 13px;
  display: grid;
  gap: 5px;
}

.portal-body .template-preview-copy i {
  width: 63%;
  height: 7px;
  display: block;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.portal-body .template-preview-copy i:nth-child(2) { width: 42%; height: 4px; background: rgba(255, 255, 255, .72); }
.portal-body .template-preview-copy i:nth-child(3) { width: 24%; height: 5px; background: var(--orange); }
.portal-body .template-card > b { margin-top: 13px; color: var(--ink); font: 800 15px/1.2 var(--serif); }
.portal-body .template-card > small { color: var(--muted); font-size: 10px; }
.portal-body .template-card > em { z-index: 4; color: #ffffff; background: var(--orange); }

/* The preview expands to the document height so the browser page owns scrolling. */
.preview-stage {
  width: 100%;
  height: auto;
  min-height: 680px;
  padding: 42px;
  display: block;
  overflow: hidden;
  border-radius: 24px;
  background: #e8eeee;
  box-shadow: inset 0 0 0 1px #d6e0e0;
}

.preview-stage iframe {
  display: block;
  width: 900px;
  min-height: 1px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 20px 55px rgba(16, 24, 40, .18);
  transform-origin: top center;
}

.asset-library-panel {
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--frame-line);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(8, 30, 38, .1);
}

.asset-library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.bounded-image-library {
  max-height: 430px;
  padding-right: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #a8cfcb #edf7f5;
  scrollbar-width: thin;
}

.asset-library-grid article {
  overflow: hidden;
  border: 1px solid var(--frame-line);
  border-radius: 18px;
  background: #ffffff;
}

.asset-library-grid img {
  width: 100%;
  height: 150px;
  display: block;
  object-fit: cover;
}

.asset-library-grid article > div {
  padding: 12px 14px;
}

.asset-library-grid b,
.asset-library-grid span {
  display: block;
}

.asset-library-grid b { color: var(--ink); font-size: 12px; }
.asset-library-grid span { margin-top: 3px; color: var(--muted); font-size: 10px; }

.tag-row {
  display: flex !important;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
  padding: 0 !important;
}

.tag-row em {
  padding: 4px 7px;
  border-radius: 999px;
  background: #e8f5f3;
  color: #00636b;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.match-reason,
.crop-notice {
  padding: 10px 12px;
  border-radius: 12px;
  background: #edf8f6;
  color: #005c64 !important;
  font-weight: 750;
}

.crop-notice {
  background: #fff0eb;
  color: #954129 !important;
}

.portal-body .status.smart_reused,
.portal-body .status.reused,
.portal-body .status.selected,
.portal-body .status.generated,
.portal-body .status.regenerated {
  background: #dff2ef;
  color: #00545c;
}

.portal-body .asset-card { overflow: visible; }
.portal-body .asset-card > img { border-radius: 20px 20px 0 0; }

.asset-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--frame-line);
}

.asset-actions form:first-child {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.asset-actions label:not(.file-button) {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.asset-secondary-actions {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 !important;
}

.file-button {
  padding: 10px 14px;
  border: 1px solid var(--frame-line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--teal);
}

.task-progress-card {
  width: 100%;
  min-height: min(560px, calc(100vh - 210px));
  padding: clamp(30px, 6vw, 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--frame-line);
  border-radius: 30px;
  background: #ffffff;
  box-shadow: var(--frame-shadow);
}

.task-progress-heading {
  margin-top: 16px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}

.task-progress-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.05;
}

.task-progress-heading p {
  margin: 12px 0 0;
  color: var(--teal);
  font-size: clamp(17px, 2vw, 22px);
  font-weight: 850;
}

.task-progress-heading output {
  color: var(--teal);
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 900;
}

.task-progress-track {
  height: 14px;
  margin-top: 36px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5efee;
}

.task-progress-track span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #006d77, #20a39e);
  transition: width .55s cubic-bezier(.22, 1, .36, 1);
}

.task-progress-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.task-progress-error {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff0eb;
  color: #913a29;
  font-weight: 750;
}

.task-progress-card[data-state="completed"] .task-progress-track span { background: #20a36a; }
.task-progress-card[data-state="failed"] .task-progress-track span { background: var(--orange); }

@media (max-width: 1080px) {
  .glass-nav .primary-nav a { display: block !important; padding: 10px 12px; }
  .account-copy { display: none; }
  .top-grid, .admin-grid { grid-template-columns: 1fr; }
  .lower-grid { grid-template-columns: 1fr 1fr; }
  .recent-panel { grid-column: 1 / -1; }
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .user-management-grid { grid-template-columns: 1fr; }
  .asset-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .portal-body { padding-bottom: 74px; }
  .frame-header.app-header { position: static; padding: 14px; }
  .glass-nav { min-height: 62px; padding: 9px 12px; border-radius: 22px; }
  .glass-nav .primary-nav, .account-copy { display: none; }
  .account-cluster { margin-left: auto; }
  .app-shell { padding: 0 14px 30px; }
  .workspace-frame { padding: 14px; border-radius: 28px; }
  .dashboard-welcome { align-items: flex-start; flex-direction: column; padding: 10px 5px 22px; }
  .dashboard-welcome h1 { font-size: 27px; }
  .dashboard-welcome .button, .welcome-actions { width: 100%; }
  .welcome-actions .button { flex: 1; }
  .metric-card-row, .lower-grid, .admin-stat-grid { grid-template-columns: 1fr; }
  .metric-card-row { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
  .metric-card-row::-webkit-scrollbar { display: none; }
  .metric-card { min-width: 75vw; scroll-snap-align: start; }
  .ring-layout { flex-direction: column; }
  .list-tools { align-items: stretch; flex-direction: column; }
  .list-search { width: 100%; }
  .list-tools > small { align-self: flex-end; }
  .compact-job-list > a { grid-template-columns: 38px minmax(0,1fr) 14px; }
  .compact-job-list .status { display: none; }
  .admin-job-table > a { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .admin-job-table > a > span:nth-child(3), .admin-job-table .status { display: none; }
  .user-directory article { grid-template-columns: 40px minmax(0,1fr) auto; }
  .user-directory .role-badge, .user-directory article > .status { display: none; }
  .user-directory article form { grid-column: 2 / -1; }
  .user-report-list article { min-width: 0; grid-template-columns: 42px repeat(3, minmax(0, 1fr)); gap: 11px 8px; }
  .user-report-identity { grid-column: 2 / -1; }
  .report-metric { padding: 8px; border-radius: 11px; background: #f4f8f7; text-align: center; }
  .report-completion { grid-column: 1 / 4; }
  .user-report-list time { grid-column: 4; }
  .mobile-nav { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 50; padding: 8px; display: flex; justify-content: space-around; border: 1px solid var(--frame-line); border-radius: 22px; background: #ffffff; box-shadow: 0 16px 40px rgba(11,35,65,.18); }
  .mobile-nav a { min-width: 60px; display: grid; place-items: center; gap: 3px; color: var(--navy); font-size: 10px; font-weight: 800; text-decoration: none; }
  .mobile-nav a span { font-size: 17px; }
  .login-body { padding: 12px; }
  .login-shell { min-height: calc(100vh - 24px); grid-template-columns: 1fr; gap: 14px; padding: 12px; border-radius: 28px; }
  .login-story { min-height: 340px; padding: 32px; }
  .login-story h1 { font-size: 36px; }
  .login-card { padding: 36px 28px; }
  .portal-logo { width: 82px; height: 38px; }
  .frame-word { font-size: 27px; }
  .portal-body .page-title, .portal-body .split-title, .portal-body .preview-toolbar { padding: 20px; border-radius: 20px; }
  .preview-stage { min-height: 520px; padding: 16px; border-radius: 20px; }
  .asset-library-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .asset-library-grid img { height: 110px; }
  .bounded-image-library { max-height: 390px; }
  .asset-actions form:first-child { grid-template-columns: 1fr; }
  .asset-secondary-actions { align-items: stretch; flex-direction: column; }
  .task-progress-card { min-height: calc(100vh - 210px); padding: 28px 22px; border-radius: 22px; }
  .task-progress-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
  .task-progress-heading output { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .metric-card, .primary-nav a, .task-progress-track span { transition: none; }
}

/* Constrain metadata to its grid track; long stable fact IDs never cover fields. */
.portal-body .form-actions.sticky { margin: 28px 12px 20px; bottom: 18px; width: auto; }
.portal-body [data-plan-form] { padding-bottom: 12px; }
.portal-body .output-tools { margin: 24px 0 18px; }
.portal-body .output-list { margin: 0 0 28px; padding: 2px; }
.portal-body .audit-card { margin-bottom: 24px; }
.document-result { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--frame-line); }
.document-result:last-child { border-bottom: 0; }
.document-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--navy); }
.document-open > span:nth-child(2) { min-width: 0; flex: 1; }
.document-open b, .document-open small { display: block; overflow-wrap: anywhere; }
.document-open small { font-size: 12px; color: #536775; margin-top: 5px; }
.delete-document { color: #a14c35; padding: 10px; }
.collection-pages { display: flex; align-items: center; gap: 10px; padding-top: 18px; flex-wrap: wrap; }
.collection-pages > span { margin-right: auto; font-size: 13px; color: #536775; }
.collection-pages .button { padding: 9px 16px; }
.collection-pages button:disabled { opacity: .42; cursor: default; }
[data-collection-results][aria-busy="true"] { opacity: .65; pointer-events: none; }
[data-collection-note] { min-width: 80px; }
.asset-library-panel { scroll-margin-top: 115px; }
.library-target { display: block; max-width: 620px; margin: 16px 0; font-weight: 700; }
.library-target .custom-select { margin-top: 8px; }
.asset-library-grid article > div { min-width: 0; }
.asset-library-grid article b { overflow-wrap: anywhere; }
.asset-library-grid [data-library-use] { margin-top: 12px; }
.imagery-notice { display: flex; align-items: center; gap: 24px; justify-content: space-between; background: white; border: 1px solid var(--frame-line); border-radius: 22px; padding: 22px; margin: 20px 0; }
.imagery-notice p { margin-bottom: 0; }
@media (max-width: 640px) {
  .portal-body .form-actions.sticky { margin: 22px 6px 18px; }
  .document-open { flex-wrap: wrap; gap: 10px; }
  .document-open .status { margin-left: 0; }
  .document-result { gap: 8px; }
  .document-result .doc-icon { display: none; }
  .imagery-notice { flex-direction: column; align-items: stretch; }
  .portal-body .output-list article { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
  .portal-body .output-list article > div { min-width: 0; }
  .portal-body .output-list article > span:nth-child(3) { grid-column: 2; }
  .portal-body .output-list article > .button { grid-column: 1 / -1; width: 100%; justify-content: center; }
}
.portal-body .plan-block { grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) minmax(0, 1.5fr) 58px; align-items: start; gap: 16px; }
.portal-body .plan-block > *, .portal-body .plan-page-head input { min-width: 0; }
.portal-body .plan-block input, .portal-body .plan-block textarea { width: 100%; font-size: 14px; line-height: 1.5; }
.portal-body .plan-block textarea { resize: vertical; min-height: 88px; }
.portal-body .fact-lock { width: 100%; max-width: 100%; border-radius: 12px; padding: 8px 10px; white-space: normal; text-transform: none; letter-spacing: normal; font-size: 11px; }
.fact-lock summary { cursor: pointer; overflow-wrap: anywhere; }
.fact-reference-list { display: grid; gap: 7px; margin-top: 10px; }
.fact-reference-list span { overflow-wrap: anywhere; font-size: 10px; line-height: 1.5; }
.portal-body .form-actions.sticky { padding: 14px 18px; border: 1px solid var(--frame-line); border-radius: 22px; background: #fff; box-shadow: 0 8px 30px rgba(0,109,119,.1); }
.portal-body .preview-stage { position: relative; min-width: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.portal-body .preview-stage iframe { position: absolute; margin: 0; max-width: none; transform-origin: top left; border: 0; }
.fact-issues { display: grid; gap: 20px; margin: 24px 0; }
.fact-issue { padding: 24px; border: 1px solid #ecd9b4; border-radius: 22px; background: #fff; }
.fact-issue h2 { font-size: 21px; margin: 0 0 10px; }
.fact-issue p { color: #445c65; line-height: 1.6; }
.correction-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(230px,100%),1fr)); gap: 18px; margin: 20px 0; }
.correction-fields label { display: grid; gap: 8px; font-weight: 750; min-width: 0; }
.correction-fields input, .correction-fields textarea { width: 100%; min-width: 0; font: inherit; border: 1px solid var(--frame-line); border-radius: 14px; padding: 12px; background: #f7fbfa; }
.facts-advanced summary { cursor: pointer; padding: 20px; font-weight: 800; }
.fact-issue .button { white-space: normal; }
@media (max-width: 760px) {
  .user-report-list article { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .user-report-list article > .account-avatar { grid-column: 1; width: 40px; }
  .user-report-identity { grid-column: 2 / -1; }
  .user-report-list .report-metric { grid-column: span 2; min-width: 0; padding: 12px 8px; }
  .user-report-list .report-metric small { font-size: 11px; overflow-wrap: anywhere; }
  .user-report-list .report-completion { grid-column: 1 / 3; }
  .user-report-list time { grid-column: 3 / -1; }
}
@media (max-width: 1050px) {
  .portal-body .plan-block { grid-template-columns: minmax(0,1fr) 58px; }
  .portal-body .plan-block .block-meta, .portal-body .plan-block > input, .portal-body .plan-block > textarea { grid-column: 1; }
  .portal-body .plan-block > .move-buttons { grid-column: 2; grid-row: 1; }
}
@media (max-width: 640px) {
  .portal-body .form-actions.sticky { bottom: 90px; padding: 12px; border-radius: 18px; }
  .portal-body .plan-page-head { gap: 8px; padding: 10px 12px; min-height: 64px; height: auto; }
  .portal-body .plan-page-head .kind { display: none; }
}
