:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0b1017;
  color: #edf3fb;
  --background: #0b1017;
  --panel: #111923;
  --border: #243140;
  --subtle: #93a6ba;
  --ice: #9bd7f4;
  --warm: #f2cd88;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }

.topbar { border-bottom: 1px solid #1d2936; background: #0d141d; }
.topbar-inner, main { max-width: 1152px; margin: auto; }
.topbar-inner { min-height: 70px; padding: 10px 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; gap: 11px; align-items: center; font-size: .88rem; font-weight: 800; letter-spacing: .19em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; border: 1px solid #314b5e; color: var(--ice); background: #152634; font-size: 1.5rem; line-height: 1; letter-spacing: 0; }
.settings, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 41px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: #16202a; color: #e4ecf6; font-size: .82rem; font-weight: 650; }
.settings:hover, .secondary:hover { background: #1b2b38; border-color: #466179; }
.settings-value { padding: 3px 6px; background: #243746; color: var(--ice); border-radius: 4px; font-size: .72rem; white-space: nowrap; }
.bell { width: 11px; height: 12px; position: relative; margin-right: 2px; border: 1.5px solid var(--ice); border-radius: 8px 8px 3px 3px; }
.bell::after { content: ''; position: absolute; width: 4px; height: 2px; bottom: -4px; left: 2px; border-radius: 0 0 6px 6px; background: var(--ice); }

main { padding: 26px 28px max(36px, env(safe-area-inset-bottom)); }
.hero { position: relative; isolation: isolate; overflow: hidden; border: 1px solid #2b4155; border-radius: 20px; background: #14222e; }
.hero::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #09121df7, #0b1525bd 34%, #0a132d18 70%), linear-gradient(0deg, #09121eaf, transparent 73%), url('/arctic.jpg') center 50% / cover; }
.hero-content { padding: clamp(24px, 5vw, 51px); }
.location { display: flex; align-items: center; gap: 7px; margin-bottom: 13px; color: #b0dcf5; font-size: .74rem; font-weight: 750; letter-spacing: .155em; text-transform: uppercase; }
.location span { font-size: 1.3rem; line-height: .9; }
h1 { font-size: clamp(3rem, 7.5vw, 5.5rem); line-height: .93; font-weight: 800; letter-spacing: -.055em; text-shadow: 0 2px 18px #0a101478; }
.hero-note { margin-top: 23px; font-size: .92rem; line-height: 1.4; color: #b8c9dd; }
.hero-note strong { color: #eaf6ff; }

.connection, .profile-strip, .web-notice { margin-top: 14px; }
.sign-in, .web-report { margin-top: 16px; padding: clamp(14px, 3vw, 24px); border: 1px solid var(--border); border-radius: 13px; background: var(--panel); }
.sign-in { max-width: 510px; }
.sign-in h2 { margin-bottom: 14px; font-size: 1.3rem; }
.sign-in label { display: block; margin-bottom: 7px; font-weight: 650; font-size: .85rem; }
.sign-in p, .report-result { margin-top: 9px; color: #b3c3d4; font-size: .83rem; line-height: 1.45; }
.captcha-image-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.captcha-image-row img { display: block; max-width: 100%; height: auto; border-radius: 7px; }
.captcha-image-row button { min-height: 36px; }
.sign-in #captcha-input { margin-bottom: 10px; }
.sign-in p.error { color: #fec9bc; }
.form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-row input { flex: 1 1 185px; width: auto; min-width: 0; margin: 0; }
.form-row .primary { width: auto; }
.profile-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: #a4b7ca; font-size: .84rem; overflow-wrap: anywhere; }
.profile-strip strong { margin-left: 5px; color: #edf3fb; }
.web-report { padding: 13px 15px; }
.web-report h2 { margin-bottom: 9px; font-size: .91rem; }
.form-row button { white-space: nowrap; }
.report-row button[aria-pressed="true"] { color: #ffd4d0; border-color: #995c60; background: #42292e; }
.push-notifications { margin-bottom: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.workspace-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.workspace-modes { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; border: 1px solid var(--border); background: #111923; }
.workspace-modes button { min-height: 35px; padding: 0 13px; border: 0; border-radius: 6px; color: var(--subtle); background: transparent; font-size: .85rem; font-weight: 700; }
.workspace-modes button[aria-pressed="true"] { background: #243746; color: #e4f3ff; }
.workspace-modes button:hover { color: var(--ice); }
.view-status { padding: 8px 10px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 7px; color: var(--ice); background: #132331; font-size: .82rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin: 27px 0 14px; }
.section-heading h2 { font-size: clamp(1.22rem, 3.2vw, 1.65rem); letter-spacing: -.025em; }
.section-heading p { margin-top: 5px; font-size: .79rem; color: var(--subtle); }
.section-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.running { display: inline-flex; align-items: center; gap: 6px; color: var(--subtle); white-space: nowrap; }
.running i { width: 6px; height: 6px; border-radius: 50%; background: var(--ice); box-shadow: 0 0 9px #91d7fc66; }
.add-bear { flex: none; gap: 7px; white-space: nowrap; }
.add-symbol { color: var(--ice); font-size: 1.15rem; line-height: 1; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.empty-list { padding: 16px 0; color: var(--subtle); font-size: .88rem; }
.limit-status { margin-bottom: 12px; color: var(--warm); font-size: .82rem; }
.add-bear:disabled { cursor: default; }
.bear { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; padding: 15px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); --timer: #becbd9; }
.bear[data-phase="countdown"] { --timer: var(--ice); }
.bear[data-phase="open"] { --timer: var(--warm); border-color: #594d38; background: #191b20; }
.bear-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; grid-column: 1 / -1; min-height: 23px; }
.bear h3 { min-width: 0; overflow-wrap: anywhere; font-size: .96rem; font-weight: 730; }
.badge { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 5px; padding: 4px 7px; border-radius: 5px; color: #a8b8c6; background: #1d2733; font-size: .65rem; font-weight: 700; white-space: nowrap; }
.badge i { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.bear[data-phase="countdown"] .badge { color: var(--ice); background: #1a3141; }
.bear[data-phase="open"] .badge { color: var(--warm); background: #392e20; }
.clock-row { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 8px; margin: 15px 0 10px; }
.clock { color: var(--timer); font-size: clamp(1.85rem, 3vw, 2.3rem); line-height: 1; font-weight: 780; font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
.window { text-align: right; }
.window-label { color: var(--subtle); font-size: .67rem; }
.window-value { color: #dae8f6; font-size: .83rem; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 3px; white-space: nowrap; }
progress { border: none; height: 3px; width: 100%; border-radius: 8px; overflow: hidden; background: #283444; color: var(--timer); }
progress::-webkit-progress-bar { background: #283444; }
progress::-webkit-progress-value { border-radius: 8px; background: var(--timer); }
progress::-moz-progress-bar { border-radius: 8px; background: var(--timer); }
.timer-actions { display: flex; gap: 5px; }
.timer-action { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid #34495d; border-radius: 7px; color: var(--ice); background: #1a2836; }
.kill { display: flex; align-items: center; justify-content: center; gap: 9px; width: auto; padding: 0 11px; color: #e4f3ff; font-size: .81rem; font-weight: 750; }
.kill:not(:disabled):hover { color: #effaff; border-color: #6192b0; background: #213a4c; }
.disappear { width: auto; padding: 0 9px; color: #d9e2fc; background: #232b43; border-color: #444f71; font-size: .81rem; font-weight: 750; }
.disappear:not(:disabled):hover { border-color: #8291c4; background: #313b59; }
.stop { color: #dbeaf8; background: #182330; }
.stop:not(:disabled):hover { border-color: #6192b0; background: #273849; }
.stop:disabled { cursor: default; }
.scope-icon { position: relative; flex: none; width: 15px; height: 15px; border: 1.5px solid currentColor; border-radius: 50%; color: var(--ice); background: radial-gradient(circle, currentColor 0 1px, transparent 1.5px); }
.scope-icon::before { content: ''; position: absolute; top: -3px; left: 50%; width: 1.5px; height: 4px; transform: translateX(-50%); background: currentColor; box-shadow: 0 14px currentColor; }
.scope-icon::after { content: ''; position: absolute; top: 50%; left: -3px; width: 4px; height: 1.5px; transform: translateY(-50%); background: currentColor; box-shadow: 14px 0 currentColor; }
.stop-icon { width: 10px; height: 10px; border-radius: 1px; background: currentColor; }
.trash-icon { position: relative; flex: none; width: 15px; height: 17px; background: linear-gradient(currentColor, currentColor) center 1px / 5px 2px no-repeat; }
.trash-icon::before { content: ''; position: absolute; inset: 6px 3px 1px; border: 1.5px solid currentColor; border-top: 0; border-radius: 0 0 2px 2px; }
.trash-icon::after { content: ''; position: absolute; inset: 4px 1px auto; height: 1.5px; border-radius: 1px; background: currentColor; }

.chat-tip { display: flex; align-items: center; gap: 13px; margin-top: 19px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 13px; background: #0f1822; }
.chat-tip div { flex: 1; }
.chat-tip h2 { font-size: .85rem; }
.chat-tip p { margin-top: 4px; color: #a4b7ca; font-size: .79rem; line-height: 1.45; }
.list-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 8px; margin-top: 13px; }
.bot-stats { margin-right: auto; color: var(--subtle); font-size: .82rem; }
.bot-stats strong { margin-left: 4px; color: var(--ice); font-variant-numeric: tabular-nums; }
.manage-remove { border-color: #463845; color: #efc5bf; background: #201c25; }
.manage-remove:not(:disabled):hover { border-color: #815a63; background: #30232c; }
.mic-icon { width: 13px; height: 21px; margin: 0 5px 5px; flex: none; border: 1.5px solid var(--ice); border-radius: 20px; position: relative; transform: scale(.85); }
.mic-icon::before { content: ''; position: absolute; inset: 7px -5px -5px; border: 1.5px solid var(--ice); border-top: 0; border-radius: 0 0 14px 14px; }
.mic-icon::after { content: ''; position: absolute; top: calc(100% + 4px); left: 4px; width: 2px; height: 6px; border-radius: 4px; background: var(--ice); }

dialog { width: min(408px, calc(100% - 28px)); color: #edf3fb; padding: 22px; background: #151f2a; border: 1px solid #3d5369; border-radius: 17px; }
dialog::backdrop { background: #04090dbf; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-head h2 { font-size: 1.4rem; }
.close-button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: #1e2b39; color: #edf3fb; font-size: 1.5rem; line-height: .8; }
dialog p { margin: 10px 0 15px; color: #b3c3d4; font-size: .87rem; line-height: 1.5; }
.notice-label { display: block; margin-bottom: 7px; font-size: .85rem; font-weight: 650; }
.notice-field { display: flex; align-items: center; gap: 10px; }
.notice-field input, .name-field { min-height: 42px; padding: 0 10px; color: #e8f6ff; background: #0c141d; border: 1px solid #496072; border-radius: 7px; }
.notice-field input { width: 95px; }
.name-field { display: block; width: 100%; margin-bottom: 14px; }
.notice-field span { color: #b9cedf; font-size: .87rem; }
.primary { display: block; width: 100%; min-height: 43px; padding: 0 14px; border: 0; border-radius: 7px; background: var(--ice); color: #0b1c2b; font-weight: 750; }
.primary:hover { background: #b7e9ff; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; }
.danger { min-height: 41px; padding: 0 14px; border: 1px solid #915158; border-radius: 7px; background: #572c35; color: #ffe2dc; font-size: .82rem; font-weight: 700; }
.danger:not(:disabled):hover { background: #713941; }
.danger:disabled, .manage-remove:disabled { cursor: default; }
.squad-subtitle { font-weight: 700; }
.member-list { margin: 0 0 14px; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 9px; }
.member-row { display: flex; align-items: center; gap: 7px; padding: 8px 9px; }
.member-row + .member-row { border-top: 1px solid var(--border); }
.member-ident { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .88rem; }
.member-ident small { display: block; margin-top: 2px; color: var(--subtle); }
.member-role { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; color: #c6dbec; font-size: .73rem; white-space: nowrap; }
.member-role input { width: 17px; height: 17px; accent-color: var(--ice); }
.member-kick { min-height: 33px; padding: 0 7px; font-size: 1rem; }
.squad-invites { margin-bottom: 14px; }
#squad-join-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
#squad-link-box { margin-top: 10px; }
.invite-link { display: flex; gap: 6px; align-items: center; }
.invite-link input { flex: 1; min-width: 0; min-height: 41px; padding: 0 8px; border: 1px solid #496072; border-radius: 7px; color: #e8f6ff; background: #0c141d; font-size: .8rem; }
.invite-link .squad-code { font-size: 1rem; font-variant-numeric: tabular-nums; letter-spacing: .12em; }
dialog .invite-expiry { margin: 6px 0 0; color: var(--subtle); font-size: .76rem; }
.error { padding: 10px 12px; margin-bottom: 12px; border: 1px solid #694c42; border-radius: 7px; background: #271d20; color: #ffccb0; font-size: .82rem; line-height: 1.45; }
.toast { position: fixed; z-index: 2; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); color: #eaf7ff; background: #1b2d3c; padding: 12px 17px; border: 1px solid #486981; border-radius: 10px; box-shadow: 0 5px 30px #050a0f8c; font-size: .86rem; }

@media (max-width: 790px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-inner { min-height: 60px; }
  .hero-content { padding-block: 34px; }
}
@media (max-width: 530px) {
  .topbar-inner { padding-inline: 14px; }
  main { padding: 14px 12px max(22px, env(safe-area-inset-bottom)); }
  .hero { border-radius: 13px; }
  .hero::before { background-position: center, center, 59% 50%; }
  .hero-content { padding: 23px 17px; }
  h1 { font-size: clamp(2.7rem, 11.8vw, 3.4rem); }
  .hero-note { margin-top: 15px; }
  .section-heading { margin-top: 21px; }
  .add-bear { padding-inline: 8px; font-size: .75rem; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .bear { padding: 11px 12px 9px; border-radius: 10px; }
  .clock-row { margin: 11px 0 5px; }
  .chat-tip { flex-wrap: wrap; }
  .chat-tip div { flex-basis: calc(100% - 38px); }
  .chat-tip button { margin-left: 36px; }
}
@media (max-width: 360px) {
  .settings-label { display: none; }
}
