* { box-sizing: border-box; }
body { margin: 0; font-family: var(--brand-font); background: var(--brand-bg); color: var(--brand-text); line-height: 1.45; }
a { color: var(--brand-accent); }
.muted { color: var(--brand-muted); }
.pad { padding: 1rem 1.25rem; }
.hidden { display: none !important; }

#top { background: var(--brand-primary); color: var(--brand-primary-text); display: flex; align-items: center; gap: 1rem; padding: .6rem 1.25rem; }
#top .brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 1.05rem; text-decoration: none; color: inherit; }
#top .brand img { height: 28px; }
#top .spacer { flex: 1; }
#top .who { font-size: .85rem; opacity: .9; }
#top button { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.5); }

main { max-width: 1200px; margin: 0 auto; padding: 1.25rem; }
h1 { font-size: 1.4rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
.card { background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.landing { max-width: 520px; margin: 4rem auto; text-align: center; }
.landing .card { text-align: left; }

button, .btn { font: inherit; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--brand-border); background: var(--brand-surface); color: var(--brand-text); cursor: pointer; }
button.primary { background: var(--brand-primary); color: var(--brand-primary-text); border-color: var(--brand-primary); }
button.danger { color: var(--brand-danger); border-color: var(--brand-danger); }
button.link { border: 0; background: none; color: var(--brand-accent); padding: 0; text-decoration: underline; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select { font: inherit; padding: .4rem .55rem; border: 1px solid var(--brand-border); border-radius: 6px; background: #fff; max-width: 100%; }
label { display: block; font-size: .85rem; color: var(--brand-muted); margin-bottom: .2rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.row > div { min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }

table { width: 100%; border-collapse: collapse; background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--brand-border); vertical-align: top; font-size: .92rem; }
th { background: #eef0f4; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--brand-muted); }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--brand-border); margin: 1rem 0; }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--brand-muted); border-bottom: 3px solid transparent; }
.tabs a.active { color: var(--brand-text); border-bottom-color: var(--brand-primary); font-weight: 600; }

.split { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.tree { list-style: none; margin: 0; padding: 0; }
.tree li { padding: 0; }
.tree button.node { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .35rem .5rem; padding-left: calc(.5rem + var(--depth, 0) * 1rem); border-radius: 6px; }
.tree button.node:hover { background: #eef0f4; }
.tree button.node.active { background: var(--brand-primary); color: var(--brand-primary-text); }
.tree .count { float: right; opacity: .7; font-size: .8rem; }

.pill { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; border: 1px solid var(--brand-border); background: #eef0f4; }
.pill.ok { background: #e3f4ea; color: var(--brand-ok); border-color: #b7e0c8; }
.pill.warn { background: #fdf3dc; color: #8a5a00; border-color: #ecd49a; }
.pill.bad { background: #fde8e6; color: var(--brand-danger); border-color: #f4b8b2; }

.invite { white-space: pre-wrap; background: #f8f9fb; border: 1px dashed var(--brand-border); padding: .75rem; border-radius: 6px; font-size: .9rem; }
.error { color: var(--brand-danger); }
.empty { padding: 2rem 1rem; text-align: center; color: var(--brand-muted); }

#toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 10; }
.toast { background: var(--brand-text); color: #fff; padding: .6rem .9rem; border-radius: 6px; max-width: 360px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.toast.error { background: var(--brand-danger); }
