/* AirKiddy theme — Terminal CSS variables (https://terminalcss.xyz) */

:root {
    --global-font-size: 13px;
    --global-line-height: 1.35;
    --global-space: 6px;
    --page-width: 100%;
    --page-margin-x: 1rem;
    --page-margin-top: 0.75rem;
    --background-color: #fcfcfc;
    --font-color: #171717;
    --invert-font-color: #ffffff;
    --primary-color: #171717;
    --secondary-color: #737373;
    --error-color: #dc2626;
    /* 6 digit amounts: ch is content width; + pad/border because inputs use border-box */
    --money-input-width: calc(6ch + 0.6rem + 2px);
    --money-col-width: calc(6ch + 1.35rem);
    --money-cur-width: 3.25ch;
    --money-col-width-mixed: calc(var(--money-input-width) + 0.3rem + var(--money-cur-width) + 0.25rem);
    --progress-bar-fill: #171717;
    --display-h1-decoration: none;
    --font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --border-color: #e5e5e5;
    --border-subtle: #eee;
    --surface-muted: #f5f5f5;
    --surface-subtle: #fafafa;
    --surface-highlight: #fef9c3;
    --text-xs: 0.65rem;
    --text-sm: 0.75rem;
    --text-base: 0.8125rem;
    --gap-md: calc(var(--global-space) * 2);
    --gap-lg: calc(var(--global-space) * 3);
    --gap-xl: calc(var(--global-space) * 4);

    --ak-ok: #16a34a;
    --ak-ok-bright: #22c55e;
    --ak-ok-dim: #15803d;
    --ak-warn: #d97706;
    --field-height: 2rem;
    --field-padding-x: 0.45rem;
    --field-font-size: 0.8125rem;

    --code-bg-color: var(--surface-muted);
    --progress-bar-background: var(--border-color);
}

/* compact headings */
h1, h2, h3, h4 { margin-top: calc(var(--global-space) * 2); margin-bottom: var(--global-space); }
h1 { font-size: 1.25rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
h4 { font-size: 0.95rem; }

a:hover { background-color: var(--primary-color); color: var(--invert-font-color); }

body.terminal > header.container,
body.terminal > main.container {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: var(--page-margin-x);
    padding-right: var(--page-margin-x);
    box-sizing: border-box;
}

body.terminal > header.container {
    padding-top: var(--page-margin-top);
}

body.terminal > main.container {
    padding-top: var(--page-margin-top);
}

.site-header { margin-bottom: calc(var(--global-space) * 2); padding-bottom: var(--global-space); border-bottom: 1px solid var(--secondary-color); }
.site-header .site-nav {
    display: grid;
    grid-template-columns: 1fr minmax(14rem, 22rem) 1fr;
    align-items: center;
    gap: calc(var(--global-space) * 2);
}
.site-header .terminal-logo { justify-self: start; }
.site-header .site-search {
    justify-self: center;
    width: 100%;
    max-width: 22rem;
    position: relative;
}
.site-header .terminal-menu { justify-self: end; }
.site-header .terminal-menu ul {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: calc(var(--global-space) * 2);
}
.site-header .site-logo {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}
.site-header .site-logo::before,
.site-header .site-logo::after {
    content: none !important;
    display: none !important;
    animation: none !important;
}
.search-field {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0 0.75rem;
    min-height: var(--field-height);
    border: 1px solid var(--border-color);
    border-radius: 1.1rem;
    background: #fff;
    box-sizing: border-box;
    cursor: text;
}
.search-field:focus-within {
    border-color: var(--font-color);
}
.search-icon {
    flex-shrink: 0;
    width: 0.95rem;
    height: 0.95rem;
    color: var(--secondary-color);
}
#search-wrapper #global-search {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0.35rem 0;
    border: none;
    background: transparent;
    font: inherit;
    font-size: inherit;
    outline: none;
    box-shadow: none;
}
#search-wrapper #global-search::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

#search-results-container {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100vw - 2 * var(--page-margin-x)), 72rem);
    margin-top: 4px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 50;
    background: var(--background-color);
    border: 1px solid var(--font-color);
    border-radius: 0.35rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
#search-results-container.hidden { display: none; }

.search-section-title {
    padding: 0.35rem 0.65rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--secondary-color);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--secondary-color);
}
.search-hit {
    display: block;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid var(--border-subtle);
    color: inherit;
    text-decoration: none;
    font-size: 0.8125rem;
}
.search-hit:hover { background: var(--surface-muted); color: var(--font-color); }

.search-lead-card {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}
.search-lead-card:last-child { border-bottom: none; }
.search-lead-event {
    display: block;
    margin-bottom: 0.5rem;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.35;
    color: var(--secondary-color);
    text-decoration: none;
}
.search-lead-fields {
    display: grid;
    grid-template-columns:
        minmax(5rem, 0.9fr)
        minmax(5rem, 0.9fr)
        minmax(9rem, 2.2fr)
        minmax(8rem, 1.6fr)
        minmax(7rem, 1.3fr)
        var(--money-col-width)
        var(--money-col-width)
        var(--money-col-width)
        minmax(6.5rem, 1fr);
    align-items: center;
    gap: 0.35rem;
}
.search-lead-fields .lead-field {
    display: flex;
    align-items: center;
    min-width: 0;
}
.search-lead-fields .col-first .inline-input,
.search-lead-fields .col-last .inline-input,
.search-lead-fields .col-email .inline-input,
.search-lead-fields .col-phone .inline-input {
    width: 100%;
    min-width: 0;
    max-width: none;
}
.search-lead-fields .col-phone .phone-cell { width: 100%; }
.search-lead-fields .col-status .status-picker { width: 100%; min-width: 0; max-width: none; }
.search-lead-fields .col-status .status-picker-trigger { max-width: none; width: 100%; }
.search-lead-fields .col-paid .inline-input,
.search-lead-fields .col-total .inline-input {
    width: var(--money-input-width);
    min-width: var(--money-input-width);
    max-width: none;
}
.search-lead-fields .col-remainder .money-amount {
    width: 100%;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.search-lead-fields .col-first .first-cell {
    width: 100%;
    min-width: 0;
}
.search-lead-fields .col-notes .note-add-input { width: 100%; min-width: 0; }
.search-lead-fields .inline-input { width: 100%; min-width: 0; }

.toolbar { display: flex; justify-content: flex-end; gap: var(--global-space); margin-bottom: calc(var(--global-space) * 2); flex-wrap: wrap; }
.page-head { margin-bottom: calc(var(--global-space) * 2); padding-bottom: var(--global-space); border-bottom: 1px solid var(--secondary-color); }
.page-head-main { width: 100%; min-width: 0; }
.page-head-title-row {
    margin-bottom: var(--global-space);
}
.page-head-title-row h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin: 0;
}
.event-title-price {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--secondary-color);
}
.event-title-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.15rem;
}
.event-title-action {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--secondary-color);
    cursor: pointer;
    text-decoration: underline;
}
a.event-title-action {
    display: inline;
}
.event-title-action:hover,
.event-title-action:focus {
    color: var(--font-color);
    outline: none;
}
.event-title-action.is-current {
    color: var(--font-color);
    text-decoration: none;
    font-weight: 600;
    cursor: default;
}
.event-head-summary { margin: 0 0 var(--global-space); font-variant-numeric: tabular-nums; }
.money-collected { color: var(--ak-ok-bright); font-weight: 600; }
.money-due { color: var(--ak-ok-dim); font-weight: 600; }
.event-head-half { max-width: 50%; }
.lead-progress {
    display: flex;
    width: 100%;
    height: 0.6rem;
    gap: 2px;
    margin-bottom: var(--global-space);
}
.lead-progress-seg {
    flex: 1 1 0;
    min-width: 0;
    border: none;
    padding: 0;
    margin: 0;
    background: var(--border-color);
    cursor: pointer;
    transition: outline-color 0.1s ease, transform 0.1s ease;
}
.lead-progress-seg.is-unpaid { background: var(--border-color); }
.lead-progress-seg.is-partial { background: #bbf7d0; }
.lead-progress-seg.is-paid { background: var(--ak-ok); }
.lead-progress-seg:hover,
.lead-progress-seg:focus-visible {
    outline: 1px solid var(--font-color);
    outline-offset: -1px;
    transform: scaleY(1.15);
    z-index: 1;
}
.event-meta-line {
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.muted { color: var(--secondary-color); font-size: var(--text-base); }
.row-link { cursor: pointer; }
.row-link:hover { background: var(--surface-muted); }
.text-ok { color: var(--ak-ok); }
.text-warn { color: var(--ak-warn); }
.text-danger { color: var(--error-color); }

/* — UI primitives (badges, tabs, panels, buttons) — */
.badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--border-color);
    font-size: var(--text-sm);
    line-height: 1.3;
    background: var(--surface-muted);
    vertical-align: middle;
}
.badge--label {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 0.25rem;
}
.badge--custom {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}
.badge--global { background: var(--surface-muted); }
.badge--pill,
.subtotal-status-pill {
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.03em;
}

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-md);
    margin: 0;
    padding: 0;
}
.tab-bar--loose { gap: var(--gap-xl); }
.tab {
    margin: 0;
    padding: 0.25rem 0;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--secondary-color);
    cursor: pointer;
    min-width: auto;
    line-height: 1.4;
}
.tab:hover,
.tab:focus {
    color: var(--font-color);
    background: transparent;
    border-color: transparent;
}
.tab.is-active {
    color: var(--font-color);
    font-weight: 700;
    border-bottom-color: var(--font-color);
}
.settings-tab { margin-right: var(--global-space); }

.panel {
    padding: var(--gap-md);
    border: 1px solid var(--border-color);
    background: var(--surface-subtle);
    box-sizing: border-box;
}
.panel h4 {
    margin-top: 0;
    margin-bottom: var(--gap-md);
    font-size: 0.85rem;
}

.btn.btn-icon {
    min-width: 0;
    width: auto;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    line-height: 1;
    opacity: 0.55;
}
.btn.btn-icon:hover,
.btn.btn-icon:focus {
    opacity: 1;
    outline: none;
}
.btn.btn-icon--destructive:hover,
.btn.btn-icon--destructive:focus {
    color: var(--error-color);
}

.field-label {
    display: block;
    margin: 0 0 0.25rem;
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--font-color);
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
}
.auth-form .field-label { margin: 0; }
.auth-form label.field-label { margin-top: calc(var(--global-space) * 0.5); }
.auth-form label.field-label:first-of-type { margin-top: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(var(--global-space) * 2); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.field-control,
.auth-form input:not([type="checkbox"]),
.auth-form select,
dialog form.dialog-form input:not([type="checkbox"]),
dialog form.dialog-form select,
.day-row input {
    display: block;
    width: 100%;
    height: var(--field-height);
    min-height: var(--field-height);
    margin: 0;
    padding: 0 var(--field-padding-x);
    box-sizing: border-box;
    font: inherit;
    font-size: var(--field-font-size);
    line-height: 1.2;
    background: var(--background-color);
    color: var(--font-color);
    border: 1px solid var(--font-color);
}
.field-control:focus,
.auth-form input:not([type="checkbox"]):focus,
.auth-form select:focus,
dialog form.dialog-form input:not([type="checkbox"]):focus,
dialog form.dialog-form select:focus,
.day-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}
dialog form.dialog-form input[type="date"],
dialog form.dialog-form input[type="time"],
dialog form.dialog-form input[type="number"],
.day-row input[type="date"],
.day-row input[type="time"] {
    appearance: none;
    -webkit-appearance: none;
}
dialog form.dialog-form input[type="date"]::-webkit-date-and-time-value,
.day-row input[type="date"]::-webkit-date-and-time-value {
    min-height: 1.2em;
    line-height: 1.2;
}
dialog form.dialog-form select {
    padding-right: 1.75rem;
}

.day-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 4.5rem;
    gap: calc(var(--global-space) * 2);
    align-items: end;
}
.day-row label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    min-width: 0;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
}
.day-row-remove {
    width: 100%;
    height: var(--field-height);
    min-height: var(--field-height);
    padding: 0 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.day-row-spacer { display: block; width: 100%; height: var(--field-height); }

input.inline-input {
    width: 100%;
    margin: 0;
    padding: 0.2rem 0.35rem;
    border: 1px solid var(--border-color);
    background: #fff;
    font: inherit;
    font-size: inherit;
    line-height: 1.35;
    box-sizing: border-box;
}
input.inline-input:focus { border-color: var(--font-color); outline: none; }

.table-scroll { overflow-x: auto; margin-bottom: calc(var(--global-space) * 2); }
.table-scroll figure { margin: 0; }
#leadsTable tr.lead-row-highlight td { background-color: var(--surface-highlight); }
figure table th { text-align: left; }

.table-data,
.table-leads {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.8125rem;
    line-height: 1.25;
}
.table-data .inline-input,
.table-leads .inline-input {
    padding: 0.15rem 0.3rem;
    line-height: 1.25;
}
.table-data th,
.table-data td,
.table-leads th,
.table-leads td {
    display: table-cell;
    padding: 0.25rem 0.45rem;
    vertical-align: middle;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}
.table-data th,
.table-leads th {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
    background: var(--surface-muted);
    text-align: left;
}
.table-events {
    width: 100%;
    table-layout: fixed;
}
.table-events col.col-event { width: 46%; }
.table-events col.col-leads { width: 11%; }
.table-events col.col-paid-contacts { width: 13%; }
.table-events col.col-paid { width: 15%; }
.table-events col.col-potential { width: 15%; }
.table-events .col-event { white-space: normal; }
.table-events th.col-leads,
.table-events th.col-paid-contacts,
.table-events td.col-leads,
.table-events td.col-paid-contacts { text-align: center; }
.table-events th.col-paid,
.table-events th.col-potential,
.table-events td.col-paid,
.table-events td.col-potential { text-align: right; }
.table-events td.col-paid .money-amount,
.table-events td.col-potential .money-amount { display: block; text-align: right; }
.table-events .events-empty-row td { vertical-align: middle; }
.events-section { margin-bottom: calc(var(--global-space) * 3); }
.events-section:last-child { margin-bottom: 0; }
.events-section > h3 { margin-bottom: calc(var(--global-space) * 1.5); }
.table-scroll-events { margin-bottom: 0; }
.table-leads .col-first,
.table-leads .col-last,
.table-leads .col-email,
.table-leads .col-phone {
    min-width: 0;
}
.table-leads .col-first .inline-input,
.table-leads .col-last .inline-input,
.table-leads .col-email .inline-input,
.table-leads .col-phone .inline-input {
    width: 100%;
    min-width: 0;
    max-width: none;
}
.first-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
}
.first-cell .inline-input {
    flex: 1;
    min-width: 0;
}
.table-leads col.col-notes { width: 5.5rem; }
.table-leads col.col-status { width: var(--status-col-width, 13rem); }
.table-leads .col-status {
    min-width: 0;
    white-space: nowrap;
}
.table-leads col.col-reg { width: 5.25rem; }
.table-leads col.col-country { width: 4.25rem; }
.table-leads col.col-delete { width: 1.75rem; }
.table-leads col.col-paid,
.table-leads col.col-total,
.table-leads col.col-remainder {
    width: var(--money-col-width);
}
.table-leads.table-leads--mixed col.col-paid,
.table-leads.table-leads--mixed col.col-total,
.table-leads.table-leads--mixed col.col-remainder {
    width: var(--money-col-width-mixed);
}
.phone-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
}
.phone-cell .inline-input {
    flex: 1;
    min-width: 0;
}
.phone-cell .wa-icon-link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    line-height: 0;
    color: #25d366;
    text-decoration: none;
    cursor: pointer;
}
.phone-cell .wa-icon-link:hover,
.phone-cell .wa-icon-link:focus {
    background: transparent;
    color: #128c7e;
}
.phone-cell .icon-wa {
    display: block;
    width: 0.85rem;
    height: 0.85rem;
}
.table-leads .col-reg { min-width: 0; }
.table-leads .col-country { min-width: 0; white-space: nowrap; }
.table-leads .col-paid,
.table-leads .col-total,
.table-leads .col-remainder {
    min-width: 0;
}
.table-leads th.col-paid,
.table-leads th.col-total,
.table-leads th.col-remainder,
.table-leads td.col-paid,
.table-leads td.col-total,
.table-leads td.col-remainder {
    text-align: right;
    overflow: hidden;
    padding-left: 0.85rem;
    padding-right: 0.45rem;
}
.table-leads .money-field {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.35rem;
}
.table-leads .money-field .inline-input-num {
    flex: 0 0 auto;
    width: var(--money-input-width);
    min-width: var(--money-input-width);
    max-width: var(--money-input-width);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.table-leads input.inline-input-num[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.table-leads input.inline-input-num[type="number"]::-webkit-outer-spin-button,
.table-leads input.inline-input-num[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.table-leads .money-field .money-cur {
    flex: 0 0 var(--money-cur-width);
    text-align: left;
}
.table-leads .col-remainder .money-amount {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.table-leads .col-remainder .money-amount .money-cur {
    flex: 0 0 var(--money-cur-width);
}
.th-unit {
    font-weight: 400;
    color: var(--secondary-color);
    letter-spacing: 0;
    text-transform: none;
}
.table-leads .col-notes {
    min-width: 0;
}
.table-leads .col-notes .note-add-input {
    width: 100%;
    min-width: 0;
    max-width: none;
}
.table-leads .col-delete {
    width: 1.75rem;
    min-width: 1.75rem;
    padding: 0.25rem 0.35rem;
    text-align: center;
    vertical-align: middle;
}
.table-subtotal td {
    background: #fff;
    border-top: none;
    font-size: 0.75rem;
    font-weight: 600;
}
.table-subtotal-head td,
.table-subtotal-head .subtotal-tab-cell {
    border: none !important;
    background: transparent !important;
    padding: 0.65rem 0 0 0 !important;
    vertical-align: bottom;
    line-height: 0;
}
.table-subtotal-head:first-child td {
    padding-top: 0.25rem !important;
}
.subtotal-tab-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    line-height: 1;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    min-height: 2rem;
}
.subtotal-tab-inline {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: 0.65rem;
    line-height: 1.2;
}
.subtotal-tab-money {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: inherit;
    align-self: flex-end;
    margin-bottom: 0.42rem;
}
.subtotal-money-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
}
.subtotal-money-label {
    font-size: inherit;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--secondary-color);
}
.subtotal-money-item .money-amount {
    font-size: inherit;
    font-weight: 700;
}
.subtotal-tab-group {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.4rem;
    flex-shrink: 0;
}
.table-subtotal-head .subtotal-tab-bar .folder-tab {
    align-self: flex-end;
    flex-shrink: 0;
    font-size: inherit;
}
.table-subtotal-head .subtotal-tab-cell {
    text-align: left;
    padding-left: 0 !important;
    padding-right: 0 !important;
    position: relative;
}
.folder-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem 0.45rem;
    border: 1px solid var(--border-color);
    border-bottom: 1px solid var(--surface-subtle);
    border-radius: 8px 8px 0 0;
    font-size: inherit;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #171717;
    line-height: 1.2;
    position: relative;
    z-index: 2;
    margin: 0 0 -1px 0;
    vertical-align: bottom;
}
.folder-tab-label { white-space: nowrap; }
.folder-tab-count {
    font-variant-numeric: tabular-nums;
    font-weight: 400;
    color: var(--secondary-color);
    margin-bottom: 0.42rem;
}
.table-subtotal-head + tr[data-lead-id] td {
    background: var(--surface-subtle);
    border-top: none !important;
}
.table-subtotal-head ~ tr[data-lead-id] td {
    background: var(--surface-subtle);
    border-left-color: var(--border-color);
    border-right-color: var(--border-color);
}
.table-subtotal-head ~ tr[data-lead-id]:has(+ tr.table-subtotal-head) td {
    border-bottom-color: var(--border-color);
}
.table-subtotal .subtotal-label {
    text-align: left;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.subtotal-status-pill {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    vertical-align: middle;
}
.subtotal-count {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--font-color);
    font-variant-numeric: tabular-nums;
}
.money-amount { font-variant-numeric: tabular-nums; }
.money-field { display: flex; align-items: center; gap: 0.25rem; }
.money-field .inline-input-num { flex: 1; min-width: 0; }
.money-cur { font-size: 0.65rem; font-weight: 600; color: var(--secondary-color); white-space: nowrap; }
.online-pricing-panel { margin-bottom: var(--gap-md); }
.online-pricing-panel h4 { margin: 0 0 var(--global-space); }
.online-pricing-hint { margin: 0 0 calc(var(--global-space) * 2); font-size: 0.75rem; }
.online-price-row { margin-bottom: var(--global-space); align-items: end; }
.online-price-cur-label { font-size: 0.75rem; font-weight: 700; color: var(--secondary-color); align-self: end; padding-bottom: 0.35rem; }
.event-online-prices { font-size: 0.85rem; font-weight: 500; }
.event-price-tier .muted { font-weight: 400; font-size: 0.75rem; }
.subtotal-breakdown { font-size: 0.68rem; line-height: 1.35; white-space: normal; }
.partial-tag { font-size: 0.68rem; font-weight: 600; font-style: italic; color: #b45309; white-space: nowrap; }
.subtotal-breakdown .partial-tag { font-size: 0.65rem; }
.table-subtotal td.col-paid,
.table-subtotal td.col-total,
.table-subtotal td.col-remainder { vertical-align: top; }
.inline-input-num { width: 100%; box-sizing: border-box; }

.btn-note-postit {
    position: relative;
    flex-shrink: 0;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 0.45rem 0 0.35rem;
    border: none;
    border-radius: 0;
    background: #fef9c4;
    color: #5a4a00;
    font: inherit;
    font-size: inherit;
    font-weight: 600;
    line-height: 1;
    box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.btn-note-postit::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: linear-gradient(225deg, #fffef5 0%, #fffef5 42%, #e8dc82 43%, #d4c96e 100%);
    pointer-events: none;
}
.btn-note-postit:hover,
.btn-note-postit:focus {
    background: #fef08a;
    color: #4a3d00;
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.14);
    outline: none;
}

.status-tag {
    display: inline-block;
    width: auto;
    min-width: 5.5rem;
    max-width: 7rem;
    border-radius: 999px;
    padding: 0.15rem 0.4rem;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid var(--border-color);
    color: #171717;
    cursor: pointer;
    background: var(--surface-muted);
    text-align: center;
}

.status-picker {
    position: relative;
    width: 100%;
    min-width: 0;
}
.status-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    max-width: none;
    min-width: 0;
    text-align: left;
    box-sizing: border-box;
}
.table-leads .col-status .status-picker {
    width: fit-content;
    max-width: 100%;
}
.table-leads .status-picker-trigger,
.table-leads .status-picker-option {
    max-width: none;
}
.table-leads .status-picker-trigger {
    width: auto;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-start;
}
.table-leads .status-picker-label {
    flex: 0 1 auto;
    overflow: visible;
    text-overflow: clip;
}
.status-picker-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.status-picker-menu {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.3rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    max-height: 16rem;
    overflow-y: auto;
}
.status-picker-menu.hidden {
    display: none;
}
.status-picker-option {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
    border-radius: 999px;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}
.status-picker-option[aria-selected="true"] {
    outline: 2px solid #171717;
    outline-offset: 1px;
}
.status-picker-option:hover,
.status-picker-option:focus {
    filter: brightness(0.97);
    outline: 2px solid #171717;
    outline-offset: 1px;
}

.status-cell {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.email-template-key {
    font-size: 0.6875rem;
    margin: 0 0 0.35rem;
    opacity: 0.7;
}

.settings-subnav {
    display: flex;
    gap: calc(var(--global-space) * 0.6);
    margin: calc(var(--global-space) * 1.25) 0 var(--gap-xl);
}

.status-label-fixed {
    flex: 1;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    line-height: 1.3;
}

.status-item-airtable .status-label-fixed {
    cursor: default;
}

.table-dense td, .table-dense th { font-size: 0.8125rem; padding: 0.5rem 0.65rem; vertical-align: top; }

.hidden { display: none !important; }

#saveIndicatorGlobal {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.35rem 0.65rem;
    background: var(--font-color);
    color: var(--invert-font-color);
    font-size: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 9999;
    border: 1px solid var(--font-color);
}
#saveIndicatorGlobal.show { opacity: 1; }

/* native dialog — Terminal CSS has no modal module */
dialog {
    border: 1px solid var(--font-color);
    padding: calc(var(--global-space) * 2);
    max-width: 42rem;
    width: 95vw;
    background: var(--background-color);
    color: var(--font-color);
}
dialog::backdrop { background: rgba(21, 21, 21, 0.35); }
dialog header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--global-space);
    margin-bottom: var(--global-space);
}
dialog header h3 { margin: 0; }
dialog header .dialog-close {
    border: none;
    background: transparent;
    padding: 0;
    min-width: auto;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--font-color);
    cursor: pointer;
    flex-shrink: 0;
}
dialog header .dialog-close:hover,
dialog header .dialog-close:focus {
    border: none;
    background: transparent;
    color: var(--secondary-color);
    outline: none;
}
dialog footer { margin-top: calc(var(--global-space) * 2); text-align: right; }

/* Notes modal — conversation timeline */
.notes-dialog {
    max-width: 34rem;
    padding: calc(var(--global-space) * 1.5);
}
.notes-dialog > article {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    border: none;
    padding: 0;
}
.notes-dialog header {
    margin-bottom: calc(var(--global-space) * 0.75);
    padding-bottom: calc(var(--global-space) * 0.75);
    border-bottom: 1px solid rgba(21, 21, 21, 0.1);
}
.notes-dialog header h3 {
    font-size: 0.9375rem;
    line-height: 1.35;
}
.notes-timeline {
    max-height: min(58vh, 26rem);
    overflow-y: auto;
    margin: 0 calc(var(--global-space) * -0.5);
    padding: calc(var(--global-space) * 0.5) calc(var(--global-space) * 0.5) 0;
    scrollbar-width: thin;
}
.notes-empty {
    margin: 0;
    padding: calc(var(--global-space) * 1.25) 0;
    font-size: 0.75rem;
}
.notes-thread {
    display: flex;
    flex-direction: column;
    gap: calc(var(--global-space) * 0.65);
}
.note-item {
    padding: calc(var(--global-space) * 0.75) calc(var(--global-space) * 0.85);
    border-radius: 4px;
    background: rgba(21, 21, 21, 0.035);
    border-left: 2px solid rgba(21, 21, 21, 0.14);
}
.note-item:nth-child(even) {
    background: rgba(21, 21, 21, 0.06);
    border-left-color: rgba(21, 21, 21, 0.22);
}
.note-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: calc(var(--global-space) * 1.5);
    margin-bottom: 0.25rem;
}
.note-meta-label {
    font-size: 0.5625rem;
    line-height: 1.35;
    color: var(--secondary-color);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.note-action-delete {
    border: none;
    background: transparent;
    padding: 0;
    min-width: auto;
    font-size: 0.5625rem;
    line-height: 1.35;
    color: var(--secondary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.12s, color 0.12s;
}
.note-item:hover .note-action-delete,
.note-item:focus-within .note-action-delete {
    opacity: 1;
}
.note-action-delete:hover,
.note-action-delete:focus {
    border: none;
    background: transparent;
    color: var(--font-color);
    outline: none;
}
.note-body {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--font-color);
    font: inherit;
    font-size: 0.75rem;
    line-height: 1.5;
    resize: none;
    overflow: hidden;
    box-shadow: none;
    outline: none;
    field-sizing: content;
}
.note-body:focus {
    border: none;
    outline: none;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 2px;
}
.notes-dialog .notes-composer {
    margin: calc(var(--global-space) * 1.25) 0 0;
    padding-top: calc(var(--global-space) * 1.25);
    border-top: 1px solid rgba(21, 21, 21, 0.12);
}
.notes-composer {
    width: 100%;
    margin: 0;
    padding: calc(var(--global-space) * 0.75) calc(var(--global-space) * 1);
    border: 1px solid rgba(21, 21, 21, 0.18);
    background: var(--background-color);
    color: var(--font-color);
    font: inherit;
    font-size: 0.8125rem;
    line-height: 1.45;
    resize: none;
    overflow: hidden;
    box-sizing: border-box;
    min-height: 2rem;
}
.notes-composer:focus {
    border-color: var(--font-color);
    outline: none;
}

dialog form.dialog-form {
    display: flex;
    flex-direction: column;
    gap: calc(var(--global-space) * 2);
}
dialog form.dialog-form > label,
dialog form.dialog-form .form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    width: 100%;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
}
dialog form.dialog-form label:has(> input[type="checkbox"]) {
    flex-direction: row;
    align-items: center;
    gap: calc(var(--global-space) * 1.5);
    font-size: 0.8125rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--font-color);
}
dialog form.dialog-form textarea {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    min-height: calc(var(--field-height) * 2);
    padding: 0.35rem var(--field-padding-x);
    font-size: var(--field-font-size);
    line-height: 1.35;
}
dialog form.dialog-form .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: calc(var(--global-space) * 2);
}
dialog form.dialog-form .form-grid-3 {
    grid-template-columns: minmax(0, 1fr) minmax(5.5rem, 0.55fr) minmax(0, 1fr);
}
dialog .form-section {
    margin-top: 0;
}
dialog .form-section h4 {
    margin-bottom: var(--gap-md);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--secondary-color);
}
dialog .form-section .day-row {
    padding: calc(var(--global-space) * 1.5) 0;
    border-bottom: 1px solid var(--border-color);
}
dialog .form-section .day-row:first-of-type { padding-top: 0; }
dialog .form-section .day-row:last-of-type {
    padding-bottom: 0;
    border-bottom: none;
}
dialog .form-section > .btn { margin-top: calc(var(--global-space) * 2); }
@media (max-width: 640px) {
    dialog form.dialog-form .form-grid,
    dialog form.dialog-form .form-grid-3,
    .day-row {
        grid-template-columns: 1fr;
    }
    .day-row-remove,
    .day-row-spacer { display: none; }
}

.login-box { max-width: 22rem; margin: 2rem auto; padding: calc(var(--global-space) * 3); border: 1px solid var(--font-color); }
.register-box { max-width: 28rem; }
.register-pricing { margin: calc(var(--global-space) * 1.5) 0; font-size: 0.9rem; }
.register-footer { margin-top: calc(var(--global-space) * 2); margin-bottom: 0; text-align: center; }
.text-success { color: #166534; }

/* Public registration (Spanish, compact) */
.register-public {
    width: 100%;
    max-width: 21rem;
    margin: 1.25rem auto 2rem;
    padding: calc(var(--global-space) * 2.5) calc(var(--global-space) * 2);
    border: 2px solid #e8c4f0;
    border-radius: 14px;
    background: linear-gradient(165deg, #fffefb 0%, #fdf6ff 55%, #f5fbff 100%);
    box-shadow: 0 6px 24px rgba(120, 80, 160, 0.08);
    box-sizing: border-box;
}
.register-public .register-header {
    text-align: center;
    margin-bottom: calc(var(--global-space) * 2);
}
.register-public .register-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--global-space) * 1.1);
}
.register-public .register-logo {
    display: block;
    width: auto;
    height: 2.35rem;
    object-fit: contain;
    flex-shrink: 0;
}
.register-public .register-brand-name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #5c3f72;
    line-height: 1;
}
.register-public .register-tagline {
    margin: calc(var(--global-space) * 0.75) 0 0;
    font-size: var(--text-sm);
    color: #7a6b8a;
}
.register-public .register-tagline p {
    margin: 0;
}
.register-public .register-tagline p + p {
    margin-top: calc(var(--global-space) * 1.25);
}
.register-public .register-form {
    gap: calc(var(--global-space) * 1.25);
}
.register-public .register-field {
    min-width: 0;
}
.register-public .register-form .field-label {
    margin: 0 0 calc(var(--global-space) * 0.35);
    font-size: var(--text-sm);
    font-weight: 600;
    color: #5c4f6b;
}
.register-public .register-form .field-control {
    width: 100%;
    min-height: calc(var(--field-height) - 2px);
    padding-top: calc(var(--field-padding-x) - 2px);
    padding-bottom: calc(var(--field-padding-x) - 2px);
    font-size: 16px;
    border-radius: 8px;
    border-color: #ddd0e8;
    background: rgba(255, 255, 255, 0.85);
    box-sizing: border-box;
}
.register-public .register-form .field-control:focus {
    border-color: #c9a0dc;
    box-shadow: 0 0 0 2px rgba(201, 160, 220, 0.25);
}
.register-public .register-form .field-control::placeholder {
    color: #b5a8c0;
    opacity: 1;
}
.register-public .register-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--global-space) * 1.25);
}
.register-public .register-submit {
    margin-top: calc(var(--global-space) * 0.5);
    min-height: 2.75rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #b87fd4 0%, #9b6fc9 100%);
    border-color: #8f5fbe;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.register-public .register-submit:hover {
    background: linear-gradient(135deg, #a86ec8 0%, #8b5fb8 100%);
}
.register-public .register-error {
    margin: 0 0 calc(var(--global-space) * 1.5);
    padding: calc(var(--global-space) * 0.75) calc(var(--global-space) * 1);
    font-size: var(--text-sm);
    border-radius: 8px;
    background: #fef2f2;
}
.register-public .register-empty {
    margin: 0;
    text-align: center;
    font-size: var(--text-sm);
    color: #7a6b8a;
}
.register-public .register-success {
    text-align: center;
}
.register-public .register-success-icon {
    margin: 0 0 calc(var(--global-space) * 0.75);
    font-size: 1.5rem;
    animation: register-pop-in 0.5s ease-out;
}
.register-public .register-success-title {
    margin: 0 0 calc(var(--global-space) * 1);
    font-size: 0.95rem;
    font-weight: 600;
}
.register-public .register-event-summary,
.register-public .register-success-note {
    margin: calc(var(--global-space) * 0.75) 0 0;
    font-size: var(--text-sm);
    color: #6b5f78;
}
.register-public .register-pricing {
    margin: calc(var(--global-space) * 1) 0 0;
    font-size: var(--text-sm);
}
.register-public .register-spam-tip {
    margin: calc(var(--global-space) * 1.25) auto 0;
    max-width: 16rem;
    padding: calc(var(--global-space) * 0.85) calc(var(--global-space) * 1.1);
    font-size: var(--text-xs);
    line-height: 1.45;
    color: #8a7a96;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px dashed #e0cfe8;
}
.register-public .register-instagram {
    margin: calc(var(--global-space) * 2) 0 0;
    font-size: var(--text-sm);
}
.register-public .register-instagram a {
    display: inline-block;
    padding: calc(var(--global-space) * 0.75) calc(var(--global-space) * 1.5);
    border-radius: 999px;
    border: 1px solid #e8c4f0;
    background: rgba(255, 255, 255, 0.7);
    color: #7a4f9a;
    font-weight: 600;
    text-decoration: none;
}
.register-public .register-instagram a:hover {
    background: #f3e6f8;
    color: #5c3a78;
}
@keyframes register-pop-in {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
@media (max-width: 480px) {
    .register-public {
        max-width: 100%;
        margin-top: 0.5rem;
        margin-bottom: 1.5rem;
        padding: calc(var(--global-space) * 2) calc(var(--global-space) * 1.5);
        padding-bottom: calc(var(--global-space) * 2 + env(safe-area-inset-bottom, 0px));
    }
    .register-public .register-field-row {
        grid-template-columns: 1fr;
    }
}


.status-item {
    display: flex;
    align-items: center;
    gap: var(--global-space);
    padding: calc(var(--global-space) * 0.75) var(--global-space);
    margin-bottom: calc(var(--global-space) / 2);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    font-size: 0.8125rem;
}

.status-item .status-label-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.status-item .status-row-btn {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.status-color-input {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.45);
}
#status-list-airkiddy,
#status-list-airtable {
    padding-bottom: 50vh;
}

/* — Email compose (event tab) — */
.page-head--compose .event-head-summary,
.page-head--compose .lead-progress {
    display: none;
}
.page-head--compose .event-meta-line {
    font-size: 0.75rem;
    opacity: 0.85;
}

.email-compose {
    max-width: 72rem;
    margin: 0 auto;
    padding: var(--gap-xl) 0 calc(var(--global-space) * 8);
}
.email-compose-header {
    margin-bottom: var(--gap-xl);
}
.email-compose-utils {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--global-space) var(--gap-xl);
}
.email-compose-util {
    font-size: 0.8125rem;
    color: var(--secondary-color);
}
.email-compose-util summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
    padding: 0.25rem 0;
}
.email-compose-util summary::-webkit-details-marker {
    display: none;
}
.email-compose-util summary::before {
    content: "▸ ";
    display: inline-block;
    width: 1rem;
    color: var(--secondary-color);
}
.email-compose-util[open] summary::before {
    content: "▾ ";
}
.email-compose-util[open] summary {
    color: var(--font-color);
}
.email-compose-util-body {
    padding: calc(var(--global-space) * 1.25) 0 var(--global-space) var(--gap-xl);
    max-width: 28rem;
}
.email-compose-util-hint {
    margin: 0 0 calc(var(--global-space) * 1.25);
    font-size: var(--text-sm);
    line-height: 1.45;
}
.email-compose-util-hint code {
    font-size: 0.7rem;
}
.email-compose-util-actions {
    margin-top: calc(var(--global-space) * 1.25);
}
.email-compose-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--gap-xl);
    align-items: start;
}
.email-compose-edit {
    min-width: 0;
}
.email-compose-preview-pane {
    min-width: 0;
    position: sticky;
    top: var(--gap-xl);
    padding: 0 0 0 var(--gap-xl);
    border-left: 1px solid var(--border-subtle);
}
.email-preview-pane-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--global-space) var(--gap-xl);
    margin-bottom: var(--gap-xl);
}
.email-preview-pane-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.email-preview-pane-as {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
}
.email-preview-pane-as select {
    width: 100%;
    max-width: 14rem;
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
    border-color: var(--border-color);
}
.email-preview-pane-sample {
    font-size: 0.75rem;
}
.email-preview-pane-meta,
.email-preview-pane-to {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    line-height: 1.4;
}
.email-preview-pane-subject {
    margin: 0 0 var(--gap-xl);
    padding: var(--global-space) 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.email-preview-pane-subject strong,
.email-preview-pane-body strong {
    font-weight: inherit;
    font-size: inherit;
    background: var(--surface-highlight);
    padding: 0.08em 0.22em;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.email-preview-pane-subject a,
.email-preview-pane-body a {
    color: #2563eb;
    background: transparent;
    padding: 0;
    border-radius: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.email-preview-pane-subject a:hover,
.email-preview-pane-body a:hover {
    background: transparent;
    color: #1d4ed8;
}
.email-preview-pane-subject strong a,
.email-preview-pane-body strong a {
    background: var(--surface-highlight);
    padding: 0.08em 0.22em;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.email-preview-pane-body {
    font-size: 0.9375rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: min(52vh, 28rem);
}
@media (max-width: 960px) {
    .email-compose-split {
        grid-template-columns: 1fr;
    }
    .email-compose-preview-pane {
        position: static;
        padding: var(--gap-xl) 0 0;
        border-left: none;
        border-top: 1px solid var(--border-subtle);
    }
}
.email-compose-nav {
    margin-bottom: var(--gap-xl);
}
.email-compose-nav .tab.is-active { font-weight: 500; }
.email-compose-panels {
    margin: 0;
}
.email-compose-field {
    margin: 0;
}
.email-compose-field--subject {
    margin-bottom: 0;
}
.email-compose-field--body {
    margin-top: var(--gap-xl);
}
.email-compose-field .email-rich-field {
    width: 100%;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    outline: none;
    box-shadow: none;
}
.email-compose-field--subject .email-rich-field {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.45;
    min-height: 2.5rem;
}
.email-compose-field--subject .email-rich-field:focus {
    border-bottom-color: var(--font-color);
    outline: none;
}
.email-compose-field--body .email-rich-field {
    min-height: min(48vh, 24rem);
    font-size: 0.9375rem;
    line-height: 1.65;
    padding: 0;
}
.email-compose-field--body .email-rich-field:focus {
    outline: none;
}
.email-compose-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--gap-xl);
    padding-top: var(--gap-xl);
}
.email-var-caret-widget {
    position: fixed;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}
.email-var-caret-btn {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--background-color);
    color: var(--secondary-color);
    font-size: 0.875rem;
    line-height: 1;
    cursor: pointer;
    min-width: auto;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.email-var-caret-btn:hover,
.email-var-caret-btn:focus {
    color: var(--font-color);
    border-color: #d4d4d4;
    background: var(--surface-subtle);
}
.email-var-caret-menu {
    max-height: 14rem;
    overflow-y: auto;
    min-width: 11rem;
    padding: 0.25rem;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.email-var-caret-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.35rem 0.5rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    text-align: left;
    color: var(--font-color);
    cursor: pointer;
    min-width: auto;
}
.email-var-caret-item:hover,
.email-var-caret-item:focus {
    background: #f4f4f5;
}
.email-payment-currency {
    margin-bottom: 0.5rem;
}
.email-payment-currency summary {
    cursor: pointer;
    padding: 0.5rem 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--font-color);
    list-style: none;
}
.email-payment-currency summary::-webkit-details-marker {
    display: none;
}
.email-payment-currency summary::before {
    content: "▸ ";
    color: var(--secondary-color);
}
.email-payment-currency[open] summary::before {
    content: "▾ ";
}
.email-payment-currency .event-content-textarea {
    margin-top: 0.5rem;
    min-height: 5rem;
    border-color: var(--border-color);
    font-size: 0.8125rem;
}
.email-payment-currency[open] .event-content-textarea {
    border-color: #d4d4d4;
}

.email-model-tab.is-active { font-weight: 500; }
.email-rich-field {
    display: block;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--font-color);
    background: var(--background-color);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.email-compose .email-rich-field {
    border: none;
    padding: 0;
    background: transparent;
}
.email-rich-field:focus {
    outline: 2px solid var(--font-color);
    outline-offset: 1px;
}
.email-compose .email-rich-field:focus {
    outline: none;
}
.email-rich-field--subject {
    min-height: 2.5rem;
    white-space: pre-wrap;
}
.email-rich-field--body {
    min-height: 8rem;
    overflow: hidden;
    resize: none;
}
.email-var-tag {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.1rem 0.4rem;
    margin: 0 0.1rem;
    border: none;
    border-radius: 4px;
    background: #f0f0f0;
    color: var(--secondary-color);
    cursor: default;
    user-select: none;
    vertical-align: baseline;
}
.email-compose .email-var-tag {
    background: #ebebeb;
    color: var(--font-color);
}
.email-template-card {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.email-template-card label {
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
}
.email-template-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.65rem;
}
.email-preview-dialog article {
    max-width: 40rem;
    width: min(92vw, 40rem);
}
.email-preview-meta {
    margin-bottom: var(--global-space);
}
.email-preview-headers {
    margin: 0 0 calc(var(--global-space) * 1.5);
    font-size: 0.875rem;
}
.email-preview-headers div {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: var(--global-space);
    margin-bottom: calc(var(--global-space) / 2);
}
.email-preview-headers dt {
    margin: 0;
    font-weight: 700;
    color: #666;
}
.email-preview-headers dd {
    margin: 0;
    word-break: break-word;
}
.email-preview-body {
    margin: 0;
    padding: calc(var(--global-space) * 1.25);
    border: 1px solid var(--border-color);
    background: var(--surface-subtle);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.55;
    max-height: 60vh;
    overflow: auto;
}
.email-template-head {
    display: flex;
    align-items: center;
    gap: var(--global-space);
    flex-wrap: wrap;
    margin-bottom: var(--global-space);
}
.email-template-head h4 { margin: 0; }
.email-templates-footer {
    margin-top: calc(var(--global-space) * 2);
    padding-top: var(--global-space);
    border-top: 1px solid var(--border-subtle);
}
.email-templates-dialog article {
    max-width: 48rem;
    max-height: 92vh;
    overflow-y: auto;
}
.email-content-dialog article {
    max-width: 44rem;
    max-height: 90vh;
    overflow-y: auto;
}
.event-content-form .event-content-section {
    margin-top: var(--gap-md);
}
.event-content-form .event-content-section:first-of-type {
    margin-top: 0;
}
.event-content-form .event-content-section h4 {
    margin: 0 0 var(--global-space);
}
.panel--section {
    margin-top: var(--gap-md);
    padding-top: var(--global-space);
    border-top: 1px solid var(--border-subtle);
    background: transparent;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding-left: 0;
    padding-right: 0;
}
.panel--section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.event-content-textarea {
    min-height: 5.5rem;
    font-family: inherit;
    font-size: 0.8125rem;
    line-height: 1.4;
    resize: vertical;
}
.event-copy-from-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}
.event-copy-from-label {
    font-size: 0.75rem;
    white-space: nowrap;
}
.event-copy-from-form select {
    flex: 1 1 10rem;
    min-width: 0;
    height: var(--field-height);
    min-height: var(--field-height);
    padding: 0 var(--field-padding-x);
    font-size: var(--field-font-size);
    box-sizing: border-box;
    border: 1px solid var(--font-color);
    background: var(--background-color);
}
.event-payment-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.event-payment-field {
    display: block;
    margin: 0;
}
.event-payment-field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--secondary-color);
}
.settings-email-hint {
    margin-top: calc(var(--global-space) * 2);
}
.create-event-modal .event-copy-from {
    margin-top: var(--global-space);
}
