:root {
    --ink: #20232b;
    --muted: #747780;
    --line: #e9e9ee;
    --panel: #fff;
    --bg: #fafafb;
    --green: #315bea;
    --green-dark: #2448c9;
    --danger: #c9394a;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 14px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
input, textarea, select { max-width: 100%; border: 1px solid #dcdde5; border-radius: 6px; background: #fff; color: var(--ink); padding: 10px 12px; }
input, textarea { width: 100%; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid #bccbff; outline-offset: 1px; border-color: #315bea; }
:focus-visible { outline: 2px solid #315bea; outline-offset: 3px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 550; }
input[readonly] { background: #f8f8fb; color: var(--muted); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; font-size: 36px; line-height: 1.2; margin-bottom: 10px; }
h2 { font-size: 16px; font-weight: 650; margin-bottom: 8px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; margin-bottom: 0; }
small { font-size: 12px; color: var(--muted); }
.lucide { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.7; vertical-align: middle; }
.button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 38px; padding: 9px 14px; border: 1px solid transparent; border-radius: 6px; background: var(--green); color: #fff; font-size: 13px; font-weight: 550; text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover { background: var(--green-dark); }
.button.ghost { color: var(--ink); background: #fff; border-color: var(--line); }
.button.ghost:hover { background: #f4f5f9; }
.button.danger { color: var(--danger); background: #fff; border-color: #f0d6db; }
.button.danger:hover { background: #fff4f5; }
.icon-button { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); text-decoration: none; flex-shrink: 0; }
.icon-button:hover { color: var(--ink); background: #f0f1f5; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--green); text-decoration: none; font-weight: 550; }
.text-link:hover { text-decoration: underline; }
.brand { display: flex; gap: 10px; align-items: center; font-size: 19px; font-weight: 650; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: #315bea; border-radius: 8px; font-family: Georgia, serif; font-size: 28px; line-height: 1; padding-bottom: 3px; }
.app-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; gap: 22px; padding: 25px 18px 14px; border-right: 1px solid var(--line); background: #fafafb; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.workspace-label { display: flex; gap: 10px; align-items: center; padding: 11px 7px; font-size: 13px; font-weight: 550; border-block: 1px solid var(--line); }
.workspace-label small, .account small { display: block; font-weight: 400; margin-top: 1px; }
.workspace-avatar { width: 31px; height: 31px; display: grid; place-items: center; flex-shrink: 0; background: #e8ecff; color: #315bea; font-weight: 600; border-radius: 50%; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav > a, .sidebar-bottom > a:not(.button) { display: flex; gap: 10px; align-items: center; padding: 9px 11px; color: #73757d; border-radius: 6px; font-size: 13px; text-decoration: none; }
.sidebar nav > a:hover, .sidebar-bottom > a:hover { background: #f0f1f5; }
.sidebar nav > a.active, .sidebar-bottom > a.active { color: #315bea; background: #edf1ff; font-weight: 550; }
.nav-section { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 4px; padding-left: 11px; color: #858791; font-size: 12px; }
.sidebar nav > .form-nav { padding-left: 16px; }
.form-nav span { min-width: 0; overflow-wrap: anywhere; }
.nav-count, .tab-count { margin-left: auto; background: #e9ebf4; font-size: 11px; padding: 1px 6px; border-radius: 4px; color: #616577; }
.nav-empty { margin: 0 0 0 16px; padding: 5px 12px; border-left: 1px solid #e0e1e9; color: var(--muted); font-size: 13px; }
.sidebar-bottom { margin-top: auto; padding-top: 40px; display: grid; gap: 15px; }
.month-summary { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 0 10px; }
.month-summary strong { color: var(--ink); font-weight: 550; }
.account { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; font-size: 12px; }
.account > span:nth-child(2) { min-width: 0; flex: 1; }
.account small { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard { min-width: 0; background: #fff; padding: 0 44px 40px; }
.topline { min-height: 66px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.breadcrumb-separator { padding: 0 10px; color: #bebfc6; }
.live-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: #45806b; font-size: 11px; }
.live-status > span { width: 6px; height: 6px; border-radius: 50%; background: #2ea779; }
.live-status.offline { color: #a45c28; }
.live-status.offline > span { background: #e18c43; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 35px 0 27px; }
.page-header h1 { overflow-wrap: anywhere; }
.eyebrow { color: var(--muted); font-size: 11px; margin-bottom: 8px; font-weight: 550; }
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin: 0 0 30px; overflow-x: auto; }
.tabs a { display: flex; align-items: center; gap: 7px; padding: 12px 0; white-space: nowrap; color: var(--muted); font-size: 13px; text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a.active { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 30px; }
.metric { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 17px 18px; background: #fff; }
.metric-label { display: flex; justify-content: space-between; align-items: center; gap: 5px; font-size: 12px; color: #747782; min-height: 28px; }
.metric-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; }
.metric-icon .lucide { width: 15px; height: 15px; }
.blue { color: #4166dd; background: #edf1ff; }
.coral { color: #d5616b; background: #fff0f2; }
.green { color: #258869; background: #eaf8f2; }
.amber { color: #ba842c; background: #fdf5e7; }
.metric > strong { display: block; margin: 9px 0 3px; font-size: 30px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.metric small { display: block; font-size: 11px; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 22px; }
.section-header h2 { margin-bottom: 2px; }
.chart-section, .form-table-section, .submission-section, .connection-section, .code-section, .recipient-summary { padding: 25px 0 28px; border-top: 1px solid var(--line); min-width: 0; }
.chart-section { padding-top: 5px; border-top: 0; }
.chart-controls { display: flex; align-items: center; gap: 9px; }
.chart-controls select { padding: 7px 10px; font-size: 12px; border-color: var(--line); }
.chart-wrap { position: relative; width: 100%; height: 256px; }
.chart-footer { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; margin: 16px 0 6px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #315bea; margin-right: 5px; }
.trend { font-size: 11px; color: #26836b; white-space: nowrap; }
.chart-data { font-size: 11px; color: var(--muted); margin-top: 12px; }
.chart-data summary { cursor: pointer; }
.chart-data table { max-width: 500px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); font-weight: 500; text-align: left; background: #fafafb; padding: 11px 14px; border-block: 1px solid var(--line); }
td { padding: 15px 14px; border-bottom: 1px solid var(--line); }
td small { display: block; font-size: 11px; margin-top: 3px; }
.table-scroll { overflow-x: auto; }
.forms-table td:nth-child(2) { max-width: 280px; overflow-wrap: anywhere; }
.forms-table td:nth-child(3) { font-size: 15px; font-weight: 550; }
.form-name { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.form-name strong { font-weight: 550; overflow-wrap: anywhere; }
.file-icon { width: 32px; height: 36px; border: 1px solid var(--line); border-radius: 5px; color: #667ac3; display: grid; place-items: center; flex-shrink: 0; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 4px; font-size: 10px; white-space: nowrap; font-weight: 500; }
.badge.delivered { background: #ecf8f1; color: #2e8b65; }
.badge.failed { background: #fff0f1; color: #c34452; }
.heading-count { color: var(--muted); font-size: 12px; margin-left: 8px; font-weight: 400; }
.submission-heading, .submission summary { display: grid; grid-template-columns: minmax(0, 1fr) 120px 130px; gap: 12px; align-items: center; }
.submission-heading { font-size: 11px; color: var(--muted); padding: 11px 14px; background: #fafafb; border-block: 1px solid var(--line); }
.submission-row { position: relative; border-bottom: 1px solid var(--line); }
.submission-heading { padding-right: 58px; }
.submission-delete { position: absolute; right: 10px; top: 14px; margin: 0; }
.submission-delete .icon-button:hover, .submission-delete .icon-button:focus-visible { color: var(--danger); background: #fff0f1; }
.team-dashboard .submission-heading, .team-dashboard .submission summary { padding-right: 14px; }
.team-actions { display: flex; align-items: center; gap: 6px; }
.team-actions form { margin: 0; }
.team-form-options { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; min-width: 0; }
.team-signout { padding: 12px 10px; }
.team-signout button { background: transparent; border: 0; font: inherit; cursor: pointer; }
.submission summary { padding: 15px 58px 15px 14px; cursor: pointer; list-style: none; }
.submission summary::-webkit-details-marker { display: none; }
.submission summary:hover { background: #fafafb; }
.sender { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 31px; height: 31px; background: #f0f0f7; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #78718b; flex-shrink: 0; }
.sender strong { font-size: 12px; font-weight: 550; display: block; overflow-wrap: anywhere; }
.sender small { display: block; font-size: 11px; overflow-wrap: anywhere; }
.submission time { color: var(--muted); font-size: 11px; }
.submission .badge { justify-self: start; }
.submission dl, .recipient-summary dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 15px; margin: 15px 14px 25px; font-size: 13px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 14px 22px; }
.attachment-list a { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--green); }
.empty-state { padding: 38px 10px; text-align: center; color: var(--muted); }
.empty-state > .lucide { width: 28px; height: 28px; color: #a4aac0; margin-bottom: 12px; }
.empty-state h3 { color: #565b68; margin-bottom: 7px; font-weight: 550; }
.empty-state p { font-size: 12px; }
.copy-field { display: flex; align-items: center; gap: 12px; padding: 13px 15px; background: #f8f9fc; border: 1px solid var(--line); border-radius: 6px; }
.copy-field code { min-width: 0; flex: 1; overflow-wrap: anywhere; font-size: 13px; color: #315bea; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 24px; background: #f8f9fc; border: 1px solid var(--line); border-radius: 6px; font: 12px/1.9 ui-monospace, SFMono-Regular, Menlo, monospace; color: #555d74; }
.settings-section { display: grid; grid-template-columns: minmax(180px, .75fr) minmax(0, 1.6fr); gap: 35px; padding: 26px 0 30px; border-bottom: 1px solid var(--line); }
.stack { display: grid; gap: 19px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.check input { width: 17px; height: 17px; accent-color: #315bea; }
.editor-actions { display: flex; align-items: center; gap: 18px; padding: 24px 0; }
.delete-section { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 25px 0; border-top: 1px solid var(--line); }
.alert { padding: 12px 16px; margin-top: 18px; border-radius: 6px; font-size: 13px; }
.alert.success { background: #edf9f3; color: #287d5c; }
.alert.error { background: #fff0f1; color: var(--danger); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: #fafafb; }
.auth-card { max-width: 410px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 34px; display: grid; gap: 20px; }
.auth-card .brand { margin-bottom: 16px; }
.auth-card h1 { font-size: 29px; margin-bottom: 0; }
.toast { position: fixed; bottom: 24px; right: 24px; background: #252936; color: #fff; border-radius: 6px; padding: 10px 16px; font-size: 12px; box-shadow: 0 4px 20px #0002; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 22px 32px; border-bottom: 1px solid var(--line); }
.hero { padding: 52px 32px; display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.hero h1 { font-size: 40px; }
.lead { color: var(--muted); max-width: 650px; font-size: 16px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.section { padding: 24px 32px; }
.panel, .card { padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card code { overflow-wrap: anywhere; }
.empty { padding: 24px; color: var(--muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; background: #2ea779; border-radius: 50%; }
@media (min-width: 1600px) { .dashboard { padding-inline: 70px; } }
@media (max-width: 1150px) { .dashboard { padding-inline: 28px; } .metrics { gap: 10px; } .metric { padding: 14px 12px; } .metric small { min-height: 32px; } }
@media (max-width: 900px) {
    .app-layout { grid-template-columns: 190px minmax(0, 1fr); }
    .sidebar { padding-inline: 12px; }
    .brand { font-size: 17px; }
    .dashboard { padding-inline: 22px; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-section { grid-template-columns: 1fr; gap: 20px; }
    .submission-heading, .submission summary { grid-template-columns: minmax(0, 1fr) 104px; }
    .submission-heading > :last-child { display: none; }
    .submission .badge { grid-column: 1 / -1; margin-left: 41px; }
}
@media (max-width: 640px) {
    .app-layout { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: static; height: auto; padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); gap: 14px; }
    .workspace-label, .sidebar-bottom .month-summary, .sidebar-bottom > .button, .account { display: none; }
    .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
    .sidebar nav > a { padding: 8px 6px; gap: 5px; font-size: 11px; }
    .nav-count { display: none; }
    .nav-section { grid-column: 1 / -1; margin: 5px 0 0; }
    .sidebar nav > .form-nav { padding-left: 6px; }
    .sidebar-bottom { padding-top: 0; margin-top: 0; }
    .sidebar-bottom > a:not(.button) { font-size: 11px; padding: 3px 6px; }
    .dashboard { padding: 0 18px 28px; }
    .topline { min-height: 44px; font-size: 10px; }
    .page-header { padding: 25px 0 20px; align-items: start; gap: 12px; }
    h1 { font-size: 30px; }
    .page-header .button { padding: 8px 10px; font-size: 11px; min-height: 34px; margin-top: 22px; }
    .metrics { gap: 10px; margin-bottom: 24px; }
    .metric-label { font-size: 11px; }
    .metric > strong { font-size: 26px; }
    .metric small { font-size: 10px; min-height: 30px; }
    .section-header { flex-wrap: wrap; gap: 12px; }
    .chart-controls { width: 100%; justify-content: flex-end; }
    .chart-controls .trend { margin-right: auto; }
    .chart-wrap { height: 220px; }
    .chart-footer { font-size: 10px; flex-wrap: wrap; }
    .forms-table { min-width: 580px; }
    .tabs { gap: 20px; }
    .tabs a { font-size: 12px; }
    .grid.two { grid-template-columns: 1fr; }
    .submission-heading, .submission summary { grid-template-columns: minmax(0, 1fr) 86px; gap: 8px; padding-inline: 5px; }
    .submission-heading, .submission summary { padding-right: 48px; }
    .submission-delete { right: 0; }
    .submission time { font-size: 10px; }
    .submission dl, .recipient-summary dl { grid-template-columns: 85px minmax(0, 1fr); gap: 10px; font-size: 12px; }
    .delete-section { flex-wrap: wrap; }
    .hero { grid-template-columns: 1fr; padding: 30px 18px; }
    .hero h1 { font-size: 32px; }
    .auth-card { padding: 26px; }
    pre { padding: 15px; font-size: 11px; }
}
