/* Reference-led UI treatment. Measured receipt paper and rendering stay in editor.css. */
.editor {
  --editor-blue: var(--blue, #007eb5);
  --editor-blue-light: #eff8fe;
  --editor-border: #dce3eb;
  --editor-muted: #526072;
  color: var(--ink, #101828);
  font-family: var(--sans, 'Tally Sans', Arial, sans-serif);
  font-size: .9375rem;
  line-height: 1.5;
  padding-top: 30px;
}

.editor h1,
.editor h2,
.editor h3 {
  font-family: var(--sans, 'Tally Sans', Arial, sans-serif);
  color: var(--ink, #101828);
  font-weight: 650;
}

.editor-toolbar { margin-bottom: 24px; padding-bottom: 24px; }
.editor-document-icon { width: 44px; height: 44px; border-radius: 12px; }
.editor-document h1 { font-size: 1.5rem; letter-spacing: -.045em; }
.editor-document p { color: var(--editor-muted); font-size: .75rem; }
.editor-saved-state { font-size: .75rem; }
.editor-saved-state:before { background: #398165; }
.editor-saved-state.is-dirty:before { background: #a36b22; }
.editor-toolbar-actions { gap: 8px; }

.editor .editor-icon-button { color: #526072; border-radius: 10px; }
.editor .editor-icon-button:hover { background: #f0f7fc; color: #006c9c; }
.editor .editor-tool-button {
  background: #fff;
  border-color: #cfd8e3;
  border-radius: 100px;
  padding-inline: 14px;
  color: #344054;
  font-size: .8125rem;
  font-weight: 600;
}
.editor .editor-tool-button:hover { border-color: #9ab5c8; background: #f8fbfe; }
.editor .button {
  background: var(--editor-blue);
  border-color: var(--editor-blue);
  border-radius: 100px;
  color: #fff;
  padding: 11px 20px;
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: -.01em;
  box-shadow: 0 2px 3px #1018280b;
}
.editor .button:hover { background: #006b9b; border-color: #006b9b; }
.editor .button.secondary { color: #344054; background: #fff; border-color: #cfd8e3; box-shadow: none; }
.editor .button.secondary:hover { background: #f8fbfe; border-color: #9ab5c8; }
.editor button:focus-visible,
.editor summary:focus-visible,
.editor input:focus-visible,
.editor select:focus-visible,
.editor textarea:focus-visible { outline-color: #0074aa; }

.editor-mode-tabs { display: flex; flex-wrap: wrap; border-color: #e3e9ef; background: #f3f6f9; border-radius: 13px; padding: 4px; }
.editor-mode-tabs button { flex: 1 1 9em; min-width: 0; padding-inline: 12px; color: #526072; border-radius: 9px; font-size: .875rem; font-weight: 600; overflow-wrap: anywhere; }
.editor-mode-tabs button[aria-selected=true] { color: #006c9c; background: #fff; box-shadow: 0 1px 4px #10182812; }
.editor-section-list { gap: 10px; }
.editor-section { border-color: var(--editor-border); border-radius: 13px; background: #fff; }
.editor-section.is-selected { border-color: #84bad6; box-shadow: 0 0 0 1px #dceffb; }
.editor-section.is-invalid { border-color: #d5a28d; }
.editor-section-toggle { padding-block: 15px; }
.editor-section-toggle:hover { background: #f8fbfe; }
.editor-section-symbol { color: #52687b; }
.editor-section.is-selected .editor-section-symbol { color: #007eb5; }
.editor-section-label strong { font-size: .875rem; font-weight: 600; }
.editor-section-label small { color: var(--editor-muted); font-size: .75rem; margin-top: 3px; }
.editor-section-chevron { color: #66778a; }
.editor-section-content { border-color: #e9eef3; padding-top: 18px; padding-bottom: 16px; }
.editor-section-tools { border-color: #e9eef3; }
.editor-core-label { color: var(--editor-muted); font-size: .75rem; }
.editor .editor-remove { color: #a26856; }
.editor .editor-remove:hover { color: #a44026; background: #fff0eb; }

.editor-field { gap: 7px; margin-bottom: 16px; }
.editor-field label { font-size: .8125rem; color: #344054; font-weight: 600; }
.editor-field label>span { font-size: .75rem; color: var(--editor-muted); }
.editor-field input:not([type=checkbox]):not([type=range]):not([type=color]),
.editor-field select,
.editor-field textarea {
  border-color: #cbd5e1;
  border-radius: 9px;
  background: #fff;
  color: #1d2939;
  font-size: .9375rem;
  padding: 10px 12px;
  box-shadow: 0 1px 2px #10182805;
}
.editor-field select { padding-right: 27px; }
.editor-field input:hover,
.editor-field select:hover,
.editor-field textarea:hover { border-color: #90b2c7; }
.editor-field-hint,
.editor-field-error,
.editor-draft-hint { font-size: .75rem; line-height: 1.6; }
.editor-field-hint,
.editor-draft-hint { color: var(--editor-muted); }
.editor-logo-controls { background: #fafcfe; border-color: #cddbe6; border-radius: 10px; padding: 13px; }
.editor-logo-header>span { font-size: .8125rem; color: #344054; }
.editor-logo-header small { font-size: .75rem; color: var(--editor-muted); }
.editor-logo-header button,
.editor-logo-preview button { border-color: #cbdce8; border-radius: 100px; color: #006c9c; font-size: .75rem; padding-inline: 11px; }
.editor-field input[type=color] { border-color: #cbd5e1; border-radius: 9px; }
.editor-add-section select { background: #fff; border-color: #cbd5e1; border-radius: 9px; color: #344054; font-size: .8125rem; }
.editor-add-section button,
.editor-add-item { background: #fff; border-color: #b9d9eb; border-radius: 100px; color: #006c9c; font-size: .8125rem; }
.editor-add-section button:hover,
.editor-add-item:hover { background: #eff8fe; border-color: #8dbdd7; }
.editor-form-footer { color: var(--editor-muted); font-size: .75rem; }
.editor-form-footer button { color: var(--editor-muted); font-size: .75rem; }
.editor-limit-hint { font-size: .75rem; }

.editor-item { background: #f8fafc; border-color: #e1e7ee; border-radius: 10px; }
.editor-item-heading,
.editor-line-total span,
.editor-item-extra,
.editor-item-extra>summary>span { font-size: .75rem; color: var(--editor-muted); }
.editor-line-total strong { color: #344054; font-size: .875rem; }
.editor-item-extra>summary { min-height: 44px; }
.editor-totals-breakdown { background: #f3f8fc; border-radius: 9px; font-size: .8125rem; color: var(--editor-muted); }
.editor-totals-breakdown>div:last-child { border-color: #dce6ed; color: #1d2939; }
.editor-appearance-card { border-color: var(--editor-border); border-radius: 13px; padding-top: 21px; }
.editor-appearance-card h2 { font-size: 1rem; letter-spacing: -.025em; }
.editor-appearance-card h3 { color: #344054; font-size: .875rem; }
.editor-appearance-card>p:first-of-type { color: var(--editor-muted); font-size: .75rem; }
.editor-template-tip { background: #eff8fe; color: #40576b; border-radius: 9px; font-size: .75rem; }
.editor-checkbox { color: #344054; font-size: .875rem; }
.editor-checkbox small { color: var(--editor-muted); font-size: .75rem; }

.editor-preview-heading h2 { font-size: .9375rem; letter-spacing: -.015em; }
.editor-live-dot { background: #398165; box-shadow: 0 0 0 3px #edf7f1; }
.editor-zoom { border-color: #d5dfe8; border-radius: 100px; }
.editor-zoom button { color: var(--editor-muted); border-radius: 100px; font-size: .75rem; padding-inline: 12px; }
.editor-zoom button[aria-pressed=true] { background: #e7f4fd; color: #006c9c; }
.editor-preview-stage { background: var(--sky, #e1f2fc); border-color: transparent; border-radius: 20px; }
.editor-preview-instruction { color: #445d72; font-size: .75rem; }
.editor-watermark-note { flex-shrink: 0; color: #445d72; font-size: .75rem; line-height: 1.6; text-align: center; margin: 8px 0 0; overflow-wrap: anywhere; }
.editor-total-label { color: var(--editor-muted); font-size: .75rem; letter-spacing: .055em; }
.editor-preview-footer strong { color: #1d2939; font-size: 1.625rem; letter-spacing: -.04em; }
.editor-preview-footer>span { color: var(--editor-muted); font-size: .75rem; }
.editor-preview-status { color: var(--editor-muted); font-size: .75rem; }
.editor-text-receipt { border-color: #e1e7ee; color: var(--editor-muted); font-size: .75rem; }
.editor-text-receipt summary { min-height: 44px; display: list-item; align-content: center; }
.editor-text-receipt>div { background: #f8fafc; border-radius: 9px; color: #344054; }

.editor-dialog { border-color: #dce3eb; border-radius: 24px; color: #101828; box-shadow: 0 24px 80px #10182824; }
.editor-dialog::backdrop { background: #10182866; }
.editor-dialog h2 { font-size: 1.5rem; letter-spacing: -.04em; }
.editor-dialog p { color: var(--editor-muted); font-size: .875rem; }
.editor-dialog .editor-eyebrow { color: #006c9c; font-size: .75rem; letter-spacing: .05em; font-weight: 600; }
.editor-dialog .editor-dialog-description { margin-bottom: 16px; }
.editor-dialog .editor-export-policy { background: #eff8fe; border: 1px solid #d5eaf7; border-radius: 11px; padding: 12px 14px; margin: 0 0 20px; font-size: .75rem; line-height: 1.65; overflow-wrap: anywhere; }
.editor-export-policy strong { color: #344054; font-weight: 600; }
.editor-export-policy a { color: #006c9c; text-decoration: underline; text-underline-offset: 3px; }
.editor-format-options { display: flex; flex-wrap: wrap; gap: 10px; }
.editor-format-options legend { color: #344054; font-size: .8125rem; }
.editor-format-options label { flex: 1 1 9em; min-width: 0; max-width: 100%; border-color: #cfd8e3; border-radius: 11px; padding: 13px 10px; }
.editor-format-options label:has(input:checked) { border-color: #77b5d6; background: #eff8fe; }
.editor-format-options strong { color: #344054; font-size: .8125rem; overflow-wrap: anywhere; }
.editor-format-options small { color: var(--editor-muted); font-size: .75rem; overflow-wrap: anywhere; }
.editor-dialog .editor-field-hint { font-size: .75rem; }
.editor-export-status { font-size: .8125rem!important; }
.editor-local-note { font-size: .75rem!important; }

@media (max-width: 1100px) {
  .editor .editor-tool-button { padding-inline: 11px; }
}

@media (max-width: 900px) {
  .editor { width: calc(100% - 48px); }
}

@media (max-width: 900px) and (min-width: 761px) {
  .editor .editor-tool-button { padding-inline: 0; }
  .editor-document h1 { font-size: 1.25rem; }
  .editor-document p,
  .editor-saved-state { font-size: .6875rem; }
  .editor-add-section button { font-size: .75rem; padding-inline: 9px; }
  .editor-add-section select { font-size: .75rem; }
}

@media (max-width: 760px) {
  .editor { width: calc(100% - 32px); padding-top: 0; padding-bottom: calc(6em + 25px); }
  .editor-toolbar { margin-bottom: 18px; padding: 13px 16px; background: #fff; }
  .editor-document h1 { font-size: 1.125rem; }
  .editor-document p,
  .editor-saved-state { font-size: .6875rem; }
  .editor-toolbar-actions { gap: 1px; }
  .editor-toolbar .editor-tool-button { padding: 0; background: transparent; border: 0; border-radius: 10px; }
  .editor-mode-tabs button { font-size: .875rem; }
  .editor-section-toggle { padding: 14px; }
  .editor-section-label small { font-size: .75rem; }
  .editor-section-content { padding: 16px 14px; }
  .editor-field input:not([type=checkbox]):not([type=range]):not([type=color]),
  .editor-field select,
  .editor-field textarea { font-size: 1rem; padding: 10px; }
  .editor-field label { font-size: .8125rem; }
  .editor-logo-header>span { font-size: .8125rem; }
  .editor-logo-header button { padding-inline: 10px; }
  .editor-logo-controls { padding: 12px; }
  .editor-item-heading .editor-icon-button { width: 44px; height: 44px; }
  .editor-line-total strong { font-size: .8125rem; }
  .editor-item-extra summary { font-size: .75rem; }
  .editor-add-section button,
  .editor-add-section select { font-size: .8125rem; }
  .editor-add-section button { padding-inline: 12px; }
  .editor-form-footer button { font-size: .75rem; }
  .editor-draft-hint { font-size: .75rem; }
  .editor-preview-heading h2 { font-size: .9375rem; }
  .editor-preview-stage { border-radius: 16px; }
  .editor-preview-instruction,
  .editor-preview-status { font-size: .75rem; }
  .editor-mobile-bar { display: flex; flex-wrap: wrap; align-items: center; background: #fffffffa; border-color: #dce3eb; box-shadow: 0 -4px 18px #10182808; gap: 4px; }
  .editor-mobile-bar button { flex: 1 0 max-content; max-width: 100%; color: var(--editor-muted); border-radius: 12px; font-size: .6875rem; overflow-wrap: anywhere; }
  .editor-mobile-bar button[aria-pressed=true] { color: #006c9c; background: #e8f5fd; }
  .editor-mobile-bar button[data-action=download] { color: #fff; background: var(--editor-blue); border-radius: 100px; padding-inline: 13px; }
  .editor-mobile-bar button[data-action=download]:hover { background: #006b9b; }
  .editor-mobile-total { flex: 1 0 max-content; flex-direction: row; align-items: baseline; justify-content: flex-end; max-width: 100%; gap: 8px; padding-block: 3px; overflow-x: auto; }
  .editor-mobile-total span { flex-shrink: 0; color: var(--editor-muted); font-size: .625rem; white-space: nowrap; }
  .editor-mobile-total strong { flex-shrink: 0; color: #1d2939; white-space: nowrap; overflow-wrap: normal; }
  .editor-dialog { border-radius: 20px; }
  .editor-dialog h2 { font-size: 1.375rem; }
  .editor-dialog .editor-field select { font-size: 1rem; }
  .editor-checkbox span { font-size: .875rem; }
  .editor-checkbox small { font-size: .75rem; }
}

@media (max-width: 360px) {
  .editor-document h1 { font-size: 1rem; }
  .editor-section-toggle { padding-inline: 12px; }
  .editor-section-content { padding-inline: 11px; }
  .editor-add-section button,
  .editor-add-section select { font-size: .75rem; }
  .editor-add-section button { padding-inline: 9px; }
  .editor-mobile-bar button { padding-inline: 7px; }
  .editor-mobile-bar button[data-action=download] { padding-inline: 10px; }
}

/* Preserve compact columns and wrapping when the user's root text size is enlarged. */
@container receipt-editor (max-width: 15rem) {
  .editor-toolbar { gap: 8px; }
  .editor-toolbar-actions { gap: 4px; }
  .editor-logo-header button { padding-inline: 10px; }
  .editor-mobile-bar button,
  .editor-mobile-bar button[data-action=download] { min-width: 0; padding-inline: 3px; border-radius: 12px; }
  .editor-dialog { padding-inline: 16px; }
}
