:root {
  font-family: 'Segoe UI', Arial, sans-serif;
  color-scheme: light;
  --bg: #f3f4ef;
  --paper: #fffefa;
  --ink: #263b3c;
  --muted: #556966;
  --line: #d7dfd7;
  --soft: #e9eee7;
  --accent: #3e6f63;
  --on-accent: #fffefa;
  --warning: #f2e9d3;
  --warning-ink: #5c461f;
  --positive: #e5efe6;
  --shadow: 0 8px 28px #273c3410;
  --brand-orange: #b34400;
  --brand-ink: #152241;
  font-synthesis: none;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111f24;
  --paper: #1a2b31;
  --ink: #d8e5e0;
  --muted: #a1b5b3;
  --line: #3a5358;
  --soft: #22383e;
  --accent: #89c9b8;
  --on-accent: #112b2c;
  --warning: #343729;
  --warning-ink: #efe3be;
  --positive: #23413c;
  --shadow: 0 8px 28px #0002;
  --brand-orange: #ff8d45;
  --brand-ink: #f1f5fb;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #111f24;
    --paper: #1a2b31;
    --ink: #d8e5e0;
    --muted: #a1b5b3;
    --line: #3a5358;
    --soft: #22383e;
    --accent: #89c9b8;
    --on-accent: #112b2c;
    --warning: #343729;
    --warning-ink: #efe3be;
    --positive: #23413c;
    --shadow: 0 8px 28px #0002;
    --brand-orange: #ff8d45;
    --brand-ink: #f1f5fb;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px, 3vw, 46px); line-height: 1.12; font-weight: 650; letter-spacing: -.03em; }
h2 { font-size: 20px; font-weight: 650; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled, fieldset:disabled { cursor: wait; }
button:disabled { opacity: .62; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.main:focus { outline: none; }

.skip {
  position: fixed;
  z-index: 10;
  inset: 10px auto auto 12px;
  background: var(--paper);
  padding: 10px 14px;
  transform: translateY(-180%);
}
.skip:focus { transform: none; }
.entry-loading { min-height: 100dvh; display: grid; place-items: center; }
.entry-loading .iris-infinity { display: block; width: clamp(96px, 9vw, 128px); height: auto; }
.entry-load-error { width: min(calc(100% - 32px), 520px); display: grid; gap: 14px; justify-items: start; }
.muted, .page-heading p, .module-card > p, .next-step p { color: var(--muted); }
.button, .text-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 15px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.button:hover:not(:disabled), .nav-link:hover { border-color: var(--accent); background: var(--soft); }
.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.button.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(.94); }
.secondary { background: transparent; }
.text-button { border-color: transparent; background: transparent; color: var(--accent); }
.text-button:hover { text-decoration: underline; text-underline-offset: .19em; }

.shell { min-height: 100dvh; }
.cabinet { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.shell-column { min-width: 0; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 25px 14px;
  background: var(--paper);
  border-right: 1px solid var(--line);
}
.sidebar > .brand { margin: 0 10px 28px; }
.brand { display: inline-flex; width: fit-content; min-height: 42px; align-items: center; gap: 10px; text-decoration: none; }
.brand-emblem, .brand-name { display: block; flex: 0 0 auto; }
.brand-emblem {
  width: 34px; height: 34px; background: var(--brand-orange);
  mask: url("/iris-entry/20261117-activation-r6/assets/brus-emblem.svg") center / contain no-repeat;
}
.brand-name {
  width: 99px; height: 19px; background: var(--brand-ink);
  mask: url("/iris-entry/20261117-activation-r6/assets/brus-wordmark.svg") center / contain no-repeat;
}
.sidebar nav { display: grid; gap: 6px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 45px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  text-decoration: none;
}
.nav-link[aria-current="page"] { background: var(--soft); border-color: var(--line); font-weight: 650; }
.nav-link .glyph { width: 21px; height: 21px; }
.topbar, .toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px clamp(18px, 3vw, 44px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.top-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-inline-start: auto; }
.toolbar { justify-content: flex-end; background: var(--bg); padding-block: 4px; }
.content-tools { font-size: 13px; min-height: 36px; }
.identity { min-width: 0; overflow-wrap: anywhere; }
.identity strong, .identity small { display: block; }
.identity small { color: var(--muted); }
.iris-icon-button { width: 42px; min-width: 42px; height: 42px; padding: 0; }
.password-glyph {
  display: block;
  flex: none;
  width: 22px;
  height: 22px;
  background: currentColor;
  mask: var(--control-icon) center / contain no-repeat;
}
.password-toggle { --control-icon: url("./assets/password-closed.svg"); }
.password-toggle[aria-pressed="true"] { --control-icon: url("./assets/brus-emblem.svg"); }
.password-glyph { color: var(--brand-orange); width: 24px; height: 24px; }
.content-only .sidebar, .content-only .topbar { display: none; }
.content-only .cabinet { display: block; }
.shell-notices:not(:empty) { width: min(1100px, 100%); padding: 16px 28px 0; margin: auto; }

.main { width: min(1210px, 100%); margin-inline: auto; padding: clamp(24px, 4vw, 54px) clamp(18px, 3vw, 44px) 44px; }
.auth-main { padding-top: clamp(21px, 5dvh, 54px); }
.auth-layout { display: grid; align-items: center; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 68px); }
.auth-layout:has(.auth-card:only-child) { grid-template-columns: minmax(0, 720px); justify-content: center; }
.panel, .auth-card {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(21px, 3vw, 38px);
  box-shadow: var(--shadow);
}
.auth-note { padding-left: 20px; border-left: 2px solid var(--line); color: var(--muted); max-width: 31ch; }
.page-heading { margin-bottom: clamp(17px, 2.5vw, 31px); overflow-wrap: anywhere; }
.page-heading p { margin-top: 9px; font-size: 16px; max-width: 58ch; }
.entry-form { display: grid; gap: 13px; }
.entry-form fieldset { display: grid; gap: 15px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: grid; min-width: 0; align-content: start; gap: 5px; }
.field label { font-weight: 630; }
.field small, .switch-label small { color: var(--muted); }
.field input, .field select {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--ink);
}
.field input[readonly] { background: var(--soft); }
.form-actions, .module-actions, .copy-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.form-actions { margin-top: 3px; }
.copy-row input { flex: 1 1 180px; }
.status {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--soft);
  overflow-wrap: anywhere;
}
.status-error { background: var(--warning); color: var(--warning-ink); }
.status-success { background: var(--positive); }
.form-result:not(:empty) { display: grid; gap: 10px; }
.form-result > a { justify-self: start; }
.form-result:empty { display: none; }
.auth-card > .status, .auth-card > .validity, .auth-card > .text-button { margin-top: 17px; }
.auth-card > div > .button { margin-top: 12px; }
.operation-id { display: block; margin-top: 4px; }

.modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.module-card, .settings-panel, .invite-receipt { display: grid; gap: 13px; align-content: start; }
.module-title { display: flex; gap: 12px; align-items: center; }
.module-title > span:last-child { min-width: 0; }
.module-directory, .module-waiting { display: grid; gap: 11px; }
.module-directory-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.module-directory > .button { justify-self: start; }
.personal-birka, .birka-body, .birka-detail { display: grid; gap: 16px; }
.birka-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.birka-offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.birka-offers > li { display: grid; min-width: 0; }
.birka-offer { display: grid; gap: 8px; align-content: start; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); text-align: left; overflow-wrap: anywhere; }
.birka-offer:hover, .birka-offer[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); }
.birka-offer[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); }
.birka-offer-title { font-weight: 650; }
.birka-price { font-size: 20px; font-variant-numeric: tabular-nums; }
.birka-detail:not(:empty) { padding-top: 20px; border-top: 1px solid var(--line); }
.birka-failure { display: grid; gap: 12px; justify-items: start; }
.module-waiting h3 { margin: 3px 0 0; font-size: 15px; font-weight: 650; color: var(--muted); }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 174px), 1fr)); gap: 10px; padding: 0; margin: 0; list-style: none; }
.module-grid li { display: grid; min-width: 0; }
.module-badge { display: grid; align-content: center; gap: 4px; min-height: 58px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); text-decoration: none; }
a.module-badge:hover { border-color: var(--accent); background: var(--soft); }
.module-grid-waiting .module-badge { background: transparent; color: var(--muted); }
.module-badge small { padding-inline-start: 39px; }
.glyph {
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  background: currentColor;
  color: var(--brand-orange);
  mask: var(--icon) center / contain no-repeat;
}
.next-step {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.next-step p { margin-top: 5px; }
#invite { margin-top: 20px; scroll-margin-top: 24px; }
.invitation-history { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.invitation-history-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.invitation-history-head h3 { margin: 0; font-size: 17px; }
.invitation-history [role="status"]:empty { display: none; }
.invitation-history > button { justify-self: start; }
.invitation-list { display: grid; padding: 0; margin: 0; list-style: none; }
.invitation-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .9fr); align-items: start; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.invitation-row:last-child { border-bottom: 0; }
.invitation-row small { display: block; color: var(--muted); }
.switch-label { display: flex; align-items: center; gap: 11px; width: fit-content; }
.switch-label input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.switch-label small { display: block; }
.settings-panel > .button { justify-self: start; }

@media (max-width: 1150px) {
  .cabinet { grid-template-columns: 176px minmax(0, 1fr); }
  .auth-layout { gap: 27px; grid-template-columns: minmax(0, 2.7fr) minmax(0, 1fr); }
}
@media (max-width: 850px) {
  .cabinet { display: block; }
  .sidebar { position: static; height: auto; padding: 9px 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; border: 0; border-bottom: 1px solid var(--line); }
  .sidebar > .brand { margin: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .auth-layout { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .auth-note { max-width: 48ch; }
  .auth-main { max-width: 670px; }
}
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; }
  .topbar, .toolbar { padding-inline: 14px; }
  .main { padding-inline: 14px; }
  .modules, .field-grid { grid-template-columns: minmax(0, 1fr); }
}

.password-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; min-width: 0; }
.entry-form .delivery-options { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 18px; }
.delivery-options legend { font-weight: 630; margin-bottom: 6px; padding: 0; }
.delivery-options label { display: flex; gap: 7px; align-items: center; min-height: 38px; }
.delivery-options input { accent-color: var(--accent); width: 18px; height: 18px; }
.form-result .button { justify-self: start; }
.status-pending { border: 1px solid var(--line); }
.status:focus, .form-result:focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.auth-card > .status { margin: 0 0 16px; }
.entry-form > .text-button { justify-self: start; padding-inline: 0; }

@media (max-width: 560px) {
  .sidebar { padding-inline: 14px; gap: 4px 12px; }
  .sidebar nav { gap: 4px; }
  .nav-link { padding: 7px 9px; min-height: 44px; }
  .nav-link .glyph { width: 18px; height: 18px; }
  .top-controls { gap: 7px; min-width: 0; }
  .auth-layout { gap: 11px; }
  .auth-note { padding-left: 12px; margin-inline: 8px; }
  .auth-card { padding: 18px; }
  .form-actions .primary, .copy-row .button { width: 100%; }
  .copy-row input { flex-basis: 100%; }
  .invitation-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

.glyph-axon { --icon: url("./assets/axon.svg"); }
.glyph-nexus { --icon: url("./assets/nexus.svg"); }
.glyph-tutor { --icon: url("./assets/tutor.svg"); }
