/* NTI Zen: shared identity and auth layout from the NTI Product Demos site. */
:root {
  --ink: #101828;
  --muted: #667085;
  --line: #eaecf0;
  --accent: #0066ff;
  --accent-dark: #0053d6;
  --panel: #fff;
  --page: #f6f8fb;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

button {
  border-color: #d0d5dd;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgb(16 24 40 / 4%);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
button:hover { background: #f5f9ff; border-color: #b2ccff; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgb(0 102 255 / 24%);
  outline-offset: 2px;
}
button.active, .primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 5px 14px rgb(0 102 255 / 14%);
}
.primary:hover, button.active:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.secondary { background: #f9fafb; }
input:not([type=range]):not([type=checkbox]), select {
  border-color: #d0d5dd;
  box-shadow: 0 1px 2px rgb(16 24 40 / 4%);
}
input:not([type=range]):not([type=checkbox]):focus, select:focus {
  border-color: var(--accent);
}
label, .check { color: #475467; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.small, .dialog-intro, .privacy { color: var(--muted); }

/* Studio shell and controls use the same surfaces as the NTI demo. */
.app { grid-template-rows: auto minmax(0, 1fr); }
.app > header {
  min-height: 72px;
  padding-block: 10px;
  padding-inline: 24px;
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 10px rgb(16 24 40 / 3%);
  z-index: 3;
}
.brand { display: flex; align-items: center; gap: 20px; min-width: 0; }
.brand-logo { display: block; width: 166px; height: auto; flex: 0 0 auto; }
.brand .brand-product {
  display: block;
  margin: 0;
  padding-left: 20px;
  border-left: 1px solid #d0d5dd;
  color: #667085;
  font-size: 10px;
  font-weight: 750;
  line-height: 26px;
  letter-spacing: .14em;
}
.header-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.header-actions button { min-height: 35px; font-size: 11px; font-weight: 600; }
.header-actions .outline { border-color: #b2ccff; color: var(--accent); background: #f5f9ff; }
.header-actions .outline:hover { background: #eaf2ff; }
.panel { background: #fff; padding-top: 25px; }
.model-heading h1 { margin-block: 9px 5px; font-size: 19px; font-weight: 650; }
.group { border-top-color: var(--line); padding-top: 16px; margin-top: 17px; }
.group summary { color: #344054; font-size: 10px; font-weight: 750; letter-spacing: .1em; }
.group[open] summary { color: var(--accent); }
.group summary::after { color: #98a2b3; }
.finish { background: #f9fafb; border: 1px solid #eaecf0; }
.finish.active { background: #f0f6ff; border-color: #84adff; color: var(--accent); box-shadow: none; }
.finish.active i { outline-color: #84adff; }
.viewbar, .model-tools > button, .orbit-tools button { box-shadow: 0 2px 8px rgb(16 24 40 / 4%); }
.viewbar { border-color: #d0d5dd; border-radius: 9px; background: rgb(255 255 255 / 96%); }
.viewbar button { box-shadow: none; }
.viewbar button.active { background: var(--accent); }
.empty-state {
  background-color: var(--page);
  background-image: radial-gradient(ellipse at 50% 0%, rgb(0 102 255 / 6%), transparent 60%);
}
.empty-state h2 { font-weight: 650; letter-spacing: -.03em; }
.empty-state p { color: var(--muted); }
.empty-state > .outline { background: var(--accent); border-color: var(--accent); color: #fff; padding: 11px 20px; }
.empty-state > .outline:hover { background: var(--accent-dark); }
.text-button { box-shadow: none; }
.web-dialog {
  padding: 27px;
  border-color: #d0d5dd;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(16 24 40 / 16%), 0 3px 12px rgb(16 24 40 / 5%);
}
.web-dialog::backdrop { background: rgb(16 24 40 / 35%); }
.dialog-head h2 { font-weight: 650; letter-spacing: -.03em; }
.dialog-head > button { border-color: transparent; background: #f9fafb; color: #667085; box-shadow: none; }
.models-dialog { width: min(860px, calc(100vw - 28px)); }
.model-card { border-color: #e4e7ec; border-radius: 9px; background: #fff; }
.model-card.current { border-color: #84adff; box-shadow: 0 0 0 2px rgb(0 102 255 / 6%); }
.model-preview { background: #f6f8fb; box-shadow: none; }
#user-form, .export-stats { border: 1px solid #e4e7ec; background: #f9fafb; }
#user-invite { border-color: #b2ccff; background: #f5f9ff; }
.form-error { color: #b42318; }

/* Compact NTI Zen login; the original studio auth IDs remain intact. */
body.login-body {
  display: block;
  min-height: 100svh;
  padding: 0;
  background: radial-gradient(circle at 50% -8%, rgb(0 102 255 / 13%), transparent 38%),
    linear-gradient(145deg, #fbfdff 0%, #f5f8fc 50%, #eef3f9 100%);
  overflow-x: hidden;
}
.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgb(16 24 40 / 2.8%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(16 24 40 / 2.8%) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 22%, transparent 78%);
}
.auth-main {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.login-card {
  position: relative;
  width: min(100%, 424px);
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgb(208 213 221 / 90%);
  border-radius: 14px;
  background: rgb(255 255 255 / 97%);
  box-shadow: 0 24px 70px rgb(16 24 40 / 12%), 0 3px 12px rgb(16 24 40 / 5%);
}
.auth-bar { height: 2px; background: linear-gradient(90deg, var(--accent), #66a5ff 52%, rgb(102 165 255 / 0%)); }
.auth-brand { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 27px 17px; border-bottom: 1px solid var(--line); }
.auth-logo { display: block; width: 166px; height: auto; }
.auth-scope { display: inline-flex; align-items: center; gap: 7px; color: #667085; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; }
.auth-scope::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgb(0 102 255 / 10%); }
.auth-content { padding: 23px 27px 26px; }
.auth-eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
#auth-title { margin: 0 0 9px; font-size: clamp(22px, 4vw, 25px); font-weight: 670; line-height: 1.15; letter-spacing: -.03em; }
.auth-lead { margin: 0 0 21px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.auth-form { display: grid; gap: 13px; margin: 0; }
.auth-field { display: grid; gap: 6px; margin: 0; color: #344054; font-size: 11px; font-weight: 650; }
.auth-field > input:not([type=checkbox]), .auth-password-control > input:not([type=checkbox]) {
  width: 100%;
  height: 43px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #d0d5dd;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-field input:hover { border-color: #98a2b3; }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(0 102 255 / 12%); }
.auth-password-control { position: relative; display: block; }
.auth-password-control > input:not([type=checkbox]) { padding-right: 88px; }
.auth-paste-password { position: absolute; top: 6px; right: 6px; min-height: 31px; padding: 0 9px; border: 0; border-left: 1px solid #e4e7ec; border-radius: 4px; background: #fff; color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: .035em; box-shadow: none; text-transform: uppercase; }
.auth-paste-password:hover { background: #f5f9ff; color: var(--accent-dark); box-shadow: none; }
.auth-password-visibility { display: inline-flex; align-items: center; gap: 8px; width: max-content; min-height: 30px; margin: 0; color: #475467; font-size: 12px; font-weight: 550; cursor: pointer; user-select: none; }
.auth-password-visibility input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; border-radius: 4px; }
.auth-form .small { margin: 0; font-size: 11px; line-height: 1.45; }
.auth-form .form-error { margin: 0; }
.auth-form .form-error:empty { display: none; }
.auth-form > .primary { min-height: 43px; margin: 2px 0 0; padding: 0 17px; font-size: 12px; font-weight: 700; letter-spacing: .035em; }
.auth-meta { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.auth-meta p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.login-card .owner-setup-link { display: block; margin-top: 15px; color: var(--accent); font-size: 11px; line-height: 1.5; text-decoration: none; }
.login-card .owner-setup-link:hover { text-decoration: underline; }

@media (max-width: 1100px) {
  .brand .brand-product { display: none; }
  .brand-logo { width: 150px; }
  .app > header { padding-inline: 18px; }
}
@media (min-width: 701px) and (max-width: 850px) {
  .header-actions { gap: 5px; }
  .header-actions button { padding: 8px; font-size: 10px; }
  .brand-logo { width: 134px; }
}
@media (max-width: 700px) {
  .app { height: auto; min-height: 100dvh; grid-template-columns: 1fr; grid-template-rows: auto 68dvh auto; }
  .app > header { grid-row: 1; min-height: 105px; padding: 14px 16px 12px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .brand { gap: 15px; }
  .brand-logo { width: 140px; }
  .brand .brand-product { display: block; padding-left: 15px; font-size: 9px; line-height: 23px; }
  .header-actions { width: 100%; justify-content: flex-start; gap: 6px; }
  .header-actions button { flex: 1 1 auto; min-height: 35px; padding: 8px 10px; font-size: 11px; }
  .viewport { grid-row: 2; }
  .panel { grid-row: 3; border-right: 0; border-top: 1px solid var(--line); padding: 22px; }
  .web-dialog { padding: 21px; }
}
@media (max-width: 460px) {
  .login-card { border-radius: 12px; }
  .auth-brand { padding: 19px 20px 15px; gap: 12px; }
  .auth-logo { width: 148px; }
  .auth-scope { font-size: 8px; letter-spacing: .1em; }
  .auth-content { padding: 21px 20px 23px; }
  #auth-title { font-size: 21px; }
  .auth-lead { margin-bottom: 19px; }
  .auth-field > input:not([type=checkbox]), .auth-password-control > input:not([type=checkbox]) { height: 44px; font-size: 16px; }
}
@media (max-height: 610px) and (min-width: 600px) {
  .auth-main { place-items: start center; padding-block: 16px; }
  .auth-brand { padding-block: 15px 12px; }
  .auth-content { padding-block: 18px 20px; }
  .auth-lead { margin-bottom: 16px; }
  .auth-meta { margin-top: 14px; padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  button, .auth-field input { transition: none; }
}

/* Account preferences and the administrator's user workspace. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.auth-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.auth-heading-row .auth-eyebrow { margin: 0; }
.auth-language-label { margin: 0; }
.auth-language-label select { width: auto; min-width: 85px; padding: 5px 7px; border-color: transparent; background: #f9fafb; color: #475467; font-size: 11px; }
.language-setting { margin-top: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #f9fafb; }
.language-setting select { margin-top: 6px; }
.admin-dialog { width: min(1120px, calc(100vw - 28px)); }
.admin-dialog h3 { margin: 0 0 12px; font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.admin-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 22px 0; }
.admin-stats > div { padding: 15px 17px; border: 1px solid var(--line); border-radius: 9px; background: #f9fafb; }
.admin-stats strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 24px; font-weight: 650; line-height: 1.15; }
.admin-stats span { color: var(--muted); font-size: 10px; }
.admin-layout { display: grid; grid-template-columns: 290px minmax(0,1fr); gap: 25px; align-items: start; }
.admin-create, .admin-members { min-width: 0; }
.admin-list-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.admin-list-head h3 { margin: 0; }
.admin-list-head input { max-width: 270px; font-size: 11px !important; }
.admin-dialog .user-row { gap: 9px; padding: 17px 0; }
.admin-dialog .user-row > div:first-child { min-width: 150px; }
.admin-dialog .user-row strong { margin-bottom: 4px; font-size: 13px; }
.admin-dialog .user-row .user-badge { display: inline-flex; flex: 0 0 auto; padding: 3px 7px; border: 1px solid #d0d5dd; border-radius: 999px; color: #667085; font-size: 10px; line-height: 1.5; }
.admin-dialog .user-badge.active { color: #067647; border-color: #abefc6; background: #ecfdf3; }
.admin-dialog .user-badge.disabled { color: #b42318; border-color: #fecdca; background: #fef3f2; }
.admin-dialog .user-badge.pending { color: #b54708; border-color: #fedf89; background: #fffaeb; }
.admin-dialog .own-account { margin-left: auto; color: #667085; font-size: 10px; }
.admin-dialog .user-controls { display: flex; flex: 0 0 100%; align-items: center; flex-wrap: wrap; gap: 7px; }
.user-controls select { width: 100px; padding: 6px 7px; font-size: 11px; }
.admin-dialog .user-controls button { padding: 7px 9px; font-size: 10px; }
.admin-empty { padding: 25px 0; color: var(--muted); font-size: 12px; }
.credentials-card, .reset-card { margin-top: 17px; padding: 16px; border: 1px solid #b2ccff; border-radius: 9px; background: #f5f9ff; }
.credentials-card label, .reset-card label { margin-top: 11px; }
.credentials-card input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important; font-size: 11px !important; }
.credentials-card > button { margin-top: 10px; }
.reset-card .two { margin-bottom: 0; }
@media (max-width: 850px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-create { max-width: none; }
  .admin-stats { gap: 8px; }
  .admin-stats > div { padding: 12px; }
}
@media (max-width: 460px) {
  .admin-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-list-head { align-items: stretch; flex-direction: column; }
  .admin-list-head input { max-width: none; }
}
