:root {
  --ink: #18212f;
  --muted: #667085;
  --line: #dce2e9;
  --line-strong: #c7d0db;
  --paper: #ffffff;
  --canvas: #f3f5f7;
  --soft: #eef2f5;
  --ticket: #651238;
  --ticket-soft: #f8edf2;
  --hotel: #17624b;
  --hotel-soft: #eaf5f1;
  --accent: #c8943c;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --focus: #2e78c7;
  --shadow: 0 18px 50px rgba(31, 42, 58, 0.08);
  font-family: Inter, "Noto Sans", "Noto Sans Arabic", ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0)) 0 0 / 100% 260px no-repeat,
    var(--canvas);
}

button,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="hidden"]),
select,
textarea {
  font: inherit;
}

button,
summary,
label[for],
input[type="radio"],
input[type="checkbox"],
input[type="file"],
input[type="color"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 38%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: block;
  align-items: center;
  padding: 0;
  border-bottom: 1px solid rgba(199, 208, 219, 0.8);
  background: var(--paper);
  backdrop-filter: blur(16px);
}

.header-primary {
  display: flex;
  width: min(1560px, 100%);
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 12px clamp(18px, 4vw, 56px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  padding: 5px;
  overflow: hidden;
  border-radius: 12px;
  background: #7d003f;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

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

.brand strong {
  font-size: 16px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.app-shell {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 54px) clamp(16px, 3.2vw, 48px) 72px;
}

.portal-dashboard {
  height: 100%;
  padding: clamp(24px, 4vw, 52px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.dashboard-heading h1 {
  margin: 5px 0 8px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.dashboard-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.dashboard-summary {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #475467;
  background: var(--soft);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.dashboard-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 28px;
}

.dashboard-service-card {
  display: grid;
  min-height: 180px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fbfcfd;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-service-card:hover:not(.unavailable) {
  border-color: var(--ticket);
  box-shadow: 0 14px 32px rgba(24, 33, 47, 0.1);
  transform: translateY(-2px);
}

.dashboard-service-card.unavailable {
  cursor: not-allowed;
  opacity: 0.56;
  filter: grayscale(0.75);
}

.dashboard-service-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--ink);
  font-size: 20px;
}

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

.dashboard-service-copy strong {
  margin: 3px 0 9px;
  font-size: 17px;
}

.dashboard-service-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.service-availability {
  padding: 6px 9px;
  border-radius: 999px;
  color: #067647;
  background: #ecfdf3;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.dashboard-service-card.unavailable .service-availability {
  color: #667085;
  background: #eaecf0;
}

.eyebrow {
  margin: 0;
  color: var(--ticket);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.75fr);
  align-items: start;
  gap: 22px;
}

.builder-card,
.results-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.builder-card {
  overflow: hidden;
}

.builder-section {
  padding: 26px;
  border-top: 1px solid var(--line);
}

.builder-section.first-section {
  border-top: 0;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 20px;
}

.section-heading h2,
.results-header h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.section-heading p,
.results-header p,
.repeater-heading p,
.manual-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.step-number {
  display: inline-grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: #344054;
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.active-document {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--ink);
  background: var(--ticket-soft);
}

body[data-domain="hotel"] .active-document {
  background: var(--hotel-soft);
}

.tab-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 11px;
  color: white;
  background: var(--ticket);
  font-size: 21px;
}

body[data-domain="hotel"] .active-document .tab-icon {
  background: var(--hotel);
}

.active-document strong,
.active-document small {
  display: block;
}

.active-document strong {
  font-size: 14px;
}

.active-document small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
}

.workflow-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.workflow-choice legend {
  grid-column: 1 / -1;
}

.workflow-choice label,
.compact-choice label {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.workflow-choice label:has(input:checked),
.compact-choice label:has(input:checked) {
  border-color: #667085;
  background: var(--soft);
}

.workflow-choice input[type="radio"],
.compact-choice input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--ticket);
}

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

.workflow-choice strong {
  font-size: 13px;
}

.workflow-choice small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

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

.editor-choice legend {
  grid-column: 1 / -1;
}

.editor-choice label {
  display: flex;
  min-height: 62px;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.editor-choice label:has(input:checked) {
  border-color: var(--ticket);
  background: var(--ticket-soft);
}

body[data-domain="hotel"] .editor-choice label:has(input:checked) {
  border-color: var(--hotel);
  background: var(--hotel-soft);
}

.editor-choice input[type="radio"] {
  width: 17px;
  height: 17px;
  min-height: 17px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--ticket);
}

.editor-choice label > span {
  min-width: 0;
}

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

.editor-choice small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.editor-mode-note {
  margin: 0 0 18px;
  padding: 11px 13px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: #475467;
  background: #fff9ed;
  font-size: 11.5px;
  line-height: 1.5;
}

.editor-field-hidden {
  display: none !important;
}

.compact-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.compact-choice legend {
  width: 100%;
}

.compact-choice label {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 12px;
}

.source-panel {
  margin-bottom: 16px;
}

.drop-zone {
  position: relative;
  min-height: 190px;
  border: 1px dashed #8f9fb2;
  border-radius: 14px;
  background: #f8fafb;
  text-align: center;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.drop-zone:hover,
.drop-zone.drag-active {
  border-color: var(--ticket);
  background: var(--ticket-soft);
}

.drop-zone.drag-active {
  border-style: solid;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ticket) 13%, transparent);
}

.drop-zone.has-file {
  border-color: #079455;
  border-style: solid;
  background: #f0fdf4;
  box-shadow: 0 0 0 3px rgba(7, 148, 85, 0.08);
}

.source-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.drop-zone-picker {
  display: grid;
  width: calc(100% - 2px);
  min-height: 187px;
  margin: 1px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 24px;
  border: 0;
  border-radius: 13px;
  color: inherit;
  background: transparent;
  text-align: center;
}

.drop-zone-picker:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 38%, transparent);
  outline-offset: -5px;
}

.drop-zone-picker strong {
  font-size: 14px;
}

.drop-zone-picker > span:not(.upload-icon),
.drop-zone-picker small {
  color: var(--muted);
  font-size: 11px;
}

.drop-zone-picker small {
  font-weight: 500;
}

.upload-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ticket);
  background: white;
  font-size: 23px;
}

.source-file-summary {
  display: grid;
  min-height: 187px;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 8px 14px;
  padding: 25px;
  text-align: left;
}

.file-success-icon {
  display: grid;
  width: 48px;
  height: 48px;
  grid-row: span 2;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #079455;
  box-shadow: 0 0 0 7px #d1fadf;
  font-size: 24px;
  font-weight: 800;
}

.source-file-details {
  min-width: 0;
}

.source-file-details > * {
  display: block;
}

.file-ready-label {
  margin-bottom: 5px;
  color: #067647;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-file-details strong {
  overflow-wrap: anywhere;
  color: #162c22;
  font-size: 14px;
}

.source-file-details > span:last-child {
  margin-top: 5px;
  color: #476056;
  font-size: 11px;
}

.source-file-actions {
  display: flex;
  grid-column: 2;
  flex-wrap: wrap;
  gap: 8px;
}

.source-file-actions .button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 11px;
}

.selected-file {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.drop-zone.has-file + .selected-file {
  color: #067647;
  font-weight: 700;
}

label,
.field-grid label {
  color: #344054;
  font-size: 11.5px;
  font-weight: 700;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: 42px;
  margin-top: 7px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: white;
  font-size: 13px;
}

textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.5;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="hidden"]):hover,
select:hover,
textarea:hover {
  border-color: #98a2b3;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="hidden"]):focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(46, 120, 199, 0.12);
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 18px;
  accent-color: var(--focus);
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input[type="checkbox"]:not(:disabled):hover,
input[type="radio"]:not(:disabled):hover {
  filter: brightness(0.94);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 3px solid rgba(46, 120, 199, 0.35);
  outline-offset: 2px;
}

input[type="file"] {
  padding: 8px;
  font-size: 11px;
}

input[type="file"]::file-selector-button {
  margin-right: 9px;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  color: #344054;
  background: var(--soft);
  font-weight: 700;
}

.field-grid {
  display: grid;
  gap: 15px;
}

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

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

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

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

.switch-row {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafbfc;
}

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

.switch-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.switch-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  flex: 0 0 18px;
  margin: 0;
  accent-color: var(--ticket);
}

.compact-switch {
  min-height: 70px;
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.45;
}

.manual-toolbar,
.repeater-heading,
.repeater-item-header,
.results-header,
.dialog-header,
.submit-bar,
.response-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.manual-toolbar {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--soft);
}

.repeater-heading {
  align-items: end;
  margin: 24px 0 10px;
}

.repeater-heading h3,
.subsection-title {
  margin: 0;
  font-size: 14px;
}

.subsection-title {
  margin: 25px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

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

.repeater-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfd;
}

.repeater-item-header {
  margin-bottom: 14px;
}

.repeater-item-header h4 {
  margin: 0;
  font-size: 13px;
}

.airport-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 15px;
}

.airport-grid fieldset {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}

.airport-grid legend {
  padding: 0 6px;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  font-weight: 750;
}

.button {
  gap: 7px;
  padding: 9px 14px;
  font-size: 12px;
}

.button.primary {
  min-width: 160px;
  color: white;
  background: var(--ticket);
}

body[data-domain="hotel"] .button.primary {
  background: var(--hotel);
}

.button.primary:hover {
  filter: brightness(0.92);
}

.button.secondary {
  border: 1px solid var(--line-strong);
  color: #344054;
  background: white;
}

.button.secondary:hover,
.text-button:hover {
  background: var(--soft);
}

.text-button {
  color: #344054;
  background: transparent;
}

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

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  color: #475467;
  background: var(--soft);
  font-size: 20px;
}

.icon-button:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.collapsible {
  padding: 0;
}

.collapsible > summary {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 22px 26px;
  list-style: none;
}

.collapsible > summary::-webkit-details-marker {
  display: none;
}

.collapsible > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--muted);
  font-size: 21px;
  font-weight: 500;
}

.collapsible[open] > summary::after {
  content: "−";
}

.collapsible > summary strong,
.collapsible > summary small {
  display: block;
}

.collapsible > summary strong {
  font-size: 14px;
}

.collapsible > summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.details-content {
  padding: 0 26px 26px;
}

.theme-switch {
  margin: 18px 0 12px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}

.theme-grid label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 8px;
  background: white;
}

.theme-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="hidden"]) {
  width: 36px;
  height: 30px;
  min-height: 30px;
  margin: 0;
  padding: 2px;
}

.ad-fields {
  margin-top: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}

.ad-fields > label:not(:first-child) {
  display: block;
  margin-top: 13px;
}

.submit-bar {
  position: sticky;
  z-index: 10;
  bottom: 0;
  padding: 18px 26px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.submit-bar strong,
.submit-bar span {
  display: block;
}

.submit-bar strong {
  font-size: 13px;
}

.submit-bar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.results-card {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 118px);
  overflow: auto;
  padding: 22px;
}

.results-header {
  align-items: flex-start;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.empty-state {
  display: grid;
  min-height: 440px;
  place-items: center;
  align-content: center;
  padding: 40px 24px;
  text-align: center;
}

.empty-state h3 {
  margin: 14px 0 6px;
  font-size: 16px;
}

.empty-state p {
  max-width: 310px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.empty-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ticket);
  background: var(--ticket-soft);
  font-size: 31px;
}

body[data-domain="hotel"] .empty-icon {
  color: var(--hotel);
  background: var(--hotel-soft);
}

.loading-state,
.error-state {
  display: flex;
  min-height: 300px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 36px 20px;
}

.loading-state p,
.error-state p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--ticket);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

body[data-domain="hotel"] .spinner {
  border-top-color: var(--hotel);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-state {
  display: block;
  min-height: 0;
  margin-top: 18px;
  border: 1px solid #fecdca;
  border-radius: 12px;
  color: #7a271a;
  background: var(--danger-soft);
}

.error-state details {
  margin-top: 14px;
}

.error-state summary {
  font-size: 11px;
  font-weight: 750;
}

.error-state pre {
  max-height: 180px;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  color: #512018;
  background: #fff;
  font-size: 10px;
  white-space: pre-wrap;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  padding: 17px 0;
}

.metric {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
}

.metric span,
.metric strong {
  display: block;
}

.metric span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric strong {
  margin-top: 4px;
  font-size: 13px;
}

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

.document-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.document-card-header {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.document-card-header strong,
.document-card-header span {
  display: block;
}

.document-card-header strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.document-card-header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.document-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px;
}

.document-actions .button {
  min-width: 0;
  padding-inline: 8px;
}

.delivery-tools {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.delivery-tools details + details {
  margin-top: 8px;
}

.delivery-tools summary {
  padding: 8px 0;
  color: #344054;
  font-size: 11px;
  font-weight: 750;
}

.delivery-form {
  display: grid;
  gap: 9px;
  padding-top: 5px;
}

.delivery-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="hidden"]) {
  min-height: 38px;
  margin-top: 4px;
  font-size: 12px;
}

.delivery-feedback {
  min-height: 17px;
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
}

.delivery-feedback.success {
  color: #067647;
}

.delivery-feedback.error {
  color: var(--danger);
}

.response-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.response-details > summary {
  padding: 15px 0;
  color: #344054;
  font-size: 11.5px;
  font-weight: 750;
}

.response-actions {
  justify-content: flex-start;
  margin-bottom: 9px;
}

.response-details pre {
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  color: #d6e2f0;
  background: #17202d;
  font-size: 9.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-dialog {
  width: min(1180px, calc(100vw - 30px));
  height: min(900px, calc(100vh - 30px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 30px 80px rgba(16, 24, 40, 0.22);
}

.preview-dialog::backdrop {
  background: rgba(12, 18, 28, 0.68);
}

.dialog-header {
  height: 72px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 2px 0 0;
  font-size: 16px;
}

.preview-dialog iframe {
  width: 100%;
  height: calc(100% - 72px);
  border: 0;
  background: #e9edf2;
}

.hidden {
  display: none !important;
}

.portal-user {
  position: relative;
}

.account-menu-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--paper);
  font-size: 12px;
  font-weight: 750;
}

#portal-user-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  right: 0;
  width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 0 18px 45px rgba(24, 33, 47, 0.16);
}

.account-menu-action {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 12px;
  font-weight: 750;
}

.account-menu-action:hover {
  background: var(--wash);
}

#portal-sign-out {
  color: var(--danger);
}

#portal-sign-out:hover {
  background: var(--danger-soft);
}

.account-menu-link {
  text-decoration: none;
}

.management-workspace {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px;
}

.management-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.management-heading h1 {
  margin: 3px 0 6px;
  font-size: clamp(25px, 3vw, 38px);
}

.management-heading p:last-child {
  margin: 0;
  color: var(--muted);
}

.role-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--burgundy-soft);
  color: var(--burgundy);
  font-size: 12px;
  font-weight: 800;
}

.management-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

#agency-settings-fields .builder-section {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 18px;
}

.settings-actions .form-feedback {
  margin: 0 auto 0 0;
}

.management-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.management-tabs a {
  min-height: 42px;
  padding: 11px 16px;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.management-tabs a.active {
  color: white;
  background: var(--ink);
}

.platform-management-canvas {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.platform-management-toolbar {
  display: flex;
  flex: 0 0 auto;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.platform-management-toolbar .management-tabs {
  margin: 0;
}

.platform-management-toolbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

#platform-management-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
}

.management-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  contain: inline-size;
}

.management-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
}

.management-table .management-actions {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.management-table th,
.management-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

.management-table th {
  color: var(--muted);
  background: var(--wash);
  font-weight: 850;
}

.management-table input[type="number"] {
  width: 100px;
}

.management-table .button {
  min-height: 36px;
  padding: 7px 10px;
}

.management-create-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.management-create-bar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="hidden"]) {
  max-width: 320px;
}

.management-service-toggles {
  display: grid;
  gap: 6px;
}

.management-service-toggles label,
.management-checkbox-target {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
}

.management-checkbox-target {
  min-width: 44px;
  justify-content: center;
}

.management-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.management-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.management-subheader h2,
.management-subheader p {
  margin: 0;
}

.management-subheader p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.agency-user-add-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.agency-user-add-form select {
  margin-top: 0;
}

.management-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
}

.management-summary-grid > div {
  display: grid;
  gap: 4px;
  padding: 20px;
  background: var(--paper);
}

.management-summary-grid strong {
  font-size: 24px;
}

.management-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.billing-tabs {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}

.billing-tabs button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper);
  font-weight: 800;
}

.billing-tabs button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.billing-tabs button.active {
  border-color: var(--ink);
  color: white;
  background: var(--ink);
}

.billing-tabs button:focus-visible {
  outline: 3px solid rgba(46, 120, 199, 0.35);
  outline-offset: 2px;
}

.billing-panel {
  min-height: 0;
}

.billing-panel[hidden] {
  display: none;
}

.billing-filter-bar,
.billing-selection-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.billing-filter-fields {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  grid-template-columns: repeat(3, minmax(150px, 220px));
  gap: 10px;
}

.billing-filter-fields-wide {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.billing-filter-field {
  min-width: 0;
}

.billing-filter-field label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.billing-filter-field select {
  width: 100%;
  min-height: 44px;
  margin: 0;
}

.billing-filter-status,
.billing-selection-bar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.billing-selection-bar {
  align-items: center;
  background: var(--wash);
}

.billing-selection-bar .button,
.billing-filter-bar > .button,
.management-subheader .management-actions .button {
  min-height: 44px;
}

#platform-management-content > details {
  padding: 18px;
}

#platform-management-content pre {
  overflow: auto;
  max-height: 480px;
  padding: 14px;
  border-radius: 10px;
  background: var(--wash);
  font-size: 11px;
}

.management-empty,
.management-loading,
.management-error {
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.management-error {
  color: var(--danger);
}

.management-section-label {
  margin: 0;
  padding: 18px 14px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 18px;
}

.history-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.history-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--wash);
}

.history-card-copy {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.history-card-copy h2,
.history-card-copy p { margin: 0; }
.history-card-copy h2 { font-size: 16px; }
.history-card-copy p { color: var(--muted); font-size: 12px; }
.history-card-copy .button { justify-self: start; }

.created-mailbox-address {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--wash);
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dialog-checkbox-target {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.dialog-checkbox-target span {
  display: grid;
  gap: 2px;
}

.dialog-checkbox-target small {
  color: var(--muted);
}

.password-reset-workspace {
  display: grid;
  min-height: 100%;
  place-items: center;
}

.password-reset-card {
  display: grid;
  width: min(520px, 100%);
  gap: 16px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.password-reset-card h1,
.password-reset-card p {
  margin: 0;
}

.password-reset-card > p:not(.eyebrow):not(.form-feedback) {
  color: var(--muted);
  line-height: 1.6;
}

.impersonation-banner {
  padding: 8px 16px;
  color: #fff;
  background: var(--burgundy);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.portal-login-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: clamp(28px, 6vw, 88px);
  align-items: center;
  min-height: min(620px, calc(100vh - 150px));
  padding: clamp(28px, 6vw, 80px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.portal-login-card h1 {
  max-width: 760px;
  margin: 5px 0 12px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.portal-login-card > div > p:last-child {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.portal-login-form {
  display: grid;
  gap: 15px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafb;
}

.portal-login-form label,
.account-switcher label,
.mail-sidebar label,
.compose-fields label {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 12px;
  font-weight: 750;
}

.portal-login-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="hidden"]),
.account-switcher select,
.mail-sidebar select,
.compose-fields input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="hidden"]),
.compose-fields select,
.compose-fields textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--paper);
}

.form-feedback {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.workspace-toolbar {
  display: flex;
  width: min(1560px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 8px clamp(18px, 4vw, 56px) 10px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.module-nav {
  display: flex;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
}

.module-nav a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 10px;
  color: #475467;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.module-nav a:hover {
  background: var(--soft);
}

.module-nav a.active {
  color: white;
  background: var(--ink);
}

.module-nav a.disabled {
  opacity: 0.42;
  pointer-events: none;
}

.module-nav a span {
  font-size: 17px;
}

.account-switcher {
  width: min(280px, 32vw);
  flex: 0 0 auto;
}

.account-switcher select,
.mail-sidebar select {
  min-height: 40px;
  padding: 7px 34px 7px 10px;
  font-size: 12px;
}

.service-workspace {
  min-width: 0;
  scroll-margin-top: 170px;
}

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

.compact-builder {
  min-width: 0;
}

.identity-drop-zone {
  min-height: 260px;
}

.identity-results {
  display: grid;
  gap: 16px;
}

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

.identity-status-card,
.identity-field-group {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8fafb;
}

.identity-status-card span,
.identity-field dt {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.identity-status-card strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.identity-field-group h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.identity-field {
  display: grid;
  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.identity-field dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 650;
}

.mail-layout {
  --mail-sidebar-width: 300px;
  display: grid;
  grid-template-columns: var(--mail-sidebar-width) minmax(280px, 0.75fr) minmax(380px, 1.25fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

body.portal-canvas-mode {
  display: flex;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.portal-canvas-mode .app-header {
  flex: 0 0 auto;
}

.portal-canvas-mode .app-shell {
  width: 100%;
  max-width: none;
  min-height: 0;
  flex: 1 1 auto;
  padding: 12px clamp(16px, 3.5vw, 56px) 16px;
}

.portal-canvas-mode #portal-workspace,
.portal-canvas-mode #portal-workspace > .service-workspace {
  height: 100%;
}

.portal-canvas-mode .management-workspace {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.portal-canvas-mode .management-workspace > .management-heading,
.portal-canvas-mode .management-workspace > .management-tabs {
  flex: 0 0 auto;
}

.portal-canvas-mode .management-workspace > .management-card {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
}

.portal-canvas-mode .management-workspace > .platform-management-canvas {
  overflow: hidden;
}

.portal-canvas-mode .studio-grid,
.portal-canvas-mode .service-grid {
  height: 100%;
  min-height: 0;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.portal-canvas-mode .studio-grid > .builder-card,
.portal-canvas-mode .service-grid > .builder-card,
.portal-canvas-mode .studio-grid > .results-card,
.portal-canvas-mode .service-grid > .results-card {
  height: 100%;
  max-height: none;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.portal-canvas-mode .studio-grid > .builder-card,
.portal-canvas-mode .service-grid > .builder-card {
  border-right: 1px solid var(--line);
}

.portal-canvas-mode .studio-grid > .results-card,
.portal-canvas-mode .service-grid > .results-card {
  position: static;
}

.privacy-note {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mailbox-search {
  width: 100%;
  margin: 6px 0 8px;
}

.mailbox-results {
  display: grid;
  min-height: 120px;
  flex: 1 1 auto;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 4px;
  margin-bottom: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mailbox-result {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

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

.mailbox-copy-button {
  min-width: 48px;
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ticket);
  background: var(--paper);
  font-size: 10px;
  font-weight: 750;
}

.mailbox-copy-button:hover {
  border-color: var(--line-strong);
  background: var(--ticket-soft);
}

.mailbox-result:hover,
.mailbox-result[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: var(--paper);
}

.mailbox-result[aria-pressed="true"] {
  box-shadow: inset 3px 0 0 var(--ticket);
}

.mailbox-result strong,
.mailbox-result span,
.mailbox-result small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mailbox-result strong {
  font-size: 12px;
}

.mailbox-result span,
.mailbox-result small,
.mailbox-results-empty {
  color: var(--muted);
  font-size: 10.5px;
}

.mailbox-results-empty {
  margin: 4px 0 10px;
  padding: 10px;
  text-align: center;
}

.mail-sidebar,
.mail-list-panel,
.mail-viewer,
.mail-viewer-panel {
  min-width: 0;
}

.mail-sidebar,
.mail-list-panel,
.mail-viewer {
  padding: 18px;
}

.mail-sidebar,
.mail-list-panel {
  border-right: 1px solid var(--line);
}

.mail-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafb;
}

.mail-list-panel,
.mail-viewer,
.mail-viewer-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.mail-sidebar-resizer {
  position: absolute;
  z-index: 2;
  top: 0;
  right: -5px;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
}

.mail-sidebar-resizer::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: transparent;
  content: "";
}

.mail-sidebar-resizer:hover::after,
.mail-sidebar-resizer:focus-visible::after,
.mail-sidebar-resizer.dragging::after {
  background: var(--focus);
}

.mail-viewer-toolbar {
  display: flex;
  min-height: 65px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.mail-viewer-toolbar .button {
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 11px;
}

.mail-viewer {
  flex: 1 1 auto;
}

.folder-tabs {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  padding: 3px;
  border-radius: 10px;
  background: var(--soft);
}

.folder-tab {
  min-width: 76px;
  min-height: 44px;
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  color: #475467;
  background: transparent;
  text-align: center;
}

.folder-tab.active {
  color: white;
  background: var(--ink);
  font-weight: 750;
}

.full-width {
  width: 100%;
}

.mail-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.mail-panel-header h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.mail-folder-heading {
  min-width: 0;
}

.mail-panel-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.mail-details-toggle {
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  font-size: 11px;
}

#mail-count {
  display: grid;
  min-width: 30px;
  min-height: 30px;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  font-size: 11px;
  font-weight: 800;
}

.mailbox-details-dialog {
  width: min(560px, calc(100vw - 32px));
}

.mailbox-details-intro {
  margin: 0;
  color: var(--muted);
}

.mailbox-details-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.mailbox-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafb;
}

.mailbox-detail-row dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mailbox-detail-row dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.mailbox-detail-copy {
  min-width: 58px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ticket);
  background: var(--paper);
  font-size: 11px;
  font-weight: 750;
}

.mailbox-detail-copy:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--ticket-soft);
}

.mail-list {
  display: grid;
}

.mail-list-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.mail-pagination {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 4px 4px;
  color: var(--muted);
  font-size: 10.5px;
  text-align: center;
}

.mail-load-more {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: var(--paper);
  font-size: 11px;
  font-weight: 750;
}

.mail-load-more:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--soft);
}

.mail-load-more:disabled {
  cursor: wait;
  opacity: 0.65;
}

.mail-pagination.complete {
  padding-bottom: 8px;
}

.mail-item {
  display: grid;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 13px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  background: transparent;
  text-align: left;
}

.mail-item:hover,
.mail-item.active {
  background: #f5f7f9;
}

.mail-item strong,
.mail-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-item strong {
  font-size: 12px;
}

.mail-item span,
.mail-item time {
  color: var(--muted);
  font-size: 11px;
}

.mail-empty {
  display: grid;
  min-height: 180px;
  place-content: center;
  gap: 6px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.mail-viewer-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.mail-viewer-header h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.mail-viewer-header p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
}

.mail-html-frame {
  display: block;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

@media (max-width: 1050px) {
  html,
  body {
    overflow-x: hidden;
  }

  body.portal-canvas-mode {
    display: block;
    height: auto;
    overflow: auto;
  }

  .portal-canvas-mode .app-shell {
    padding: 20px 16px 52px;
  }

  .portal-canvas-mode #portal-workspace,
  .portal-canvas-mode #portal-workspace > .service-workspace {
    height: auto;
  }

  .portal-canvas-mode .management-workspace {
    display: block;
    overflow: visible;
  }

  .portal-canvas-mode .management-workspace > .management-card {
    overflow: hidden;
  }

  .portal-canvas-mode .platform-management-canvas {
    min-height: 620px;
  }

  .portal-canvas-mode .portal-dashboard,
  .portal-canvas-mode .studio-grid,
  .portal-canvas-mode .service-grid {
    height: auto;
    overflow: visible;
  }

  .portal-canvas-mode .studio-grid,
  .portal-canvas-mode .service-grid {
    gap: 20px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .portal-canvas-mode .studio-grid > .builder-card,
  .portal-canvas-mode .service-grid > .builder-card,
  .portal-canvas-mode .studio-grid > .results-card,
  .portal-canvas-mode .service-grid > .results-card {
    height: auto;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }

  .taskemail-mode .mail-layout {
    height: auto;
    min-height: 0;
    grid-template-columns: var(--mail-sidebar-width) minmax(0, 1fr);
  }

  .taskemail-mode .mail-sidebar,
  .taskemail-mode .mail-list-panel {
    height: 620px;
    min-height: 0;
  }

  .taskemail-mode .mail-viewer-panel {
    grid-column: 1 / -1;
    min-height: 520px;
    border-top: 1px solid var(--line);
  }

  .taskemail-mode .mail-html-frame {
    min-height: 400px;
  }
}

.loading-inline {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 80px;
  color: var(--muted);
  font-size: 12px;
}

.compose-dialog {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 30px 90px rgba(24, 33, 47, 0.28);
}

.compose-fields {
  display: grid;
  gap: 13px;
  padding: 20px 24px;
}

.compose-fields input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]):not([type="hidden"]),
.compose-fields select,
.compose-fields textarea {
  padding: 10px 11px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .studio-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .results-card {
    position: static;
    max-height: none;
  }

  .empty-state {
    min-height: 280px;
  }

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

  .mail-layout {
    grid-template-columns: var(--mail-sidebar-width) minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  }
}

@media (max-width: 820px) {
  .app-header {
    position: static;
  }

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

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

  .workspace-toolbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

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

  .dashboard-services {
    grid-template-columns: 1fr;
  }

  .account-switcher {
    width: 100%;
  }

  .portal-login-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .mail-layout {
    grid-template-columns: var(--mail-sidebar-width) minmax(0, 1fr);
  }

  .mail-viewer-panel {
    grid-column: 1 / -1;
    min-height: 360px;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .header-primary {
    min-height: 64px;
    padding: 10px 14px;
  }

  .brand small {
    margin-top: 1px;
    font-size: 9px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand strong {
    max-width: 210px;
    font-size: 13px;
    line-height: 1.2;
  }

  .mail-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mail-panel-actions {
    justify-content: space-between;
  }

  .mail-details-toggle {
    flex: 1 1 auto;
  }

  .mailbox-detail-row {
    gap: 8px;
  }

  .submit-bar,
  .manual-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .management-subheader {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-filter-bar,
  .billing-selection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-filter-fields,
  .billing-filter-fields-wide {
    grid-template-columns: 1fr;
  }

  .billing-filter-bar > .button,
  .billing-selection-bar .management-actions,
  .billing-selection-bar .button,
  .management-subheader .management-actions .button {
    width: 100%;
  }

  .platform-management-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .platform-management-toolbar .management-tabs {
    overflow-x: auto;
  }

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

  .app-shell {
    padding: 25px 12px 52px;
  }

  .portal-dashboard {
    padding: 20px 16px;
  }

  .dashboard-heading h1 {
    font-size: 31px;
  }

  .dashboard-summary {
    white-space: normal;
  }

  .dashboard-service-card {
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 17px;
  }

  .service-availability {
    grid-column: 2;
    width: fit-content;
  }

  .editor-choice,
  .workflow-choice,
  .two-columns,
  .three-columns,
  .four-columns,
  .theme-grid {
    grid-template-columns: 1fr;
  }

  .span-two {
    grid-column: auto;
  }

  .builder-section {
    padding: 21px 16px;
  }

  .collapsible > summary {
    padding: 20px 16px;
  }

  .details-content {
    padding: 0 16px 22px;
  }

  .workflow-choice label {
    min-height: 58px;
  }

  .drop-zone {
    min-height: 160px;
  }

  .drop-zone-picker,
  .source-file-summary {
    min-height: 157px;
  }

  .source-file-summary {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 22px 16px;
    text-align: center;
  }

  .file-success-icon {
    grid-row: auto;
  }

  .source-file-actions {
    grid-column: 1;
    justify-content: center;
  }

  .repeater-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .repeater-heading .button {
    width: 100%;
  }

  .submit-bar {
    position: static;
    padding: 16px;
  }

  .submit-bar .button {
    width: 100%;
  }

  .results-card {
    padding: 17px;
  }

  #portal-user-name {
    display: none;
  }

  .account-menu-toggle::before {
    content: "Account";
  }

  .portal-login-card {
    padding: 24px 16px;
  }

  .portal-login-card h1 {
    font-size: 31px;
  }

  .module-nav {
    width: 100%;
  }

  .module-nav a {
    flex: 0 0 auto;
  }

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

  .identity-field {
    grid-template-columns: 1fr;
  }

  .mail-layout {
    display: block;
    min-height: 0;
  }

  .taskemail-mode .mail-layout {
    display: block;
  }

  .taskemail-mode .mail-sidebar,
  .taskemail-mode .mail-list-panel {
    height: auto;
    min-height: 0;
  }

  .taskemail-mode .mailbox-results,
  .taskemail-mode .mail-list-scroll {
    max-height: 430px;
  }

  .mail-sidebar,
  .mail-list-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mail-sidebar-resizer {
    display: none;
  }

  .folder-tabs {
    width: fit-content;
  }

  .mail-viewer-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .mail-viewer-toolbar .button {
    flex: 1 1 92px;
  }

  .mail-viewer {
    min-height: 300px;
  }

  .mail-html-frame {
    min-height: 380px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
