/* Scoped presentation layer: shared across both panels, without changing API forms. */
#layout-content:has(> .bastifytools-page) > .header { display: none; }
.bastifytools-page {
    --bastify-primary: #087eb5;
    --bastify-primary-dark: #05668f;
    --bastify-ink: #2c363a;
    --bastify-muted: #65757e;
    --bastify-surface: #f5f8fa;
    --bastify-panel: #fff;
    --bastify-border: #d8e1e7;
    --btu-selected: #e4f4fc;
    --btu-green: #14804a;
    --btu-red: #b42318;
    --btu-red-bg: #fff3f0;
    --btu-shadow: 0 4px 16px #263d5010;
    padding: 0 !important;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    background: var(--bastify-panel);
    color: var(--bastify-ink);
    font-size: 14px;
    line-height: 1.5;
}
.bastifytools-page *, .bastifytools-page *:before { box-sizing: border-box; }
.btu-sidebar {
    flex: 0 0 220px;
    padding: 0 10px 16px;
    border-right: 1px solid var(--bastify-border);
    overflow-y: auto;
    background: var(--bastify-surface);
}
.btu-sidebar > h2 {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 -10px 10px;
    border-bottom: 1px solid var(--bastify-border);
    font-size: 15px;
    font-weight: 700;
    color: var(--bastify-ink);
}
.btu-nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
    min-height: 40px;
    padding: 9px 10px;
    margin: 3px 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--bastify-ink);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.btu-nav-item img { width: 19px; height: 19px; opacity: .8; flex-shrink: 0; }
.btu-nav-item[aria-current="page"] { background: var(--btu-selected); color: var(--bastify-primary); font-weight: 600; }
.btu-nav-item:hover { background: var(--btu-selected); }
.btu-nav-group { margin: 22px 10px 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--bastify-muted); }
.btu-sidebar-help { border-top: 1px solid var(--bastify-border); margin: 22px 8px 0; padding-top: 14px; font-size: 12px; color: var(--bastify-muted); }
.btu-workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.btu-header { height: 58px; min-height: 58px; display: flex; gap: 12px; align-items: center; padding: 0 24px; border-bottom: 1px solid var(--bastify-border); background: var(--bastify-surface); }
.btu-heading { min-width: 0; flex: 1; }
.btu-header h1 { font-size: 16px; font-weight: 700; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bastify-ink); }
.bastifytools-nav-back { position: static; }
.bastifytools-page .btu-back { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.bastifytools-page .btu-header .btu-app-menu { display: none; }
html.layout-phone .bastifytools-page .btu-app-menu { display: inline-flex; min-width: 32px; min-height: 38px; padding: 6px; flex-shrink: 0; }
html.layout-phone .bastifytools-page .btu-app-menu:before { content: "\f0c9"; font-family: "Icons"; font-size: 18px; }
.btu-content { flex: 1; min-height: 0; padding: 28px clamp(18px, 3vw, 40px); overflow-y: auto; overflow-x: hidden; scroll-padding-top: 16px; }
.btu-intro, .bastifytools-dashboard { max-width: 1100px; margin-left: auto; margin-right: auto; }
.btu-eyebrow { color: var(--bastify-primary); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.btu-intro h2 { font-size: 26px; font-weight: 700; letter-spacing: -.6px; margin: 5px 0 8px; color: var(--bastify-ink); }
.bastifytools-subtitle { color: var(--bastify-muted); max-width: none; font-size: 14px; }
.btu-search { max-width: 520px; margin-top: 22px; }
.btu-search input {
    width: 100%; height: 42px; padding: 10px 14px; font: inherit;
    border: 1px solid var(--bastify-border); border-radius: 9px;
    color: var(--bastify-ink); background: var(--bastify-panel);
}
.bastifytools-dashboard { gap: 28px; margin-top: 28px; }
.bastifytools-group { padding: 0; border: 0; border-radius: 0; background: transparent; }
.bastifytools-group:before { content: none; }
.bastifytools-group-title { font-size: 12px; color: var(--bastify-muted); font-weight: 700; margin: 0 0 12px; }
.bastifytools-grid, .bastifytools-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bastifytools-entry { min-height: 110px; padding: 20px; gap: 16px; border: 1px solid var(--bastify-border); background: var(--bastify-panel); border-radius: 12px; align-items: center; box-shadow: 0 1px 3px #263d5005; }
.bastifytools-entry:hover, .bastifytools-entry:focus { transform: none; background: var(--bastify-panel); border-color: var(--bastify-primary); box-shadow: var(--btu-shadow); }
.bastifytools-entry-icon { width: 44px; height: 44px; flex-basis: 44px; padding: 10px; border: 0; border-radius: 12px; background: var(--btu-selected); margin: 0; }
.bastifytools-entry-text { min-width: 0; flex: 1; }
.bastifytools-entry-text h3 { font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--bastify-ink); }
.bastifytools-entry-text p { font-size: 12px; line-height: 1.6; color: var(--bastify-muted); margin-top: 4px; }
.bastifytools-entry:after { content: "\203a"; color: var(--bastify-muted); font-size: 22px; }
.bastifytools-page .bastifytools-panel {
    width: 100% !important; max-width: 1000px !important; padding: 0;
    margin: 0 auto; border: 0; border-radius: 0; box-shadow: none;
    background: transparent; color: var(--bastify-ink);
}
.bastifytools-page #bastifytools-change-password-panel, .bastifytools-page #bastifytools-user-data-panel, .bastifytools-page #bastifytools-support-panel { max-width: 740px !important; }
.bastifytools-panel h2 { font-size: 22px; font-weight: 700; margin: 0 0 8px; color: var(--bastify-ink); letter-spacing: -.3px; }
.btu-panel-intro { margin: 0 0 24px; font-size: 13px; color: var(--bastify-muted); line-height: 1.6; }
.btu-list-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 10px; }
.btu-list-heading h2 { flex: 1; margin: 4px 0; }
.btu-list-heading > .button { flex-shrink: 0; margin-left: auto; }
.bastifytools-page .btu-editor {
    width: min(680px, calc(100% - 32px)); max-width: none;
    max-height: calc(100dvh - 32px); margin: auto; padding: 0;
    border: 1px solid var(--bastify-border); border-radius: 16px;
    background: var(--bastify-panel); color: var(--bastify-ink);
    box-shadow: 0 24px 80px #0005; overflow: auto; overscroll-behavior: contain;
}
.btu-editor::backdrop { background: #10232d99; }
.btu-editor-header { display: flex; gap: 16px; padding: 24px 24px 0; align-items: flex-start; }
.btu-editor-header > div { flex: 1; min-width: 0; }
.btu-editor-header h3 { margin: 0 0 8px; font-size: 21px; font-weight: 700; color: var(--bastify-ink); }
.btu-editor-header p { margin: 0; color: var(--bastify-muted); font-size: 13px; line-height: 1.6; }
.bastifytools-page .btu-editor-close { min-width: 40px; min-height: 40px; padding: 4px; font-size: 24px; }
.bastifytools-page .btu-editor .bastifytools-form { border: 0; border-radius: 0; margin: 0; padding: 24px; }
.btu-editor .bastifytools-form-actions { display: flex; flex-wrap: wrap; flex-direction: row-reverse; justify-content: flex-start; }
.btu-editor-error, .btu-editor-status { margin: 20px 24px 0; padding: 12px 14px; border-radius: 8px; font-size: 13px; }
.btu-editor-error { background: var(--btu-red-bg); color: var(--btu-red); }
.btu-editor-status { background: var(--btu-selected); color: var(--bastify-primary); }
.bastifytools-page .bastifytools-form { background: var(--bastify-panel); border: 1px solid var(--bastify-border); padding: 22px; border-radius: 12px; }
.bastifytools-form-row { margin-bottom: 18px; min-width: 0; }
.bastifytools-form-row > div { min-width: 0; }
.bastifytools-form-row label { color: var(--bastify-ink); font-size: 13px; margin-bottom: 6px; }
.bastifytools-form-row :is(input:not([type="checkbox"]):not([type="hidden"]), select, textarea) {
    width: 100%; border: 1px solid var(--bastify-border); border-radius: 8px;
    color: var(--bastify-ink); background: var(--bastify-panel);
    padding: 10px 12px; font: inherit; box-shadow: none; min-width: 0;
}
.bastifytools-form-row :is(input:not([type="checkbox"]), select) { height: 42px; }
.bastifytools-form-row input:read-only { background: var(--bastify-surface); color: var(--bastify-muted); }
.bastifytools-page input::placeholder, .bastifytools-page textarea::placeholder { color: var(--bastify-muted); opacity: .8; }
.bastifytools-form-row-inline, .bastifytools-form-row-inline-2, .bastifytools-form-row-inline-3 { gap: 16px; }
.bastifytools-ar-subject-inline { display: block; }
.bastifytools-checkbox-label { padding: 12px; background: var(--bastify-surface); border-radius: 8px; min-height: 42px; }
.bastifytools-form-row input[type="checkbox"] { accent-color: var(--bastify-primary); width: 16px; height: 16px; flex-shrink: 0; }
.btu-password { position: relative; }
.btu-password input { padding-right: 85px !important; }
.btu-reveal { position: absolute; top: 3px; right: 4px; padding: 7px 10px; min-height: 36px; border: 0; background: transparent; color: var(--bastify-primary); font: inherit; font-size: 12px; cursor: pointer; }
.bastifytools-page .button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 38px; padding: 8px 14px; border: 1px solid var(--bastify-border);
    border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600;
    background: var(--bastify-panel); color: var(--bastify-ink);
    text-decoration: none; box-shadow: none; cursor: pointer; height: auto;
}
.bastifytools-page .button:before { content: none; }
.bastifytools-page .button.mainaction { background: var(--bastify-primary); border-color: var(--bastify-primary); color: #fff; }
.bastifytools-page .button:hover { filter: brightness(.97); border-color: var(--bastify-primary); }
.bastifytools-page .button:disabled { opacity: .5; cursor: not-allowed; }
.bastifytools-page .button-delete, .bastifytools-page #bastifytools-delete-autoresponder, .bastifytools-page #bastifytools-support-stop { color: var(--btu-red); background: var(--btu-red-bg); }
.bastifytools-page :is(button, input, select, textarea, a, .bastifytools-entry):focus-visible { outline: 3px solid #159bd455; outline-offset: 2px; }
.bastifytools-panel:focus { outline: none; }
.bastifytools-form-actions { border-top: 1px solid var(--bastify-border); margin-top: 22px; padding-top: 16px; margin-bottom: 0; flex-direction: row; justify-content: flex-end; gap: 8px; }
.bastifytools-help { color: var(--bastify-muted); font-size: 12px; line-height: 1.6; }
.bastifytools-help-ok { color: var(--btu-green); }
.bastifytools-help-error { color: var(--btu-red); }
.bastifytools-page .bastifytools-list-wrapper { border: 1px solid var(--bastify-border); border-radius: 12px; margin-top: 24px !important; background: var(--bastify-panel); }
.bastifytools-page .bastifytools-table { font-size: 13px !important; }
.bastifytools-table caption { caption-side: top; color: var(--bastify-ink); background: var(--bastify-panel); padding: 14px 16px; font-weight: 600; font-size: 14px; }
.bastifytools-page .bastifytools-table :is(th, td) { border: 0; border-bottom: 1px solid var(--bastify-border); padding: 12px 16px !important; line-height: 1.5 !important; color: var(--bastify-ink); }
.bastifytools-table thead th { background: var(--bastify-surface); color: var(--bastify-muted) !important; font-size: 11px; font-weight: 600; }
.bastifytools-table tbody tr:last-child td { border-bottom: 0; }
.bastifytools-table tbody tr:hover { background: var(--bastify-surface); }
.bastifytools-page .bastifytools-table td .button { min-width: 36px; min-height: 36px !important; padding: 8px !important; font-size: 12px !important; }
.bastifytools-page .bastifytools-table td:last-child { white-space: nowrap; }
.bastifytools-page .bastifytools-empty, .bastifytools-page .bastifytools-table-loading-cell { color: var(--bastify-muted); text-align: center; padding: 28px !important; }
.bastifytools-ticket-thread { background: var(--bastify-surface); border-color: var(--bastify-border); padding: 18px; }
.bastifytools-ticket-message { background: var(--bastify-panel); border-color: var(--bastify-border); padding: 14px 16px; }
.bastifytools-ticket-message-support { background: var(--btu-selected); border-color: var(--bastify-border); }
.bastifytools-ticket-message-body, .bastifytools-ticket-message-author, .bastifytools-ticket-view-headline h3 { color: var(--bastify-ink); }
.bastifytools-ticket-message-meta, .bastifytools-ticket-view-headline p, .bastifytools-ticket-thread-empty { color: var(--bastify-muted); }
.bastifytools-ticket-message-meta { flex-wrap: wrap; }
.bastifytools-page #bastifytools-ar-message { min-height: 220px; height: 220px; }
.bastifytools-page :is(.bastifytools-mail-setup-choice, .bastifytools-mail-setup-pdf) { padding: 16px; min-height: 68px; color: var(--bastify-ink); background: var(--bastify-panel); border-color: var(--bastify-border); border-radius: 10px; gap: 12px; }
.bastifytools-mail-setup-choice:hover, .bastifytools-mail-setup-pdf:hover { background: var(--btu-selected); border-color: var(--bastify-primary); }
.bastifytools-mail-setup-header, .bastifytools-mail-setup-manual, .bastifytools-mail-setup-actions, .bastifytools-mail-setup-complete { border-color: var(--bastify-border); }
.bastifytools-mail-setup-instruction { background: var(--bastify-surface); border-color: var(--bastify-primary); padding: 16px; border-radius: 0 8px 8px 0; }
.bastifytools-page :is(.bastifytools-mail-setup-header, .bastifytools-mail-setup-manual, .bastifytools-mail-setup-complete, .bastifytools-mail-setup-instruction) p { color: var(--bastify-muted); }
.bastifytools-mail-setup-image { border-color: var(--bastify-border); border-radius: 8px; }
.bastifytools-mail-setup-actions .bastifytools-form-actions { display: flex; max-width: none; }
.bastifytools-mail-setup-actions .bastifytools-form-actions button { width: auto; min-height: 40px; justify-content: center; text-align: center; }
.bastifytools-page .bastifytools-footer {
    position: static; flex: 0 0 auto; padding: 10px 20px; pointer-events: auto;
    border-top: 1px solid var(--bastify-border); background: var(--bastify-surface); z-index: auto;
}
.bastifytools-footer-row { gap: 12px; flex-wrap: wrap; }
.bastifytools-footer-progress { flex: 1 1 160px; max-width: 260px; min-width: 0; }
.bastifytools-footer-progress-text { white-space: normal; font-size: 11px; margin-bottom: 4px; color: var(--bastify-muted); }
.bastifytools-footer-version { font-size: 10px; color: var(--bastify-muted); }
.bastifytools-footer-progress-bar { height: 4px; background: var(--bastify-border); }
.bastifytools-footer-status { margin-left: auto; }
.btu-empty { padding: 24px 0; color: var(--bastify-muted); }
.bastifytools-page [hidden] { display: none !important; }
html.dark-mode .bastifytools-page, body.dark-mode .bastifytools-page {
    --bastify-primary: #149bd3; --bastify-primary-dark: #53c0eb;
    --bastify-ink: #dee8ed; --bastify-muted: #a6b9c3;
    --bastify-surface: #252f34; --bastify-panel: #21292d;
    --bastify-border: #405159; --btu-selected: #1d3a49;
    --btu-green: #6cdb9e; --btu-red: #ffaea4; --btu-red-bg: #432d2c;
}
@media (max-width: 1100px) {
    .btu-sidebar { flex-basis: 190px; }
    .btu-content { padding: 24px 20px; }
    .bastifytools-entry { padding: 16px; gap: 12px; }
}
@media (max-width: 900px) {
    .btu-sidebar { display: none; }
    .bastifytools-grid, .bastifytools-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .btu-list-heading { gap: 8px; flex-wrap: wrap; }
    .btu-list-heading h2 { font-size: 18px; }
    .btu-editor-header { padding: 18px 16px 0; }
    .bastifytools-page .btu-editor .bastifytools-form { padding: 20px 16px; }
    .btu-editor-error, .btu-editor-status { margin: 16px 16px 0; }
    .btu-header { padding: 0 14px; gap: 8px; }
    .btu-header h1 { font-size: 14px; }
    .btu-content { padding: 22px 16px; }
    .btu-intro h2 { font-size: 23px; }
    .bastifytools-grid, .bastifytools-grid-two { grid-template-columns: 1fr; }
    .bastifytools-entry { min-height: 96px; }
    .bastifytools-page .bastifytools-form { padding: 16px; }
    .bastifytools-panel h2 { font-size: 20px; }
    .bastifytools-form-actions { justify-content: stretch; }
    .bastifytools-form-actions > .button { flex: 1 1 auto; }
    .bastifytools-ticket-row .bastifytools-ticket-message { max-width: 96%; }
    .bastifytools-mail-setup-step-head { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .bastifytools-entry { transition: none; }
    .bastifytools-inline-spinner { animation: none; }
}
