.design-app {
  --accent: #086547;
  --accent-shade: #064a37;
  --profile-ink: #142044;
  --profile-secondary: #415064;
  --profile-bg: #f6f8fb;
  --profile-border: #d9e2e5;
  --profile-soft: #eaf5ef;
  --profile-white: #fff;
  color: var(--profile-ink);
  background: var(--profile-bg);
}

.design-app .shell {
  width: min(100% - 48px, 1216px);
  margin-inline: auto;
}

.design-app .site-header {
  border-bottom: 1px solid var(--profile-border);
  background: var(--profile-white);
}

.design-app .profile-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 68px;
  gap: 12px;
}

.design-app .brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--profile-ink);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.035em;
  white-space: nowrap;
}

.profile-brand-light {
  font-weight: 510;
}

.profile-brand-mark {
  display: grid;
  grid-template-columns: 5px 5px 5px;
  align-items: end;
  justify-content: center;
  gap: 3px;
  inline-size: 35px;
  block-size: 35px;
  padding-block-end: 8px;
  background: var(--accent);
  border-radius: 9px;
}

.profile-brand-mark i {
  display: block;
  height: 12px;
  border-radius: 1px;
  background: #e3f4e8;
}

.profile-brand-mark i:nth-child(2) {
  height: 18px;
}

.profile-brand-mark i:nth-child(3) {
  height: 10px;
}

.design-app .lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--profile-border);
  border-radius: 9px;
  background: var(--profile-bg);
  padding: 3px;
}

.design-app .lang-switch button {
  border: 0;
  background: transparent;
  color: var(--profile-secondary);
  border-radius: 5px;
  min-height: 34px;
  min-width: 42px;
  padding: 3px 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.design-app .lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.profile-language-control {
  display: none;
}

[data-site-route="profile"] .profile-language-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 15px;
  margin-block-end: 16px;
  font-size: .9rem;
  font-weight: 650;
  color: var(--profile-secondary);
}

.design-app .profile-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-block: clamp(28px, 4.4vw, 62px) 24px;
  padding: clamp(22px, 4vw, 50px);
  border: 1px solid #e3dfd5;
  border-radius: 17px;
  background: linear-gradient(130deg, #f3f7f4, #fbf3e7);
}

.profile-intro h1 {
  margin: 0;
  max-width: 22ch;
  color: var(--profile-ink);
  font-size: clamp(1.85rem, 4.05vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -.055em;
}

[dir="rtl"] .profile-intro h1 {
  letter-spacing: 0;
  line-height: 1.3;
}

.profile-intro p {
  margin: 13px 0 0;
  color: var(--profile-secondary);
  max-width: 55ch;
  line-height: 1.55;
}

.profile-intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

.design-app .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid var(--profile-border);
  background: var(--profile-white);
  color: var(--profile-ink);
  font: inherit;
  font-weight: 670;
  cursor: pointer;
}

.design-app .button.secondary:hover,
.design-app .profile-text-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.design-app .button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.design-app .button.primary:hover {
  background: var(--accent-shade);
}

.design-app .button:disabled {
  opacity: .65;
  cursor: progress;
}

.design-app .profile-jump {
  display: none;
  text-decoration: none;
}

.profile-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  align-items: start;
  gap: clamp(18px, 3vw, 34px);
}

.profile-editor {
  min-width: 0;
}

.design-app .profile-card {
  margin-block: 0 15px;
  padding: clamp(16px, 2.2vw, 26px);
  border: 1px solid var(--profile-border);
  border-radius: 12px;
  background: var(--profile-white);
  box-shadow: 0 2px 7px #25443808;
}

.profile-card-heading,
.profile-preview-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  margin-block-end: 19px;
}

.profile-card-heading h2,
.profile-preview-heading h2 {
  font-size: 1.18rem;
  color: var(--profile-ink);
  margin: 0;
  letter-spacing: -.015em;
}

#preview-title,
#template-title {
  scroll-margin-block-start: 12px;
}

[dir="rtl"] .profile-card-heading h2,
[dir="rtl"] .profile-preview-heading h2 {
  letter-spacing: 0;
}

.profile-card-heading p,
.profile-preview-heading p {
  margin: 4px 0 0;
  color: var(--profile-secondary);
  font-size: .875rem;
  line-height: 1.5;
}

.profile-required,
.profile-required-mark {
  font-size: .82rem;
  color: var(--accent-shade);
}

.profile-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.profile-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.profile-field-wide {
  grid-column: 1 / -1;
}

.profile-field > label,
.profile-palettes legend {
  font-weight: 650;
  font-size: .91rem;
}

.profile-field input:not([type="checkbox"]),
.profile-field textarea,
.profile-field select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 9px 10px;
  border: 1px solid #c0d2cb;
  border-radius: 7px;
  background: #fff;
  color: var(--profile-ink);
  font: inherit;
  font-size: .93rem;
  line-height: 1.4;
}

.profile-field input::placeholder,
.profile-field textarea::placeholder {
  color: #526863;
  opacity: 1;
}

.profile-field textarea {
  resize: vertical;
  min-height: 70px;
}

.profile-field input[aria-invalid="true"],
.profile-field textarea[aria-invalid="true"] {
  border-color: #9e2a3d;
}

.profile-field-help {
  margin: 1px 0 0;
  color: var(--profile-secondary);
  font-size: .8rem;
  line-height: 1.45;
}

.profile-details {
  border-top: 1px solid var(--profile-border);
  padding-block: 3px;
}

.profile-details > summary {
  padding-block: 9px;
  color: var(--accent-shade);
  font-weight: 670;
  cursor: pointer;
}

.profile-section-fields {
  padding-block: 8px 12px;
}

.profile-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--profile-ink);
}

.profile-checkbox input,
.profile-layout-option input,
.profile-palettes input {
  accent-color: var(--accent);
}

.profile-checkbox input {
  flex: 0 0 auto;
  inline-size: 16px;
  block-size: 16px;
  margin: 2px 0 0;
}

.profile-layouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  min-width: 0;
  border: 0;
}

.profile-layout-option {
  display: grid;
  grid-template-columns: auto 45px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 83px;
  padding: 8px;
  border: 1px solid var(--profile-border);
  border-radius: 8px;
  cursor: pointer;
}

.profile-layout-option:has(input:checked) {
  border-color: #3d8275;
  background: #f0f7f1;
}

.profile-layout-option input {
  margin: 0;
}

.profile-layout-option strong,
.profile-layout-option small {
  display: block;
  overflow-wrap: anywhere;
}

.profile-layout-option strong {
  font-size: .86rem;
}

.profile-layout-option small {
  margin-block-start: 3px;
  color: var(--profile-secondary);
  font-size: .72rem;
  line-height: 1.3;
}

.profile-layout-swatch {
  display: grid;
  gap: 3px;
  align-content: start;
  inline-size: 40px;
  block-size: 51px;
  padding: 6px 4px;
  border: 1px solid #a5beb5;
  border-radius: 4px;
  background: #fff;
}

.profile-layout-swatch i {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 1px;
  background: #d5e4dd;
}

.profile-layout-swatch i:first-child {
  width: 60%;
  height: 4px;
  background: #33796d;
}

.profile-layout-swatch i:last-child {
  width: 74%;
}

.profile-layout-portfolio i:first-child {
  width: 100%;
  height: 11px;
}

.profile-palettes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 15px;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 15px 0;
}

.profile-palettes legend {
  margin-block-end: 5px;
  padding: 0;
}

.profile-palettes label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  font-size: .85rem;
  cursor: pointer;
}

.profile-palettes input {
  margin: 0;
}

.profile-palette {
  block-size: 12px;
  inline-size: 12px;
  border-radius: 50%;
}

.profile-palette-teal { background: #0a6457; }
.profile-palette-ink { background: #264361; }
.profile-palette-wine { background: #803d53; }

.profile-brand-controls,
.profile-draft-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.profile-brand-controls {
  margin-block: 12px 16px;
}

.profile-brand-controls .profile-field {
  flex: 1 1 240px;
}

.profile-text-button {
  min-height: 40px;
  padding: 3px 6px;
  border: 0;
  background: transparent;
  color: var(--accent-shade);
  text-decoration: underline;
  text-underline-offset: 3px;
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}

.profile-section-controls {
  display: grid;
  gap: 4px;
}

.profile-section-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
}

.profile-icon-button {
  inline-size: 34px;
  block-size: 34px;
  border: 1px solid var(--profile-border);
  background: var(--profile-white);
  border-radius: 6px;
  color: var(--accent-shade);
  font: inherit;
  cursor: pointer;
}

.profile-icon-button:disabled {
  opacity: .42;
  cursor: default;
}

.profile-preview-panel {
  min-width: 0;
  border: 1px solid #cee0d7;
  border-radius: 14px;
  background: #eef4ef;
  padding: clamp(13px, 2vw, 22px);
}

.profile-preview-heading {
  align-items: start;
  margin-block-end: 11px;
}

.profile-sheet-frame {
  background: #dfe8e1;
  border: 1px solid #cbd9d0;
  border-radius: 8px;
  padding: 12px;
  max-block-size: calc(297mm * var(--profile-zoom, 1) + 47px);
  overflow: auto;
  overscroll-behavior: contain;
}

@media screen {
  .design-app .profile-sheet[data-template="company-profile"] {
    inline-size: 210mm;
    min-inline-size: 210mm;
    min-block-size: 297mm;
    margin: 0 auto;
    max-inline-size: none;
    zoom: var(--profile-zoom, 1);
    box-shadow: 0 2mm 6mm #23382b21;
  }
}

.profile-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 0 12px;
}

.profile-export-actions .button {
  flex: 1 1 130px;
}

.profile-warning,
.profile-status {
  margin: 9px 0 0;
  font-size: .84rem;
  line-height: 1.4;
  color: var(--accent-shade);
}

.profile-status:empty {
  margin: 0;
}

.profile-status.profile-error {
  color: #902b42;
}

.profile-referral {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 14px;
  justify-content: space-between;
  align-items: center;
  margin-block-start: 13px;
  padding: 12px;
  background: #f8fbf7;
  border: 1px solid var(--profile-border);
  border-radius: 8px;
}

.profile-referral p {
  margin: 3px 0 0;
  color: var(--profile-secondary);
  font-size: .85rem;
}

.profile-referral a {
  color: var(--accent-shade);
  font-size: .88rem;
  font-weight: 670;
}

.design-app [hidden] {
  display: none !important;
}

.design-app :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.profile-visually-hidden,
.design-app .skip-link:not(:focus) {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  white-space: nowrap;
  overflow: hidden;
}

.design-app .skip-link:focus {
  position: absolute;
  z-index: 4;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  padding: 8px;
  background: #fff;
}

.profile-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  justify-content: space-between;
  padding-block: 18px 25px;
  color: var(--profile-secondary);
  font-size: .85rem;
}

@media (min-width: 950px) {
  .profile-preview-panel {
    position: sticky;
    top: 12px;
  }

}

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

  .design-app .profile-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .design-app .profile-jump {
    display: inline-flex;
  }

  .design-app {
    padding-block-end: 76px;
  }

  .design-app[data-profile-pane="preview"] .profile-intro,
  .design-app[data-profile-pane="preview"] .profile-language-control,
  .design-app[data-profile-pane="preview"] .profile-editor,
  .design-app[data-profile-pane="edit"] .profile-preview-panel {
    display: none;
  }

  .design-app[data-profile-pane="preview"] .profile-workspace {
    margin-block-start: 16px;
  }

  .design-app .profile-mobile-nav {
    display: flex;
  }
}

@media (max-width: 460px) {
  .design-app .shell {
    width: calc(100% - 24px);
  }

  .profile-field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-layout-option {
    grid-template-columns: 15px minmax(0, 1fr);
  }

  .profile-layout-swatch {
    display: none;
  }
}

@media print {
  .design-app #print-document {
    margin: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    box-shadow: none !important;
    overflow-wrap: anywhere;
  }

  .design-app .profile-sheet-frame,
  .design-app .profile-preview-panel,
  .design-app .profile-workspace {
    max-height: none;
    overflow: visible;
    position: static;
  }
}

.profile-intro .profile-free-summary {
  margin-block-start: .55rem;
  color: var(--accent-shade);
  font-size: .85rem;
  font-weight: 650;
}

.profile-template-card .profile-layout-option {
  min-block-size: 100px;
}

.profile-template-card .profile-layout-swatch {
  inline-size: 43px;
  block-size: 59px;
  gap: 4px;
}

.profile-layout-compact {
  border-inline-start: 3px solid #438778;
  background: #f9fbf9;
}

.profile-layout-portfolio {
  border-color: #33796d;
  background: #126455;
}

.profile-layout-portfolio i:first-child {
  inline-size: 66%;
  block-size: 3px;
  margin-block-start: 12px;
  background: #fff;
}

.profile-layout-portfolio i:nth-child(2) {
  inline-size: 95%;
  block-size: 4px;
  background: #f7fcf6;
}

.profile-layout-portfolio i:nth-child(3) {
  inline-size: 75%;
  background: #b9ddd2;
}

.profile-layout-portfolio i:last-child {
  margin-block-start: 9px;
  inline-size: 100%;
  background: #72afa3;
}

.profile-transfer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-block: 0 15px;
  padding: 14px 16px;
  border: 1px solid var(--profile-border);
  border-radius: 10px;
  background: #eaf5ef;
}

.profile-transfer p {
  margin: 2px 0 0;
  color: var(--profile-secondary);
  font-size: .87rem;
}

.profile-field-count {
  text-align: end;
}

.profile-field .profile-proof-state {
  margin: 3px 0 0;
  color: var(--profile-secondary);
  font-size: .84rem;
}

.profile-field .profile-proof-reconfirm {
  color: #8a3319;
  font-weight: 660;
}

.profile-asset-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  padding-block: 3px 13px;
}

.profile-asset-label {
  font-size: .91rem;
  font-weight: 650;
}

.profile-asset-controls .button,
.profile-brand-controls .button {
  justify-self: start;
}

.profile-color-label {
  border-radius: 6px;
  padding-inline: 4px;
}

.profile-palettes .profile-color-label input {
  appearance: auto;
  padding: 0;
  width: 24px;
  height: 24px;
  border: 0;
  cursor: pointer;
}

.profile-color-label.profile-custom-active {
  outline: 1px solid var(--accent);
}

#color-help {
  display: block;
  inline-size: 100%;
}

.profile-facts-toggle {
  margin-block: 6px;
  font-size: .91rem;
}

.profile-mobile-nav {
  display: none;
  position: fixed;
  inset: auto 0 0;
  z-index: 3;
  padding-block: 10px max(10px, env(safe-area-inset-bottom));
  padding-inline: 12px;
  gap: 8px;
  background: #f4f8f4;
  border-block-start: 1px solid var(--profile-border);
}

.profile-mobile-nav .button {
  flex: 1 1 50%;
}

.design-app .profile-mobile-nav .button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.profile-preview-dialog {
  color: var(--profile-ink);
  padding: 0;
  border: 1px solid var(--profile-border);
  border-radius: 9px;
  inline-size: min(970px, calc(100% - 20px));
  max-inline-size: 970px;
  max-block-size: calc(100dvh - 20px);
  overflow: hidden;
  background: var(--profile-bg);
}

.profile-preview-dialog::backdrop {
  background: #142c26d9;
}

.profile-dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-block-end: 1px solid var(--profile-border);
}

.profile-dialog-heading h2 {
  margin: 0;
  font-size: 1.08rem;
}

.profile-dialog-canvas {
  padding: 18px;
  max-block-size: calc(100dvh - 94px);
  overflow: auto;
  background: #dfe8e1;
}

.profile-usage {
  flex-basis: 100%;
}

.profile-autosave {
  margin-block-start: 16px;
}

@media screen and (max-width: 460px) {
  .profile-template-card .profile-layout-option {
    grid-template-columns: auto 1fr;
    align-content: start;
  }

  .profile-template-card .profile-layout-swatch {
    display: grid;
    justify-self: center;
  }

  .profile-template-card .profile-layout-option > span:last-child {
    grid-column: 1 / -1;
  }
}

@media print {
  .design-app #print-copy[data-template="company-profile"] {
    zoom: 1 !important;
    min-inline-size: 0 !important;
    min-block-size: 0 !important;
  }

  .design-app .profile-preview-dialog,
  .design-app .profile-mobile-nav {
    display: none !important;
  }
}
