:root {
  color-scheme: light;
  --navy: #313a4c;
  --navy-dark: #252d3d;
  --light-blue: #a1dcee;
  --light-blue-soft: #e9f7fb;
  --bg: #f3f8fa;
  --surface: #ffffff;
  --surface-soft: #f8fcfd;
  --text: #313a4c;
  --muted: #667085;
  --line: #dce8ec;
  --line-strong: #b8d2db;
  --primary: var(--navy);
  --primary-dark: var(--navy-dark);
  --primary-soft: var(--light-blue-soft);
  --green: #3ba186;
  --green-dark: #2f806b;
  --amber-bg: #fff7df;
  --amber-text: #6c4b0a;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 10px 28px rgb(49 58 76 / 8%);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 240px),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 "Gill Sans MT", Calibri, Arial, sans-serif;
  letter-spacing: 0;
}

h1,
h2,
h3,
th,
button,
.button,
.brand {
  font-family: Arial, "Helvetica Neue", sans-serif;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.button:hover {
  background: var(--green-dark);
  text-decoration: none;
}

button.secondary,
.button.secondary {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--text);
}

button.secondary:hover,
.button.secondary:hover {
  background: var(--primary-soft);
}

button.danger {
  background: var(--danger);
}

button.text-danger {
  min-height: 32px;
  justify-content: flex-start;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 700;
}

button.text-danger:hover {
  background: transparent;
  color: #8f1f17;
  text-decoration: underline;
}

button:disabled,
button:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 86px;
  padding: 10px 11px;
  resize: vertical;
}

input[type="file"] {
  padding: 8px 10px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  min-height: 16px;
  accent-color: var(--green);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
.button:focus-visible {
  border-color: var(--green);
  outline: 3px solid rgb(59 161 134 / 24%);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

#pwa-install,
.pwa-install {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--sky);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 18px 44px rgb(49 58 76 / 28%);
}

.pwa-install-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--navy-dark);
}

.pwa-install-mark img {
  width: 44px;
  height: 44px;
  object-fit: cover;
}

.pwa-install-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pwa-install-copy strong {
  display: block;
  color: var(--navy);
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.2;
}

.pwa-install-copy span,
.pwa-install-message {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.pwa-install-action {
  justify-self: end;
  min-height: 34px;
  padding: 0 12px;
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.pwa-install-action:hover {
  background: var(--navy-dark);
}

.pwa-install-close {
  justify-self: end;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: var(--line);
  background: var(--white);
  color: var(--navy);
  font-size: 22px;
  line-height: 1;
}

.pwa-install-close:hover {
  background: var(--panel);
}

.offline-panel {
  max-width: 560px;
  margin: 48px auto;
}

.page-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 24px auto 56px;
}

.login-panel,
.search-panel,
.result-panel,
.summary-panel,
.form-panel,
.table-panel,
.section-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(440px, 100%);
  margin: 72px auto;
  overflow: hidden;
  padding: 0;
}

.stack {
  display: grid;
  gap: 14px;
}

.page-title,
.asset-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.page-title h1,
.asset-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.search-panel {
  margin-bottom: 16px;
  padding: 12px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  align-items: center;
  gap: 10px;
}

.search-form input[name="q"] {
  min-height: 46px;
  font-size: 17px;
}

.result-panel,
.section-block,
.form-panel,
.table-panel {
  margin-bottom: 16px;
  overflow: hidden;
}

.result-toolbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.section-heading form {
  margin: 0;
}

.result-toolbar h2,
.section-heading h2 {
  margin: 0;
  font-size: 17px;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.asset-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.asset-list-head,
.asset-row {
  display: grid;
  grid-template-columns: 76px minmax(140px, 0.9fr) minmax(200px, 1.2fr) minmax(120px, 0.75fr) minmax(110px, 0.7fr) minmax(120px, 0.7fr);
  align-items: center;
  gap: 14px;
}

.asset-list-head {
  min-height: 30px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.asset-row {
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.asset-row:hover {
  background: var(--surface-soft);
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgb(49 58 76 / 10%);
  text-decoration: none;
}

.asset-summary {
  display: block;
}

.asset-thumb {
  display: block;
  width: 52px;
  height: 52px;
  max-width: 52px;
  max-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  flex: none;
  object-fit: cover;
}

.asset-thumb-empty {
  display: block;
  background: linear-gradient(135deg, #ffffff, var(--primary-soft));
}

.field-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge,
.status-dot {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.badge {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.status-dot {
  background: #eaf7f4;
  color: var(--green-dark);
}

.asset-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 16px;
  margin-bottom: 16px;
}

.summary-panel {
  padding: 18px;
}

.asset-field-list {
  display: grid;
}

.asset-field-row {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 52px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.asset-field-row:last-child {
  border-bottom: 0;
}

.asset-field-row.is-editing {
  align-items: start;
}

.asset-field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.asset-field-display {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.asset-field-value {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-edit-button {
  width: 34px;
  min-height: 34px;
  border-color: var(--line-strong);
  padding: 0;
  background: #fff;
  color: var(--primary);
  font-size: 18px;
  line-height: 1;
}

.field-edit-button:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.asset-field-form {
  display: grid;
  grid-column: 2;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
  gap: 0;
  margin: 0;
}

.detail-grid dt,
.detail-grid dd {
  min-height: 42px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.detail-grid dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-grid dd {
  color: var(--text);
}

.detail-grid dt:last-of-type,
.detail-grid dd:last-of-type {
  border-bottom: 0;
}

.asset-field-row-readonly {
  min-height: 44px;
}

.asset-field-value-readonly {
  white-space: normal;
}

.primary-photo {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: var(--primary-soft);
  color: inherit;
  box-shadow: var(--shadow);
  appearance: none;
  cursor: pointer;
}

.primary-photo img {
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
}

.primary-photo-video {
  cursor: default;
}

.primary-photo-video video {
  width: 100%;
  max-height: 440px;
  background: #000;
}

.empty-photo {
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.actions,
.inline-form,
.upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.upload-form {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.upload-form input[type="file"] {
  flex: 1 1 260px;
  max-width: 520px;
}

.inline-form input {
  flex: 1 1 240px;
}

.upload-status {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.upload-form.is-uploading input[type="file"] {
  opacity: 0.62;
  pointer-events: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  padding: 16px;
}

.photo-card {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.photo-link {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: var(--primary-soft);
  color: inherit;
  appearance: none;
  cursor: pointer;
}

.photo-link:hover {
  background: var(--primary-soft);
  text-decoration: none;
}

.photo-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-main-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgb(12 18 24 / 84%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.photo-video-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgb(12 18 24 / 84%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.photo-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.photo-tools form {
  margin: 0;
}

.photo-main-label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.photo-tool-main {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.photo-tool-icon {
  width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.photo-tool-icon:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.is-lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(8 13 18 / 82%);
}

.lightbox-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: var(--radius);
  background: #151b28;
  box-shadow: 0 24px 60px rgb(0 0 0 / 42%);
}

.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.lightbox-counter {
  color: #e9f7fb;
  font-size: 14px;
  font-weight: 700;
}

.lightbox-close {
  width: 38px;
  min-height: 38px;
  border-color: rgb(255 255 255 / 18%);
  padding: 0;
  background: rgb(255 255 255 / 8%);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgb(255 255 255 / 16%);
}

.lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(74vh, 760px);
  background: #0d111a;
}

.lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 112px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 112px);
  background: #000;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 44px;
  min-height: 44px;
  border-color: rgb(255 255 255 / 24%);
  border-radius: 999px;
  padding: 0;
  background: rgb(255 255 255 / 92%);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  transform: translateY(-50%);
}

.lightbox-nav:hover {
  background: #fff;
}

.lightbox-prev {
  left: 14px;
}

.lightbox-next {
  right: 14px;
}

.document-search-form {
  grid-template-columns: minmax(220px, 1fr);
  align-items: center;
}

.document-search-form-admin {
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 190px);
}

.document-search-form input,
.document-search-form select {
  min-height: 46px;
}

.document-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.document-breadcrumbs a {
  color: var(--primary-dark);
}

.document-folder-create-panel {
  padding: 12px;
}

.document-folder-create-panel .inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.document-folder-create-panel input[name="name"] {
  min-width: min(320px, 100%);
}

.document-library-grid {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.document-folder-card,
.document-card,
.asset-document-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.document-folder-card {
  grid-template-columns: auto minmax(0, 1fr);
  color: inherit;
}

.document-folder-card:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

.document-folder-tile {
  position: relative;
  width: 48px;
  height: 38px;
  border: 1px solid #d7c878;
  border-radius: 8px;
  background: #fff1a8;
}

.document-folder-tile::before {
  content: "";
  position: absolute;
  left: 6px;
  top: -7px;
  width: 22px;
  height: 9px;
  border: 1px solid #d7c878;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #fff1a8;
}

.document-type-tile {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #cce4ea;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.document-type-tile-large {
  width: 72px;
  height: 72px;
  font-size: 18px;
}

.document-card-main,
.asset-document-main {
  min-width: 0;
}

.document-card-main h2,
.asset-document-main h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.document-card-main p {
  margin: 5px 0 0;
  color: var(--muted);
}

.document-card-actions,
.asset-document-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.asset-document-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.asset-document-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.asset-document-main span {
  display: inline-block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.document-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  margin-bottom: 16px;
}

.document-preview-panel,
.document-meta-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.document-preview-panel {
  min-height: 580px;
}

.document-preview-frame {
  display: block;
  width: 100%;
  height: min(76vh, 820px);
  min-height: 580px;
  border: 0;
  background: #fff;
}

.document-preview-image {
  display: block;
  width: 100%;
  max-height: 820px;
  object-fit: contain;
  background: var(--surface-soft);
}

.document-preview-fallback {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 580px;
  padding: 24px;
  text-align: center;
}

.document-preview-fallback h2 {
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.document-meta-panel {
  padding: 16px;
}

.document-description {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--text);
  overflow-wrap: anywhere;
}

.document-linked-assets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  padding: 14px;
}

.document-linked-asset-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.document-linked-asset-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.document-editor-form {
  display: grid;
  gap: 0;
}

.document-current-file {
  display: grid;
  gap: 4px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-soft);
}

.document-asset-linker {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.document-linked-asset-list {
  display: grid;
  gap: 8px;
}

.document-linked-asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
}

.document-linked-asset-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.document-linked-asset-row small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.document-asset-search {
  position: relative;
  max-width: 520px;
}

.document-asset-results {
  position: absolute;
  z-index: 4;
  inset: calc(100% + 6px) 0 auto 0;
  display: grid;
  gap: 4px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.document-asset-result {
  display: grid;
  justify-items: start;
  min-height: 0;
  border: 0;
  padding: 9px 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.document-asset-result:hover {
  background: var(--primary-soft);
}

.document-asset-result span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checklist-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.checklist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  color: var(--text);
}

.checklist-row:hover {
  border-color: var(--primary);
  background: var(--surface-soft);
  text-decoration: none;
}

.checklist-row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.checklist-row-main span {
  color: var(--muted);
  font-size: 13px;
}

.checklist-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.checklist-counts span,
.checklist-item-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.checklist-issues {
  grid-column: 1 / -1;
  margin: 0;
  padding-left: 18px;
  color: var(--danger);
  font-size: 13px;
}

.checklist-empty {
  margin: 0;
}

.checklist-template-list {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.checklist-template-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}

.checklist-template-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.checklist-template-main h3 {
  margin: 0;
  font-size: 17px;
}

.checklist-template-main p,
.checklist-template-main span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checklist-template-card form {
  margin: 0;
}

.checklist-template-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.checklist-template-more {
  border-top: 1px solid var(--line);
}

.checklist-template-more summary {
  cursor: pointer;
  padding: 14px 16px;
  color: var(--primary);
  font-weight: 700;
}

.checklist-template-list-all {
  border-top: 1px solid var(--line);
}

.checklist-default-form {
  margin: 0;
}

.checklist-default-toggle {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.checklist-start-template-card {
  color: var(--text);
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.checklist-start-template-card:hover {
  border-color: var(--primary);
  background: var(--surface-soft);
  box-shadow: 0 2px 10px rgb(49 58 76 / 10%);
  text-decoration: none;
}

.checklist-start-page-title .actions,
.checklist-start-heading .count-pill {
  flex-shrink: 0;
}

.start-asset-list-head,
.start-asset-row {
  grid-template-columns: 76px minmax(140px, 0.9fr) minmax(200px, 1.2fr) minmax(120px, 0.75fr) minmax(110px, 0.7fr) minmax(120px, 0.7fr);
}

.start-asset-list {
  justify-items: stretch;
}

.start-asset-form {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.start-asset-card {
  display: grid;
  width: 100%;
  min-width: 0;
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: inherit;
  text-align: left;
  white-space: normal;
}

.start-asset-card:hover {
  border-color: var(--primary);
  background: var(--surface-soft);
}

.start-asset-card:focus-visible {
  border-color: var(--green);
}

.section-heading-inline {
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 14px;
}

.checklist-location-gate {
  padding: 16px;
}

.checklist-location-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
}

.checklist-location-panel h2 {
  margin: 0;
  font-size: 17px;
}

.checklist-location-panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.checklist-location-status {
  display: inline-block;
  margin-top: 8px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.checklist-item-list {
  display: grid;
  gap: 0;
  padding: 0 16px;
  --checklist-row-columns: minmax(260px, 320px) minmax(280px, 1fr) minmax(220px, 300px) minmax(76px, auto);
}

.checklist-item-form {
  display: grid;
  grid-template-columns: var(--checklist-row-columns);
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.checklist-item-form:last-child {
  border-bottom: 0;
}

.checklist-item-form-text {
  grid-template-columns: var(--checklist-row-columns);
  align-items: start;
}

.checklist-item-form-photo,
.checklist-item-form-video {
  grid-template-columns: var(--checklist-row-columns);
}

.checklist-item-form-signature {
  grid-template-columns: var(--checklist-row-columns);
  align-items: start;
}

.checklist-item-form-text textarea,
.checklist-item-form-signature .signature-pad {
  grid-column: 2 / 4;
}

.checklist-item-form-signature .signature-clear {
  grid-column: 4;
  grid-row: 1;
}

.checklist-item-form-signature .checklist-autosave-status {
  grid-column: 4;
  grid-row: 2;
}

.checklist-static-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--primary-dark);
}

.checklist-item-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.checklist-item-label strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.checklist-item-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

.radio-options,
.checkbox-options {
  display: grid;
  gap: 7px;
}

.checkbox-options {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 9px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.radio-option input,
.checkbox-option input {
  flex: none;
}

.checklist-upload-state {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.checklist-photo-control,
.checklist-video-control {
  display: grid;
  grid-template-columns: 78px minmax(88px, auto) minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.checklist-photo-control input[type="file"],
.checklist-video-control input[type="file"] {
  min-width: 0;
}

.checklist-photo-preview {
  width: 78px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.checklist-photo-preview {
  object-fit: cover;
}

.checklist-video-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 78px;
  height: 58px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  background: #0d111a;
  color: #fff;
}

.checklist-video-preview:hover {
  border-color: var(--primary);
  background: #0d111a;
}

.checklist-video-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checklist-video-play {
  position: absolute;
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: rgb(23 32 51 / 82%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.checklist-video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(8 13 22 / 82%);
}

.checklist-video-lightbox-window {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1100px, 96vw);
  height: min(760px, 88vh);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: var(--radius);
  background: #0d111a;
  box-shadow: 0 24px 70px rgb(0 0 0 / 42%);
}

.checklist-video-lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid rgb(255 255 255 / 12%);
  color: #e9f7fb;
  font-size: 14px;
  font-weight: 700;
}

.checklist-video-lightbox video {
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.signature-pad {
  min-width: 0;
}

.signature-pad canvas {
  display: block;
  width: 100%;
  height: 112px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  touch-action: none;
}

.signature-clear {
  align-self: start;
}

.signature-preview {
  width: min(220px, 100%);
  max-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: contain;
  background: #fff;
}

.checklist-autosave-status {
  min-width: 74px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checklist-item-form.is-saved .checklist-autosave-status {
  color: var(--green-dark);
}

.checklist-item-form.is-error .checklist-autosave-status {
  color: var(--danger);
}

.checklist-item-state-ok {
  background: #eaf7f4;
  color: var(--green-dark);
}

.checklist-item-state-issue {
  background: var(--danger-soft);
  color: var(--danger);
}

.checklist-item-state-pending {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.checklist-note {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.checklist-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.checklist-complete-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.checklist-complete-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-panel {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.span-full {
  grid-column: 1 / -1;
}

.checklist-email-rule-form {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.checklist-email-template-field,
.email-address-field {
  min-width: 0;
}

.email-address-field {
  display: grid;
  gap: 8px;
}

.form-field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.email-address-list {
  display: grid;
  gap: 8px;
}

.email-address-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
}

.checklist-email-rules-table {
  overflow-x: auto;
}

.checklist-email-rules-table table {
  min-width: 720px;
  background: var(--surface);
}

.email-recipient-list {
  display: inline-block;
  max-width: 520px;
}

.delivery-status {
  display: inline-block;
  max-width: 320px;
  font-size: 13px;
  font-weight: 700;
}

.delivery-status-sent {
  color: var(--green-dark);
}

.delivery-status-failed {
  color: var(--danger);
}

.table-panel {
  overflow-x: auto;
}

.table-panel table {
  min-width: 760px;
  background: var(--surface);
}

.table-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table-actions form {
  margin: 0;
}

.admin-template-action-cell {
  text-align: right;
  white-space: nowrap;
}

.admin-template-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.admin-template-actions form {
  display: inline-flex;
  margin: 0;
}

.admin-template-actions .table-action,
.admin-template-actions button {
  width: auto;
  min-width: 76px;
}

.muted-line {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.template-status-archived {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.checklist-template-details {
  grid-template-columns: minmax(240px, 520px);
  padding: 16px;
}

.checklist-builder-layout {
  padding: 16px;
  background: var(--surface-soft);
}

.checklist-template-workspace {
  min-width: 0;
}

.template-item-list {
  display: grid;
  gap: 12px;
  min-height: 96px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.template-item-list.is-invalid {
  border-color: var(--danger);
  outline: 3px solid rgb(180 35 24 / 14%);
}

.builder-empty {
  margin: 8px 0 0;
}

.template-builder-row {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgb(49 58 76 / 5%);
}

.template-row-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.template-row-number {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.template-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}

.template-drag-handle::before {
  content: "";
  width: 14px;
  height: 18px;
  background-image: radial-gradient(currentColor 1.3px, transparent 1.3px);
  background-position: 0 0;
  background-size: 6px 6px;
  opacity: 0.75;
}

.template-drag-handle:active {
  cursor: grabbing;
}

.template-drag-handle:disabled {
  cursor: default;
  opacity: 0.45;
}

.template-item-list.is-reordering {
  user-select: none;
}

.template-builder-row.is-dragging {
  border-color: var(--primary);
  box-shadow: 0 10px 26px rgb(49 58 76 / 14%);
  opacity: 0.72;
}

.template-insert-control {
  display: grid;
  grid-template-columns: minmax(24px, 1fr) auto minmax(24px, 1fr);
  gap: 10px;
  align-items: center;
  margin: -4px 0;
}

.template-insert-control::before,
.template-insert-control::after {
  content: "";
  border-top: 1px solid var(--line);
}

.template-insert-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
  font-size: 22px;
  font-weight: 750;
  line-height: 1;
}

.template-insert-button:hover,
.template-insert-button:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.template-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.template-row-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 220px) minmax(120px, 150px);
  gap: 12px;
  align-items: start;
}

.template-row-label,
.template-options-field {
  grid-column: 1 / -1;
}

.template-options-field {
  display: grid;
  gap: 8px;
}

.template-answer-head,
.template-answer-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 88px auto;
  gap: 8px;
  align-items: center;
}

.template-answer-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.template-answer-list {
  display: grid;
  gap: 8px;
}

.template-answer-issue {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--text);
  font-size: 13px;
}

.template-required-option {
  min-height: 40px;
}

.builder-save-bar {
  padding: 14px 16px;
  background: var(--surface-soft);
}

.danger-zone {
  padding: 14px 16px;
  border-color: #f3c1bd;
  background: var(--danger-soft);
}

.empty {
  color: var(--muted);
}

.result-empty {
  padding: 18px 16px;
}

@media (max-width: 900px) {
  .asset-list-head {
    display: none;
  }

  .asset-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
  }

  .field-value::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 64px;
    color: var(--muted);
    font-weight: 700;
  }

  .asset-layout {
    grid-template-columns: 1fr;
  }

  .document-detail-layout {
    grid-template-columns: 1fr;
  }

  .primary-photo {
    min-height: 240px;
  }
}

@media (max-width: 720px) {
  body.pwa-install-visible,
  body:has(#pwa-install) {
    padding-bottom: 136px;
  }

  .page-shell {
    width: min(100vw - 20px, 1280px);
  }

  .page-title,
  .asset-header,
  .result-toolbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search-form,
  .form-grid {
    grid-template-columns: 1fr;
  }

  button,
  .button {
    width: 100%;
  }

  .field-edit-button {
    width: 34px;
  }

  .actions button,
  .actions .button,
  .inline-form button,
  .upload-form button,
  .photo-tools button,
  .pwa-install-action,
  .pwa-install-close {
    width: auto;
  }

  #pwa-install,
  .pwa-install {
    right: 10px;
    bottom: 10px;
    left: 10px;
    grid-template-columns: minmax(0, 1fr) 36px;
    grid-template-areas:
      "copy close"
      "action action";
    gap: 10px;
    width: auto;
    padding: 10px;
  }

  .pwa-install-mark,
  .pwa-install-mark img {
    width: 40px;
    height: 40px;
  }

  .pwa-install-copy {
    grid-area: copy;
  }

  .pwa-install-action {
    grid-area: action;
    justify-self: stretch;
    width: 100%;
    min-height: 40px;
  }

  .pwa-install-close {
    grid-area: close;
    width: 36px;
    min-height: 36px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .checklist-start-page-title {
    align-items: flex-end;
    flex-direction: row;
  }

  .checklist-start-heading {
    align-items: center;
    flex-direction: row;
  }

  .asset-field-row,
  .asset-field-form {
    grid-template-columns: 1fr;
  }

  .asset-field-form {
    grid-column: auto;
  }

  .detail-grid dt {
    min-height: 0;
    padding-bottom: 2px;
    border-bottom: 0;
  }

  .detail-grid dd {
    padding-top: 0;
  }

  .lightbox {
    padding: 10px;
  }

  .lightbox-window {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .lightbox-stage {
    min-height: min(70vh, 620px);
  }

  .lightbox-nav {
    width: 40px;
    min-height: 40px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  .checklist-row,
  .checklist-template-card,
  .checklist-template-actions,
  .checklist-item-form,
  .checklist-email-rule-form,
  .email-address-row,
  .document-search-form,
  .document-folder-card,
  .document-card,
  .asset-document-row,
  .document-linked-asset-row,
  .template-row-grid,
  .template-answer-head,
  .template-answer-row {
    grid-template-columns: 1fr;
  }

  .document-card-actions,
  .asset-document-actions {
    flex-wrap: wrap;
  }

  .document-preview-panel,
  .document-preview-fallback,
  .document-preview-frame {
    min-height: 420px;
  }

  .document-preview-frame {
    height: 62vh;
  }

  .checklist-counts {
    justify-content: flex-start;
  }

  .checklist-photo-preview,
  .checklist-video-preview {
    width: 120px;
    height: 90px;
  }

  .checklist-video-lightbox {
    padding: 8px;
  }

  .checklist-video-lightbox-window {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
  }

  .signature-clear,
  .checklist-autosave-status {
    justify-self: start;
  }

  .checklist-item-form-text textarea,
  .checklist-item-form-signature .signature-pad,
  .checklist-item-form-signature .signature-clear,
  .checklist-item-form-signature .checklist-autosave-status {
    grid-column: auto;
    grid-row: auto;
  }

  .checklist-photo-control,
  .checklist-video-control {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .checklist-location-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .checklist-photo-control input[type="file"],
  .checklist-video-control input[type="file"] {
    grid-column: 1 / -1;
  }

  .template-row-label,
  .template-options-field {
    grid-column: auto;
  }

  .template-row-actions {
    justify-content: flex-start;
  }

  .checklist-complete-form {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }
}

/* Atlantic One alignment */
:root {
  --sky: #a1dcee;
  --white: #ffffff;
  --ink: #242b38;
  --page: #f3f6f8;
  --panel: #fbfcfd;
  --bg: var(--page);
  --surface-soft: var(--panel);
  --line: #d7dee8;
  --line-strong: #cfd6e1;
  --soft-line: #e6ebf1;
  --light-blue: var(--sky);
  --light-blue-soft: #eef8fb;
  --primary: var(--navy);
  --primary-dark: var(--navy-dark);
  --primary-soft: #f7fafc;
  --shadow: 0 18px 44px rgb(37 45 61 / 12%);
  --radius: 8px;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: "Gill Sans MT", "Gill Sans", Calibri, Arial, sans-serif;
}

a {
  color: var(--navy);
}

button,
.button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
}

button:hover,
.button:hover {
  background: var(--navy-dark);
}

button.secondary,
.button.secondary {
  border-color: var(--line);
  background: var(--white);
  color: var(--navy);
}

button.secondary:hover,
.button.secondary:hover {
  border-color: #aab7c8;
  background: var(--panel);
}

input,
select,
textarea {
  min-height: 44px;
  border-color: var(--line);
  border-radius: 8px;
  color: var(--ink);
}

label {
  color: var(--navy);
  font-weight: 700;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.login-panel,
.search-panel,
.result-panel,
.summary-panel,
.form-panel,
.table-panel,
.section-block,
.asset-row,
.document-folder-card,
.document-card,
.asset-document-row,
.checklist-template-card,
.template-builder-row {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.search-panel,
.result-panel,
.section-block,
.form-panel,
.table-panel {
  margin-bottom: 16px;
}

.page-title h1,
.asset-header h1 {
  color: var(--navy);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.15;
}

.section-heading,
.result-toolbar {
  background: var(--white);
}

.asset-row:hover,
.document-folder-card:hover,
.document-card:hover,
.asset-document-row:hover,
.checklist-template-card:hover {
  border-color: #aab7c8;
  background: var(--panel);
  box-shadow: 0 12px 24px rgb(37 45 61 / 9%);
}

.count-pill,
.checklist-item-number,
.template-row-number {
  background: var(--light-blue-soft);
  color: var(--navy);
}

#pwa-install,
.pwa-install {
  border-color: var(--line);
  border-top: 4px solid var(--sky);
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.pwa-install-mark {
  background: var(--panel);
}

.pwa-install-copy strong {
  color: var(--navy);
}

.pwa-install-copy span,
.pwa-install-message {
  color: var(--muted);
}

.pwa-install-action {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.pwa-install-action:hover {
  background: var(--navy-dark);
}

.pwa-install-close {
  border-color: var(--line);
  background: var(--white);
  color: var(--navy);
}

.pwa-install-close:hover {
  background: var(--panel);
}

/* Shared Atlantic One shell */
.has-platform-shell {
  min-height: 100vh;
  background: var(--page);
}

.has-platform-shell .page-shell {
  width: 100%;
  margin: 0;
}

.platform-shell {
  min-height: 100vh;
}

.platform-shell svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.desktop-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: grid;
  width: clamp(220px, 16vw, 252px);
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 18px 12px 14px;
  border-right: 1px solid var(--soft-line);
  background: var(--white);
}

.rail-logo {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 8px;
}

.rail-logo img {
  display: block;
  width: min(198px, 100%);
  height: auto;
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.rail-link {
  display: grid;
  min-height: 46px;
  align-items: center;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

.rail-link:hover,
.rail-link:focus-visible {
  background: #edf8fb;
  outline: none;
  text-decoration: none;
}

.rail-link.active {
  background: var(--navy);
  color: var(--white);
}

.rail-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-content {
  min-width: 0;
  min-height: 100vh;
  margin-left: clamp(220px, 16vw, 252px);
  padding: 22px clamp(16px, 2vw, 26px) 48px;
}

.profile-menu {
  position: relative;
  min-width: 0;
}

.profile-menu summary {
  list-style: none;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-button {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
}

.profile-button svg {
  width: 18px;
  height: 18px;
  margin-left: auto;
}

.avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
}

.profile-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 50;
  display: none;
  width: min(270px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 18px 34px rgb(37 45 61 / 16%);
}

.profile-menu[open] .profile-popover {
  display: grid;
  gap: 4px;
}

.profile-identity {
  display: grid;
  gap: 3px;
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--soft-line);
}

.profile-identity strong {
  color: var(--ink);
  font-size: 13px;
}

.profile-identity span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.profile-popover form {
  margin: 0;
}

.profile-menu-item {
  display: grid;
  width: 100%;
  min-height: 38px;
  align-items: center;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.profile-menu-item:hover,
.profile-menu-item:focus-visible {
  background: #edf8fb;
  outline: none;
  text-decoration: none;
}

.profile-menu-item svg {
  width: 18px;
  height: 18px;
}

.mobile-switcher-toggle,
.mobile-topbar,
.mobile-switcher {
  display: none;
}

.mobile-topbar {
  min-height: 58px;
  align-items: center;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  gap: 0;
  padding: 0 10px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--white);
}

.mobile-menu-button,
.switcher-close {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--navy);
  cursor: pointer;
}

.mobile-topbar-logo {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.mobile-topbar-logo img {
  display: block;
  width: clamp(112px, 38vw, 138px);
  height: auto;
}

.profile-menu-mobile .profile-button {
  width: 44px;
  min-height: 44px;
  justify-content: center;
  padding: 0;
  border: 0;
}

.profile-menu-mobile {
  justify-self: end;
}

.profile-menu-mobile .profile-popover {
  top: calc(100% + 8px);
  right: 0;
  bottom: auto;
}

.mobile-switcher {
  position: fixed;
  inset: 0;
  right: auto;
  z-index: 80;
  width: 100vw;
  max-width: 100vw;
  width: 100dvw;
  max-width: 100dvw;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 14px 28px;
  background: var(--white);
}

.mobile-switcher-toggle:checked ~ .mobile-topbar {
  z-index: 40;
}

.mobile-switcher-toggle:checked ~ .mobile-switcher {
  display: block;
}

.switcher-header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.switcher-logo {
  grid-column: 2;
  width: clamp(160px, 42vw, 196px);
  height: auto;
  justify-self: center;
}

.switcher-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.mobile-switcher h2 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 22px;
  line-height: 1.15;
}

.switcher-list {
  display: grid;
  gap: 8px;
}

.switcher-link {
  display: grid;
  min-height: 66px;
  align-items: center;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
}

.switcher-link:hover,
.switcher-link:focus-visible {
  text-decoration: none;
}

.switcher-link.active {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.switcher-link span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.switcher-link strong {
  font-size: 13px;
  line-height: 1.2;
}

.switcher-link small {
  color: currentColor;
  font-size: 12px;
  opacity: 0.78;
}

@media (max-width: 840px) {
  .desktop-rail {
    display: none;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
  }

  .platform-content {
    min-height: calc(100vh - 58px);
    margin-left: 0;
    padding: 14px 10px 32px;
  }
}

@media (max-width: 430px) {
  .mobile-topbar {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
  }

  .mobile-topbar-logo img {
    width: clamp(104px, 34vw, 126px);
  }

  .switcher-logo {
    width: clamp(118px, 37vw, 160px);
  }
}
