:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --base: #120e14;
  --sidebar: #171119;
  --surface: #1c151e;
  --line: #342635;
  --text: #f8f0f5;
  --muted: #b6a4b4;
  --soft: #a38da1;
  --accent: #f55c83;
  --accent-hover: #ff7a9b;
  --green: #8ee0b0;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body { margin: 0; background: var(--base); color: var(--text); font-size: 14px; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 4px; }
button:disabled { cursor: wait; opacity: .6; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
svg { display: block; width: 19px; height: 19px; }
.skip { position: fixed; z-index: 9; top: -120px; left: 12px; padding: 10px; background: var(--surface); }
.skip:focus { top: 10px; }

.layout { min-height: 100vh; display: grid; grid-template-columns: 242px minmax(0, 1fr); }
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 45px;
  height: 100dvh;
  position: sticky;
  top: 0;
  padding: 26px 19px 21px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 5px; font-size: 18px; font-weight: 800; letter-spacing: -.045em; white-space: nowrap; }
.brand-mark, .bot-mark, .tile-icon, .dialog-icon {
  flex: none; display: inline-grid; place-items: center; border-radius: 12px;
  color: #ff8ea9; background: #38202d; width: 43px; height: 43px;
}
.brand-mark { color: #1c0c16; background: var(--accent); width: 39px; height: 39px; }
.brand-mark svg { width: 26px; height: 26px; }
.nav { display: grid; gap: 7px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 45px;
  padding: 11px 12px; border: 1px solid transparent; border-radius: 10px;
  color: var(--muted); font-weight: 620; white-space: nowrap;
}
.nav a:hover, .icon-button:hover { background: #291c29; color: var(--text); }
.nav a[aria-current="page"] { border-color: #522d40; color: #ff9bb6; background: #35202e; }
.sidebar-bot {
  display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 10px 9px;
  background: #211823; border: 1px solid #362737; border-radius: 13px;
}
.sidebar-bot:hover { border-color: #714358; }
.sidebar-bot strong, .sidebar-bot small { display: block; }
.sidebar-bot strong { font-size: 12px; }
.sidebar-bot small { margin-top: 3px; font-size: 11px; color: var(--muted); }
.bot-mark { width: 33px; height: 33px; border-radius: 9px; }
.bot-mark svg, .bot-external svg { width: 15px; height: 15px; }
.bot-external { color: var(--muted); margin-left: auto; }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  min-height: 78px; padding: 14px clamp(21px, 3.4vw, 52px); display: flex; align-items: center;
  justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.breadcrumb strong { color: var(--text); font-weight: 620; }
.breadcrumb svg { width: 14px; height: 14px; color: var(--soft); }
.top-actions, .account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-actions { gap: 15px; }
.account-name { font-weight: 640; font-size: 13px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #ffbfd0; background: #43273b; font-weight: 750; }
.icon-button { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); background: transparent; border-radius: 10px; color: var(--muted); }
.signout { width: 32px; height: 32px; border-color: transparent; }
.signout svg { width: 17px; height: 17px; }
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 100px; white-space: nowrap; font-size: 11px; font-weight: 710; letter-spacing: .005em; }
.demo-badge { color: #f8b4c6; border: 1px solid #573345; background: #2f1d2a; }
.dot { flex: none; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.main { width: min(100%, 1390px); margin: 0 auto; padding: 36px clamp(21px, 3.4vw, 52px) 40px; outline: none; }
.loading { padding: 30px 0; color: var(--muted); }
.page-head { margin-bottom: 25px; }
.page-head h1 { font-size: clamp(29px, 3.4vw, 44px); line-height: 1.11; letter-spacing: -.052em; font-weight: 790; }
.page-head p, .hero p, .tile p, .empty p, dialog p { margin-top: 9px; color: var(--muted); line-height: 1.55; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center;
  min-height: 251px; padding: 31px 36px; border-radius: 21px; border: 1px solid #593248;
  background: radial-gradient(ellipse at 85% 40%, #631c39 0%, #361729 38%, #201420 76%);
}
.hero::before, .hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero::before { background: url("/flower.jpg") right 51% / cover no-repeat; }
.hero::after { background: linear-gradient(90deg, #211420 0%, #211420e8 24%, #21142066 54%, #2114200d 100%); }
.hero-content { max-width: 495px; }
.hero h2 { font-size: clamp(26px, 3.2vw, 42px); line-height: 1.08; letter-spacing: -.048em; }
.hero p { max-width: 365px; color: #e0cbd9; }
.hero .button { margin-top: 21px; }
.status { color: var(--green); background: #224032; border: 1px solid #335646; }
.status.neutral { color: #ecc1d1; background: #3a2330; border-color: #5a374a; }
.hero .status { margin-bottom: 13px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  padding: 9px 13px; border: 1px solid #56364a; background: #30202d; border-radius: 10px;
  font-weight: 730; font-size: 13px; line-height: 1.3; text-align: center;
}
.button svg { width: 16px; height: 16px; flex: none; }
.button:hover { background: #412a3c; border-color: #81516a; }
.button.primary { color: #1c0c16; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.text { color: #f8a8bf; border-color: transparent; background: transparent; }
.button.text:hover { background: #2a1d29; }

.panels { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; margin-top: 19px; }
.tile {
  min-width: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 21px; display: flex; flex-direction: column;
}
.tile h2, .empty h2 { font-size: 20px; font-weight: 750; letter-spacing: -.027em; }
.tile .tile-icon { margin-bottom: 13px; }
.tile .action { margin-top: auto; padding-top: 16px; }
.tile p { font-size: 13px; margin-top: 6px; }
.config-row { display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); background: #181219; border-radius: 12px; padding: 11px; margin-top: 16px; }
.config-row .tile-icon { width: 34px; height: 34px; border-radius: 8px; margin: 0; }
.config-row .tile-icon svg { width: 16px; height: 16px; }
.config-row h3 { font-size: 13px; }
.config-row p { font-size: 12px; margin-top: 3px; }
.config-row .button { margin-left: auto; }
.config-meta { flex: 1; min-width: 0; }
.empty { padding: 20px; border: 1px dashed #50354a; border-radius: 12px; margin-top: 16px; }
.empty p { max-width: 52ch; }
.empty .button { margin-top: 12px; }
.config-grid, .support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.config-grid .empty { margin-top: 0; grid-column: 1 / -1; }
.config-grid .badge { align-self: flex-start; margin-top: 13px; }
.faq { grid-column: 1 / -1; }
details { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 680; }
details p { max-width: 72ch; }
.notice { border: 1px solid #63404b; background: #301d28; padding: 14px; border-radius: 12px; color: #ffcfdb; margin-bottom: 15px; line-height: 1.5; }
.footer { display: flex; justify-content: space-between; gap: 12px; width: min(100%, 1390px); margin: auto auto 0; padding: 0 clamp(21px, 3.4vw, 52px) 24px; color: var(--muted); font-size: 12px; }
.footer a:hover { color: var(--text); }

dialog {
  width: min(510px, calc(100% - 32px)); padding: 24px; background: var(--surface); color: var(--text);
  border: 1px solid #644055; border-radius: 18px;
}
dialog::backdrop { background: #0b070bd9; }
.dialog-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
dialog h2 { font-size: 23px; letter-spacing: -.035em; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.config-secret { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 215px; overflow: auto; padding: 13px; margin-bottom: 0; background: #120e14; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }
.toast { position: fixed; z-index: 10; bottom: 18px; right: 18px; max-width: calc(100vw - 36px); border: 1px solid #80546b; background: #352330; color: var(--text); border-radius: 11px; padding: 13px 16px; font-weight: 620; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .panels { grid-template-columns: 1.25fr 1fr; }
}
@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; padding: 13px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); gap: 12px; }
  .brand { padding: 0; }
  .nav { display: flex; flex-wrap: wrap; gap: 5px; }
  .nav a { padding: 7px 8px; gap: 6px; min-height: 36px; font-size: 12px; }
  .nav svg { width: 15px; height: 15px; }
  .sidebar-bot { display: none; }
  .topbar { min-height: 58px; padding-inline: 16px; }
  .main { padding: 22px 16px 30px; }
  .hero { min-height: 235px; padding: 24px; }
  .footer { padding-inline: 16px; }
  .panels, .config-grid, .support-grid { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .breadcrumb span, .breadcrumb svg, .account-name { display: none; }
  .hero { padding: 21px 18px; }
  .hero::before { background-position: 67% center; }
  .hero::after { background: linear-gradient(90deg, #211420 0%, #211420bf 52%, #21142026 100%); }
  .top-actions { gap: 7px; }
  .account { gap: 4px; }
  .config-row .button { padding-inline: 9px; }
}

.auth-hero .hero-content { max-width: 460px; }
.auth-form { display: grid; gap: .55rem; max-width: 360px; margin: 1.4rem 0 1rem; }
.auth-form label { color: #f7e8eb; font-size: .88rem; font-weight: 650; }
.auth-form input {
  min-width: 0;
  padding: .8rem .95rem;
  border: 1px solid #68414d;
  border-radius: 12px;
  color: #fff5f7;
  background: #22171d;
  font: inherit;
}
.auth-form input:focus { outline: 2px solid #ff849f; outline-offset: 2px; }
.auth-form input::placeholder { color: #a2858f; }
.auth-form .button { justify-self: start; margin-top: .25rem; }
.auth-help { margin: 1rem 0 .65rem; }

.support-form { max-width: none; }
.support-form select, .auth-form textarea {
  min-width: 0;
  padding: .8rem .95rem;
  border: 1px solid #68414d;
  border-radius: 12px;
  color: #fff5f7;
  background: #22171d;
  font: inherit;
}
.auth-form textarea { resize: vertical; }
.support-form select:focus, .auth-form textarea:focus { outline: 2px solid #ff849f; outline-offset: 2px; }
.support-form .field-note { margin: 0; font-size: .8rem; }
.support-result:empty { display: none; }
.support-result { color: #ffd1dd; }
.ticket-list { list-style: none; padding: 0; margin: .8rem 0 0; }
.ticket-list li { border-top: 1px solid var(--line); }
.ticket-open {
  display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px;
  padding: .8rem .35rem; background: transparent; color: var(--text); border: 0;
  border-radius: 8px; cursor: pointer; text-align: left; font: inherit;
}
.ticket-open:hover, .ticket-open:focus-visible { background: #3d2534; }
.ticket-open strong, .ticket-open span { display: block; }
.ticket-open span { margin-top: .25rem; color: var(--muted); font-size: .85rem; }
.ticket-open svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.chat-status { margin-bottom: 10px; font-size: .9rem; }
.chat-messages {
  display: flex; flex-direction: column; align-items: flex-start; gap: .7rem;
  max-height: min(36vh, 310px); overflow: auto; margin-top: .55rem; padding: .25rem;
}
.chat-message {
  max-width: 94%; padding: .65rem .85rem; border-radius: 11px;
  border: 1px solid var(--line); background: #251924;
}
.chat-message.mine { align-self: flex-end; background: #3c2432; }
.chat-message header { display: flex; gap: .4rem .9rem; flex-wrap: wrap; align-items: baseline; font-size: .84rem; }
.chat-message time { color: var(--muted); font-size: .75rem; }
.chat-message p { margin: .25rem 0 0; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-form { margin-top: .85rem; max-width: none; }
.chat-form[hidden], #chat-older[hidden] { display: none; }
.support-unread {
  min-width: 1.3rem; padding: .12rem .3rem; border-radius: 1rem;
  background: var(--accent); color: #1c0c16; font-size: .72rem; font-weight: 720; text-align: center;
}
.ticket-open .ticket-unread { color: #ff9bb6; font-weight: 680; }
.config-qr { margin: 1rem 0 0; }
.config-qr canvas { display: block; width: min(100%, 272px); height: auto; border-radius: 8px; image-rendering: pixelated; }
.config-qr p { font-size: .88rem; }
.footer-cookie {
  border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}
.footer-cookie:hover { color: var(--text); text-decoration: underline; }
.reply-popup, .cookie-panel {
  position: fixed; z-index: 12; bottom: 18px; right: 18px;
  width: min(370px, calc(100vw - 36px)); padding: 16px;
  background: #30202c; border: 1px solid #80546b; border-radius: 14px;
  box-shadow: 0 12px 30px #12090e99;
}
.reply-popup-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.reply-popup-head strong { color: #ffe4ed; }
.reply-popup .icon-button { flex: none; width: 35px; height: 35px; }
.cookie-panel {
  z-index: 14; left: 50%; right: auto; transform: translateX(-50%);
  width: min(500px, calc(100vw - 36px)); padding: 20px;
}
.cookie-panel h2 { font-size: 1.15rem; }
.cookie-panel p { margin: .5rem 0 .85rem; color: var(--muted); line-height: 1.45; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.file-picker { display: grid; gap: .35rem; margin-top: .25rem; min-width: 0; }
.auth-form input[type="file"] { padding: .55rem; width: 100%; font-size: .83rem; }
.file-picker input::file-selector-button {
  font: inherit; font-weight: 680; padding: .35rem .55rem; margin-right: .5rem;
  border: 0; border-radius: 6px; background: #523344; color: #fff4f6; cursor: pointer;
}
.file-selected { display: flex; align-items: center; justify-content: space-between; gap: .4rem; font-size: .83rem; }
.file-selected span, .chat-attachment span { overflow-wrap: anywhere; }
.file-selected[hidden] { display: none; }
.file-error { color: #ffc3d5; font-size: .85rem; }
.chat-attachment {
  display: flex; align-items: center; gap: .45rem; max-width: 100%; margin-top: .35rem;
  padding: .35rem .45rem; border: 1px solid #80546b; border-radius: 7px; background: #30202c;
  color: #ffcfdb; font: inherit; font-size: .85rem; text-align: left; cursor: pointer;
}
.chat-attachment svg { width: 16px; height: 16px; flex: none; }
.chat-attachment small { color: var(--muted); white-space: nowrap; }
.admin-directory { max-width: 840px; }
.admin-search { display: grid; gap: .45rem; max-width: 450px; margin-bottom: 1.15rem; }
.admin-search label { color: var(--muted); font-size: .86rem; }
.admin-search div { display: flex; flex-wrap: wrap; gap: .55rem; }
.admin-search input {
  flex: 1; min-width: min(175px, 100%); padding: .65rem .8rem; font: inherit;
  color: var(--text); background: #22171d; border: 1px solid #68414d; border-radius: 10px;
}
.admin-accounts { list-style: none; margin: 0; padding: 0; }
.admin-accounts li { border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.admin-profile { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .8rem; margin: 1rem 0; }
.admin-profile dt { color: var(--muted); }
.admin-profile dd { margin: 0; }
.admin-config-title { margin: 1.25rem 0 .5rem; font-size: 1rem; }
.admin-confirm { padding: .65rem .8rem; margin-top: .8rem; background: #352332; border: 1px solid #68414d; border-radius: 10px; }
.admin-confirm p { margin-top: 0; }
.admin-back { margin-top: .7rem; }
