:root {
  --ink: #17211d;
  --ink-soft: #405049;
  --muted: #6f7b76;
  --line: #dfe5e1;
  --line-strong: #cbd4cf;
  --paper: #ffffff;
  --canvas: #f3f5f2;
  --canvas-warm: #f8f7f2;
  --forest: #1f6b50;
  --forest-dark: #15523c;
  --forest-soft: #e5f2eb;
  --lime: #cce74f;
  --lime-soft: #f0f8c8;
  --amber: #a96517;
  --amber-soft: #fff2dc;
  --red: #a83b32;
  --red-soft: #fdecea;
  --blue: #2b5f93;
  --blue-soft: #e9f2fb;
  --shadow-sm: 0 1px 2px rgba(23, 33, 29, 0.06), 0 4px 12px rgba(23, 33, 29, 0.04);
  --shadow-lg: 0 24px 70px rgba(23, 33, 29, 0.18);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font: "Aptos", "Segoe UI Variable", "Segoe UI", Inter, system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(204, 231, 79, 0.13), transparent 22rem),
    var(--canvas);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
label,
select,
input[type="checkbox"],
input[type="radio"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(31, 107, 80, 0.2);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.auth-gate {
  min-height: 100vh;
  padding: 38px clamp(20px, 5vw, 72px) 48px;
  background:
    radial-gradient(circle at 8% 0%, rgba(204, 231, 79, 0.18), transparent 25rem),
    linear-gradient(145deg, #f8f9f5 0%, #edf1ed 100%);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.auth-brand-mark {
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.16), inset -8px -8px 0 rgba(204, 231, 79, 0.09);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
  width: min(100%, 1040px);
  min-height: 620px;
  margin: clamp(34px, 7vh, 76px) auto 0;
  overflow: hidden;
  border: 1px solid rgba(203, 212, 207, 0.85);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: 0 36px 90px rgba(23, 33, 29, 0.14);
}

.auth-card {
  align-self: center;
  padding: clamp(34px, 6vw, 68px);
}

.auth-card h1 {
  max-width: 520px;
  margin: 12px 0 14px;
  font-family: var(--serif);
  font-size: clamp(36px, 4.4vw, 52px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.auth-lead {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 30px 0 23px;
  padding: 5px;
  border-radius: 13px;
  background: #eef1ee;
}

.auth-tab {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.auth-tab.is-active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: grid;
  gap: 17px;
}

.auth-password-grid {
  gap: 12px;
}

.auth-password-help {
  margin-top: -9px;
  color: var(--muted);
  font-size: 10.5px;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 1px;
}

.auth-switch {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.auth-switch button {
  padding: 0;
  border: 0;
  color: var(--forest);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.auth-assurance {
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: clamp(36px, 5vw, 60px);
  overflow: hidden;
  color: #eef5f1;
  background:
    radial-gradient(circle at 80% 8%, rgba(204, 231, 79, 0.16), transparent 18rem),
    var(--ink);
}

.auth-assurance::after {
  position: absolute;
  right: -88px;
  bottom: -94px;
  width: 270px;
  height: 270px;
  border: 1px solid rgba(204, 231, 79, 0.18);
  border-radius: 50%;
  content: "";
}

.auth-assurance-number {
  position: absolute;
  top: 28px;
  right: 36px;
  color: rgba(238, 245, 241, 0.1);
  font-family: var(--serif);
  font-size: 96px;
  line-height: 1;
}

.auth-assurance > div {
  position: relative;
  z-index: 1;
}

.auth-assurance .eyebrow {
  color: var(--lime);
}

.auth-assurance h2 {
  max-width: 360px;
  margin: 14px 0 28px;
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.auth-assurance ul {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-assurance li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  color: #b8c5bf;
  font-size: 11.5px;
  line-height: 1.55;
}

.auth-assurance li span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font-size: 11px;
  font-weight: 900;
}

.site-shell {
  min-height: 100vh;
  padding-top: 72px;
}

.topbar {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(203, 212, 207, 0.9);
  background: rgba(255, 255, 255, 0.91);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px 11px 11px 3px;
  color: #eef9c7;
  background: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  box-shadow: inset -8px -8px 0 rgba(204, 231, 79, 0.09);
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.account-name {
  max-width: 150px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.logout-button:hover {
  border-color: var(--line);
  color: var(--ink);
  background: var(--canvas);
}

.save-status {
  color: var(--muted);
  font-size: 12px;
}

.api-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.api-button:hover {
  border-color: #aab8b0;
  transform: translateY(-1px);
}

.api-button.is-connected {
  border-color: #b7d9c7;
  background: var(--forest-soft);
}

.api-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aab3af;
  box-shadow: 0 0 0 4px rgba(170, 179, 175, 0.15);
}

.api-button.is-connected .api-dot {
  background: #27a36e;
  box-shadow: 0 0 0 4px rgba(39, 163, 110, 0.14);
}

.app-frame {
  display: flex;
  min-height: calc(100vh - 72px);
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 72px auto 88px 0;
  display: flex;
  flex-direction: column;
  width: 282px;
  padding: 34px 28px 24px;
  overflow-y: auto;
  color: #eff4f1;
  background:
    radial-gradient(circle at 22% 18%, rgba(204, 231, 79, 0.08), transparent 14rem),
    var(--ink);
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 34px;
  padding: 0;
  border: 0;
  color: #aebbb5;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.back-home:hover {
  color: #ffffff;
}

.eyebrow {
  display: block;
  color: var(--lime);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-dark {
  color: var(--forest);
}

.sidebar-heading h2 {
  margin: 9px 0 8px;
  color: #ffffff;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.sidebar-heading p {
  margin: 0;
  color: #9dacA5;
  font-size: 12px;
  line-height: 1.55;
}

.step-nav {
  display: grid;
  gap: 5px;
  margin: 35px 0 28px;
}

.step-link {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 6px 8px;
  border: 0;
  border-radius: 12px;
  color: #8e9d96;
  background: transparent;
  text-align: left;
}

.step-link:not(:disabled) {
  cursor: pointer;
}

.step-link:not(:last-child)::after {
  position: absolute;
  top: 38px;
  bottom: -10px;
  left: 23px;
  width: 1px;
  background: #34413b;
  content: "";
}

.step-number {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #46544d;
  border-radius: 50%;
  background: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.step-label {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-link.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.step-link.is-active .step-number {
  border-color: var(--lime);
  color: var(--ink);
  background: var(--lime);
}

.step-link.is-done {
  color: #d4ddd8;
}

.step-link.is-done .step-number {
  border-color: #68a48a;
  color: #c8efdc;
  background: #275c48;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 15px;
  border: 1px solid #34443c;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.privacy-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font-size: 11px;
  font-weight: 900;
}

.privacy-note strong,
.privacy-note small {
  display: block;
}

.privacy-note strong {
  color: #eaf0ed;
  font-size: 11px;
}

.privacy-note small {
  margin-top: 3px;
  color: #91a099;
  font-size: 9.5px;
  line-height: 1.45;
}

.main-content {
  width: 100%;
  min-width: 0;
  padding: 56px max(32px, calc((100vw - 1180px) / 2)) 130px;
}

.sidebar:not(.is-hidden) + .main-content {
  margin-left: 282px;
  padding-right: max(42px, calc((100vw - 1240px) / 2));
  padding-left: max(42px, calc((100vw - 1240px) / 2));
}

.view {
  width: min(100%, 960px);
  margin: 0 auto;
}

.home-view {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(310px, 0.82fr);
  gap: 52px;
  align-items: center;
  min-height: 340px;
  padding: 30px 0 48px;
}

.hero h1 {
  max-width: 720px;
  margin: 16px 0 18px;
  font-family: var(--serif);
  font-size: clamp(43px, 5vw, 70px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero h1 em {
  color: var(--forest);
  font-style: italic;
  font-weight: 400;
}

.hero-copy > p {
  max-width: 620px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.65;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 25px;
}

.hero-point {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.7);
  font-size: 11.5px;
  font-weight: 650;
}

.hero-point::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--forest);
  content: "";
}

.hero-preview {
  position: relative;
  min-height: 298px;
}

.paper-preview {
  position: absolute;
  width: 220px;
  min-height: 286px;
  padding: 28px 25px;
  border: 1px solid #dde3df;
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 0 22px 60px rgba(23, 33, 29, 0.13);
}

.paper-preview:first-child {
  top: 4px;
  right: 68px;
  transform: rotate(-5deg);
}

.paper-preview:last-child {
  top: 19px;
  right: 8px;
  transform: rotate(5deg);
}

.paper-kicker {
  width: 52px;
  height: 5px;
  border-radius: 4px;
  background: var(--lime);
}

.paper-title {
  width: 82%;
  height: 10px;
  margin: 13px 0 8px;
  border-radius: 4px;
  background: var(--ink);
}

.paper-line {
  width: 100%;
  height: 4px;
  margin: 7px 0;
  border-radius: 3px;
  background: #dce3df;
}

.paper-line.short {
  width: 64%;
}

.paper-photo {
  position: relative;
  height: 102px;
  margin: 19px 0 12px;
  overflow: hidden;
  border-radius: 5px;
  background:
    linear-gradient(143deg, transparent 0 43%, #829289 44% 52%, transparent 53%),
    linear-gradient(25deg, #d6ded9 0 47%, #9eada5 48% 58%, #eef1ef 59%);
}

.paper-photo::after {
  position: absolute;
  right: 16px;
  bottom: 17px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--lime);
  content: "";
}

.document-section {
  padding: 18px 0 0;
}

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

.section-intro h2 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.section-intro p {
  max-width: 410px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
  text-align: right;
}

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

.document-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 245px;
  padding: 48px 28px 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.card-status {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 28px;
  border-bottom: 1px solid rgba(23, 33, 29, 0.07);
  color: #725f24;
  background: #f7f1dc;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.card-status.is-ready {
  color: var(--forest-dark);
  background: #ddf1e6;
}

.document-card:hover {
  border-color: #b8c8bf;
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(23, 33, 29, 0.1);
}

.card-number {
  position: absolute;
  top: 40px;
  right: 22px;
  color: #dfe5e1;
  font-family: var(--serif);
  font-size: 60px;
  line-height: 1;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--forest-dark);
  background: var(--forest-soft);
  font-family: var(--serif);
  font-size: 21px;
}

.document-card.is-cota .card-icon {
  color: #6d5a10;
  background: var(--lime-soft);
}

.document-card.is-admin .card-icon {
  color: #1d5870;
  background: #e4f2f7;
}

.document-card.is-alert .card-icon {
  color: #7b4b18;
  background: #f8ecdc;
}

.document-card h3 {
  margin: 24px 0 9px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.document-card p {
  max-width: 450px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
}

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

.page-heading h1 {
  margin: 10px 0 9px;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 45px);
  font-weight: 500;
  line-height: 1.07;
  letter-spacing: -0.04em;
}

.page-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.panel {
  margin-bottom: 18px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
}

.panel.compact {
  padding: 20px 22px;
}

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

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

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

.field-grid.three {
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
}

.field {
  display: grid;
  gap: 7px;
}

.field + .field.stacked {
  margin-top: 18px;
}

.field > span:first-child,
.field-label {
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 800;
}

.field small,
.field-help {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #ffffff;
  font-size: 13px;
  line-height: 1.45;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

input:hover,
textarea:hover,
select:hover {
  border-color: #aebbb4;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--forest);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(31, 107, 80, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: #9ba5a0;
}

.text-counter {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.upload-box {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  padding: 16px;
  border: 1px dashed #b9c5be;
  border-radius: var(--radius-md);
  background: #fafbf9;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-box:hover,
.upload-box.is-dragging {
  border-color: var(--forest);
  background: var(--forest-soft);
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-symbol {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--forest);
  background: var(--forest-soft);
  font-size: 22px;
  font-weight: 300;
}

.upload-copy strong,
.upload-copy span {
  display: block;
}

.upload-copy strong {
  font-size: 12.5px;
}

.upload-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas-warm);
}

.selected-file img {
  width: 52px;
  height: 52px;
  border-radius: 9px;
  object-fit: cover;
}

.selected-file-copy {
  min-width: 0;
}

.selected-file-copy strong,
.selected-file-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-copy strong {
  font-size: 12px;
}

.selected-file-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.selected-file .icon-button {
  margin-left: auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-primary {
  color: #ffffff;
  background: var(--forest);
  box-shadow: 0 6px 16px rgba(31, 107, 80, 0.18);
}

.button-primary:hover:not(:disabled) {
  background: var(--forest-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--paper);
}

.button-secondary:hover:not(:disabled) {
  border-color: #aab8b0;
  background: #f9faf9;
}

.button-quiet {
  min-height: 34px;
  padding: 0 11px;
  border-color: transparent;
  color: var(--forest);
  background: transparent;
}

.button-danger {
  color: var(--red);
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--paper);
  font-size: 18px;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

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

.choice-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 78px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #ffffff;
  cursor: pointer;
}

.choice-card:hover {
  border-color: #aebbb4;
}

.choice-card:has(input:checked) {
  border-color: #8cbda6;
  background: var(--forest-soft);
  box-shadow: 0 0 0 2px rgba(31, 107, 80, 0.06);
}

.choice-card input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--forest);
}

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

.choice-card strong {
  font-size: 12px;
}

.choice-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 60px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-copy strong,
.switch-copy small {
  display: block;
}

.switch-copy strong {
  font-size: 12px;
}

.switch-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #ccd4d0;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(23, 33, 29, 0.26);
  content: "";
  transition: transform 160ms ease;
}

.switch input:checked + .switch-track {
  background: var(--forest);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

.ai-switch-row {
  padding-top: 4px;
}

.ai-assistance-details {
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

.subsection-label {
  display: block;
  font-size: 12px;
}

.field-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.compact-notice {
  margin-top: 2px;
  padding: 11px 13px;
}

.direct-mode-notice {
  margin-top: 15px;
}

.cota-base-field {
  margin-top: 18px;
}

.inline-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-button:focus-visible {
  border-radius: 3px;
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  font-size: 11.5px;
  cursor: pointer;
}

.check-row:has(input:checked) {
  border-color: #a8ccb9;
  background: var(--forest-soft);
}

.check-row input {
  accent-color: var(--forest);
}

.inline-add {
  display: flex;
  gap: 9px;
  margin-top: 13px;
}

.inline-add input {
  flex: 1;
}

.photo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.photo-count {
  color: var(--muted);
  font-size: 11.5px;
}

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.photo-list {
  display: grid;
  gap: 12px;
}

.photo-card {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
  min-height: 126px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.photo-card img {
  width: 126px;
  height: 102px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--canvas);
}

.photo-card-main {
  min-width: 0;
}

.photo-card-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.photo-card-heading strong {
  overflow: hidden;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-index {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  color: var(--forest-dark);
  background: var(--forest-soft);
  font-size: 9px;
  font-weight: 850;
}

.photo-card textarea {
  min-height: 63px;
  padding: 8px 10px;
  font-size: 11px;
}

.photo-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9.5px;
}

.analysis-state::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aab3af;
  content: "";
}

.analysis-state.is-done::before {
  background: #2d9a6d;
}

.analysis-state.is-working::before {
  background: var(--amber);
  animation: pulse 1s infinite;
}

.analysis-state.is-error::before {
  background: var(--red);
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
  background: #fafbf9;
}

.empty-state strong {
  display: block;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.empty-state span {
  display: block;
  max-width: 410px;
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.5;
}

.topic-list {
  display: grid;
  gap: 15px;
}

.topic-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbf9;
}

.topic-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.topic-heading strong {
  font-size: 12px;
}

.topic-image-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

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

.summary-card {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #ffffff;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 9px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.summary-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.review-block {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.review-block:last-child {
  border-bottom: 0;
}

.review-block h3 {
  margin: 0 0 7px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-block p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 14px 0;
  padding: 13px 14px;
  border: 1px solid #c9ddcf;
  border-radius: 12px;
  color: #28533f;
  background: var(--forest-soft);
  font-size: 10.5px;
  line-height: 1.5;
}

.notice.is-warning {
  border-color: #efd3a7;
  color: #765019;
  background: var(--amber-soft);
}

.notice.is-danger {
  border-color: #efc8c4;
  color: #76332c;
  background: var(--red-soft);
}

.notice strong {
  color: inherit;
}

.progress-card {
  display: grid;
  place-items: center;
  min-height: 430px;
  padding: 55px 28px;
  text-align: center;
}

.progress-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 1px solid #cbd8d1;
  border-radius: 50%;
}

.progress-orbit::before {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 5px rgba(204, 231, 79, 0.16);
  animation: orbit 1.45s linear infinite;
  content: "";
}

@keyframes orbit {
  from { transform: rotate(0deg) translateX(51px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(51px) rotate(-360deg); }
}

.progress-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--forest);
  font-family: var(--serif);
  font-size: 29px;
}

.progress-card h2 {
  margin: 26px 0 8px;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 500;
}

.progress-card p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.progress-line {
  width: min(100%, 410px);
  height: 7px;
  margin-top: 25px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e7e4;
}

.progress-line span {
  display: block;
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: var(--forest);
  transition: width 250ms ease;
}

.success-card {
  display: grid;
  place-items: center;
  min-height: 430px;
  padding: 55px 28px;
  text-align: center;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 24px 24px 24px 7px;
  color: var(--forest-dark);
  background: var(--lime);
  font-size: 32px;
  font-weight: 800;
}

.success-card h2 {
  margin: 24px 0 9px;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 500;
}

.success-card p {
  max-width: 510px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.action-bar {
  position: fixed;
  z-index: 25;
  inset: auto 0 0 282px;
  display: flex;
  align-items: center;
  min-height: 88px;
  padding: 18px max(42px, calc((100vw - 1240px) / 2));
  border-top: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.action-copy {
  margin: 0 auto 0 18px;
}

.action-copy strong,
.action-copy small {
  display: block;
}

.action-copy strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.action-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
}

.dialog {
  width: min(calc(100% - 32px), 560px);
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  background: transparent;
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: rgba(13, 22, 18, 0.58);
  backdrop-filter: blur(5px);
}

.dialog-card {
  padding: 28px;
  border-radius: 22px;
  background: var(--paper);
}

.dialog-small {
  width: min(calc(100% - 32px), 450px);
  text-align: center;
}

.dialog-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 23px;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: var(--forest-dark);
  background: var(--lime-soft);
  font-size: 18px;
}

.dialog h2 {
  margin: 9px 0 9px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.dialog-lead {
  margin: 0 0 23px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.dialog .field {
  margin-top: 17px;
  text-align: left;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 75px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  color: var(--forest);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  transform: translateY(-50%);
  cursor: pointer;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.inline-feedback {
  margin-top: 16px;
  padding: 11px 12px;
  border-radius: 10px;
  color: #28533f;
  background: var(--forest-soft);
  font-size: 10.5px;
  line-height: 1.45;
  text-align: left;
}

.inline-feedback.is-error {
  color: #76332c;
  background: var(--red-soft);
}

.message-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 17px;
  border-radius: 16px;
  color: #765019;
  background: var(--amber-soft);
  font-family: var(--serif);
  font-size: 25px;
}

.message-icon.is-success {
  color: var(--forest-dark);
  background: var(--forest-soft);
}

.message-icon.is-error {
  color: var(--red);
  background: var(--red-soft);
}

.dialog-small .dialog-actions {
  justify-content: center;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  max-width: min(390px, calc(100% - 48px));
  padding: 13px 16px;
  border: 1px solid #34443c;
  border-radius: 12px;
  color: #f5f8f6;
  background: var(--ink);
  box-shadow: var(--shadow-lg);
  font-size: 11.5px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 980px) {
  .auth-layout {
    grid-template-columns: 1fr;
    max-width: 650px;
  }

  .auth-assurance {
    min-height: 310px;
  }

  .topbar {
    padding: 0 22px;
  }

  .save-status {
    display: none;
  }

  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    padding: 18px 22px;
    overflow: visible;
  }

  .sidebar-heading {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    align-items: center;
  }

  .back-home {
    grid-row: 1 / 4;
    width: 42px;
    height: 42px;
    margin: 0;
    justify-content: center;
    border: 1px solid #3a4942;
    border-radius: 11px;
    font-size: 0;
  }

  .back-home span {
    font-size: 17px;
  }

  .sidebar-heading h2 {
    margin: 4px 0 2px;
    font-size: 19px;
  }

  .sidebar-heading p,
  .privacy-note {
    display: none;
  }

  .step-nav {
    display: flex;
    gap: 8px;
    margin: 17px 0 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .step-link {
    flex: 0 0 auto;
    grid-template-columns: 25px auto;
    min-height: 38px;
    padding: 5px 10px;
    border: 1px solid #34443c;
  }

  .step-link::after {
    display: none;
  }

  .step-number {
    width: 23px;
    height: 23px;
  }

  .app-frame {
    display: block;
  }

  .sidebar:not(.is-hidden) + .main-content,
  .main-content {
    margin-left: 0;
    padding: 38px 24px 118px;
  }

  .action-bar {
    left: 0;
    min-height: 78px;
    padding: 14px 24px;
  }

  .action-copy {
    display: none;
  }

  .action-bar #backButton {
    margin-right: auto;
  }

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

  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .hero-preview {
    display: none;
  }
}

@media (max-width: 680px) {
  .auth-gate {
    padding: 24px 14px;
  }

  .auth-layout {
    min-height: 0;
    margin-top: 28px;
    border-radius: 22px;
  }

  .auth-card {
    padding: 30px 22px;
  }

  .auth-card h1 {
    font-size: 38px;
  }

  .auth-password-grid {
    grid-template-columns: 1fr;
  }

  .auth-assurance {
    min-height: 300px;
    padding: 32px 24px;
  }

  .auth-assurance-number {
    right: 22px;
    font-size: 76px;
  }

  .site-shell {
    padding-top: 64px;
  }

  .topbar {
    height: 64px;
    padding: 0 15px;
  }

  .brand-copy small,
  .api-button span:not(.api-dot) {
    display: none;
  }

  .account-name {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .logout-button {
    padding: 0 7px;
  }

  .api-button {
    min-width: 40px;
    padding: 0 15px;
  }

  .sidebar {
    padding: 15px;
  }

  .main-content,
  .sidebar:not(.is-hidden) + .main-content {
    padding: 29px 15px 108px;
  }

  .hero {
    min-height: 0;
    padding: 18px 0 37px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero-copy > p {
    font-size: 14px;
  }

  .section-intro {
    display: block;
  }

  .section-intro p {
    margin-top: 8px;
    text-align: left;
  }

  .document-grid,
  .field-grid,
  .field-grid.three,
  .choice-grid,
  .responsible-list,
  .summary-grid,
  .topic-image-row {
    grid-template-columns: 1fr;
  }

  .document-card {
    min-height: 225px;
  }

  .panel {
    padding: 19px;
  }

  .panel-header,
  .photo-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .photo-card {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 11px;
  }

  .photo-card img {
    width: 86px;
    height: 86px;
  }

  .photo-card-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }

  .photo-card textarea {
    min-height: 74px;
  }

  .action-bar {
    min-height: 74px;
    padding: 12px 15px;
  }

  .button {
    padding-right: 14px;
    padding-left: 14px;
  }

  .dialog-card {
    padding: 22px;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions .button {
    width: 100%;
  }
}

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