:root {
    color-scheme: light;
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #172f36;
    background: #f1f5f2;
    --paper: #fff;
    --line: #dbe5e0;
    --muted: #537069;
    --accent: #087976;
    --wash: #e6f4ee;
}
* { box-sizing: border-box }
body { margin: 0 }
.signed-in { padding-left: 68px; background: #f7faf8 }
a { color: #076660; text-decoration: none }
button, input, textarea, select { font: inherit }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #21a499; outline-offset: 3px }
.top { background: var(--paper); border-bottom: 1px solid var(--line) }
.top-inner { min-height: 51px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 15px }
.brand, .account { display: flex; align-items: center; gap: 12px; flex-wrap: wrap }
.brand { color: #172f36; letter-spacing: -.025em }
.brand > span:last-child, .account > span { color: var(--muted) }
.mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; border-radius: 9px; background: var(--accent) }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; min-width: 0 }
.signin { min-height: min(620px, calc(100dvh - 65px)); display: grid; place-items: center; padding: 24px }
.login { width: min(100%, 410px); padding: clamp(18px, 5vw, 34px); display: grid; gap: 15px }
h1, h2 { margin: 0; line-height: 1.2; letter-spacing: -.03em; overflow-wrap: anywhere }
h1 { font-size: 1.45rem }
h2 { font-size: 1.22rem }
label { display: grid; gap: 5px; font-size: .9rem; font-weight: 600 }
input, textarea, select { width: 100%; color: inherit; padding: 8px 11px; border: 1px solid #cbd9d1; border-radius: 8px; background: #fcfdfc }
textarea { resize: vertical }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 37px; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 650; border: 1px solid transparent; font-size: .9rem }
.primary { color: white; background: var(--accent) }
.primary:hover { background: #066661 }
.secondary { color: #1c5250; background: var(--paper); border-color: var(--line) }
.secondary:hover { background: var(--wash) }
.workspace { display: grid; grid-template-columns: clamp(160px, 13vw, 228px) clamp(270px, 31vw, 465px) minmax(0, 1fr); height: calc(100dvh - 52px); background: var(--line); gap: 1px }
.workspace > .card { border: 0; border-radius: 0; min-height: 0; max-height: none }
.sidebar { padding: 10px; display: flex; flex-direction: column; gap: 11px; background: #f4f8f6; overflow: auto }
.new { width: 100% }
.folders { overflow: auto; scrollbar-width: thin }
.folders ul { margin: 0; padding: 0; list-style: none }
.folder-node { position: relative; margin-bottom: 2px }
.folder-link { min-height: 33px; display: flex; align-items: center; gap: 7px; color: #20403e; border-radius: 7px; padding: 5px 8px; font-size: .89rem }
.folder-link:hover, .folder-link[aria-current] { background: var(--wash) }
.folder-link[aria-current] { font-weight: 700; color: #09605a }
.folder-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.folder-icon { display: inline-grid; place-items: center; width: 16px; flex: 0 0 16px; color: var(--muted) }
.folders b { margin-left: auto; padding: 1px 5px; background: #edf5f2; border-radius: 5px; color: #086762; font-size: .75rem; font-variant-numeric: tabular-nums }
.has-children > .folder-link { margin-right: 27px }
.branch > summary { position: absolute; top: 0; right: 0; width: 25px; height: 33px; line-height: 33px; text-align: center; border-radius: 7px; font-size: 1.15rem }
.folders summary { list-style: none; cursor: pointer; color: var(--muted) }
.folders summary::-webkit-details-marker { display: none }
.folders summary:hover { background: var(--wash) }
.branch > summary > span { display: inline-block }
.branch[open] > summary > span { transform: rotate(90deg) }
.branch > ul { margin-left: 9px; padding-left: 4px; border-left: 1px solid var(--line) }
.branch .folder-link { font-size: .84rem }
.more-folders { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 6px }
.more-folders > summary { display: flex; align-items: center; gap: 6px; border-radius: 7px; padding: 7px 8px; font-size: .86rem; font-weight: 650 }
.more-folders > summary::before { content: '›'; display: inline-block; font-size: 1rem }
.more-folders[open] > summary::before { transform: rotate(90deg) }
.more-folders > summary > span { margin-left: auto; font-size: .75rem }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 19px; border-bottom: 1px solid var(--line) }
.search, .toolbar, .toolbar form { display: flex; align-items: center; gap: 7px }
.search { flex: 0 1 345px }
.messages { list-style: none; padding: 0; margin: 0 }
.messages li + li { border-top: 1px solid var(--line) }
.inbox, .message-pane { overflow: auto; scrollbar-width: thin }
.inbox > .section-head { position: sticky; top: 0; z-index: 1; background: var(--paper); padding: 13px 12px; gap: 8px }
.inbox > .section-head h1 { font-size: 1.16rem }
.folder-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100% }
.folder-heading .secondary { min-height: 28px; padding: 1px 8px; font-size: 1rem }
.inbox .search { flex-basis: 100% }
.inbox .search input { min-width: 0 }
.messages a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 9px; padding: 6px 12px; min-height: 60px; color: inherit; align-content: center }
.messages a:hover { background: #f4faf6 }
.messages a.unread { box-shadow: inset 3px 0 var(--accent); background: #f2faf6 }
.messages a[aria-current] { background: #deeee8; box-shadow: inset 3px 0 var(--accent) }
.messages .from { grid-area: 1 / 1 }
.messages strong { font-weight: 550; grid-row: 2; grid-column: 1/-1 }
.messages .unread strong, .messages .unread .from { font-weight: 700 }
.messages strong, .messages .from, .preview { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis }
.messages time, .preview, .empty, .pagination { font-size: .81rem; color: var(--muted) }
.messages time { grid-area: 1 / 2; font-variant-numeric: tabular-nums; align-self: baseline; text-align: right; font-size: .73rem }
.preview { grid-row: 3; grid-column: 1/-1 }
.preview b { font-size: .74rem; color: #125c55; margin-right: 3px }
.pagination { display: flex; justify-content: center; gap: 15px; padding: 12px }
.empty { padding: 14px 19px }
.compose, .reader { padding: 20px; display: grid; gap: 13px }
.compose { max-width: 930px }
.compose header, .reader header { display: flex; gap: 10px; align-items: baseline; justify-content: space-between }
.compose .primary { justify-self: start }
.details { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .9rem }
.details dt { color: var(--muted) }
.details dd { margin: 0; overflow-wrap: anywhere }
.toolbar, .toolbar form { flex-wrap: wrap }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; border-top: 1px solid var(--line); padding-top: 15px }
.attachments { margin: 0; padding-left: 20px; overflow-wrap: anywhere }
.attachments a, .pagination a, .reader header a, .compose header a { text-decoration: underline }
.reader-empty { display: grid; align-content: center; justify-items: center; min-height: min(460px, calc(100dvh - 84px)); color: var(--muted); padding: 20px; text-align: center }
.reader-empty span { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; background: var(--wash); color: var(--accent); font-size: 1.2rem }
.reader .close-reader, .compose header a { flex-shrink: 0; font-size: .86rem }
.attachment-panel { padding: 10px 11px; border: 1px solid var(--line); background: #f7faf8; border-radius: 8px }
.attachment-panel h3 { margin: 0 0 7px; color: #355750; font-size: .81rem }
.attachment-panel h3 span { margin-left: 4px; color: var(--muted) }
.attachment-panel .attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none }
.attachment-panel a { display: block; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: white; font-size: .85rem }
.feedback { color: #13564b; background: var(--wash); border-radius: 7px; margin: 10px 19px; padding: 8px 10px }
.login .feedback { margin: 0 }
.feedback.error { color: #7d2729; background: #fcecec }
.mail-nav { position: fixed; inset: 0 auto 0 0; z-index: 3; width: 68px; display: flex; flex-direction: column; gap: 5px; background: #edf4f0; border-right: 1px solid var(--line); padding: 9px 5px }
.mail-nav a { display: grid; justify-items: center; gap: 1px; color: #365650; padding: 6px 0; border-radius: 7px; font-size: .72rem; font-weight: 650 }
.mail-nav a span { font-size: 1.06rem; line-height: 1.1 }
.mail-nav a:hover, .mail-nav a[aria-current] { color: #066661; background: white; box-shadow: inset 0 0 0 1px var(--line) }
.groupware { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); align-items: start; gap: 14px; max-width: 1540px; margin: auto; padding: 15px clamp(12px, 2vw, 28px) 32px }
.groupware-form { display: grid; gap: 11px; padding: 16px }
.groupware-form h2 { margin-bottom: 4px }
.groupware-form .primary { justify-self: start }
.inline-check { display: flex; align-items: center; gap: 6px }
.inline-check input { width: auto }
.calendar-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 18px }
.calendar-controls .secondary { min-height: 28px; padding: 2px 9px }
.today-link { font-size: .84rem; text-decoration: underline }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); margin: 0 18px 12px; border-radius: 8px; overflow: hidden }
.month-grid > * { background: white; min-width: 0 }
.weekday { text-align: center; padding: 5px; background: #f0f5f2; color: var(--muted); font-size: .8rem }
.blank-day { background: #f8faf9 }
.calendar-day { min-height: 38px }
.calendar-day > * { display: flex; align-items: flex-start; justify-content: space-between; gap: 2px; min-height: 100%; padding: 5px 7px }
.calendar-day a:hover, .calendar-day.today { background: var(--wash) }
.calendar-day.today { box-shadow: inset 0 0 0 1px var(--accent) }
.calendar-day a span { font-size: .74rem; background: #dceddf; border-radius: 9px; padding: 0 5px }
.agenda { border-top: 1px solid var(--line); padding: 10px 18px }
.agenda h3 { margin: 0 0 4px; font-size: .87rem; color: var(--muted) }
.agenda-item { border-radius: 7px; padding: 5px 8px }
.agenda-item:hover { background: #f4faf6 }
.agenda-item summary { cursor: pointer; overflow-wrap: anywhere }
.agenda-item summary span { color: var(--muted); font-size: .82rem; margin-right: 9px }
.agenda-item dl, .agenda-item .body-text { margin-top: 8px }
.contact-list { margin: 0; padding: 0; list-style: none }
.contact-list li { padding: 10px 18px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere }
.contact-list li > div { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: .88rem }
.contact-list a { text-decoration: underline }
@media (max-width: 800px) {
    .groupware { grid-template-columns: 1fr }
}
@media (max-width: 980px) {
    .workspace { grid-template-columns: clamp(165px, 25vw, 235px) minmax(0, 1fr) }
    .workspace:not(.detail-open) .message-pane, .workspace.detail-open .inbox { display: none }
}
@media (max-width: 680px) {
    .signed-in { padding-left: 0 }
    .top-inner { flex-wrap: wrap; gap: 6px }
    .mail-nav { position: static; width: 100%; flex-direction: row; order: 3; border: 0; border-radius: 7px; padding: 3px }
    .mail-nav a { display: flex; align-items: center; gap: 5px; padding: 5px 9px }
    .workspace { grid-template-columns: 1fr; height: auto }
    .workspace > .sidebar { max-height: 230px }
    .folders > ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px }
    .new { width: max-content }
    .workspace.detail-open .sidebar { display: none }
    .inbox, .message-pane { min-height: 0; max-height: none; overflow: visible }
    .inbox > .section-head { position: static }
    .messages a { padding: 10px 14px }
    .account > span { display: none }
}

/* Mailspace design surfaces and navigation. */
:root {
    --accent: #635bdf;
    --canvas: #f3f5fa;
    --panel: #f8f9fd;
    --rail: #22263a;
    --line: #e1e5ef;
    --muted: #697386;
    --wash: #eeecff;
    color: #20283c;
    background: var(--canvas);
}
.signed-in { background: var(--canvas); padding-left: 52px }
.mail-nav { width: 52px; border: 0; background: var(--rail); padding: 11px 5px }
.mail-nav a { color: #e0e3f4; font-size: .61rem; padding: 6px 1px }
.mail-nav a span { font-size: 1.17rem }
.mail-nav a:is(:hover,[aria-current]) { background: var(--accent); color: white; box-shadow: none }
.top-inner { gap: 20px; padding-inline: 14px; justify-content: flex-start }
.top-inner > .account { margin-left: auto }
.brand strong { font-size: 1.22rem; letter-spacing: -.05em }
.brand > span:last-child { font-size: .79rem }
.workspace-tabs, .list-filters { display: flex; align-items: center; gap: 4px }
.workspace-tabs a, .list-filters a { padding: 5px 10px; border-radius: 7px; color: var(--muted); font-size: .85rem }
.workspace-tabs a:is(:hover,[aria-current]), .list-filters a:is(:hover,[aria-current]) { color: var(--accent); background: var(--wash); font-weight: 650 }
.primary:hover { background: #5148c8 }
.sidebar { background: var(--panel); padding: 16px 12px }
.new { min-height: 41px; box-shadow: 0 4px 12px #635bdf28 }
.folder-link, .folder-link[aria-current], .secondary { color: #34405b }
.folder-link[aria-current], .folders b { color: #534bc5; background: var(--wash) }
.folder-icon, .folders summary { color: var(--muted) }
.inbox > .section-head { padding: 15px 15px 9px; border: 0 }
.inbox > .section-head h1 { font-size: 1.34rem }
.inbox .search input { border-color: var(--line); background: var(--canvas) }
.list-filters { padding: 0 12px 8px; border-bottom: 1px solid var(--line) }
.messages { padding: 4px 7px }
.messages li + li { border-top: 0 }
.messages a { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 2px 8px; margin: 3px 0; padding: 8px; min-height: 69px; border: 1px solid transparent; border-bottom-color: var(--line); border-radius: 10px }
.messages a:is(:hover,[aria-current]) { background: var(--wash) }
.messages a.unread { background: #f8f7ff; box-shadow: none }
.messages a[aria-current] { border-color: #bfb9f2; box-shadow: none; background: var(--wash) }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #e9e3fa; color: #5746a6; font-size: .83rem; font-weight: 700 }
.messages .avatar { grid-area: 1 / 1 / 4 / 2; align-self: center }
.messages .from { grid-area: 1 / 2 }
.messages time { grid-area: 1 / 3 }
.messages strong { grid-row: 2; grid-column: 2/-1 }
.messages .preview { grid-row: 3; grid-column: 2/-1 }
.message-pane { background: var(--canvas) }
.reader { padding: 0 0 20px; gap: 14px }
.reader .toolbar { padding: 9px 13px; background: var(--paper); border-bottom: 1px solid var(--line) }
.reader .toolbar .secondary { min-height: 31px; font-size: .79rem; padding-inline: 7px }
.reader-content { min-width: 0; display: grid; gap: 14px; margin: 0 16px; padding: 20px clamp(14px, 2vw, 29px); background: var(--paper); border: 1px solid var(--line); border-radius: 12px }
.reader-content h2 { font-size: 1.53rem }
.reader-sender { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 10px }
.reader-sender .avatar { width: 40px; height: 40px }
.reader-content .body-text { line-height: 1.78 }
.message-format { display: flex; flex-wrap: wrap; gap: 5px 15px; color: var(--muted); font-size: .79rem }
.message-format a { color: #5148c8; text-decoration: underline }
.message-html { width: 100%; height: clamp(340px, 69dvh, 1050px); border: 1px solid var(--line); border-radius: 8px; background: white }
.attachment-panel { background: var(--canvas) }
.attachment-panel h3 { color: #414269 }
.attachment-panel a { color: #5148c8 }
.compose { margin: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px }
.groupware > .card { border-radius: 12px }
@media (max-width: 680px) {
    .signed-in { padding-left: 0 }
    .top-inner { gap: 7px }
    .mail-nav { display: none }
    .workspace-tabs { order: 3; width: 100% }
    .reader-content { margin: 0 8px }
}
.workspace.full-message { grid-template-columns: minmax(0, 1fr) }
.workspace.full-message > :is(.sidebar, .inbox) { display: none }
.full-message .reader-content { width: min(100% - 24px, 1360px); margin-inline: auto }
.attachment-panel .attachments li { display: flex; flex-wrap: wrap; gap: 5px }
.pdf-preview { display: grid; gap: 8px; margin-top: 10px; scroll-margin-top: 10px }
.pdf-preview > div { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 7px }
.pdf-preview iframe { width: 100%; height: clamp(350px, 70dvh, 1050px); border: 1px solid var(--line); border-radius: 7px; background: white }
.contact-list .contact-name { display: block; font-weight: 700; text-decoration: none }
.contact-list .contact-name:hover { text-decoration: underline }
.contact-list .selected-contact { background: var(--wash) }
.contact-detail header, .contact-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap }
.contact-detail form { display: grid; gap: 9px }
.contact-detail form button { justify-self: start }
.contact-delete { border-top: 1px solid var(--line); padding-top: 8px }
.contact-delete summary { cursor: pointer; color: #842d38; font-size: .86rem }
.contact-delete form { margin-top: 8px }

