@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --navy: #101820;
    --navy-light: #182531;
    --navy-hover: #243544;
    --blue: #3878f6;
    --blue-dark: #2863dc;
    --blue-soft: #edf4ff;
    --white: #ffffff;
    --background: #f7f9fc;
    --surface: #ffffff;
    --text: #17212b;
    --text-secondary: #667586;
    --text-light: #8b98a7;
    --border: #e6ebf1;
    --border-dark: #d7e0e9;
    --success: #16845b;
    --success-soft: #e8f7ef;
    --warning: #a66a10;
    --warning-soft: #fff5df;
    --danger: #c63838;
    --danger-soft: #fff0f0;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 2px 8px rgba(16, 24, 32, 0.035);
    --shadow-md: 0 12px 36px rgba(16, 24, 32, 0.07);
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    margin: 0;
    background: var(--white);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body,
button,
input,
textarea {
    font-family: 'DM Sans', sans-serif;
}

body.menu-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font-size: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

button,
a,
input,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(56, 120, 246, 0.28);
    outline-offset: 3px;
}

svg {
    display: block;
    width: 100%;
    height: 100%;
}

img {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

.page-view[hidden] {
    display: none !important;
}

.page-view {
    min-height: 60vh;
}

.container {
    width: min(var(--container), calc(100% - 48px));
    margin-inline: auto;
}

section[id] {
    scroll-margin-top: 100px;
}

.site-header {
    position: sticky;
    z-index: 100;
    top: 0;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(230, 235, 241, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--navy);
    font-family: 'Manrope', sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1.2px;
    white-space: nowrap;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    padding: 8px;
    color: var(--white);
    background: var(--navy);
    border-radius: 12px;
}

.brand-accent {
    color: var(--blue);
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-navigation > a:not(.button) {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.main-navigation > a:not(.button):hover,
.main-navigation > a[aria-current="page"]:not(.button) {
    color: var(--blue);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 12px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 4px 0;
    background: var(--navy);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-6px) rotate(-45deg);
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 21px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button-primary {
    color: var(--white);
    background: var(--blue);
    box-shadow: 0 5px 15px rgba(56, 120, 246, 0.14);
}

.button-primary:hover:not(:disabled) {
    background: var(--blue-dark);
    box-shadow: 0 8px 22px rgba(56, 120, 246, 0.23);
}

.button-secondary {
    color: var(--navy);
    background: var(--white);
    border-color: var(--border-dark);
}

.button-secondary:hover:not(:disabled) {
    background: var(--background);
    border-color: #bdc9d8;
}

.button-dark {
    color: var(--white);
    background: var(--navy);
}

.button-dark:hover:not(:disabled) {
    background: var(--navy-hover);
}

.button-danger {
    color: var(--danger);
    background: var(--white);
    border-color: #efc3c3;
}

.button-danger:hover:not(:disabled) {
    background: var(--danger-soft);
    border-color: var(--danger);
}

.button-full {
    width: 100%;
}

.button-small {
    min-height: 38px;
    padding: 9px 13px;
    font-size: 12px;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 100px 0 106px;
    background: radial-gradient(ellipse at 80% 45%, rgba(56, 120, 246, 0.075), transparent 38%), linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.home-hero {
    padding-top: 80px;
    padding-bottom: 80px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 80px;
}

.home-hero .hero-grid {
    align-items: center;
}

.hero-content {
    max-width: 580px;
}

.home-hero .hero-content {
    max-width: 580px;
}

.eyebrow,
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(22, 132, 91, 0.1);
}

.hero h1 {
    margin: 25px 0 22px;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(44px, 5.5vw, 70px);
    font-weight: 800;
    letter-spacing: -4px;
    line-height: 1.12;
}

.home-hero h1 {
    letter-spacing: -0.045em;
}

.hero h1 span,
.workflow-content h2 span {
    color: var(--blue);
}

.hero-description {
    max-width: 500px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.9;
}

.home-hero .hero-description {
    max-width: 490px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin-top: 32px;
}

.home-hero .hero-actions {
    margin-top: 28px;
}

.trust-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 27px;
    color: var(--text-secondary);
    font-size: 12px;
}

.home-hero .trust-note {
    margin-top: 24px;
}

.trust-note svg {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    color: var(--success);
}

.hero-preview {
    position: relative;
    width: 100%;
    padding: 20px;
}

.home-hero .hero-preview {
    width: 100%;
    max-width: 460px;
    justify-self: end;
}

.hero-preview::before {
    position: absolute;
    z-index: 0;
    top: 2%;
    right: 0;
    bottom: 0;
    left: 5%;
    background: linear-gradient(135deg, #e8f0ff, #f3f7ff);
    border: 1px solid #e5edfc;
    border-radius: 30px;
    content: "";
    transform: rotate(3deg);
}

.preview-window {
    position: relative;
    z-index: 1;
    overflow: hidden;
    background: var(--white);
    border: 1px solid rgba(230, 235, 241, 0.9);
    border-radius: 20px;
    box-shadow: 0 28px 70px rgba(16, 24, 32, 0.12);
}

.preview-header {
    padding: 30px 30px 25px;
    color: var(--white);
    background: linear-gradient(135deg, #111e2b, #1b3045);
}

.preview-label,
.panel-eyebrow {
    color: #9bbcf8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.preview-header h2 {
    margin: 12px 0 4px;
    font-family: 'Manrope', sans-serif;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.preview-header p {
    margin: 0;
    color: #b5c3d2;
    font-size: 12px;
}

.preview-content {
    display: grid;
    gap: 0;
    padding: 8px 25px;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 19px 0;
    border-bottom: 1px solid var(--border);
}

.preview-item:last-child {
    border-bottom: 0;
}

.preview-icon {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    place-items: center;
    padding: 11px;
    color: var(--blue);
    background: var(--blue-soft);
    border-radius: 12px;
}

.preview-item-text {
    display: grid;
    gap: 2px;
}

.preview-item-text strong {
    font-size: 12px;
    font-weight: 700;
}

.preview-item-text small {
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.6;
}

.preview-status {
    margin-left: auto;
    padding: 5px 8px;
    color: var(--warning);
    background: var(--warning-soft);
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
}

.preview-disclaimer {
    margin: 0;
    padding: 15px 25px;
    color: var(--text-light);
    background: #fafbfd;
    border-top: 1px solid var(--border);
    font-size: 10px;
    line-height: 1.7;
}

.section {
    padding: 100px 0;
}

.workspace-section {
    min-height: 60vh;
    background: var(--background);
}

.workspace-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 35px;
}

.workspace-heading h2 {
    margin: 10px 0 6px;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(30px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.3;
}

.workspace-heading p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.connection-status {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 6px 11px;
    color: var(--text-secondary);
    background: #edf0f4;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.connection-status::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    background: #96a2b0;
    border-radius: 50%;
    content: "";
}

.connection-status.is-connected {
    color: var(--success);
    background: var(--success-soft);
}

.connection-status.is-connected::before {
    background: var(--success);
}

.connection-status.is-error {
    color: var(--danger);
    background: var(--danger-soft);
}

.connection-status.is-error::before {
    background: var(--danger);
}

.connection-status.is-pending {
    color: var(--warning);
    background: var(--warning-soft);
}

.connection-status.is-pending::before {
    background: var(--warning);
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 25px;
}

.workspace-main,
.workspace-sidebar {
    display: grid;
    min-width: 0;
    gap: 23px;
}

.card {
    min-width: 0;
    padding: 27px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 24px;
}

.card-heading h3 {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.35px;
}

.card-heading p {
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 11px;
}

.small-label {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
}

#composeForm {
    display: grid;
    gap: 19px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.form-group input,
.form-group textarea {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 13px 15px;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border-dark);
    border-radius: 9px;
    outline: none;
    font-size: 13px;
    line-height: 1.7;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input {
    min-height: 48px;
}

.form-group textarea {
    min-height: 190px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a2adba;
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: #bdc9d8;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(56, 120, 246, 0.1);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: #e2a4a4;
}

.compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 5px;
}

.compose-footer p {
    max-width: 300px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.8;
}

.connection-card .card-heading {
    margin-bottom: 20px;
}

.account-box {
    display: grid;
    gap: 16px;
    padding: 17px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.google-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #4285f4;
    font-family: Arial, sans-serif;
    font-size: 25px;
    font-weight: 700;
}

.account-row > div {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.account-row strong {
    font-size: 12px;
    font-weight: 700;
}

.account-row span:last-child {
    overflow-wrap: anywhere;
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.6;
}

.account-box > .connection-status {
    justify-self: start;
}

.account-box .button {
    min-width: 0;
}

.privacy-note {
    margin: 17px 0 0;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.9;
}

.privacy-note a {
    color: var(--blue-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.settings-card .card-heading {
    margin-bottom: 12px;
}

.settings-links {
    display: grid;
}

.settings-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.settings-links a:last-child {
    border-bottom: 0;
}

.settings-links a span:last-child {
    color: var(--text-light);
    font-size: 16px;
}

.settings-links a:hover,
.settings-links a:hover span:last-child {
    color: var(--blue);
}

.history-card .card-heading {
    margin-bottom: 15px;
}

.history-list {
    display: grid;
    min-width: 0;
}

.empty-state {
    margin: 0;
    padding: 25px 15px;
    color: var(--text-secondary);
    background: var(--background);
    border: 1px dashed var(--border-dark);
    border-radius: 10px;
    font-size: 12px;
    text-align: center;
}

.history-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 0;
    border-bottom: 1px solid var(--border);
}

.history-item:last-child {
    border-bottom: 0;
}

.history-item-main {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.history-item-main strong {
    overflow-wrap: anywhere;
    font-size: 12px;
    font-weight: 700;
}

.history-item-main span {
    overflow-wrap: anywhere;
    color: var(--text-secondary);
    font-size: 11px;
}

.history-item-main time {
    color: var(--text-light);
    font-size: 10px;
}

.history-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

.history-status.sent {
    color: var(--success);
    background: var(--success-soft);
}

.history-status.failed {
    color: var(--danger);
    background: var(--danger-soft);
}

.history-status.pending {
    color: var(--warning);
    background: var(--warning-soft);
}

.inbox-card .card-heading {
    margin-bottom: 15px;
}

.message-list {
    display: grid;
    min-width: 0;
    max-height: 480px;
    overflow-y: auto;
}

.message-item {
    display: grid;
    width: 100%;
    gap: 3px;
    padding: 14px 12px;
    color: var(--text);
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid transparent;
    font: inherit;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.message-item > * {
    min-width: 0;
}

.message-item:last-child {
    border-bottom: 0;
}

.message-item:hover {
    background: var(--background);
}

.message-item.is-active {
    background: var(--blue-soft);
    border-left-color: var(--blue);
}

.message-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.message-from,
.message-subject,
.message-snippet {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-from {
    font-size: 12px;
    font-weight: 600;
}

.message-subject {
    font-size: 12px;
    font-weight: 500;
}

.message-snippet {
    color: var(--text-secondary);
    font-size: 11px;
}

.message-date {
    flex: 0 0 auto;
    color: var(--text-light);
    font-size: 10px;
}

.message-item.is-unread .message-from,
.message-item.is-unread .message-subject {
    font-weight: 800;
}

.load-more {
    margin-top: 14px;
}

.reader-card .card-heading {
    align-items: flex-start;
    margin-bottom: 14px;
}

.reader-card .card-heading h3 {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 18px;
    line-height: 1.5;
}

.reader-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 16px;
    margin-bottom: 16px;
    color: var(--text-light);
    font-size: 11px;
}

.reader-meta span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-weight: 600;
}

.reader-body {
    max-height: 420px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    color: var(--text);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.8;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.reader-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.legal-page {
    min-height: 60vh;
    padding: 55px 0 75px;
    background: var(--white);
}

.legal-container {
    width: min(820px, calc(100% - 48px));
    margin-inline: auto;
}

.legal-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-back:hover {
    color: var(--blue);
}

.legal-container h2 {
    margin: 14px 0 8px;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -1.8px;
    line-height: 1.25;
}

.legal-updated {
    margin: 0 0 36px;
    color: var(--text-light);
    font-size: 12px;
}

.legal-container h3 {
    margin: 30px 0 10px;
    font-family: 'Manrope', sans-serif;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.5;
}

.legal-container p,
.legal-container li {
    max-width: 800px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.95;
    overflow-wrap: anywhere;
}

.legal-container p {
    margin: 0 0 16px;
}

.legal-container ul,
.legal-container ol {
    display: grid;
    gap: 8px;
    padding-left: 23px;
    margin: 0 0 20px;
}

.legal-container a:not(.legal-back) {
    color: var(--blue-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.legal-container a:not(.legal-back):hover {
    color: var(--navy);
}

.legal-container strong {
    color: var(--text);
    font-weight: 700;
}

.legal-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 30px;
}

.legal-navigation a {
    display: inline-flex;
    align-items: center;
    padding: 8px 13px;
    color: var(--text-secondary);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    text-decoration: none;
}

.legal-navigation a:hover {
    color: var(--blue);
    border-color: var(--blue);
}

.legal-section {
    padding: 88px 0;
    background: var(--white);
    border-top: 1px solid var(--border);
}

.legal-section:nth-of-type(even) {
    background: var(--background);
}

.legal-section:target {
    scroll-margin-top: 100px;
}

.legal-section:target .legal-container {
    animation: legal-focus 0.5s ease;
}

@keyframes legal-focus {
    from {
        opacity: 0.75;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-section {
    padding: 85px 0;
    color: var(--white);
    background: radial-gradient(circle at 80% 0, rgba(56, 120, 246, 0.2), transparent 35%), var(--navy);
    text-align: center;
}

.cta-section .section-label {
    color: #a9c6ff;
}

.cta-section h2 {
    margin: 17px 0 13px;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(32px, 4.5vw, 48px);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.25;
}

.cta-section p {
    max-width: 560px;
    margin: 0 auto 28px;
    color: #bdc9d7;
    font-size: 13px;
    line-height: 1.9;
}

.cta-section .button {
    display: inline-flex;
}

.site-footer {
    padding: 42px 0 22px;
    background: var(--white);
    border-top: 1px solid var(--border);
}

.footer-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 35px;
    padding-bottom: 35px;
}

.footer-brand .brand {
    font-size: 21px;
}

.footer-brand .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
}

.footer-brand p {
    max-width: 290px;
    margin: 12px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 25px;
    padding-top: 9px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a[aria-current="page"] {
    color: var(--blue);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-top: 20px;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    font-size: 10px;
    line-height: 1.8;
}

.toast {
    position: fixed;
    z-index: 1000;
    right: 24px;
    bottom: 24px;
    max-width: min(420px, calc(100% - 32px));
    padding: 15px 19px;
    color: var(--white);
    background: var(--navy);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    box-shadow: 0 12px 35px rgba(16, 24, 32, 0.2);
    font-size: 12px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.toast.success {
    background: #126647;
}

.toast.error {
    background: #a52d35;
}

.toast.warning {
    background: #79500e;
}

.is-loading {
    pointer-events: none;
    opacity: 0.65;
}

.loading-indicator {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1050px) {
    .main-navigation {
        gap: 19px;
    }

    .hero-grid {
        gap: 40px;
    }

    .workspace-grid {
        grid-template-columns: minmax(0, 1fr) 285px;
        gap: 18px;
    }

    .card {
        padding: 23px;
    }
}

@media (max-width: 800px) {
    .container {
        width: min(calc(100% - 36px), var(--container));
    }

    .header-inner {
        min-height: 72px;
    }

    .menu-toggle {
        display: block;
        position: relative;
        z-index: 102;
    }

    .main-navigation {
        position: fixed;
        z-index: 101;
        inset: 72px 0 0;
        display: flex;
        align-items: stretch;
        flex-direction: column;
        gap: 0;
        padding: 20px 24px 35px;
        overflow-y: auto;
        background: var(--white);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    }

    .main-navigation.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .main-navigation > a:not(.button) {
        padding: 15px 3px;
        border-bottom: 1px solid var(--border);
        font-size: 14px;
    }

    .main-navigation > .button {
        margin-top: 20px;
    }

    .home-hero {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .hero {
        padding: 75px 0 80px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .hero-content {
        max-width: 650px;
    }

    .hero h1 {
        font-size: clamp(45px, 9vw, 65px);
        letter-spacing: -2.8px;
    }

    .home-hero .hero-preview {
        justify-self: stretch;
        width: 100%;
        max-width: none;
    }

    .hero-preview {
        width: min(100%, 560px);
        margin: 0 auto;
    }

    .section {
        padding: 75px 0;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .workspace-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .workspace-heading {
        align-items: flex-start;
    }

    .legal-page {
        padding-top: 35px;
        padding-bottom: 50px;
    }

    .legal-section {
        padding: 70px 0;
    }

    .footer-main {
        flex-direction: column;
        gap: 24px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 520px) {
    .container {
        width: calc(100% - 30px);
    }

    .brand {
        gap: 8px;
        font-size: 22px;
    }

    .brand-mark {
        width: 35px;
        height: 35px;
        flex-basis: 35px;
        padding: 7px;
        border-radius: 10px;
    }

    .hero {
        padding: 58px 0 65px;
    }

    .home-hero {
        padding: 48px 0;
    }

    .hero h1 {
        margin-top: 21px;
        font-size: clamp(39px, 11vw, 53px);
        letter-spacing: -2.2px;
    }

    .hero-description {
        font-size: 14px;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions .button {
        width: 100%;
    }

    .trust-note {
        align-items: flex-start;
        font-size: 11px;
    }

    .hero-preview {
        padding: 10px 5px;
    }

    .hero-preview::before {
        border-radius: 20px;
    }

    .preview-header {
        padding: 24px 20px;
    }

    .preview-header h2 {
        font-size: 22px;
    }

    .preview-content {
        padding: 7px 17px;
    }

    .preview-item {
        gap: 10px;
    }

    .preview-icon {
        width: 37px;
        height: 37px;
        flex-basis: 37px;
        padding: 10px;
    }

    .preview-item-text strong {
        font-size: 11px;
    }

    .preview-item-text small {
        font-size: 9px;
    }

    .preview-status {
        padding: 4px 5px;
        font-size: 8px;
    }

    .preview-disclaimer {
        padding: 13px 17px;
    }

    .section {
        padding: 62px 0;
    }

    .workspace-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .workspace-heading h2 {
        font-size: 31px;
    }

    .workspace-grid,
    .workspace-main,
    .workspace-sidebar {
        gap: 16px;
    }

    .workspace-sidebar {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 19px;
        border-radius: 12px;
    }

    .card-heading {
        align-items: flex-start;
        gap: 10px;
    }

    .card-heading h3 {
        font-size: 14px;
    }

    .small-label {
        font-size: 9px;
        text-align: right;
    }

    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 13px;
    }

    .compose-footer {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .compose-footer p {
        max-width: none;
    }

    .compose-footer .button {
        width: 100%;
    }

    .history-item {
        gap: 10px;
    }

    .history-status {
        font-size: 9px;
    }

    .message-list {
        max-height: 420px;
    }

    .message-item {
        padding: 13px 10px;
    }

    .reader-card .card-heading h3 {
        font-size: 16px;
    }

    .reader-body {
        max-height: 360px;
        padding: 13px;
        font-size: 12.5px;
    }

    .reader-actions .button {
        width: 100%;
    }

    .legal-page {
        padding: 30px 0 45px;
    }

    .legal-container {
        width: calc(100% - 30px);
    }

    .legal-back {
        margin-bottom: 25px;
    }

    .legal-container h2 {
        font-size: 34px;
        letter-spacing: -1.4px;
    }

    .legal-container h3 {
        margin-top: 25px;
        font-size: 16px;
    }

    .legal-container p,
    .legal-container li {
        font-size: 13px;
        line-height: 1.9;
    }

    .legal-navigation {
        gap: 8px;
    }

    .legal-navigation a {
        font-size: 11px;
    }

    .cta-section {
        padding: 65px 0;
    }

    .cta-section h2 {
        font-size: 35px;
        letter-spacing: -1.5px;
    }

    .footer-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    .footer-bottom {
        font-size: 10px;
    }

    .toast {
        right: 12px;
        bottom: 12px;
        max-width: calc(100% - 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}