@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --mc3-navy-950: #050b14;
  --mc3-navy-900: #07111f;
  --mc3-navy-850: #0a1626;
  --mc3-navy-800: #0d1e31;
  --mc3-blue: #1676df;
  --mc3-blue-hover: #318aea;
  --mc3-cyan: #36c7ef;
  --mc3-orange: #f58220;
  --mc3-white: #f4f8fc;
  --mc3-muted: #8da0b5;
  --mc3-line: rgba(145, 174, 203, 0.14);
  --mc3-success: #41d991;
  --mc3-warning: #f6c453;
  --mc3-danger: #ff6178;
  --bg: var(--mc3-navy-950);
  --panel: var(--mc3-navy-850);
  --card: var(--mc3-navy-800);
  --border: var(--mc3-line);
  --text: var(--mc3-white);
  --muted: var(--mc3-muted);
  --accent: var(--mc3-success);
  --accent-2: #2ec67e;
  --ok: var(--mc3-success);
  --danger: var(--mc3-danger);
  --shadow: 0 14px 40px rgba(0, 4, 12, 0.2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 86% 8%, rgba(54, 199, 239, 0.06), transparent 28%),
    radial-gradient(circle at 38% 100%, rgba(65, 217, 145, 0.045), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, .brand-mark, .stat .value, .sidebar-note strong { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; }
h1 { margin-top: 4px; font-size: 38px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
h2 { font-size: 30px; font-weight: 700; line-height: 1.12; }
h3 { font-size: 21px; font-weight: 600; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
button:focus-visible, summary:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--mc3-cyan); outline-offset: 3px; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 248px; flex-direction: column; padding: 28px 20px 20px; background: var(--mc3-navy-900); border-right: 1px solid var(--border); }
.corporate-lockup { position: relative; margin: 0 10px 31px; padding-bottom: 23px; border-bottom: 1px solid var(--border); }
.corporate-lockup::after { content: ""; position: absolute; bottom: -1px; left: 0; width: 32px; height: 2px; background: var(--mc3-orange); }
.menzies-logo { display: block; width: 154px; height: auto; }
.cargo-identity { display: block; margin-top: 14px; color: var(--mc3-white); font-size: 9px; font-weight: 600; letter-spacing: .17em; }
.cargo-identity i { display: inline-block; width: 3px; height: 3px; margin: 0 6px 2px; background: var(--mc3-orange); border-radius: 50%; }
.brand { display: flex; flex-direction: column; align-items: flex-start; margin: 0 10px 35px; text-decoration: none; }
.brand-mark { display: flex; align-items: baseline; gap: 8px; color: var(--mc3-white); font-size: 35px; font-weight: 700; letter-spacing: .01em; line-height: 1; }
.brand-mark > span { color: var(--accent); font-family: Inter, sans-serif; font-size: 8px; font-weight: 600; letter-spacing: .2em; }
.brand-caption { margin-top: 8px; color: var(--mc3-muted); font-size: 10px; font-weight: 600; letter-spacing: .18em; }
.workspace-label { margin: 0 12px 11px; color: #71869c; font-size: 9px; font-weight: 600; letter-spacing: .13em; }
.nav-item { display: flex; min-height: 46px; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.nav-item > svg { width: 21px; height: 21px; }
.nav-item.active { border-color: rgba(65, 217, 145, .16); background: rgba(65, 217, 145, .09); color: var(--accent); }
.nav-arrow { width: 17px !important; height: 17px !important; margin-left: auto; }
.sidebar-bottom { margin-top: auto; }
.sidebar-note { padding: 20px 12px 28px; }
.mini-mark { display: block; width: 25px; height: 25px; margin-bottom: 13px; color: var(--accent); }
.sidebar-note strong { font-size: 22px; font-weight: 600; line-height: 1.1; }
.sidebar-note p { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.nexus-return { display: flex; min-height: 58px; align-items: center; gap: 11px; padding: 11px 12px; border-top: 1px solid var(--border); text-decoration: none; transition: background .18s ease; }
.nexus-return:hover { background: rgba(255, 255, 255, .025); }
.nexus-return > svg { width: 21px; color: var(--mc3-cyan); }
.nexus-return strong { display: block; font-size: 11px; font-weight: 600; }
.nexus-return small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

.workspace-bar { display: flex; height: 66px; align-items: center; justify-content: space-between; margin-left: 248px; padding: 0 38px; background: rgba(7, 17, 31, .86); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; backdrop-filter: blur(12px); }
.workspace-bar strong { color: var(--text); font-weight: 500; }
.slash { margin: 0 13px; color: #496078; }
.workspace-tag { display: flex; align-items: center; gap: 12px; font-size: 9px; font-weight: 600; letter-spacing: .15em; }
.accent-dot { display: inline-block; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 4px rgba(65, 217, 145, .08); }

.app { width: auto; max-width: 1500px; margin: 0 0 0 248px; padding: 34px 38px 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .17em; }
.eyebrow > span { width: 18px; height: 2px; background: var(--mc3-orange); }
.title-dot { color: var(--accent); }
.sub { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.btn { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; border: 1px solid var(--border); border-radius: 9px; background: #10243a; color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease; }
.btn > svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); border-color: rgba(54, 199, 239, .34); background: #142b44; }
.btn:active { transform: translateY(0); }
.btn-primary { border-color: var(--mc3-blue); background: var(--mc3-blue); color: #fff; box-shadow: 0 7px 18px rgba(22, 118, 223, .16); }
.btn-primary:hover { border-color: var(--mc3-blue-hover); background: var(--mc3-blue-hover); }
.btn-danger { color: var(--danger); }
.btn-full { width: 100%; margin-top: 16px; }

.welcome-banner { position: relative; display: grid; min-height: 278px; grid-template-columns: 1.2fr 1fr; margin-bottom: 29px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(120deg, #0c2036 0%, #0a192b 68%, #0a1626 100%); box-shadow: var(--shadow); }
.welcome-banner::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--accent), var(--mc3-cyan)); }
.banner-copy { z-index: 1; padding: 34px 36px; }
.banner-label { display: flex; align-items: center; gap: 10px; color: #a7bacd; font-size: 9px; font-weight: 600; letter-spacing: .18em; }
.banner-copy h2 { margin: 18px 0 12px; font-size: 40px; line-height: 1.02; letter-spacing: -.02em; }
.banner-copy h2 > span { color: var(--accent); }
.banner-copy p { color: #9bb0c4; font-size: 12px; line-height: 1.65; }
.banner-link { display: inline-flex; align-items: center; gap: 18px; margin-top: 23px; padding-bottom: 6px; border-bottom: 1px solid rgba(54, 199, 239, .3); color: var(--mc3-cyan); font-size: 11px; font-weight: 500; text-decoration: none; }
.banner-link svg { width: 17px; height: 17px; transition: transform .18s ease; }
.banner-link:hover svg { transform: translateX(3px); }
.banner-art { position: relative; min-width: 0; overflow: hidden; }
.orbit { position: absolute; top: -50px; left: 0; width: 350px; height: 350px; border: 1px solid rgba(54, 199, 239, .18); border-radius: 50%; }
.orbit-two { top: -100px; left: -52px; width: 455px; height: 455px; border-color: rgba(65, 217, 145, .1); }
.art-tile { position: absolute; top: 48px; left: calc(50% - 73px); width: 145px; height: 175px; border-radius: 12px; }
.tile-back { border: 1px solid rgba(54, 199, 239, .38); background: #102a44; transform: rotate(-20deg) translate(-23px, 3px); }
.tile-front { display: flex; flex-direction: column; justify-content: space-between; padding: 18px; background: linear-gradient(145deg, #123e54, #0f7457); box-shadow: 0 18px 40px rgba(0, 0, 0, .3); transform: rotate(12deg); }
.tile-front > span { color: #fff; font-family: "Barlow Condensed", sans-serif; font-size: 20px; font-weight: 700; }
.tile-front > svg { width: 66px; height: 66px; align-self: center; color: var(--accent); stroke-width: 1.2; }
.tile-front small { font-size: 6px; letter-spacing: .13em; }
.art-plus { position: absolute; top: 34px; right: 33px; color: var(--mc3-orange); font-size: 27px; font-weight: 300; }
.art-caption { position: absolute; bottom: 22px; width: 100%; color: #71879c; font-size: 7px; letter-spacing: .2em; text-align: center; }

.section-kicker { display: flex; justify-content: space-between; margin-bottom: 13px; color: #7f94a9; font-size: 9px; font-weight: 600; letter-spacing: .13em; }
.section-kicker span { color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: 0; }
.grid-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 29px; }
.stat, .panel, .card { border: 1px solid var(--border); background: rgba(10, 22, 38, .94); box-shadow: var(--shadow); }
.stat { position: relative; min-height: 127px; padding: 21px 22px; border-radius: 10px; }
.stat::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 72%); opacity: .7; }
.stat .label { color: var(--muted); font-size: 11px; }
.stat .value { margin-top: 9px; font-size: 38px; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-foot { margin-top: 10px; color: #70869b; font-size: 9px; }
.stat-icon { position: absolute; top: 17px; right: 18px; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(65, 217, 145, .14); border-radius: 8px; background: rgba(65, 217, 145, .07); color: var(--accent); }
.stat-icon svg { width: 20px; height: 20px; }
.stat:nth-child(2) .stat-icon { border-color: rgba(54, 199, 239, .16); background: rgba(54, 199, 239, .07); color: var(--mc3-cyan); }
.stat:nth-child(3) .stat-icon { border-color: rgba(246, 196, 83, .16); background: rgba(246, 196, 83, .07); color: var(--mc3-warning); }

.panel { overflow: visible; border-radius: 11px; }
#evaluationsPanel { scroll-margin-top: 74px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 23px 24px 19px; }
.panel-header .hint { margin-top: 5px; }
.hint { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 24px 17px; border-bottom: 1px solid var(--border); }
.list-toolbar > span { color: var(--muted); font-size: 10px; }
.search-field { display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; background: #091728; }
.search-field > svg { width: 19px; height: 19px; color: #70869b; }
.search-field input { width: 180px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.eval-list { display: flex; flex-direction: column; }
.eval-item { padding: 22px 24px; border-bottom: 1px solid var(--border); }
.eval-item:last-child { border-bottom: 0; }
.eval-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.eval-identity { display: flex; min-width: 0; align-items: center; gap: 14px; }
.eval-identity > div { min-width: 0; }
.eval-identity strong { font-size: 13px; overflow-wrap: anywhere; }
.eval-icon { display: grid; width: 44px; height: 46px; flex-shrink: 0; place-items: center; border: 1px solid rgba(65, 217, 145, .15); border-radius: 8px; background: rgba(65, 217, 145, .07); color: var(--accent); }
.eval-icon svg { width: 22px; height: 22px; }
.meta { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.meta > span { margin: 0 5px; color: #4e667e; }
.actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 8px; }
.actions .btn { min-height: 40px; padding: 8px 11px; font-size: 10px; }
.btn-result { border-color: rgba(65, 217, 145, .18); background: rgba(65, 217, 145, .08); color: var(--accent); }
.more-menu { position: relative; }
.more-menu summary { list-style: none; letter-spacing: 2px; }
.more-menu summary::-webkit-details-marker { display: none; }
.menu-items { position: absolute; top: calc(100% + 7px); right: 0; z-index: 10; width: 155px; padding: 5px; border: 1px solid var(--border); border-radius: 9px; background: #0b1b2c; box-shadow: 0 14px 32px rgba(0, 0, 0, .3); }
.menu-items .btn { display: flex; width: 100%; justify-content: flex-start; border: 0; background: transparent; font-size: 11px; letter-spacing: 0; }
.menu-items .btn:hover { background: #10243a; }
.screen.hidden { display: none; }

.screen-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
body:not([data-screen="homeScreen"]) .topbar { display: none; }
#editorScreen, #resultsScreen, .public-wrap { padding-top: 8px; }
#evalForm, .public-wrap { padding: 27px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.field-block { display: block; margin-top: 14px; }
label { display: block; }
.field-label { display: block; margin-bottom: 7px; color: #c9d5e0; font-size: 11px; font-weight: 600; }
input[type="text"], input[type="number"], textarea { width: 100%; min-height: 44px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 8px; outline: 0; background: #081728; color: var(--text); font-size: 12px; }
input::placeholder, textarea::placeholder { color: #61768c; }
input:focus, textarea:focus { border-color: var(--mc3-cyan); box-shadow: 0 0 0 3px rgba(54, 199, 239, .07); }
textarea { resize: vertical; }
.questions-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 27px; }
.builder { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; counter-reset: question; }
.question-card { padding: 19px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); counter-increment: question; }
.question-head { display: flex; align-items: flex-start; gap: 12px; }
.question-head .grow { min-width: 0; flex: 1; }
.question-head .field-label::before { content: counter(question, decimal-leading-zero) " / "; color: var(--accent); }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.option-line, .choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #091728; transition: border-color .18s ease, background .18s ease; }
.option-line:has(input:checked), .choice:has(input:checked) { border-color: rgba(54, 199, 239, .65); background: rgba(54, 199, 239, .06); }
.option-line input[type="radio"] { flex: 0 0 auto; }
.option-line input[type="text"] { min-width: 0; flex: 1; border: 0; background: transparent; box-shadow: none; }
input[type="radio"] { width: 16px; height: 16px; accent-color: var(--mc3-cyan); }
.small-field { max-width: 115px; margin-top: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
#formMsg:empty { display: none; }
#formMsg { color: var(--danger); }

.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 15px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 12px; }
th { background: #091727; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.detail { margin-top: 16px; }
.detail-card { margin-top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); }
.pill { display: inline-block; margin-left: 8px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 999px; background: #10243a; color: var(--muted); font-size: 10px; vertical-align: middle; }
.status-ok { color: var(--ok); }
.status-bad { color: var(--danger); }
td.status-ok, td.status-bad { font-weight: 600; }
.public-wrap { max-width: 840px; margin: 0 auto; }
.public-form { margin-top: 18px; }
.public-question { min-width: 0; margin-top: 24px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.public-question legend { max-width: 100%; padding: 0 8px; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.choice { margin-top: 8px; padding: 13px; font-size: 12px; cursor: pointer; }
.choice:hover { border-color: rgba(54, 199, 239, .4); }
.choice input { flex: 0 0 auto; }
.public-message { margin-top: 12px; color: var(--ok); text-align: center; }
.empty { padding: 40px 20px; color: var(--muted); text-align: center; }
.empty-icon { display: grid; width: 45px; height: 45px; place-items: center; margin: 0 auto 14px; border: 1px solid rgba(65, 217, 145, .16); border-radius: 9px; background: rgba(65, 217, 145, .07); color: var(--accent); }
.empty-icon svg { width: 23px; height: 23px; }
.empty p { margin-top: 8px; font-size: 11px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: none; max-width: min(360px, calc(100% - 36px)); padding: 14px 18px; border: 1px solid rgba(65, 217, 145, .22); border-radius: 9px; background: #0d2430; color: var(--text); box-shadow: var(--shadow); }
.app-footer { display: flex; justify-content: space-between; padding-top: 25px; color: #6c8297; font-size: 8px; letter-spacing: .08em; }
.app-footer b { margin: 0 7px; color: #415a72; font-weight: 400; }

body[data-screen="accessScreen"] .sidebar,
body[data-screen="accessScreen"] .workspace-bar,
body[data-screen="accessScreen"] .app-footer,
body[data-mode="public"] .sidebar,
body[data-mode="public"] .workspace-bar,
body[data-mode="public"] .app-footer {
  display: none;
}

body[data-screen="accessScreen"] .app,
body[data-mode="public"] .app {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

body[data-screen="accessScreen"] .app {
  max-width: none;
  min-height: 100vh;
  padding: 24px;
}

body[data-mode="public"] #closePreview {
  display: none;
}

.access-screen {
  min-height: calc(100vh - 48px);
  place-items: center;
}

.access-screen:not(.hidden) {
  display: grid;
}

.access-card {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--mc3-navy-850);
  box-shadow: var(--shadow);
}

.access-card::before {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-bottom: 26px;
  background: var(--mc3-orange);
}

.access-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.access-brand img {
  width: 145px;
  height: auto;
}

.access-brand span {
  color: var(--mc3-muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .13em;
  text-align: right;
}

.access-form {
  margin-top: 27px;
}

.access-code-stage {
  position: relative;
  height: 96px;
  margin-top: 9px;
  isolation: isolate;
}

.access-code-fields {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 4px;
}

.access-code-input {
  --merge-x: 0px;
  --orbit-x: 0px;
  --orbit-y: 0px;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 1px solid rgba(141, 160, 181, .3);
  border-radius: 10px;
  background: var(--mc3-navy-800);
  color: var(--mc3-white);
  caret-color: var(--mc3-success);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.access-code-input:focus {
  border-color: var(--mc3-success);
  outline: none;
  background: #10263a;
  box-shadow: 0 0 0 3px rgba(65, 217, 145, .12);
}

.access-code-input:nth-child(1) { --merge-x: 105px; --orbit-x: -17px; --orbit-y: -16px; }
.access-code-input:nth-child(2) { --merge-x: 35px; --orbit-x: 17px; --orbit-y: -16px; }
.access-code-input:nth-child(3) { --merge-x: -35px; --orbit-x: 17px; --orbit-y: 16px; }
.access-code-input:nth-child(4) { --merge-x: -105px; --orbit-x: -17px; --orbit-y: 16px; }

.auth-core {
  position: absolute;
  top: 39px;
  left: 50%;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(54, 199, 239, .14);
  box-shadow: 0 0 0 0 rgba(54, 199, 239, .18);
  opacity: 0;
  transform: translateX(-50%) scale(.35);
}

.auth-core-ring {
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(54, 199, 239, .55);
  border-radius: inherit;
}

.auth-check {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 14px;
  height: 8px;
  border-bottom: 3px solid var(--mc3-navy-950);
  border-left: 3px solid var(--mc3-navy-950);
  opacity: 0;
  transform: rotate(-45deg) scale(.4);
}

.access-form.is-validating .access-code-input {
  pointer-events: none;
  animation: credential-orbit 1.15s cubic-bezier(.45, 0, .2, 1) infinite;
}

.access-form.is-validating .access-code-input:nth-child(2) { animation-delay: 60ms; }
.access-form.is-validating .access-code-input:nth-child(3) { animation-delay: 120ms; }
.access-form.is-validating .access-code-input:nth-child(4) { animation-delay: 180ms; }

.access-form.is-validating .auth-core {
  opacity: 1;
  animation: core-pulse 1.15s ease-in-out infinite;
}

.access-form.is-success .access-code-input {
  pointer-events: none;
  opacity: 0;
  transform: translate(var(--merge-x), 20px) scale(.1);
  transition: opacity 220ms ease, transform 320ms cubic-bezier(.2, .8, .2, 1);
}

.access-form.is-success .auth-core {
  background: var(--mc3-success);
  box-shadow: 0 0 0 9px rgba(65, 217, 145, .12), 0 0 30px rgba(65, 217, 145, .32);
  opacity: 1;
  transform: translateX(-50%) scale(1.35);
  transition: background 180ms ease, box-shadow 240ms ease, opacity 180ms ease, transform 320ms cubic-bezier(.2, .8, .2, 1);
}

.access-form.is-success .auth-core-ring { border-color: rgba(65, 217, 145, .65); }
.access-form.is-success .auth-check { opacity: 1; transform: rotate(-45deg) scale(1); transition: opacity 180ms 120ms ease, transform 220ms 120ms ease; }

.access-form.is-error .access-code-input {
  animation: credential-rebuild 420ms cubic-bezier(.2, .8, .2, 1) both;
  border-color: rgba(255, 97, 120, .65);
}

.auth-message {
  min-height: 20px;
  margin-top: 2px;
  color: var(--mc3-danger);
  font-size: 12px;
  text-align: center;
}

.access-form.is-validating .auth-message { color: var(--mc3-cyan); }
.access-form.is-success .auth-message { color: var(--mc3-success); }

@keyframes credential-orbit {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  30% { opacity: .95; transform: translate(var(--merge-x), 20px) scale(.52); }
  52% { opacity: .9; transform: translate(calc(var(--merge-x) + var(--orbit-x)), calc(20px + var(--orbit-y))) rotate(100deg) scale(.35); }
  76% { opacity: .75; transform: translate(calc(var(--merge-x) - var(--orbit-x)), calc(20px - var(--orbit-y))) rotate(230deg) scale(.28); }
  100% { opacity: .18; transform: translate(var(--merge-x), 20px) rotate(360deg) scale(.12); }
}

@keyframes core-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(54, 199, 239, .2); transform: translateX(-50%) scale(.8); }
  50% { box-shadow: 0 0 0 10px rgba(54, 199, 239, 0); transform: translateX(-50%) scale(1.08); }
}

@keyframes credential-rebuild {
  0% { opacity: .12; transform: translate(var(--merge-x), 20px) scale(.15); }
  72% { opacity: 1; transform: translate(0, 0) scale(1.06); }
  82% { transform: translateX(-4px) scale(1); }
  91% { transform: translateX(4px) scale(1); }
  100% { opacity: 1; transform: translate(0, 0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .access-form.is-validating .access-code-input,
  .access-form.is-validating .auth-core,
  .access-form.is-error .access-code-input {
    animation-duration: 1ms;
    animation-iteration-count: 1;
  }
}

@media (max-width: 430px) {
  .access-code-fields { gap: 9px; }
  .access-code-input { width: 52px; height: 54px; }
  .access-code-input:nth-child(1) { --merge-x: 91.5px; }
  .access-code-input:nth-child(2) { --merge-x: 30.5px; }
  .access-code-input:nth-child(3) { --merge-x: -30.5px; }
  .access-code-input:nth-child(4) { --merge-x: -91.5px; }
}

@media (min-width: 1700px) { .app { margin-right: auto; margin-left: calc(248px + (100% - 1748px) / 2); } }
@media (max-width: 1150px) {
  .sidebar { width: 205px; padding-right: 15px; padding-left: 15px; }
  .app { margin-left: 205px; padding: 28px; }
  .workspace-bar { margin-left: 205px; padding: 0 28px; }
  .eval-row { align-items: flex-start; flex-direction: column; }
  .actions { margin-left: 58px; }
  .banner-copy { padding: 28px; }
  .banner-copy h2 { font-size: 36px; }
}
@media (max-width: 800px) {
  .sidebar { position: static; width: auto; height: 72px; flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 20px; border-right: 0; border-bottom: 1px solid var(--border); }
  .corporate-lockup { margin: 0; padding: 0 18px 0 0; border: 0; border-right: 1px solid var(--border); }
  .corporate-lockup::after, .cargo-identity { display: none; }
  .menzies-logo { width: 116px; }
  .brand { margin: 0 auto 0 17px; }
  .brand-mark { font-size: 26px; }
  .brand-caption, .workspace-label, .sidebar-bottom, .workspace-bar { display: none; }
  .nav-item { min-height: 42px; padding: 8px 11px; font-size: 11px; }
  .nav-arrow { display: none; }
  .app { width: auto; margin: 0; padding: 25px 20px; }
  .grid-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .stat-icon { display: none; }
  .stat { min-height: 115px; padding: 18px 14px; }
  .stat .value { font-size: 34px; }
  .welcome-banner { grid-template-columns: 1.2fr 1fr; }
  .form-grid, .options-grid { grid-template-columns: 1fr; }
  .question-head, .screen-title-row, .questions-toolbar, .form-actions, .topbar { flex-direction: row; align-items: center; }
  .actions { justify-content: flex-start; }
}
@media (max-width: 540px) {
  .sidebar { padding: 12px 15px; }
  .nav-item > svg:first-child { display: none; }
  .app { padding: 23px 15px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 18px; }
  .topbar .btn-primary { width: 100%; }
  h1 { font-size: 33px; }
  .welcome-banner { min-height: 280px; grid-template-columns: 1fr; }
  .banner-copy { padding: 27px 25px; }
  .banner-copy h2 { font-size: 37px; }
  .banner-art { display: none; }
  .grid-stats { gap: 7px; }
  .stat { min-height: 104px; padding: 15px 10px; }
  .stat .label { min-height: 30px; font-size: 9px; line-height: 1.45; }
  .stat .value { margin-top: 4px; font-size: 31px; }
  .stat-foot { display: none; }
  .panel-header, .eval-item { padding-right: 16px; padding-left: 16px; }
  .list-toolbar { flex-wrap: wrap; padding-right: 16px; padding-left: 16px; }
  .search-field { flex: 1; }
  .search-field input { width: 100%; min-width: 0; }
  .eval-identity { gap: 10px; }
  .eval-icon { width: 38px; height: 42px; }
  .actions { width: 100%; margin-left: 0; gap: 6px; }
  .actions > .btn { flex: 1 1 auto; }
  #evalForm, .public-wrap { padding: 17px; }
  .screen-title-row h2 { font-size: 25px; }
  .questions-toolbar, .question-head { align-items: stretch; flex-direction: column; }
  .question-head .btn { align-self: flex-end; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .app-footer { gap: 14px; }
  .app-footer > span:last-child { text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
