:root {
  --bg: #fbfbfd; --surface: #ffffff; --fg: #15161a; --muted: #6c6d75; --line: rgba(20,22,30,.08); --soft: #f1f2f6; --soft-2: #e9eaf0;
  --accent: #2b4fd1; --accent-soft: rgba(43,79,209,.10); --warn: #b4541a; --ok: #1f9d55; --you: #2b4fd1; --you-fg: #fff;
  --shadow: 0 1px 2px rgba(16,18,27,.04), 0 6px 24px rgba(16,18,27,.06); --radius: 18px; color-scheme: light dark;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0f1013; --surface: #17181c; --fg: #f1f2f5; --muted: #9a9ba3; --line: rgba(255,255,255,.08); --soft: #1f2025; --soft-2: #26272d;
  --accent: #7d97ff; --accent-soft: rgba(125,151,255,.14); --warn: #f0a060; --ok: #4ad087; --you: #3d5ee0; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.35);
} }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow-x: hidden; background: var(--bg); color: var(--fg); font: 15.5px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
#app { height: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; border-radius: 12px; padding: 0; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mark-svg polygon { fill: var(--accent); } .mark-svg path { stroke: var(--accent); }
.primary { background: var(--accent); color: #fff; font-weight: 600; padding: 12px 18px; }
.primary.big { padding: 14px 18px; font-size: 16px; } .primary:disabled { opacity: .6; }
.link { color: var(--accent); padding: 4px 0; align-self: flex-start; }
.note { color: var(--muted); font-size: 14px; } .warn { color: var(--warn); }
.fine { color: var(--muted); font-size: 13px; margin-top: 18px; }
.muted { color: var(--muted); font-size: 13.5px; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.empty { color: var(--muted); text-align: center; margin-top: 16vh; } .empty.small { margin: 4px 0; text-align: left; }

/* the first screen */
.start { max-width: 25rem; margin: 14vh auto 0; padding: 0 20px; display: flex; flex-direction: column; gap: 14px; }
.logo { width: 88px; height: 88px; border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; margin-bottom: 6px; }
.start h1 { font-size: 30px; letter-spacing: -.02em; margin: 4px 0 0; }
.lede { color: var(--muted); margin: 0 0 6px; }
.trust { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; }

/* signed in */
.shell { height: 100%; display: grid; grid-template-columns: 76px minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; border-right: 1px solid var(--line); }
.rail-logo { position: relative; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 12px; background: var(--surface); box-shadow: var(--shadow); transition: transform .15s; }
.rail-logo:hover { transform: scale(1.05); }
.dot { position: absolute; right: 4px; bottom: 4px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface); background: var(--muted); }
.dot.up { background: var(--ok); } .dot.down { background: var(--warn); }
.rail-btn { width: 46px; height: 46px; display: grid; place-items: center; color: var(--muted); border-radius: 14px; position: relative; text-decoration: none; }
.rail-btn:hover { background: var(--soft); color: var(--fg); }
.rail-btn.on { background: var(--accent-soft); color: var(--accent); }
.badge { position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }

.main { position: relative; min-width: 0; height: 100%; overflow: hidden; }
.chat { position: relative; height: 100%; display: flex; flex-direction: column; }
.chat-top { position: absolute; top: 14px; left: 20px; z-index: 2; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 500; color: var(--fg); text-decoration: none; }
.view { flex: 1; height: 100%; overflow-y: auto; padding: 64px 24px 150px; }
.view.padded { padding: 40px 28px 60px; }
.thread, .list { max-width: 46rem; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.list h1 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 6px; }
.list h3 { font-size: 12.5px; color: var(--muted); margin: 16px 0 0; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 12px; }
.center { text-align: center; }
.focus > .card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }

.composer { position: absolute; left: 24px; right: 24px; bottom: 20px; max-width: 46rem; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); padding: 8px; }
.composer-row { display: flex; align-items: flex-end; gap: 6px; }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--fg); font: inherit; padding: 9px 4px; max-height: 220px; }
.composer-note { font-size: 13px; padding: 4px 10px 8px; }
.plus-wrap { position: relative; }
.plus, .send { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.plus { color: var(--muted); } .plus:hover, .plus[aria-expanded="true"] { background: var(--soft); color: var(--fg); }
.send { background: var(--accent); color: #fff; } .send:disabled { opacity: .35; }
.menu { position: absolute; bottom: 46px; left: 0; min-width: 170px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; z-index: 3; }
.menu button { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-align: left; } .menu button:hover { background: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 4px 8px; }
.chip { position: relative; display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 6px 30px 6px 6px; border-radius: 12px; background: var(--soft); overflow: hidden; }
.chip img, .chip-icon { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--soft-2); }
.chip-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.bad { outline: 1px solid var(--warn); }
.chip-x { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); }
.chip-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--soft-2); } .chip-bar span { display: block; height: 100%; background: var(--accent); }
.chat.dropping .view { outline: 2px dashed var(--accent); outline-offset: -12px; border-radius: 20px; }
.drop-hint { position: absolute; inset: auto 0 50% 0; text-align: center; color: var(--accent); font-weight: 600; pointer-events: none; }

.working { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; padding: 2px 4px; }
.dots { display: inline-flex; gap: 3px; } .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; } .dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.day { text-align: center; color: var(--muted); font-size: 12.5px; margin: 14px 0 2px; }
.msg { display: flex; flex-direction: column; gap: 8px; max-width: 86%; min-width: 0; }
.bubble, .card { overflow-wrap: anywhere; }
.msg.you { align-self: flex-end; align-items: flex-end; }
.msg.me { align-self: flex-start; }
.bubble { padding: 12px 16px; border-radius: var(--radius); background: var(--soft); }
.msg.you .bubble { background: var(--you); color: var(--you-fg); border-bottom-right-radius: 6px; }
.msg.me .bubble { border-bottom-left-radius: 6px; }
.msg.you .bubble a { color: inherit; }
.quote { font-size: 13px; opacity: .8; border-left: 3px solid currentColor; padding-left: 8px; margin-bottom: 6px; }
.meta { color: var(--muted); font-size: 12px; padding: 0 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13.5px; opacity: .9; }
.rich p { margin: 0 0 8px; } .rich p:last-child { margin: 0; } .rich a { color: var(--accent); text-underline-offset: 2px; }
.msg.you .rich a { color: inherit; }
.rich code, pre { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(127,127,127,.14); border-radius: 6px; padding: 1px 5px; }
pre { padding: 10px 12px; white-space: pre-wrap; word-break: break-word; margin: 0; }
.shot { max-width: 100%; border-radius: 14px; margin-top: 6px; display: block; } .shot.placeholder { width: 220px; height: 140px; background: var(--soft-2); }
.choices { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 30rem; }
.choice { text-align: left; padding: 11px 14px; border: 1px dashed var(--soft-2); border-radius: 14px; background: var(--surface); }
.choice:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.choice.chosen { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.choice:disabled:not(.chosen) { opacity: .5; }

.hello { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-top: 12vh; }
.hello-mark { width: 72px; height: 72px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; margin-bottom: 8px; }
.hello h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 15rem)); gap: 10px; margin-top: 18px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); font-weight: 500; }
.tile .icon { color: var(--accent); } .tile:hover { border-color: var(--accent); }

.card { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; color: var(--fg); text-decoration: none; }
.row-btn:hover { border-color: var(--accent); }
.card-title { font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 8px; width: 100%; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; font-size: 14.5px; } dt { color: var(--muted); } dd { margin: 0; font-weight: 500; }
.scroll { overflow-x: auto; } table { border-collapse: collapse; font-size: 14px; } th { text-align: left; color: var(--muted); font-weight: 600; } th, td { padding: 5px 16px 5px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
blockquote { margin: 0; padding-left: 10px; border-left: 3px solid var(--accent); font-style: italic; }
.linkcard { font-weight: 500; color: var(--accent); }
.source { color: var(--muted); font-size: 12px; }
.weather .place { font-weight: 600; } .weather .big { font-size: 46px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
.hours { display: flex; gap: 16px; overflow-x: auto; padding-top: 6px; } .hour { display: flex; flex-direction: column; align-items: center; font-size: 13.5px; }
.days { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: 4px; } .dayrow { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mails { display: flex; flex-direction: column; gap: 2px; }
.mail { display: grid; grid-template-columns: 1fr auto; text-align: left; padding: 8px 6px; border-radius: 10px; gap: 0 10px; }
.mail:hover { background: var(--soft); }
.mail .from { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mail.unread .from { font-weight: 700; }
.mail .when { color: var(--muted); font-size: 12.5px; } .mail .subject { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the logo's drawer, and sheets */
.scrim { position: fixed; inset: 0; z-index: 10; background: rgba(10,12,18,.32); backdrop-filter: blur(3px); animation: fade .15s ease-out; }
.scrim.center { display: grid; place-items: center; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.drawer { position: absolute; top: 10px; bottom: 10px; left: 10px; width: min(360px, calc(100% - 20px)); overflow-y: auto; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 18px; animation: slide .18s ease-out; }
.drawer-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.drawer-mark { width: 56px; height: 56px; border-radius: 18px; background: var(--bg); display: grid; place-items: center; }
.drawer-name { font-size: 19px; font-weight: 650; }
.status { font-size: 13.5px; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.up::before { background: var(--ok); } .status.down::before { background: var(--warn); }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); } .icon-btn:hover { background: var(--soft); color: var(--fg); }
.drawer section { display: flex; flex-direction: column; gap: 2px; }
.drawer h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.drawer-row { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 12px; color: var(--fg); text-decoration: none; }
.drawer-row:hover { background: var(--soft); }
.row-title { font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .row-meta.pad { padding: 0 10px; }
.drawer-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.danger-link { display: inline-flex; align-items: center; gap: 8px; color: var(--warn); padding: 8px 10px; border-radius: 12px; align-self: flex-start; } .danger-link:hover { background: var(--soft); }
.sheet { width: min(44rem, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); animation: rise .18s ease-out; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 8px; }
.sheet-head h2 { margin: 0; font-size: 19px; line-height: 1.3; }
.sheet-body { overflow-y: auto; padding: 0 22px 22px; }
.mail-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }

@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { order: 2; flex-direction: row; justify-content: space-around; padding: 6px 8px; border-right: 0; border-top: 1px solid var(--line); }
  .rail-logo { width: 42px; height: 42px; margin: 0; box-shadow: none; }
  .view { padding: 58px 14px 140px; } .view.padded { padding: 24px 16px 40px; }
  .composer { left: 10px; right: 10px; bottom: 10px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.card p { margin: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
