:root {
  --ink: #10213d;
  --muted: #64748b;
  --blue: #2563eb;
  --blue-deep: #174fb8;
  --blue-soft: #eaf3ff;
  --line: #dce6f2;
  --surface: #ffffff;
  --canvas: #f3f7fc;
  --success: #109179;
  --danger: #c94b62;
  --shadow: 0 12px 32px rgba(30, 64, 175, .09);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 2px; }
button:disabled, input:disabled, textarea:disabled { cursor: not-allowed; opacity: .65; }
.panel { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 13px; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .15em; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 24px; font-weight: 850; letter-spacing: -.04em; }
.brand-mark { position: relative; width: 38px; height: 38px; flex: 0 0 38px; overflow: hidden; border: 1px solid rgba(99,91,255,.14); border-radius: 11px; background: #0b1020; box-shadow: 0 7px 18px rgba(11,16,32,.24); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.button { min-height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 800; }
.primary-button { border-color: transparent; color: #fff; background: linear-gradient(135deg, #1d4ed8, #2388eb); }
.secondary-button { color: #32496a; background: #fff; }
.primary-link { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 18px; border-radius: 9px; color: #fff; text-decoration: none; background: linear-gradient(135deg, #1d4ed8, #2388eb); font-size: 12px; font-weight: 800; }
code { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: #f3f7fc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }

/* Authentication */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: linear-gradient(rgba(255,255,255,.62), rgba(255,255,255,.08)), radial-gradient(circle at 7% 7%, rgba(191,219,254,.52), transparent 25%), var(--canvas); }
.auth-shell { width: min(1120px, 100%); display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(350px, .78fr); overflow: hidden; border: 1px solid #d8e4f1; border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(30,64,175,.13); }
.auth-showcase { position: relative; overflow: hidden; padding: 58px; border-right: 1px solid var(--line); background: radial-gradient(circle at 86% 13%, rgba(147,197,253,.34), transparent 26%), linear-gradient(145deg, #fff 20%, #eff6ff 100%); }
.auth-showcase::after { content: ""; position: absolute; right: -80px; bottom: -110px; width: 280px; height: 280px; border: 50px solid rgba(37,99,235,.06); border-radius: 50%; pointer-events: none; }
.brand-large { margin-bottom: 58px; }
.auth-showcase h1 { max-width: 610px; margin: 0; color: #0f2647; font-size: clamp(40px, 5vw, 66px); line-height: 1.03; letter-spacing: -.055em; }
.auth-lead { max-width: 610px; margin: 24px 0 36px; color: #5e718c; font-size: 17px; line-height: 1.7; }
.feature-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.feature-grid article { padding: 17px; border: 1px solid #dbe7f4; border-radius: 14px; background: rgba(255,255,255,.93); box-shadow: 0 8px 20px rgba(30,64,175,.05); }
.feature-grid article > span { display: grid; width: 36px; height: 36px; place-items: center; margin-bottom: 13px; border-radius: 10px; color: #1d4ed8; background: var(--blue-soft); font-weight: 850; }
.feature-grid strong, .feature-grid small { display: block; }
.feature-grid strong { font-size: 12px; line-height: 1.4; }
.feature-grid small { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.auth-card { align-self: center; margin: 36px; padding: 36px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 12px 30px rgba(30,64,175,.08); }
.auth-icon { display: grid; width: 54px; height: 54px; place-items: center; margin-bottom: 26px; border-radius: 14px; color: #fff; background: linear-gradient(145deg, #1d4ed8, #2589ed); box-shadow: 0 12px 24px rgba(29,78,216,.24); font-size: 28px; }
.auth-card h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.auth-copy { margin: 13px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-form { display: grid; gap: 14px; }
.auth-form label, .installer-form label, .filename-control { display: grid; gap: 7px; }
.auth-form label > span, .installer-form label > span, .filename-control > span { color: #425675; font-size: 11px; font-weight: 800; }
.auth-form input, .installer-form input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #f9fbfe; outline: 0; }
.auth-form input:focus, .installer-form input:focus, .installer-form select:focus { border-color: #86ace3; background: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.07); }
.auth-form label small { margin-top: -2px; color: var(--muted); font-size: 9px; }
.signin-button, .secondary-submit { min-height: 49px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border: 0; border-radius: 10px; cursor: pointer; font-weight: 850; }
.signin-button { color: #fff; background: linear-gradient(135deg, #1d4ed8, #2589ed); box-shadow: 0 10px 22px rgba(29,78,216,.22); }
.secondary-submit { justify-content: center; color: var(--blue-deep); background: var(--blue-soft); }
.form-error { margin-bottom: 14px; padding: 11px 13px; border: 1px solid #fecdd3; border-radius: 9px; color: #9f1239; background: #fff1f2; font-size: 11px; line-height: 1.5; }
.form-success { margin-bottom: 14px; padding: 11px 13px; border: 1px solid #a7f3d0; border-radius: 9px; color: #065f46; background: #ecfdf5; font-size: 11px; line-height: 1.5; }
.register-box { margin-top: 18px; border-top: 1px solid var(--line); }
.register-box summary { padding: 16px 0 0; color: var(--blue-deep); cursor: pointer; text-align: center; font-size: 11px; font-weight: 800; }
.register-form { margin-top: 15px; }
.privacy-line { display: flex; align-items: center; gap: 8px; margin: 17px 0 0; color: #718198; font-size: 10px; }
.privacy-line i { width: 7px; height: 7px; border-radius: 50%; background: #14a38b; box-shadow: 0 0 0 4px rgba(20,163,139,.1); }
.auth-inline-link { margin-top: -5px; text-align: right; }
.auth-inline-link a, .auth-switch a, .resend-inline button { color: var(--blue-deep); font-size: 10px; font-weight: 800; }
.auth-switch { margin: 17px 0 0; color: var(--muted); text-align: center; font-size: 10px; }
.auth-main-link { min-height: 44px; display: flex; align-items: center; justify-content: center; margin-top: 15px; border-radius: 9px; color: #fff; text-decoration: none; background: linear-gradient(135deg,#1d4ed8,#2589ed); font-size: 11px; font-weight: 850; }
.resend-inline { margin-top: 12px; text-align: center; }
.resend-inline button { padding: 0; border: 0; background: transparent; cursor: pointer; }
.compact-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Shared header */
.topbar { position: relative; z-index: 20; min-height: 70px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 18px 10px 20px; border-radius: 14px; color: #fff; background: linear-gradient(110deg, #1645ae 0%, #1d65dc 58%, #238ce9 100%); box-shadow: 0 12px 28px rgba(23,84,199,.22); }
.topbar-brand { width: max-content; color: #fff; }
.topbar .brand-mark { border-color: rgba(255,255,255,.28); background: #0b1020; box-shadow: 0 6px 14px rgba(5,13,35,.25); }
.topbar nav { display: flex; align-self: stretch; gap: 38px; }
.topbar nav a { position: relative; display: flex; align-items: center; color: #fff; text-decoration: none; opacity: .74; font-size: 13px; font-weight: 750; }
.topbar nav a:hover, .topbar nav a.active { opacity: 1; }
.topbar nav a.active::after { content: ""; position: absolute; right: 0; bottom: -10px; left: 0; height: 3px; border-radius: 3px 3px 0 0; background: #7dd3fc; }
.workspace-page, .public-page { min-height: 100vh; padding: 16px; background: linear-gradient(rgba(255,255,255,.64), rgba(255,255,255,.08)), radial-gradient(circle at 7% 7%, rgba(191,219,254,.52), transparent 25%), var(--canvas); }
.account-menu { display: flex; align-items: center; justify-self: end; gap: 10px; }
.avatar { display: grid; width: 40px; height: 40px; place-items: center; border: 2px solid rgba(255,255,255,.55); border-radius: 50%; color: var(--blue-deep); background: #fff; font-size: 13px; font-weight: 850; }
.account-copy { display: grid; max-width: 170px; }
.account-copy strong, .account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 11px; }
.account-copy small { color: #dbeafe; font-size: 9px; }
.account-menu form { margin: 0; }
.logout-button { padding: 8px 11px; border: 1px solid rgba(255,255,255,.34); border-radius: 8px; color: #fff; background: rgba(255,255,255,.1); cursor: pointer; font-size: 10px; font-weight: 750; }
.logout-button:hover { color: var(--blue-deep); background: #fff; }
.mobile-menu { display: none; }

/* Workspace */
.workspace-layout { position: relative; z-index: 2; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; min-height: calc(100dvh - 102px); margin-top: 16px; }
.notes-sidebar, .editor-panel { border-radius: 14px; }
.notes-sidebar { min-height: 0; display: flex; flex-direction: column; padding: 18px; }
.new-note-button, .import-note-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; font-weight: 850; }
.new-note-button { min-height: 52px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #1d4ed8, #2388eb); box-shadow: 0 9px 20px rgba(29,78,216,.2); }
.new-note-button:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(29,78,216,.26); }
.new-note-button span { font-size: 20px; font-weight: 400; }
.import-note-button { min-height: 43px; margin-top: 9px; border: 1px dashed #93b7eb; border-radius: 10px; color: var(--blue-deep); background: #eff6ff; font-size: 10px; }
.import-note-button:hover { border-color: #568bd7; background: #e3efff; }
.import-note-button span { font-size: 16px; }
.search-box { min-height: 46px; display: flex; align-items: center; gap: 8px; margin: 16px 0 21px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: #7789a2; background: #f7faff; }
.search-box > span { font-size: 22px; transform: rotate(-18deg); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-box button { width: 25px; height: 25px; border: 0; border-radius: 50%; color: var(--blue-deep); background: #e5efff; cursor: pointer; }
.notes-list-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.notes-list-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.notes-list-heading > span { display: grid; min-width: 25px; height: 25px; place-items: center; border-radius: 999px; color: var(--blue-deep); background: #e5efff; font-size: 10px; font-weight: 850; }
.notes-list { min-height: 0; flex: 1; overflow-y: auto; padding: 2px 2px 14px; scrollbar-width: thin; scrollbar-color: #bfd2ec transparent; }
.note-card { position: relative; width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; margin-bottom: 9px; padding: 12px; border: 1px solid #e1e9f3; border-radius: 11px; color: var(--ink); text-align: left; background: #fff; cursor: pointer; }
.note-card:hover { border-color: #a8c3eb; background: #f8fbff; }
.note-card.active { border-color: #7fa9e8; background: #edf5ff; box-shadow: 0 8px 18px rgba(29,78,216,.08); }
.note-card.active::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: -2px; width: 4px; border-radius: 4px; background: var(--blue); }
.note-icon { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #c8dcf7; border-radius: 9px; color: #1d5bc9; background: #eaf3ff; }
.note-summary { min-width: 0; }
.note-summary strong, .note-summary small, .note-summary em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-summary strong { font-size: 11px; }
.note-summary small { margin-top: 4px; color: #2772d6; font-size: 8px; font-style: normal; }
.note-summary em { margin-top: 5px; color: #75839a; font-size: 8px; font-style: normal; }
.note-chevron { color: #8a98ad; font-size: 21px; }
.empty-notes { margin: 28px 8px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; }
.note-skeleton { height: 78px; border-radius: 11px; background: linear-gradient(90deg, #f1f5f9, #e6effb, #f1f5f9); background-size: 200% 100%; animation: shimmer 1.1s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.shortcut-tip { display: flex; align-items: center; justify-content: space-between; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); }
.shortcut-tip kbd { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: #f6f9fd; font-size: 8px; font-weight: 800; }
.shortcut-tip small { font-size: 9px; }
.editor-panel { min-width: 0; display: flex; overflow: hidden; flex-direction: column; background: #fff; }
.editor-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 27px 30px 21px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, #fbfdff); }
.title-group { min-width: 0; flex: 1; }
.title-input { width: 100%; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: clamp(27px,3vw,38px); font-weight: 850; letter-spacing: -.045em; }
.title-input::placeholder { color: #a6b3c5; }
.save-status { display: flex; align-items: center; gap: 8px; margin: 9px 0 0; color: var(--success); font-size: 10px; font-weight: 750; }
.save-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(16,145,121,.1); }
.save-status.saving, .save-status.loading { color: var(--blue); }
.save-status.saving i { animation: pulse 1s infinite; }
.save-status.error { color: var(--danger); }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.editor-actions button, .editor-toolbar button { border: 1px solid #d8e4f0; color: #334a69; background: #fff; cursor: pointer; font-weight: 750; }
.editor-actions button { min-height: 40px; padding: 0 13px; border-radius: 9px; font-size: 10px; }
.editor-actions button:hover, .editor-toolbar button:hover { border-color: #8cb3ea; color: var(--blue-deep); background: #eff6ff; }
.editor-actions .share-button { border-color: #9fc0ed; color: var(--blue-deep); background: #eaf3ff; }
.editor-actions .delete-button { width: 40px; padding: 0; color: var(--danger); }
.editor-toolbar { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 30px; border-bottom: 1px solid #e5ebf3; color: #718198; background: #f8fafd; font-size: 9px; }
.editor-toolbar > i { width: 1px; height: 14px; background: var(--line); }
.editor-toolbar button { padding: 5px 8px; border-radius: 7px; font-size: 8px; }
.editor-toolbar button:first-of-type { margin-left: auto; }
.note-editor, .public-content { width: 100%; min-height: 0; flex: 1; resize: none; padding: 28px 30px; border: 0; outline: 0; color: #243653; background: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: 15px; line-height: 1.8; scrollbar-width: thin; scrollbar-color: #bfd2ec transparent; }
.document-footer { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 30px; border-top: 1px solid var(--line); color: #718198; background: #fbfdff; font-size: 9px; }
.document-footer strong { color: #405574; }
.sidebar-scrim { display: none; }

/* Share modal */
.modal-backdrop[hidden] { display: none; }
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(15,35,66,.35); backdrop-filter: blur(4px); }
.share-modal { position: relative; width: min(520px, 100%); padding: 30px; border-radius: 16px; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: #f8fafd; cursor: pointer; font-size: 19px; }
.share-icon { display: grid; width: 50px; height: 50px; place-items: center; margin-bottom: 20px; border-radius: 13px; color: #fff; background: linear-gradient(145deg,#1d4ed8,#2589ed); box-shadow: 0 12px 24px rgba(29,78,216,.22); font-size: 22px; }
.share-modal h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.share-modal > p:not(.eyebrow) { margin: 12px 0 21px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.private-share { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafd; }
.private-share > span { color: #9aa8ba; }
.private-share strong, .private-share small { display: block; }
.private-share strong { font-size: 12px; }
.private-share small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.activate-share { width: 100%; min-height: 49px; margin-top: 12px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(135deg,#1d4ed8,#2589ed); cursor: pointer; font-weight: 850; }
.share-link-field { display: grid; gap: 7px; }
.share-link-field > span { color: #526680; font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.share-link-field > div { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafd; }
.share-link-field input { min-width: 0; flex: 1; padding: 0 8px; border: 0; outline: 0; color: #50627d; background: transparent; font-size: 10px; }
.share-link-field button { min-height: 37px; padding: 0 13px; border: 0; border-radius: 7px; color: #fff; background: var(--blue-deep); cursor: pointer; font-size: 10px; font-weight: 850; }
.share-modal-actions { display: flex; justify-content: space-between; gap: 9px; margin-top: 11px; }
.share-modal-actions a, .share-modal-actions button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; cursor: pointer; font-size: 9px; font-weight: 850; }
.share-modal-actions a { color: var(--blue-deep); background: #edf5ff; }
.share-modal-actions button { color: var(--danger); background: #fff; }
.share-active { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: #60738e; font-size: 9px; }
.share-active i { width: 7px; height: 7px; border-radius: 50%; background: #14a38b; box-shadow: 0 0 0 4px rgba(20,163,139,.1); }
.modal-export { width: 100%; min-height: 44px; margin-top: 20px; border: 1px dashed #8db3e8; border-radius: 10px; color: var(--blue-deep); background: #f0f6ff; cursor: pointer; font-size: 10px; font-weight: 850; }

/* Public note */
.public-badge { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px; color: #fff; background: rgba(255,255,255,.12); font-size: 9px; font-weight: 850; }
.public-badge i { width: 7px; height: 7px; border-radius: 50%; background: #5eead4; }
.topbar-secondary { justify-self: end; padding: 10px 13px; border-radius: 9px; color: var(--blue-deep); text-decoration: none; background: #fff; font-size: 9px; font-weight: 850; }
.public-shell { width: min(1050px, 100%); margin: 30px auto 0; }
.public-document { min-height: min(680px, calc(100vh - 170px)); display: flex; overflow: hidden; flex-direction: column; border-radius: 14px; }
.public-document-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; padding: 30px 34px 24px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg,#fff,#fbfdff); }
.public-document-header h1 { margin: 0; font-size: clamp(28px,4vw,44px); line-height: 1.08; letter-spacing: -.045em; }
.public-document-header > div:first-child > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 9px; }
.public-actions { display: flex; gap: 8px; }
.public-content { min-height: 430px; resize: vertical; padding: 30px 34px; font-size: 15px; }
.download-card { display: grid; grid-template-columns: auto minmax(220px,1fr) minmax(210px,.7fr) auto; align-items: center; gap: 18px; margin-top: 16px; padding: 20px 23px; border-radius: 14px; }
.download-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg,#1d4ed8,#2589ed); font-size: 22px; }
.download-description .eyebrow { margin-bottom: 4px; font-size: 8px; }
.download-description h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.download-description > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.filename-control input { min-width: 0; min-height: 41px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--ink); background: #f8fafd; font-size: 10px; }
.download-button { min-height: 42px; display: flex; align-items: center; justify-content: center; padding: 0 15px; border-radius: 9px; color: #fff; text-decoration: none; white-space: nowrap; background: linear-gradient(135deg,#1d4ed8,#2589ed); font-size: 10px; font-weight: 850; }
.unavailable-card { width: min(510px, 100%); margin: 12vh auto 0; padding: 42px; border-radius: 16px; text-align: center; }
.unavailable-icon { display: grid; width: 56px; height: 56px; place-items: center; margin: 0 auto 22px; border-radius: 14px; color: #fff; background: linear-gradient(145deg,#1d4ed8,#2589ed); font-size: 26px; }
.unavailable-card h1 { margin: 0; font-size: 31px; letter-spacing: -.04em; }
.unavailable-card > p:not(.eyebrow) { margin: 13px 0 24px; color: var(--muted); line-height: 1.6; }

/* Installer */
.installer-page { min-height: 100vh; padding: 28px; background: linear-gradient(rgba(255,255,255,.64),rgba(255,255,255,.08)), radial-gradient(circle at 7% 7%,rgba(191,219,254,.52),transparent 25%), var(--canvas); }
.installer-shell { width: min(900px, 100%); margin: 0 auto; }
.installer-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding: 10px 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.version-pill { padding: 7px 10px; border-radius: 999px; color: var(--blue-deep); background: var(--blue-soft); font-size: 9px; font-weight: 850; }
.installer-intro { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: center; margin-bottom: 18px; padding: 28px; border-radius: 16px; color: #fff; background: linear-gradient(110deg,#1645ae,#1d65dc 58%,#238ce9); box-shadow: 0 14px 32px rgba(23,84,199,.2); }
.installer-intro .eyebrow { color: #bae6fd; }
.installer-intro h1 { margin: 0; font-size: clamp(28px,4vw,42px); letter-spacing: -.045em; }
.installer-intro p:last-child { margin: 11px 0 0; color: #dbeafe; font-size: 12px; line-height: 1.6; }
.requirement-list { display: grid; gap: 7px; }
.requirement { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.09); font-size: 9px; font-weight: 700; }
.requirement i { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: #0f4a3d; background: #5eead4; font-style: normal; font-weight: 900; }
.requirement.failed i { color: #881337; background: #fda4af; }
.installer-form { display: grid; gap: 14px; }
.installer-card { position: relative; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.section-number { position: absolute; top: 25px; left: 25px; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; color: var(--blue-deep); background: var(--blue-soft); font-size: 12px; font-weight: 900; }
.section-heading { min-height: 42px; margin: 0 0 18px 48px; }
.section-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.installer-form label { margin-top: 13px; }
.installer-form label small { color: var(--muted); font-size: 9px; }
.installer-form select { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #f9fbfe; outline: 0; }
.form-grid { display: grid; gap: 12px; }
.two-columns { grid-template-columns: 1fr 1fr; }
.install-button { min-height: 55px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#1d4ed8,#2589ed); box-shadow: 0 12px 25px rgba(29,78,216,.22); cursor: pointer; font-weight: 900; }
.install-button span { font-size: 20px; font-weight: 400; }
.alert { margin-bottom: 14px; padding: 13px 15px; border: 1px solid; border-radius: 10px; font-size: 11px; line-height: 1.5; }
.alert ul { margin: 7px 0 0; padding-left: 19px; }
.error-alert { border-color: #fecdd3; color: #9f1239; background: #fff1f2; }
.success-alert { border-color: #a7f3d0; color: #065f46; background: #ecfdf5; }
.success-alert a { color: inherit; font-weight: 850; }
.installer-complete { margin-top: 10vh; text-align: center; }
.complete-icon { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 22px; border-radius: 16px; color: #fff; background: #14a38b; font-size: 26px; }
.installer-complete h1 { margin: 0; font-size: 34px; letter-spacing: -.04em; }
.installer-complete > p:not(.eyebrow) { max-width: 560px; margin: 14px auto 25px; color: var(--muted); line-height: 1.65; }
.smtp-test-shell { max-width: 720px; }
.tool-title { margin: 0; font-size: clamp(30px,5vw,44px); letter-spacing: -.045em; }
.tool-copy { margin: 12px 0 22px; color: var(--muted); line-height: 1.7; }
.smtp-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.smtp-summary div { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbff; }
.smtp-summary dt { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.smtp-summary dd { overflow-wrap: anywhere; margin: 6px 0 0; color: var(--ink); font-size: 12px; font-weight: 750; }

.toast { position: fixed; z-index: 80; right: 24px; bottom: 24px; max-width: min(360px,calc(100vw - 36px)); padding: 12px 15px; border: 1px solid #233f6a; border-radius: 10px; color: #fff; background: #102a50; box-shadow: 0 14px 32px rgba(15,35,66,.23); opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; font-size: 11px; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; max-width: 680px; }
  .auth-showcase { padding: 40px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-large { margin-bottom: 38px; }
  .auth-card { margin: 28px; }
  .workspace-layout { grid-template-columns: 286px minmax(0,1fr); }
  .account-copy { display: none; }
  .download-card { grid-template-columns: auto 1fr auto; }
  .filename-control { grid-column: 2 / 3; }
  .download-button { grid-column: 3 / 4; grid-row: 1 / 3; }
}

@media (max-width: 760px) {
  .auth-page, .workspace-page, .public-page, .installer-page { padding: 10px; }
  .auth-shell { border-radius: 14px; }
  .auth-showcase { padding: 28px 22px; }
  .auth-showcase h1 { font-size: 38px; }
  .auth-lead { font-size: 14px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article { display: grid; grid-template-columns: 36px 1fr; column-gap: 11px; }
  .feature-grid article > span { grid-row: 1 / 3; margin: 0; }
  .auth-card { margin: 14px; padding: 27px 22px; }
  .topbar { min-height: 62px; grid-template-columns: auto 1fr auto; padding: 8px 9px; border-radius: 12px; }
  .mobile-menu { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 9px; color: #fff; background: rgba(255,255,255,.12); }
  .topbar-brand { justify-self: center; font-size: 19px; }
  .topbar-brand .brand-mark { width: 30px; height: 30px; flex-basis: 30px; transform: scale(.82); }
  .topbar nav, .logout-button { display: none; }
  .avatar { width: 37px; height: 37px; }
  .workspace-layout { grid-template-columns: 1fr; min-height: calc(100dvh - 88px); margin-top: 10px; }
  .notes-sidebar { position: fixed; z-index: 40; top: 82px; bottom: 10px; left: 10px; width: min(335px,calc(100vw - 54px)); border-radius: 12px; transform: translateX(calc(-100% - 24px)); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
  .notes-sidebar.open { transform: translateX(0); }
  .sidebar-scrim.show { position: fixed; z-index: 35; inset: 0; display: block; border: 0; background: rgba(15,35,66,.24); backdrop-filter: blur(2px); }
  .editor-panel { min-height: calc(100dvh - 88px); border-radius: 14px; }
  .editor-header { flex-direction: column; padding: 23px 19px 18px; }
  .editor-actions { width: 100%; }
  .editor-actions button { flex: 1; }
  .editor-actions .delete-button { flex: 0 0 40px; }
  .editor-toolbar { min-height: 50px; flex-wrap: wrap; padding: 5px 19px; }
  .editor-toolbar > i, .editor-toolbar > span:nth-of-type(2) { display: none; }
  .editor-toolbar button:first-of-type { margin-left: auto; }
  .note-editor, .public-content { min-height: 52vh; padding: 21px 19px; font-size: 14px; }
  .document-footer { min-height: 62px; align-items: flex-start; flex-direction: column; justify-content: center; padding: 9px 19px; }
  .share-modal { padding: 26px 20px; border-radius: 14px; }
  .share-modal-actions { flex-direction: column; }
  .share-modal-actions a, .share-modal-actions button { width: 100%; }
  .public-topbar { grid-template-columns: 1fr auto; }
  .public-badge { justify-self: end; }
  .topbar-secondary { display: none; }
  .public-shell { margin-top: 10px; }
  .public-document { min-height: calc(100dvh - 88px); border-radius: 14px; }
  .public-document-header { flex-direction: column; padding: 24px 19px 18px; }
  .public-actions { width: 100%; }
  .public-actions button { flex: 1; }
  .download-card { grid-template-columns: auto 1fr; padding: 18px; border-radius: 14px; }
  .filename-control, .download-button { grid-column: 1 / -1; grid-row: auto; }
  .installer-header { border-radius: 12px; }
  .installer-intro { grid-template-columns: 1fr; padding: 23px; border-radius: 14px; }
  .installer-card { padding: 21px; }
  .section-number { top: 20px; left: 20px; }
  .two-columns { grid-template-columns: 1fr; gap: 0; }
  .smtp-summary { grid-template-columns: 1fr; }
  .toast { right: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
