@import url('/assets/themes.css');
* { box-sizing: border-box; }

html { height:100%; }
body { height:100dvh; display:flex; flex-direction:column; overflow:hidden; margin: 0; color: var(--text); background: var(--surface); font: 15px/1.4 Arial, Helvetica, sans-serif; }
a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; border: 1px solid var(--border); border-radius: 6px; }
input, select, textarea { color: var(--text); background: var(--input); padding: 10px 12px; width: 100%; display: block; min-width: 0; }
textarea { resize: vertical; }
button { background: var(--accent); color: var(--on-accent); padding: 8px 14px; cursor: pointer; min-height: 38px; }
button:hover { filter: brightness(0.92); }
button:disabled { cursor: not-allowed; color: var(--text); background: var(--secondary); }
button.secondary, td button, .actions button { color: var(--text); background: var(--surface); }
button.danger { background: var(--error); color:var(--surface); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: 12px; top: -100px; background: var(--surface); padding: 12px; z-index: 10; border: 1px solid var(--border); }
.skip-link:focus { top: 12px; }
.topbar { flex-shrink:0; flex-wrap:wrap; min-width:0; min-height: 64px; padding: 10px 24px; background:var(--rail); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-name { display: flex; align-items: baseline; gap: 18px; }
.brand { font-size: 19px; font-weight: bold; text-decoration:none; display:flex; align-items:center; }
.account-controls { min-width:0; max-width:100%; flex-wrap:wrap; display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; }
.account-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-identity .avatar { width: 32px; height: 32px; }
.person-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-text { min-width: 0; overflow-wrap: anywhere; }
.person-text strong { display: block; font-size: 14px; }
.person-handle { display: block; font-size: 12px; }
.avatar-stack { width: 40px; height: 40px; flex-shrink: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px; overflow: hidden; }
.avatar-stack .avatar { width: 100%; height: 19px; font-size: 10px; border: 0; }
.account-name { min-width:0; max-width:24ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.app-layout { position:relative; flex:1; min-height:0; min-width:0; overflow:hidden; display:grid; grid-template-columns:224px minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
.sidebar { min-height:0; min-width:0; overflow-y:auto; border-right: 1px solid var(--border); background: var(--secondary); padding: 20px 12px 28px; }
.sidebar a { display:flex; align-items:center; gap:12px; padding:10px 12px; margin:3px 0; border-radius:5px; color:var(--muted); text-decoration:none; font-size:14px; overflow-wrap:anywhere; }
.sidebar a:hover { background:var(--hover); color:var(--text); }
.sidebar a[aria-current="page"] { background: var(--selected); color: var(--text); font-weight: bold; }
.nav-heading { font-size: 10px; font-weight:bold; text-transform:uppercase; letter-spacing:1.2px; color:var(--muted); margin:28px 12px 10px; }
main { min-height:0; min-width:0; height:100%; overflow:auto; width:100%; max-width:none; padding: 36px 40px 48px; }
h1 { font-size: 28px; letter-spacing:-0.7px; line-height: 1.2; margin: 0 0 10px; font-weight: bold; }
h2 { font-size: 18px; margin: 28px 0 14px; }
h3 { font-size: 16px; margin: 22px 0 10px; }
h4 { font-size: 15px; margin: 18px 0 8px; }
h1,h2,h3,h4,p,dd { overflow-wrap: anywhere; }
p { margin: 12px 0; }
.page-intro { color:var(--muted); margin: 0 0 30px; max-width: 760px; }
.section-label { font-size: 13px; margin: 0 0 10px; }
form { max-width: 560px; }
label { display: block; font-weight:bold; font-size:13px; margin:18px 0 8px; }
form button[type="submit"] { margin-top: 20px; }
fieldset { min-width: 0; border: 1px solid var(--border); padding: 16px 20px 20px; margin: 24px 0; }
legend { font-weight: bold; padding: 0 6px; overflow-wrap: anywhere; }
input[type="checkbox"],input[type="radio"] { display: inline-block; width: 16px; height: 16px; flex-shrink: 0; margin: 2px 8px 0 0; accent-color: var(--accent); }
.choice { display: flex; align-items: flex-start; font-weight: normal; gap: 4px; }
.message { margin: 12px 0; min-height: 21px; }
.message:empty { margin: 0; min-height: 0; }
.error,.overdue { color: var(--error); }
.success { color: var(--success); }
.hint { margin:8px 0; font-size:12px; color:var(--muted); }
.panel { border:1px solid var(--border); border-radius:8px; background:var(--secondary); padding:24px; margin:26px 0; }
.panel > h2:first-child { margin-top: 0; }
.notice,.empty-state { padding: 18px 20px; background: var(--secondary); border: 1px solid var(--border); }
.table-wrap { overflow-x:auto; margin:18px 0; border:1px solid var(--border); border-radius:8px; }
table { border-collapse: collapse; width: 100%; margin: 0; }
th,td { border:0; border-bottom:1px solid var(--border); text-align: left; padding: 12px 14px; vertical-align: top; overflow-wrap: anywhere; }
th { background:var(--secondary); color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:0.6px; padding-top:15px; padding-bottom:15px; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover { background: var(--secondary); }
td button { padding: 5px 9px; margin: 4px 4px 4px 0; min-height: 32px; }
td a { display: inline-block; margin: 5px 8px 5px 0; }
td p { margin: 6px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.actions button { margin: 0; }
.plain-text { white-space: pre-wrap; overflow-wrap: anywhere; }
dt { font-weight: bold; margin-top: 18px; }
dd { margin: 6px 0 20px; }
summary { font-weight: bold; cursor: pointer; text-decoration: underline; }
.request-entry { border-top: 1px solid var(--border); padding: 8px 0 18px; }
footer { flex-shrink:0; min-width:0; overflow-wrap:anywhere; min-height: 44px; color:var(--muted); background:var(--rail); border-top: 1px solid var(--border); padding: 12px 20px; display: flex; justify-content: space-between; gap: 18px; font-size: 13px; }
.guest .app-layout { display:block; overflow:auto; }
.guest main { height:auto; overflow:visible; }
.public-page main { flex:1; height:auto; }
.guest main,.public-page main { max-width: 960px; margin: 0 auto; }
.guest .account-page { max-width:460px; margin:64px auto; padding:36px; background:var(--surface); border:1px solid var(--border); border-radius:12px; }
.guest { background:var(--rail); }
.guest .account-page form button[type="submit"] { width:100%; margin-top:28px; }
.account-page form { padding-top: 6px; }
.account-page h1 { margin-bottom:14px; }
.account-page > p { color:var(--muted); }
.public-page section { margin: 32px 0; }
.user-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 28px; align-items: start; }
.user-create { border-radius:8px; border: 1px solid var(--border); padding: 20px; background: var(--secondary); }
.user-create h2 { margin-top: 0; }
.user-list { min-width: 0; }
.user-list > h2 { margin-top: 0; }
.user-list table { table-layout: fixed; min-width:660px; }
.user-list th:nth-child(1) { width: 18%; }
.user-list th:nth-child(2) { width: 25%; }
.user-list th:nth-child(3) { width:18%; }
.user-list th:nth-child(4) { width: 12%; }
.user-list th:nth-child(5) { width: 26%; }

.filters { max-width: none; display: grid; grid-template-columns: minmax(0,1fr) minmax(150px,230px) auto; column-gap: 12px; align-items: end; }
.filters .filter-field label { margin-top: 0; }
.filters button[type="submit"] { margin: 0; }
.user-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border:1px solid var(--border); border-radius:8px; background:var(--secondary); padding:20px 0; margin:0 0 30px; }
.user-summary p { margin:0; padding:0 24px; border-right:1px solid var(--border); }
.user-summary p:last-child { border:0; }
.user-summary strong { display:block; font-size:28px; line-height:1.2; margin-bottom:6px; }
.user-summary span { color:var(--muted); font-size:12px; }
.avatar { display: inline-flex; width: 40px; height: 40px; flex-shrink: 0; align-items: center; justify-content: center; vertical-align: middle; border: 1px solid var(--border); background: var(--selected); overflow: hidden; font-weight: bold; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-photo { margin: 20px 0; }
.profile-photo .avatar { width: 72px; height: 72px; font-size: 22px; }
@media (max-width: 1250px) {
 .user-layout { grid-template-columns:minmax(0,1fr); }
 .user-create { max-width: 600px; }
 .app-layout { grid-template-columns: 224px minmax(0,1fr); }
 main { padding: 26px 22px 40px; }
 .sidebar a { padding-left: 14px; }
 .filters { grid-template-columns:minmax(0,1fr); gap: 12px; }
 .filters button { justify-self: start; }
}
@media (max-width: 799px) {
 .nav-toggle { display: inline-block; }
 .account-name { max-width: 120px; }
 .topbar { padding: 14px 16px; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
 .site-name { gap: 12px; }
 .account-controls { flex-wrap: wrap; gap: 10px; }
 .app-layout { display: block; }
 .sidebar { display: flex; flex-wrap: wrap; padding: 8px; border-right: 0; border-bottom: 1px solid var(--border); gap: 2px; }
 .sidebar .nav-heading { width: 100%; margin: 10px 10px 3px; }
 .sidebar a { padding: 10px; border-left: 0; border-bottom: 2px solid transparent; }
 .sidebar a[aria-current="page"] { border-bottom-color:transparent; }
 main { padding: 24px 16px 36px; }
 .guest .account-page { margin:28px 16px; width:calc(100% - 32px); padding:26px; }
 h1 { font-size: 23px; }
 .panel { padding: 18px 16px; }
 th,td { padding: 9px 10px; }
 footer { flex-direction: column; padding: 18px 16px; gap: 8px; }
 .user-summary { gap: 12px 20px; }
}
.theme-picker { display:flex; align-items:center; gap:8px; font-size:12px; }
.theme-picker label { margin:0; }
.theme-picker select { width:auto; padding:5px 8px; }
.topbar .account-controls { margin-left:auto; }
button.profile-trigger { padding:0; min-height:0; border:0; background:transparent; color:var(--text); text-align:left; }
.name-trigger { font-size:14px; font-weight:bold; }
.photo-trigger { flex-shrink:0; align-self:flex-start; }
.person-dialog { color:var(--text); background:var(--surface); border:1px solid var(--border); padding:24px; width:min(440px,calc(100% - 32px)); max-height:85dvh; overflow:auto; }
.person-dialog::backdrop { background:rgb(0 0 0 / 65%); }
.person-dialog > button { float:right; }
.person-dialog h2 { clear:both; padding-top:16px; }
.person-dialog .avatar { width:88px; height:88px; font-size:32px; }
.person-dialog .presence { display:block; margin:12px 0; }
@media(max-width:799px) { .theme-picker { margin-left:auto; } .topbar { gap:8px; } }
.avatar { border-radius:50%; }
.avatar img { border-radius:inherit; }
.id-menu { position:fixed; z-index:20; width:max-content; max-width:calc(100vw - 16px); border:1px solid var(--border); padding:4px; background:var(--surface); color:var(--text); }
.id-menu button { display:block; width:100%; text-align:left; background:var(--surface); color:var(--text); border:0; font-size:14px; }
.id-menu button:hover,.id-menu button:focus { background:var(--secondary); }
.copy-status { font-size:12px; margin:0; padding:6px 16px; overflow-wrap:anywhere; }
.copy-status:empty { display:none; }
.manual-copy { width:180px; max-width:100%; margin-top:6px; }
.profile-id { font-size:13px; }

.icon { width:19px; height:19px; flex-shrink:0; }
.brand-mark { width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; margin-right:12px; border-radius:10px; background:var(--accent); color:var(--on-accent); font-size:19px; letter-spacing:-1px; }
.brand-domain { color:var(--muted); }
.brand { white-space:nowrap; }
.brand-mark { flex-shrink:0; }
.site-caption { font-size:12px; color:var(--muted); border-left:1px solid var(--border); padding-left:18px; }
.workspace-label { display:grid; grid-template-columns:36px 1fr; column-gap:10px; padding:4px 8px 18px; border-bottom:1px solid var(--border); font-size:14px; font-weight:bold; }
.workspace-monogram { grid-row:1 / 3; width:36px; height:36px; display:grid; place-items:center; background:var(--selected); border-radius:10px; }
.workspace-label small { font-size:10px; font-weight:normal; color:var(--muted); margin-top:3px; }
.sidebar-note { font-size:11px; color:var(--muted); padding:12px; margin-top:22px; border-top:1px solid var(--border); }
.account-identity { text-decoration:none; font-size:13px; }
.account-controls > button { font-size:12px; background:transparent; }
.theme-picker select { min-height:34px; background:var(--secondary); }
.person-handle,.profile-id { color:var(--muted); }
.account-symbol { width:52px; height:52px; display:grid; place-items:center; border:1px solid var(--border); border-radius:14px; margin-bottom:24px; background:var(--secondary); }
.account-symbol .icon { width:25px; height:25px; }
.eyebrow { font-size:10px; font-weight:bold; letter-spacing:1.4px; }
.profile-layout { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,0.8fr); gap:24px; max-width:1050px; }
.profile-layout .panel { margin:0; }
.profile-photo .avatar { width:88px; height:88px; }
.profile-layout .panel > button { margin-top:18px; }
.public-page section { border-top:1px solid var(--border); padding-top:12px; }
.person-dialog { border-radius:12px; }
.id-menu { border-radius:6px; }
@media(max-width:1000px) { .site-caption { display:none; } .profile-layout { grid-template-columns:minmax(0,1fr); } }
@media(max-width:799px) {
 .workspace-label,.sidebar-note { display:none; }
 .topbar { padding:12px; gap:8px; }
 .brand { font-size:17px; }
 .brand-mark { width:30px; height:30px; margin-right:8px; }
 .theme-picker select { max-width:106px; }
 .nav-toggle { padding:8px 10px; font-size:12px; }
 .topbar .site-name { flex:1; }
 .topbar .account-controls { width:100%; order:3; justify-content:space-between; }
 .theme-picker label { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
 .theme-picker { margin-left:0; }
 .account-controls:empty { display:none; }
 .user-summary p { padding:0 12px; }
 .user-summary strong { font-size:24px; }
 .user-summary span { font-size:11px; }
 .sidebar a { flex:1 0 45%; }
 .sidebar .nav-heading { flex-basis:100%; }
 .profile-layout { gap:18px; }
}

/* Keep the content wide enough in tablet windows and browser split views. */
@media(max-width:1023px) {
 .nav-toggle { display:inline-block; }
 .app-layout { display:flex; flex-direction:column; }
 .app-layout > main { flex:1; height:auto; }
 .app-layout > .sidebar { position:absolute; inset:0 auto 0 0; width:min(320px,100%); z-index:15; border-right:1px solid var(--border); }
}
