:root { --accent: #2563eb; --border: #e5e7eb; --muted: #6b7280; --bg: #f9fafb; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #111827; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 16px; } h2 { font-size: 16px; margin: 0 0 10px; }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; max-width: 1180px; margin: 0 auto; }
.side { display: flex; flex-direction: column; gap: 2px; padding: 20px 12px; border-right: 1px solid var(--border); background: #fff; }
.side .brand { font-weight: 700; font-size: 18px; padding: 0 10px; } .side .addr { color: var(--muted); font-size: 12px; padding: 0 10px 14px; word-break: break-all; }
.side a { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 8px; color: #111827; }
.side a.active, .side a:hover { background: #f3f4f6; } .side a.active { font-weight: 600; }
.side .link { margin-top: auto; text-align: left; padding: 7px 10px; }
.count { background: var(--accent); color: #fff; border-radius: 10px; font-size: 12px; padding: 0 7px; }
main { padding: 24px 28px; max-width: 960px; width: 100%; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin: 0 0 14px; }
.card.ok { border-color: #a7f3d0; background: #ecfdf5; }
label { display: block; font-weight: 500; margin: 0 0 12px; } label input, label textarea, label select { display: block; width: 100%; margin-top: 4px; font-weight: 400; }
input, textarea, select { font: inherit; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; padding: 8px 14px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; } button:disabled { opacity: .6; cursor: default; }
button.link { border: 0; background: none; color: var(--accent); padding: 0 4px; }
.switch { display: flex; align-items: center; gap: 8px; } .switch input { display: inline; width: auto; margin: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .row input:not([type=file]) { flex: 1; min-width: 160px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .empty { padding: 40px 0; text-align: center; }
.error { color: #b91c1c; } .error:empty { display: none; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; } .auth { width: 100%; max-width: 380px; }
.handle { display: flex; align-items: center; gap: 6px; } .handle input { flex: 1; } .handle span { color: var(--muted); }
.threads { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.threads li + li { border-top: 1px solid var(--border); }
.threads a { display: grid; grid-template-columns: 14px 220px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; color: #111827; }
.threads a:hover { background: #f9fafb; } .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); } .dot.off { background: transparent; }
.tag { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--border); border-radius: 10px; padding: 0 6px; }
.thread { display: grid; grid-template-columns: 1fr 240px; gap: 16px; align-items: start; }
.msg { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; max-width: 640px; }
.msg.out { margin-left: auto; border-color: color-mix(in srgb, var(--accent) 35%, white); background: color-mix(in srgb, var(--accent) 5%, white); }
.msg header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; } .msg footer { color: var(--muted); font-size: 12px; margin-top: 6px; }
.subject { font-weight: 600; } .text { white-space: pre-wrap; } .atts { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; } .att { font-size: 13px; padding: 4px 10px; }
.event, .gap { text-align: center; color: var(--muted); font-size: 13px; } .gap { color: #b45309; }
.reply textarea { width: 100%; margin-bottom: 8px; } .members ul { list-style: none; padding: 0; margin: 0 0 10px; } .members li { padding: 3px 0; font-size: 14px; word-break: break-all; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 18px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); word-break: break-all; } th { font-size: 13px; color: var(--muted); font-weight: 500; }
.token { display: block; word-break: break-all; background: #fff; padding: 8px; border: 1px solid var(--border); border-radius: 6px; }
.request header { display: flex; justify-content: space-between; }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; } .side { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px; }
  .side .addr { display: none; } .side .brand { width: 100%; padding-bottom: 6px; } .side .link { margin-top: 0; }
  main { padding: 16px; } .thread { grid-template-columns: 1fr; } .threads a { grid-template-columns: 14px 1fr auto; } .snippet { grid-column: 2 / 4; }
}
