:root {
  --avd-navy-950: #04131d;
  --avd-navy-900: #071b28;
  --avd-navy-850: #0a2231;
  --avd-navy-800: #0c2a3c;
  --avd-navy-700: #063f61;
  --avd-blue: #07577f;
  --avd-orange: #ec5a1f;
  --avd-orange-dark: #c94310;
  --avd-orange-soft: rgba(236, 90, 31, 0.14);
  --page-bg: var(--avd-navy-950);
  --surface: var(--avd-navy-850);
  --surface-raised: var(--avd-navy-800);
  --surface-soft: rgba(255, 255, 255, 0.035);
  --field-bg: #071c2a;
  --text: #f5f9fb;
  --text-soft: #d7e3ea;
  --muted: #97adba;
  --border: rgba(202, 222, 233, 0.14);
  --border-strong: rgba(202, 222, 233, 0.24);
  --success: #25b67a;
  --warning: #f5b942;
  --danger: #ec5e69;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.16);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;
}

[data-theme="light"] {
  --page-bg: #eef3f6;
  --surface: #ffffff;
  --surface-raised: #f8fafb;
  --surface-soft: rgba(6, 63, 97, 0.045);
  --field-bg: #ffffff;
  --text: #102936;
  --text-soft: #314d5c;
  --muted: #647c89;
  --border: rgba(20, 59, 78, 0.13);
  --border-strong: rgba(20, 59, 78, 0.22);
  --shadow: 0 22px 55px rgba(18, 49, 66, 0.12);
  --shadow-soft: 0 10px 28px rgba(18, 49, 66, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 14% -12%, rgba(7, 87, 127, 0.26), transparent 32rem),
    radial-gradient(circle at 88% 14%, rgba(236, 90, 31, 0.07), transparent 25rem),
    var(--page-bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[data-theme="light"] body {
  background:
    radial-gradient(circle at 10% -10%, rgba(7, 87, 127, 0.12), transparent 34rem),
    radial-gradient(circle at 91% 15%, rgba(236, 90, 31, 0.08), transparent 25rem),
    var(--page-bg);
}

a {
  color: inherit;
}

.mono,
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 49, 75, 0.94);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(18px);
}

.app-navbar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1640px;
  min-height: 76px;
  margin: 0 auto;
  padding: 0 32px;
}

.app-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.app-brand:hover {
  color: #fff;
}

.brand-logo {
  display: grid;
  width: 72px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.brand-logo img {
  display: block;
  width: 68px;
  height: auto;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-copy small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-navigation {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  margin-left: 34px;
}

.app-nav-links,
.app-user-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: 160ms ease;
}

.app-nav-link:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.app-nav-link.is-active {
  border-color: rgba(236, 90, 31, 0.38);
  background: rgba(236, 90, 31, 0.18);
  color: #fff;
}

.app-nav-link.is-active i {
  color: #ff8a55;
}

.mobile-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.45rem;
}

.session-pill,
.icon-button,
.logout-button {
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(0, 0, 0, 0.12);
  color: #fff;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.session-pill i {
  color: #79d5ff;
}

.session-timer.timer-warn {
  color: var(--warning);
}

.session-timer.timer-danger {
  color: #ff8b93;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  transition: 160ms ease;
}

.icon-button:hover,
.logout-button:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.theme-icon-light {
  display: none;
}

[data-theme="light"] .theme-icon-light {
  display: inline;
}

[data-theme="light"] .theme-icon-dark {
  display: none;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: 4px;
  color: #fff;
}

.user-avatar,
.mini-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff7a3f, var(--avd-orange));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(236, 90, 31, 0.25);
}

.user-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.84rem;
}

.user-copy {
  display: flex;
  max-width: 150px;
  flex-direction: column;
  line-height: 1.15;
}

.user-copy strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.67rem;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.app-main {
  width: 100%;
  max-width: 1640px;
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 38px 32px 24px;
}

.is-guest .app-main {
  display: flex;
  max-width: 1280px;
  flex-direction: column;
  justify-content: center;
  padding-top: 54px;
}

.flash-stack {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 10px;
  max-width: 1000px;
  margin: 0 auto 20px;
}

.portal-alert {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 52px;
  padding: 20px 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.footer-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
}

.section-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--avd-orange);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  font-weight: 700;
  transition: 160ms ease;
}

.btn-sm {
  min-height: 34px;
}

.btn-lg {
  min-height: 50px;
}

.btn-primary,
.btn-success {
  border-color: var(--avd-orange);
  background: var(--avd-orange);
  color: #fff;
  box-shadow: 0 8px 18px rgba(236, 90, 31, 0.2);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
  border-color: var(--avd-orange-dark);
  background: var(--avd-orange-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-primary {
  border-color: rgba(236, 90, 31, 0.65);
  color: #ff7942;
}

.btn-outline-primary:hover {
  border-color: var(--avd-orange);
  background: var(--avd-orange);
  color: #fff;
}

.btn-outline-secondary,
.btn-outline-light {
  border-color: var(--border-strong);
  color: var(--text-soft);
}

.btn-outline-secondary:hover,
.btn-outline-light:hover {
  border-color: var(--border-strong);
  background: var(--surface-soft);
  color: var(--text);
}

.btn-outline-danger {
  border-color: rgba(236, 94, 105, 0.5);
  color: #ff8d95;
}

.btn-outline-danger:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.form-label {
  margin-bottom: 7px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 750;
}

.form-control,
.form-select {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--field-bg);
  color: var(--text);
  font-size: 0.92rem;
}

.form-control-lg,
.form-select-lg {
  min-height: 50px;
  padding: 0.68rem 0.9rem;
  font-size: 0.96rem;
}

.form-control::placeholder {
  color: var(--muted);
  opacity: 0.54;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(236, 90, 31, 0.75);
  background-color: var(--field-bg);
  color: var(--text);
  box-shadow: 0 0 0 0.2rem rgba(236, 90, 31, 0.13);
}

.form-control:disabled,
.form-control[readonly] {
  background: var(--surface-soft);
  color: var(--text-soft);
}

.form-select {
  --bs-form-select-bg-img: none;
  padding-right: 2.5rem;
  appearance: auto;
  background-image: none;
}

.form-check-input {
  border-color: var(--border-strong);
  background-color: var(--field-bg);
}

.form-check-input:checked {
  border-color: var(--avd-orange);
  background-color: var(--avd-orange);
}

.form-check-input:focus {
  border-color: var(--avd-orange);
  box-shadow: 0 0 0 0.2rem rgba(236, 90, 31, 0.13);
}

.field-group {
  min-width: 0;
}

.field-help {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.75rem;
}

.field-error {
  margin-top: 6px;
  color: #ff9199;
  font-size: 0.76rem;
  font-weight: 650;
}

.input-with-icon {
  position: relative;
}

.input-with-icon > i {
  position: absolute;
  top: 50%;
  left: 15px;
  z-index: 2;
  color: var(--muted);
  transform: translateY(-50%);
}

.input-with-icon .form-control {
  padding-left: 42px;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  width: 100%;
  min-height: 600px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 70px 68px;
  background:
    linear-gradient(145deg, rgba(6, 68, 103, 0.98), rgba(4, 30, 45, 0.98)),
    var(--avd-navy-700);
  color: #fff;
}

.auth-brand-panel::before {
  position: absolute;
  right: -150px;
  bottom: -190px;
  width: 440px;
  height: 440px;
  border: 80px solid rgba(255, 255, 255, 0.035);
  border-radius: 50%;
  content: "";
}

.auth-brand-panel::after {
  position: absolute;
  top: -160px;
  left: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(236, 90, 31, 0.08);
  content: "";
}

.auth-brand-content {
  position: relative;
  z-index: 2;
  max-width: 570px;
}

.auth-eyebrow {
  display: inline-flex;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffc4aa;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-brand-content h1 {
  max-width: 620px;
  margin: 24px 0 18px;
  font-size: 3.4rem;
  font-size: clamp(2.25rem, 4vw, 3.65rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.auth-brand-content > p {
  max-width: 550px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.04rem;
  line-height: 1.75;
}

.auth-capabilities {
  display: grid;
  gap: 14px;
  margin-top: 38px;
}

.auth-capabilities div {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.87rem;
  font-weight: 650;
}

.auth-capabilities i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: rgba(236, 90, 31, 0.16);
  color: #ff9a6c;
}

.auth-brand-mark {
  position: absolute;
  right: 48px;
  bottom: 32px;
  color: rgba(255, 255, 255, 0.035);
  font-size: 10rem;
}

.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 58px 64px;
}

.auth-logo {
  display: block;
  width: 205px;
  max-height: 84px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 34px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
}

.auth-form-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 2rem;
  font-weight: 750;
  letter-spacing: -0.025em;
}

.auth-form-heading p {
  margin: 8px 0 28px;
  color: var(--muted);
}

.auth-form-panel .portal-form {
  display: grid;
  gap: 20px;
}

.portal-submit {
  margin-top: 2px;
}

.auth-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 23px;
  color: var(--muted);
  font-size: 0.73rem;
}

.auth-security-note i {
  color: var(--success);
}

.dashboard-hero,
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.dashboard-hero {
  min-height: 225px;
  overflow: hidden;
  padding: 44px 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(120deg, rgba(6, 63, 97, 0.98), rgba(10, 39, 56, 0.94)),
    var(--surface);
  box-shadow: var(--shadow);
  color: #fff;
}

.dashboard-hero h1,
.page-heading h1 {
  margin: 0;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.dashboard-hero h1 {
  max-width: 800px;
  font-size: 3rem;
  font-size: clamp(2.15rem, 4vw, 3.25rem);
}

.dashboard-hero > div > p {
  max-width: 710px;
  margin: 13px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1rem;
}

.hero-status-card {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 13px;
  min-width: 285px;
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.14);
}

.status-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: rgba(37, 182, 122, 0.15);
  color: #57d9a1;
  font-size: 1.2rem;
}

.hero-status-card div {
  display: flex;
  flex-direction: column;
}

.hero-status-card strong {
  font-size: 0.83rem;
}

.hero-status-card small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.7rem;
}

.dashboard-section,
.results-section {
  margin-top: 34px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-heading h2,
.data-card-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.32rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 190px;
  padding: 30px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: 180ms ease;
}

.tool-card::after {
  position: absolute;
  right: -70px;
  bottom: -100px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(7, 87, 127, 0.09);
  content: "";
}

.tool-card-primary::after {
  background: rgba(236, 90, 31, 0.09);
}

.tool-card:hover {
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.tool-icon {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 18px;
  background: rgba(7, 87, 127, 0.16);
  color: #53bde8;
  font-size: 1.85rem;
}

.tool-card-primary .tool-icon {
  background: var(--avd-orange-soft);
  color: #ff824a;
}

.tool-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tool-copy small {
  color: var(--avd-orange);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tool-copy strong {
  margin-top: 7px;
  font-size: 1.24rem;
}

.tool-copy > span {
  max-width: 560px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.tool-arrow {
  position: relative;
  z-index: 2;
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
}

.admin-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-link-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: 160ms ease;
}

.admin-link-card:hover {
  border-color: rgba(236, 90, 31, 0.38);
  color: var(--text);
  transform: translateY(-2px);
}

.admin-link-card > i:first-child {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  background: var(--surface-soft);
  color: #64c7ee;
  font-size: 1.12rem;
}

.admin-link-card > i:last-child {
  color: var(--muted);
}

.admin-link-card span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.admin-link-card strong {
  font-size: 0.86rem;
}

.admin-link-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.page-shell {
  width: 100%;
  margin: 0 auto;
}

.page-shell-narrow {
  max-width: 820px;
}

.page-shell-medium {
  max-width: 1180px;
}

.page-shell-large {
  max-width: 1320px;
}

.page-shell-wide {
  max-width: none;
}

.page-heading {
  margin-bottom: 24px;
}

.page-heading h1 {
  color: var(--text);
  font-size: 2.3rem;
  font-size: clamp(1.85rem, 3vw, 2.5rem);
}

.page-heading p {
  max-width: 760px;
  margin: 9px 0 0;
  color: var(--muted);
}

.form-card,
.data-card,
.filter-card,
.guidance-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.form-card {
  overflow: hidden;
}

.form-section {
  padding: 30px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: 0;
}

.form-section-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 24px;
}

.form-section-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: var(--avd-orange-soft);
  color: #ff7b42;
  font-size: 1.1rem;
}

.form-section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 750;
}

.form-section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.field-span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 30px;
  background: var(--surface-soft);
}

.choice-panel {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 66px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  cursor: pointer;
}

.choice-panel:hover {
  border-color: var(--border-strong);
}

.choice-panel .form-check-input {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  margin: 0;
}

.choice-panel > span {
  display: flex;
  flex-direction: column;
}

.choice-panel strong {
  color: var(--text);
  font-size: 0.84rem;
}

.choice-panel small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.reset-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, 0.72fr);
  align-items: start;
  gap: 18px;
}

.guidance-card {
  position: sticky;
  top: 100px;
  padding: 28px;
}

.guidance-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 13px;
  background: rgba(7, 87, 127, 0.16);
  color: #5fc8ef;
  font-size: 1.2rem;
}

.guidance-card h2 {
  margin: 18px 0 7px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 750;
}

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

.check-list li {
  display: flex;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.55;
}

.check-list i {
  margin-top: 2px;
  color: var(--success);
}

.format-example {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
  padding: 15px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.format-example small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  text-transform: uppercase;
}

.format-example code {
  margin-top: 6px;
  color: var(--text);
  font-size: 0.82rem;
}

.result-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 22px 25px;
  border: 1px solid rgba(37, 182, 122, 0.35);
  border-radius: var(--radius-lg);
  background: linear-gradient(110deg, rgba(22, 109, 77, 0.92), rgba(9, 61, 54, 0.95));
  box-shadow: var(--shadow-soft);
  color: #fff;
}

.result-banner-icon {
  font-size: 2rem;
  color: #74e5b2;
}

.result-banner-copy {
  display: flex;
  flex-direction: column;
}

.result-banner-copy span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-banner-copy strong {
  margin-top: 4px;
  font-size: 2rem;
  letter-spacing: 0.13em;
}

.result-banner-copy small {
  color: rgba(255, 255, 255, 0.7);
}

.session-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  margin-bottom: 16px;
  padding: 17px 19px;
  border: 1px solid rgba(37, 182, 122, 0.25);
  border-radius: 14px;
  background: rgba(37, 182, 122, 0.08);
}

.summary-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  background: rgba(37, 182, 122, 0.14);
  color: #57d9a1;
}

.summary-copy > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.summary-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.summary-tags span {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 0.68rem;
}

.notice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.notice-card {
  display: flex;
  gap: 13px;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
}

.notice-card > i {
  margin-top: 2px;
  color: #63c7ee;
  font-size: 1.1rem;
}

.notice-card div {
  display: flex;
  flex-direction: column;
}

.notice-card strong {
  color: var(--text);
  font-size: 0.8rem;
}

.notice-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.radio-card-grid {
  display: grid;
  gap: 8px;
}

.server-model-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.type-grid {
  grid-template-columns: repeat(2, minmax(0, 180px));
}

.radio-card {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  transition: 150ms ease;
}

.radio-card:hover {
  border-color: var(--border-strong);
}

.radio-card:has(.form-check-input:checked) {
  border-color: var(--avd-orange);
  background: var(--avd-orange-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(236, 90, 31, 0.18);
}

.radio-card .form-check-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.feature-actions {
  flex-wrap: wrap;
}

.results-section {
  padding-top: 4px;
}

.result-key-grid {
  display: grid;
  gap: 14px;
}

.key-result-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.key-result-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
}

.key-result-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--avd-orange-soft);
  color: #ff8149;
}

.key-result-heading small {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 750;
  text-transform: uppercase;
}

.key-result-heading h3 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 1rem;
}

.key-result-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.key-result-meta > div {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.key-result-meta span,
.key-output label {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 750;
  text-transform: uppercase;
}

.key-result-meta strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 0.82rem;
}

.key-output {
  margin-top: 17px;
}

.key-output label {
  display: block;
  margin-bottom: 7px;
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-badge-success {
  border-color: rgba(37, 182, 122, 0.24);
  background: rgba(37, 182, 122, 0.12);
  color: #5bd9a3;
}

[data-theme="light"] .status-badge-success {
  color: #13764f;
}

.status-badge-warning {
  border-color: rgba(245, 185, 66, 0.3);
  background: rgba(245, 185, 66, 0.12);
  color: #f4c45d;
}

[data-theme="light"] .status-badge-warning {
  color: #8a6210;
}

.filter-card {
  margin-bottom: 16px;
  padding: 20px;
}

.filter-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.filter-card-heading > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.filter-card-heading > div > i {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: rgba(7, 87, 127, 0.15);
  color: #5ec4ec;
}

.filter-card-heading span {
  display: flex;
  flex-direction: column;
}

.filter-card-heading strong {
  color: var(--text);
  font-size: 0.86rem;
}

.filter-card-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.69rem;
}

.filter-grid {
  display: grid;
  align-items: end;
  gap: 12px;
}

.filter-grid-history {
  grid-template-columns: 1.1fr 1.15fr 1.15fr 0.9fr 0.9fr auto;
}

.filter-grid-resets {
  grid-template-columns: 1fr 1.45fr 0.8fr 0.8fr;
}

.compact-check {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.76rem;
  white-space: nowrap;
}

.compact-check .form-check-input {
  margin: 0;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.data-card {
  overflow: hidden;
}

.data-card-heading {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.data-card-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.portal-table-wrap,
.history-table-scroll {
  position: relative;
  overflow: auto;
}

.history-table-scroll {
  max-height: calc(100vh - 310px);
  min-height: 250px;
}

.portal-table {
  width: 100%;
  min-width: 840px;
  margin: 0;
  color: var(--text-soft);
  --bs-table-bg: transparent;
  --bs-table-color: var(--text-soft);
  --bs-table-border-color: var(--border);
  --bs-table-hover-bg: var(--surface-soft);
  --bs-table-hover-color: var(--text);
}

.history-table {
  min-width: 1900px;
}

.history-table-no-x-scroll {
  overflow-x: hidden;
  overflow-y: auto;
}

.compact-history-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.compact-history-table th:nth-child(1) {
  width: 9%;
}

.compact-history-table th:nth-child(2) {
  width: 15%;
}

.compact-history-table th:nth-child(3) {
  width: 10%;
}

.compact-history-table th:nth-child(4) {
  width: 12%;
}

.compact-history-table th:nth-child(5) {
  width: 15%;
}

.compact-history-table th:nth-child(6) {
  width: 25%;
}

.compact-history-table th:nth-child(7) {
  width: 8%;
}

.compact-history-table th:nth-child(8) {
  width: 6%;
}

.compact-history-table td {
  min-width: 0;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.compact-history-table td > strong,
.compact-history-table td > small {
  display: block;
}

.compact-history-table td > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.35;
}

.history-mac-cell {
  font-size: 0.7rem !important;
  letter-spacing: -0.02em;
}

.reset-history-table {
  min-width: 1050px;
}

.portal-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.portal-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.75rem;
  white-space: nowrap;
}

.portal-table tbody tr:last-child td {
  border-bottom: 0;
}

.history-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  box-shadow: inset 0 -1px var(--border-strong);
}

.history-table thead th:first-child {
  left: 0;
  z-index: 6;
}

.history-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: 1px 0 var(--border);
}

.history-table tbody tr:hover td:first-child {
  background: var(--surface-raised);
}

.history-key-cell code {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: #75cdef;
  font-size: 0.72rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

[data-theme="light"] .history-key-cell code {
  color: #07577f;
}

.history-key-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px;
}

.icon-button-copy {
  width: 29px;
  height: 29px;
  border-color: var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.72rem;
}

.icon-button-copy:hover {
  border-color: rgba(236, 90, 31, 0.45);
  background: var(--avd-orange-soft);
  color: #ff7b42;
}

.history-key-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.history-actions {
  flex-wrap: wrap;
}

.identity-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mini-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.68rem;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-actions form,
.history-table form {
  margin: 0;
}

.empty-state {
  height: 190px;
  color: var(--muted) !important;
  text-align: center;
}

.empty-state i,
.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state i {
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.empty-state strong {
  color: var(--text-soft);
}

.empty-state span {
  margin-top: 4px;
}

.page-shell-form {
  max-width: 1420px;
}

.edit-key-warning {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(245, 185, 66, 0.32);
  border-radius: var(--radius-md);
  background: rgba(245, 185, 66, 0.1);
  color: #f4c45d;
}

.edit-key-warning > i {
  margin-top: 2px;
  font-size: 1.1rem;
}

.edit-key-warning strong,
.edit-key-warning span {
  display: block;
}

.edit-key-warning strong {
  color: var(--text);
}

.edit-key-warning span {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.edit-key-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  align-items: start;
  gap: 18px;
}

.edit-key-form {
  padding: 0;
}

.form-security-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 20px 0;
  padding: 11px 13px;
  border: 1px solid rgba(226, 74, 86, 0.3);
  border-radius: 9px;
  background: rgba(226, 74, 86, 0.1);
  color: #ff9199;
  font-size: 0.76rem;
  font-weight: 700;
}

.form-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.form-card-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-card-heading > div > i {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--avd-orange-soft);
  color: #ff7b42;
}

.form-card-heading strong,
.form-card-heading small {
  display: block;
}

.form-card-heading small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.edit-key-form > .field-group {
  padding: 0 20px 18px;
}

.edit-key-value {
  min-height: 126px;
  resize: vertical;
  overflow-wrap: anywhere;
}

.record-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 20px;
  padding: 20px;
  background: var(--border);
}

.record-summary > div {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface-soft);
}

.record-summary dt {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.record-summary dd {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.key-audit-card {
  overflow: hidden;
}

.key-audit-list {
  max-height: 650px;
  overflow: auto;
}

.key-audit-entry {
  padding: 18px;
  border-bottom: 1px solid var(--border);
}

.key-audit-entry:last-child {
  border-bottom: 0;
}

.key-audit-entry > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.key-audit-entry > div span {
  color: var(--muted);
  font-size: 0.72rem;
}

.key-audit-entry > p {
  margin: 10px 0;
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.5;
}

.key-audit-entry dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.key-audit-entry dl > div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.key-audit-entry dt {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.key-audit-entry dd {
  margin: 4px 0 0;
}

.key-audit-entry code {
  color: #75cdef;
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

[data-theme="light"] .key-audit-entry code {
  color: #07577f;
}

.key-audit-empty {
  padding: 55px 22px;
  color: var(--muted);
  text-align: center;
}

.key-audit-empty i,
.key-audit-empty strong,
.key-audit-empty span {
  display: block;
}

.key-audit-empty i {
  margin-bottom: 9px;
  color: var(--success);
  font-size: 1.6rem;
}

.key-audit-empty span {
  margin-top: 4px;
  font-size: 0.72rem;
}

.copy-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  border: 1px solid rgba(37, 182, 122, 0.35);
  border-radius: 11px;
  background: #0e4939;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(12px);
  transition: 180ms ease;
  pointer-events: none;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1450px) {
  .app-navbar {
    padding-inline: 22px;
  }

  .app-navigation {
    margin-left: 22px;
  }

  .app-nav-link {
    padding-inline: 9px;
    font-size: 0.78rem;
  }

  .user-copy {
    display: none;
  }
}

@media (max-width: 1199.98px) {
  .app-navbar {
    min-height: 70px;
  }

  .mobile-nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .app-navigation {
    position: absolute;
    top: calc(100% + 1px);
    right: 18px;
    left: 18px;
    display: none;
    max-height: calc(100vh - 90px);
    align-items: stretch;
    margin: 0;
    padding: 16px;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0 0 16px 16px;
    background: rgba(5, 49, 75, 0.98);
    box-shadow: var(--shadow);
  }

  .app-navigation.is-open {
    display: grid;
    gap: 15px;
  }

  .app-nav-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .app-nav-link {
    justify-content: center;
    padding: 11px;
  }

  .app-user-tools {
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .user-copy {
    display: flex;
  }

  .app-main {
    min-height: calc(100vh - 70px);
    padding: 30px 22px 20px;
  }

  .server-model-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-grid-history {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-grid-resets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .edit-key-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  .auth-shell {
    grid-template-columns: 0.82fr 1fr;
  }

  .auth-brand-panel,
  .auth-form-panel {
    padding: 46px 38px;
  }

  .auth-brand-content h1 {
    font-size: 2.45rem;
  }

  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-status-card {
    min-width: 0;
  }

  .admin-link-grid {
    grid-template-columns: 1fr;
  }

  .reset-layout {
    grid-template-columns: 1fr;
  }

  .guidance-card {
    position: static;
  }

  .compact-history-table,
  .compact-history-table tbody {
    display: block;
    width: 100%;
  }

  .compact-history-table thead {
    display: none;
  }

  .compact-history-table tbody {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .compact-history-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
  }

  .compact-history-table tbody td {
    position: static !important;
    display: block;
    min-width: 0;
    padding: 12px 14px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: transparent !important;
    box-shadow: none !important;
  }

  .compact-history-table tbody td:nth-child(even) {
    border-right: 0;
  }

  .compact-history-table tbody td::before {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.61rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .compact-history-table tbody td.empty-state {
    grid-column: 1 / -1;
    border: 0;
  }

  .compact-history-table tbody td.empty-state::before {
    display: none;
  }

  .history-key-cell,
  .compact-history-table td[data-label="Actions"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767.98px) {
  body {
    font-size: 14px;
  }

  .app-navbar {
    min-height: 64px;
    padding-inline: 15px;
  }

  .brand-logo {
    width: 58px;
    height: 38px;
  }

  .brand-logo img {
    width: 55px;
  }

  .brand-copy strong {
    font-size: 0.92rem;
  }

  .brand-copy small {
    display: none;
  }

  .app-navigation {
    right: 8px;
    left: 8px;
  }

  .app-nav-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-user-tools {
    flex-wrap: wrap;
  }

  .user-chip {
    margin-left: auto;
  }

  .app-main,
  .is-guest .app-main {
    padding: 22px 14px 16px;
  }

  .auth-shell {
    display: block;
    min-height: 0;
  }

  .auth-brand-panel {
    min-height: 260px;
    padding: 36px 28px;
  }

  .auth-brand-content h1 {
    margin-block: 16px 12px;
    font-size: 2rem;
  }

  .auth-brand-content > p {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .auth-capabilities,
  .auth-brand-mark {
    display: none;
  }

  .auth-form-panel {
    padding: 34px 26px;
  }

  .auth-logo {
    width: 180px;
    margin-bottom: 24px;
  }

  .dashboard-hero {
    min-height: 0;
    padding: 30px 25px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 155px;
    padding: 23px;
  }

  .tool-icon {
    width: 58px;
    height: 58px;
    font-size: 1.5rem;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .form-section {
    padding: 23px 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: span 1;
  }

  .server-model-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notice-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    padding: 18px 20px;
  }

  .feature-actions .btn {
    flex: 1 1 calc(50% - 6px);
  }

  .session-summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .session-summary > .btn {
    grid-column: 1 / -1;
  }

  .filter-grid-history,
  .filter-grid-resets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .result-banner .btn {
    grid-column: 1 / -1;
  }

  .key-result-meta {
    grid-template-columns: 1fr;
  }

  .app-footer {
    flex-wrap: wrap;
  }
}

@media (max-width: 575.98px) {
  .app-nav-links {
    grid-template-columns: 1fr;
  }

  .app-user-tools {
    display: grid;
    grid-template-columns: auto auto 1fr;
  }

  .user-chip {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 4px 0 0;
  }

  .logout-button {
    justify-content: center;
  }

  .tool-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 15px;
  }

  .tool-arrow {
    display: none;
  }

  .tool-copy strong {
    font-size: 1.06rem;
  }

  .form-actions,
  .filter-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions .btn,
  .filter-actions .btn,
  .filter-actions a,
  .feature-actions .btn {
    width: 100%;
    flex: 1 1 auto;
  }

  .server-model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-grid-history,
  .filter-grid-resets {
    grid-template-columns: 1fr;
  }

  .compact-history-table tbody tr {
    grid-template-columns: 1fr;
  }

  .compact-history-table tbody td {
    border-right: 0;
  }

  .record-summary {
    grid-template-columns: 1fr;
  }

  .key-audit-entry > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-banner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .result-banner-icon {
    display: none;
  }

  .result-banner-copy strong {
    font-size: 1.65rem;
  }

  .key-result-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .key-result-heading > .status-badge {
    grid-column: 1 / -1;
  }

  .key-output .input-group {
    display: grid;
    gap: 7px;
  }

  .key-output .input-group > * {
    width: 100%;
    border-radius: 10px !important;
  }

  .app-footer {
    flex-direction: column;
    gap: 4px;
  }

  .footer-divider {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
