:root {
  color-scheme: dark;
  --base: #0e1319;
  --sidebar: #10161e;
  --panel: #151d26;
  --raised: #1a2431;
  --well: #111821;
  --border: #283340;
  --text: #f0f2f7;
  --muted: #a0a9b9;
  --quiet: #778596;
  --violet: #ad95ff;
  --violet-deep: #7755df;
  --violet-bg: #252039;
  --green: #75d5a5;
  --orange: #efab7a;
  --blue: #8eb8f0;
  --danger: #f5a4ac;
  --radius: 11px;
  font-family: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-synthesis: none;
  color: var(--text);
  background: var(--base);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; font-size: 1rem; }
button, input, select, textarea { font: inherit; }
a { color: var(--violet); text-decoration: none; }
button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
button:disabled { opacity: .48; cursor: default; }
p { margin: 0; color: var(--muted); line-height: 1.5; }
h1, h2, h3 { margin: 0; letter-spacing: -.025em; }
h1 { font-size: clamp(1.65rem, 3vw, 2rem); line-height: 1.12; }
h2 { font-size: 1.2rem; }
h3 { font-size: .99rem; }
small { font-size: .81rem; color: var(--muted); }
.icon { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; display: inline-block; vertical-align: -.18em; }
.skip { position: absolute; z-index: 5; inset: 8px auto auto 8px; padding: 12px; background: var(--well); transform: translateY(-150%); }
.skip:focus { transform: translateY(0); }
.loading { min-height: 100dvh; display: grid; place-items: center; color: var(--muted); }
.shell { display: grid; grid-template-columns: clamp(185px, 17vw, 248px) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; padding: 27px 15px 19px; display: flex; flex-direction: column;
  border-right: 1px solid #222b37; background: linear-gradient(173deg, #10171f, #10151d 70%, #111820);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 3px 9px; color: var(--text); text-align: left; width: 100%; }
.brand strong, .workspace strong, .person strong { display: block; font-size: .91rem; }
.brand small { white-space: nowrap; }
.workspace-name { min-width: 0; }
.workspace strong, .workspace small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small, .workspace small, .person small { display: block; margin-top: 3px; }
.logo, .workspace-mark, .avatar, .tile-icon {
  width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; flex: 0 0 auto;
}
.logo { color: #170f30; background: linear-gradient(145deg, #b5a4ff, #7653df); box-shadow: 0 4px 18px #9166ed40; }
.logo .icon { width: 20px; height: 20px; }
.workspace {
  margin: 28px 0 22px; background: #17202a; border: 1px solid #25303b; border-radius: 9px; overflow: hidden;
}
.workspace-banner { width: 100%; height: 75px; display: block; object-fit: cover; background: #211c36; }
.workspace-identity { display: flex; align-items: center; gap: 10px; padding: 10px; }
.workspace-mark { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; background: linear-gradient(140deg, #bbaaff, #7653df); color: #211738; font-weight: 800; font-size: .82rem; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.workspace .dot { margin-left: auto; box-shadow: 0 0 9px #64d99c78; }
.nav { display: grid; gap: 5px; }
.nav button, .side-help {
  display: flex; align-items: center; gap: 12px; color: var(--muted); text-align: left; background: transparent;
  border: 1px solid transparent; border-radius: 8px; padding: 12px 11px; min-height: 42px; font-size: .9rem; font-weight: 550;
}
.nav button:hover, .side-help:hover { background: #17202c; color: var(--text); }
.nav button.active { color: var(--text); background: #1b2533; border-color: #222e3c; box-shadow: inset 3px 0 var(--violet); }
.nav button.active .icon { color: var(--violet); }
.sidebar-bottom { margin-top: auto; padding-top: 13px; border-top: 1px solid #25303b; }
.person { display: flex; align-items: center; gap: 9px; color: var(--text); }
.sidebar-bottom .person { padding: 6px 9px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #b49af9; color: #211738; font-weight: 800; font-size: .66rem; object-fit: cover; }
.side-help { min-height: auto; width: 100%; padding: 9px 9px 3px; font-size: .82rem; }
.main { min-width: 0; background: radial-gradient(ellipse 75% 510px at 82% 0%, #1e2739, transparent 77%); }
.topbar, .content { width: 100%; max-width: 1800px; margin: 0 auto; padding-inline: clamp(18px, 3vw, 42px); }
.topbar { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.breadcrumb { display: flex; gap: 10px; align-items: center; font-size: .86rem; color: var(--muted); }
.breadcrumb strong { color: var(--text); }
.breadcrumb span[aria-hidden] { color: var(--quiet); }
.top-actions { display: flex; align-items: center; gap: 15px; }
.timezone { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .81rem; white-space: nowrap; }
.account { position: relative; }
.account summary { cursor: pointer; list-style: none; }
.account summary::-webkit-details-marker { display: none; }
.account-button { display: flex; gap: 8px; align-items: center; padding: 4px 9px 4px 4px; border: 1px solid var(--border); border-radius: 30px; color: var(--text); font-size: .82rem; white-space: nowrap; }
.account-button:hover { background: #263142; }
.account-button .avatar { width: 27px; height: 27px; }
.dropdown { position: absolute; z-index: 3; top: calc(100% + 8px); right: 0; min-width: 170px; padding: 6px; background: var(--raised); border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 12px 28px #070a0f77; }
.dropdown form { margin: 0; }
.dropdown button, .dropdown a { display: block; width: 100%; padding: 8px 9px; color: var(--text); background: transparent; border: 0; text-align: left; border-radius: 5px; font-size: .86rem; }
.dropdown button:hover, .dropdown a:hover { background: var(--violet-bg); color: var(--violet); }
.content { padding-bottom: 38px; }
.content::before { content: ""; display: block; height: 1px; margin-bottom: clamp(24px, 3.2vw, 42px); background: linear-gradient(90deg, #283341, transparent 82%); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 23px; }
.heading-line { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.eyebrow { color: var(--violet); font-weight: 750; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 9px; }
.page-head p { font-size: .91rem; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; padding: 7px 12px;
  background: #1a2330; color: var(--text); border: 1px solid #303d4c; border-radius: 7px; font-size: .87rem; font-weight: 650;
}
.btn:hover { background: #242f41; border-color: #49576b; }
.btn.primary { color: #fff; background: #6747cf; border-color: #8969ee; box-shadow: 0 2px 9px #7652dc2b; }
.btn.primary:hover { background: #7656df; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #212b39; color: var(--text); }
.btn.soft { color: #c0adff; background: #27213e; border-color: #493a68; }
.btn.danger { color: var(--danger); }
.btn.square { width: 32px; min-height: 32px; padding: 0; }
.btn.tiny { min-height: 29px; padding: 3px 8px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 15px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(118deg, #17212d, #141c25 62%); }
.tile-icon { color: var(--violet); background: #27223e; }
.tile-icon.orange { color: var(--orange); background: #2e2630; }
.tile-icon.green { color: var(--green); background: #1c3032; }
.tile-icon.blue { color: var(--blue); background: #202b42; }
.stat-label { display: block; font-size: .83rem; color: var(--muted); }
.stat strong { display: inline-block; margin-right: 5px; font-size: 1.44rem; line-height: 1.2; letter-spacing: -.045em; }
.stat small { font-size: .77rem; }
.progress-ring { width: 38px; height: 38px; margin-left: auto; position: relative; display: grid; place-items: center; }
.progress-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; }
.progress-ring strong { font-size: .66rem; margin: 0; letter-spacing: 0; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: #141c25; overflow: clip; }
.calendar-bar { display: flex; gap: 15px; justify-content: space-between; flex-wrap: wrap; align-items: center; padding: 12px 17px; border-bottom: 1px solid var(--border); min-height: 57px; }
.month-controls, .legend, .filter-group { display: flex; align-items: center; gap: 8px; }
.month-controls strong { font-size: 1.01rem; min-width: 140px; }
.today-btn { color: var(--violet) !important; }
.legend { gap: 11px; }
.legend span { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.social { --category: var(--violet); --category-bg: #282139; }
.raid { --category: var(--orange); --category-bg: #30262a; }
.treasure { --category: var(--green); --category-bg: #1e3030; }
.misc { --category: var(--blue); --category-bg: #232f43; }
.legend .dot { width: 6px; height: 6px; margin-right: 4px; background: var(--category); vertical-align: .13em; }
.filter-group { gap: 12px; }
.select-filter { padding-left: 9px; border-left: 1px solid var(--border); }
.select-filter select { width: auto; min-width: 73px; font-size: .8rem; min-height: 30px; }
.calendar-body { padding: 0 15px 15px; }
.weekdays, .calendar-grid, .mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays { color: var(--muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .04em; }
.weekdays span { padding: 10px 8px; }
.calendar-grid { border-top: 1px solid #293541; }
.day { min-height: clamp(72px, 9.1vh, 110px); min-width: 0; padding: 5px 5px 9px; border-right: 1px solid #252f3a; border-bottom: 1px solid #252f3a; }
.day:nth-child(7n) { border-right: 0; }
.day.other { background: #121a22; }
.day.other .day-number { color: #728191; }
.day-number { min-width: 25px; height: 25px; border: 0; border-radius: 50%; display: inline-grid; place-items: center; background: transparent; color: #bbc3d0; font-size: .81rem; padding: 0 3px; }
button.day-number:hover { background: #252f3d; color: white; }
.day-number.current { color: white; background: #6949d4; font-weight: 700; }
.day-events { display: grid; gap: 4px; margin-top: 3px; }
.event-chip { display: flex; align-items: center; gap: 4px; text-align: left; width: 100%; min-width: 0; border: 0; border-left: 2px solid var(--category); border-radius: 4px; background: var(--category-bg); color: var(--text); padding: 4px 4px 4px 5px; font-size: .72rem; line-height: 1.28; }
.event-chip:hover { outline: 1px solid var(--category); }
.event-chip .icon { color: var(--category); width: .72rem; height: .72rem; }
.event-chip b { font-weight: 660; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-chip time { color: var(--muted); font-size: .66rem; white-space: nowrap; }
.claim-bar { display: flex; text-align: left; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 11px 15px; background: linear-gradient(112deg, #292140, #211d35); color: var(--text); border: 1px solid #564478; border-radius: 9px; }
.claim-bar:hover { background: #302749; border-color: #886ae0; }
.claim-bar strong, .claim-bar small { display: block; }
.claim-bar strong { font-size: .9rem; }
.claim-bar small { margin-top: 4px; color: #bab0ce; }
.claim-bar .tile-icon { width: 31px; height: 31px; background: #362b50; }
.end-icon { margin-left: auto; color: var(--violet); }
.flow { min-height: 245px; padding: clamp(15px, 2.2vw, 26px); }
.flow-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 16px; }
.flow-head p { margin-top: 6px; font-size: .9rem; }
.flow-grid, .picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.option { display: flex; align-items: center; gap: 11px; min-width: 0; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid #303b4b; border-radius: 8px; background: #1a2331; color: var(--text); }
.option:hover { border-color: #7b62b5; background: #252a41; }
.option strong, .option small { display: block; }
.option small { margin-top: 3px; }
.option .tile-icon, .category-icon { background: var(--category-bg); color: var(--category); }
.empty { padding: 21px 16px; color: var(--muted); border: 1px dashed var(--border); border-radius: 8px; }
.picker { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
.mini, .form-card { background: #192330; border: 1px solid #2d3949; border-radius: 8px; padding: 13px; }
.mini-grid { margin-top: 8px; gap: 4px; }
.mini-grid .mini-day, .mini-grid span { text-align: center; min-height: 29px; font-size: .79rem; display: grid; place-items: center; }
.mini-day { background: #151f2a; color: var(--text); border: 1px solid #283747; border-radius: 5px; }
.mini-day:hover { border-color: var(--violet); }
.mini-day.selected { background: #6949cc; color: white; border-color: #9b7aef; }
.mini-grid span { color: var(--quiet); }
.form-card h3 { margin-bottom: 4px; }
.form-card > p { font-size: .83rem; margin-bottom: 12px; }
form .actions, .detail-card .actions { margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.form-grid .wide, .wide { grid-column: 1 / -1; }
label, .field-label { display: grid; gap: 5px; color: #d4dbea; font-size: .84rem; font-weight: 600; }
input, select, textarea {
  width: 100%; min-height: 38px; color: var(--text); background: #111923; border: 1px solid #354151;
  padding: 7px 9px; border-radius: 6px; font-size: .91rem;
}
input::placeholder, textarea::placeholder { color: #8792a4; }
textarea { resize: vertical; }
select { appearance: none; padding-right: 24px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23a0a9b9' stroke-width='1.5'/%3E%3C/svg%3E"); background-position: right 7px center; background-repeat: no-repeat; }
input[type=checkbox] { width: 15px; min-height: 15px; margin: 0; accent-color: var(--violet-deep); }
.check { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.form-error, .time-hint { color: var(--danger); min-height: 0; margin-top: 9px; font-size: .84rem; }
.form-error:empty, .time-hint:empty { display: none; }
.time-hint.ok { color: var(--green); }
.detail-card { width: min(100%, 510px); margin: 0 auto; padding: clamp(15px, 3vw, 28px); border: 1px solid #504477; border-radius: 12px; background: linear-gradient(167deg, #201f37, #181f2d); }
.detail-top { text-align: center; }
.detail-top .tile-icon { margin: 0 auto 13px; }
.detail-top p { margin: 7px 0 15px; font-size: .87rem; }
.inset { display: flex; align-items: center; gap: 9px; border-radius: 7px; background: #141a27; padding: 9px 11px; margin: 12px 0; }
.inset small, .inset strong { display: block; }
.detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; font-size: .93rem; }
.detail-fields small { display: block; margin-bottom: 3px; }
.detail-fields p { white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-fields .wide { border-top: 1px solid var(--border); padding-top: 10px; }
.detail-card .actions { justify-content: center; }
.admin-layout { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 15px; align-items: start; }
.admin-nav { padding: 8px; }
.admin-nav button { width: 100%; }
.admin-note { border-top: 1px solid var(--border); margin: 10px 5px 4px; padding: 11px 3px; }
.admin-note p { font-size: .8rem; margin-top: 5px; }
.panel-head { padding: 13px 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head p { margin-top: 4px; font-size: .84rem; }
.panel-pad { padding: 15px; }
.row { display: flex; align-items: center; gap: 13px; padding: 11px 14px; border-bottom: 1px solid #242f3b; }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-main small, .row-main strong { display: block; overflow-wrap: anywhere; }
.row-main small { margin-top: 3px; }
.badge { display: inline-flex; align-items: center; gap: 6px; color: var(--category, var(--violet)); background: var(--category-bg, var(--violet-bg)); border: 1px solid currentColor; border-radius: 12px; padding: 3px 7px; font-size: .72rem; white-space: nowrap; }
.badge.green { color: var(--green); background: #1a2b29; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .87rem; }
th, td { padding: 11px 12px; white-space: nowrap; border-bottom: 1px solid #273341; }
th { color: var(--muted); font-weight: 600; font-size: .77rem; }
tbody tr:last-child td { border-bottom: 0; }
.report-month { width: auto; }
.gate { display: grid; place-items: center; min-height: min(60vh, 550px); padding: 20px; }
.gate-body { width: min(100%, 440px); text-align: center; }
.gate-body .workspace-mark { margin: 0 auto 13px; width: 58px; height: 58px; border-radius: 16px; }
.gate-body p { margin: 10px 0 17px; }
.gate-body .actions { justify-content: center; }
.gate-body .form-error { margin-top: 13px; }
.inline-link { text-decoration: underline; text-underline-offset: 3px; }
#toast:not(:empty) { position: fixed; z-index: 6; inset: auto 16px 16px auto; max-width: min(390px, calc(100% - 32px)); padding: 12px 14px; background: #daf1e5; color: #18342a; border-radius: 8px; box-shadow: 0 8px 34px #070a0f80; font-size: .91rem; }
#toast.error { background: #f5d6da; color: #511f27; }
dialog {
  width: min(550px, calc(100% - 26px)); max-height: calc(100dvh - 32px); background: #18212c; color: var(--text);
  border: 1px solid #3b485a; border-radius: 13px; padding: 0; box-shadow: 0 25px 100px #060810bb;
}
dialog::backdrop { background: #080b10b8; }
.dialog-top { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 17px; background: #1b2532; border-bottom: 1px solid var(--border); z-index: 1; }
.dialog-body { padding: 17px; }
@media (max-width: 1370px) {
  .event-chip time { display: none; }
}
@media (max-width: 1130px) {
  .month-controls strong { min-width: auto; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 175px minmax(0, 1fr); }
  .brand, .workspace-identity { gap: 7px; }
  .sidebar { padding-inline: 9px; }
  .legend { display: none; }
  .stat { gap: 7px; padding-inline: 8px; }
  .progress-ring { display: none; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav .nav { display: flex; flex-wrap: wrap; }
  .admin-nav button { width: auto; }
  .admin-note { display: none; }
}
@media (max-width: 650px) {
  .shell { display: block; }
  .sidebar { position: relative; height: auto; padding: 12px; border: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0 2px; }
  .brand .logo { width: 31px; height: 31px; }
  .workspace { margin: 10px 0 7px; }
  .workspace-banner { height: 54px; }
  .workspace-identity { padding: 6px 8px; }
  .workspace-mark { width: 32px; height: 32px; }
  .sidebar-bottom { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
  .nav button { min-height: 35px; padding: 6px 9px; gap: 5px; font-size: .8rem; }
  .nav button.active { box-shadow: inset 0 -2px var(--violet); }
  .topbar { min-height: 55px; }
  .timezone { display: none; }
  .content { padding-inline: 10px; }
  .content::before { margin-bottom: 17px; }
  .page-head { gap: 10px; margin-bottom: 14px; padding-inline: 2px; }
  .page-head p { font-size: .85rem; }
  .calendar-bar { padding: 7px; min-height: 50px; gap: 6px; }
  .calendar-body { padding: 0 3px 6px; }
  .weekdays span { padding: 6px 2px; text-align: center; font-size: .67rem; }
  .day { padding: 3px 1px 4px; min-height: 60px; }
  .day-number { font-size: .75rem; min-width: 22px; height: 22px; }
  .event-chip { font-size: .66rem; padding-inline: 2px; }
  .event-chip .icon { display: none; }
  .stats { gap: 4px; margin-bottom: 13px; }
  .stat { padding: 6px; min-height: 53px; }
  .stat .tile-icon { display: none; }
  .stat-label { font-size: .7rem; }
  .stat strong { font-size: 1.1rem; }
  .stat small { display: none; }
  .picker, .flow-grid { grid-template-columns: 1fr; }
  .flow-head { align-items: flex-start; }
  .flow-head .btn { padding: 4px; white-space: nowrap; }
  .stat + .stat { border-left-color: var(--border); }
  .row { gap: 6px; padding-inline: 8px; }
  .row .badge { display: none; }
}
[hidden] { display: none !important; }
.event-time-note { margin: 9px 0 12px; font-size: .83rem; }
.detail-top h2 { margin-bottom: 8px; }
