:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --text: #16161a;
  --muted: #6e6e78;
  --line: #e6e6eb;
  --accent: #2f6bff;
  --accent-soft: #e8efff;
  --accent-strong: #2f6bff;
  --green: #1f9d55;
  --green-soft: #e3f6ec;
  --amber: #b7791f;
  --amber-soft: #fdf2dc;
  --red: #d64545;
  --red-soft: #fde8e8;
  --purple: #7a4fe0;
  --purple-soft: #efe8ff;
  --teal: #0e8f8f;
  --teal-soft: #dcf4f2;
  --pink: #c2417f;
  --pink-soft: #fce6f0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 16, 26, .04), 0 4px 16px rgba(16, 16, 26, .05);
  --shadow-sm: 0 1px 2px rgba(16, 16, 26, .08), 0 0 0 .5px rgba(16, 16, 26, .04); /* fits inside scroll containers */
  color-scheme: light;
}
/* dark: follows the system unless the theme is chosen in the settings */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f12;
    --surface: #18181c;
    --surface-2: #222228;
    --text: #f2f2f5;
    --muted: #9a9aa6;
    --line: #2a2a31;
    --accent: #5b8cff;
    --accent-soft: #1c2640;
    --accent-strong: #3a6cf0;
    --green: #4cc38a;
    --green-soft: #17301f;
    --amber: #e0a84a;
    --amber-soft: #352a14;
    --red: #f07070;
    --red-soft: #3a1c1c;
    --purple: #b399ff;
    --purple-soft: #2a2140;
    --teal: #4fd1c5;
    --teal-soft: #15302e;
    --pink: #f08cbf;
    --pink-soft: #3a1c2c;
    --shadow: none;
    --shadow-sm: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0f12;
  --surface: #18181c;
  --surface-2: #222228;
  --text: #f2f2f5;
  --muted: #9a9aa6;
  --line: #2a2a31;
  --accent: #5b8cff;
  --accent-soft: #1c2640;
  --accent-strong: #3a6cf0;
  --green: #4cc38a;
  --green-soft: #17301f;
  --amber: #e0a84a;
  --amber-soft: #352a14;
  --red: #f07070;
  --red-soft: #3a1c1c;
  --purple: #b399ff;
  --purple-soft: #2a2140;
  --teal: #4fd1c5;
  --teal-soft: #15302e;
  --pink: #f08cbf;
  --pink-soft: #3a1c2c;
  --shadow: none;
  --shadow-sm: none;
  color-scheme: dark;
}
/* inside Telegram follow the user's theme */
.tg {
  --bg: var(--tg-theme-secondary-bg-color);
  --surface: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color));
  --text: var(--tg-theme-text-color);
  --muted: var(--tg-theme-hint-color);
  --accent: var(--tg-theme-button-color);
  --accent-strong: var(--tg-theme-button-color);
  --red: var(--tg-theme-destructive-text-color, #d64545);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 650; }

/* layout */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 24px;
  padding: 12px max(24px, calc((100% - 1180px) / 2 + 24px));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand i { font-style: normal; font-size: 20px; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px; margin: -4px; }
.nav a {
  color: var(--muted); padding: 6px 12px; border-radius: 999px; white-space: nowrap; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; white-space: nowrap; }
main { max-width: 1180px; margin: 0 auto; padding: 24px; }
.tg .top { padding: 8px 16px; }
.tg .brand, .tg .who { display: none; }
.tg main { padding: 16px; }

/* primitives */
.icon { flex: none; }
.btn {
  border: 0; border-radius: 10px; padding: 9px 16px; cursor: pointer; font-weight: 550;
  background: var(--surface-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(.96); }
.btn.primary { background: var(--accent-strong); color: #fff; }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.ghost { background: transparent; color: var(--muted); padding: 6px 10px; }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }

.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.select {
  appearance: none; cursor: pointer; padding-right: 36px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238a8a94' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 120px; max-height: 480px; field-sizing: content; }
.label { display: block; font-size: 13px; font-weight: 550; color: var(--muted); margin-bottom: 6px; }
.field { margin-bottom: 18px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 56px 16px; }
.empty b { display: block; font-size: 32px; margin-bottom: 8px; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.c-blue { background: var(--accent-soft); color: var(--accent); }
.c-amber { background: var(--amber-soft); color: var(--amber); }
.c-green { background: var(--green-soft); color: var(--green); }
.c-gray { background: var(--line); color: var(--muted); }
.c-red { background: var(--red-soft); color: var(--red); }
.c-purple { background: var(--purple-soft); color: var(--purple); }
.c-teal { background: var(--teal-soft); color: var(--teal); }
.c-pink { background: var(--pink-soft); color: var(--pink); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { white-space: nowrap; border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 550; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 650; color: #fff; font-size: 15px;
}

/* applications */
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters .input { max-width: 260px; }
.filters .select { width: auto; max-width: 240px; }
.split { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.list { overflow: hidden; }
.item {
  display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; color: inherit;
  transition: background .12s;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.item.on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.item .meta { min-width: 0; flex: 1; }
.item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12px; color: var(--muted); }
.detail { padding: 24px; position: sticky; top: 80px; }
.detail header { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.detail header .avatar { width: 52px; height: 52px; font-size: 19px; }
.detail header .date { font-size: 13px; }
.contacts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.answers { display: grid; gap: 14px; margin: 22px 0; }
.answer + .answer { padding-top: 14px; border-top: 1px solid var(--line); }
.answer .q { font-size: 15px; font-weight: 650; margin-bottom: 6px; }
.answers { counter-reset: question; }
.answer .q::before { counter-increment: question; content: counter(question) ". "; color: var(--muted); }
.answer .a { white-space: pre-wrap; word-break: break-word; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--surface-2); padding: 3px 10px; border-radius: 999px; font-size: 14px; }
.back { display: none; margin-bottom: 12px; }
.back-link { margin: 0 0 8px -10px; }

/* vacancies */
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.group { margin-bottom: 28px; }
.group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; font-weight: 650; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.vac { padding: 18px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.vac:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(16, 16, 26, .08); }
.vac.off { opacity: .6; }
.stats .btn.ghost { margin-right: -10px; }
.stats > span { display: inline-flex; align-items: center; gap: 5px; }
.vac .desc { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); align-items: center; margin-top: auto; white-space: nowrap; min-height: 28px; }

/* editor */
.editor { max-width: 760px; }
.editor .card { padding: 24px; margin-bottom: 16px; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(16px); }
.switch.broadcast { display: flex; width: fit-content; margin-top: 12px; }
.q-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; background: var(--surface); box-shadow: var(--shadow); }
.q-top { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.q-text { display: block; resize: none; field-sizing: content; }
.q-num { width: 26px; height: 26px; border-radius: 8px; background: var(--surface); display: grid; place-items: center; font-size: 13px; font-weight: 650; color: var(--muted); border: 1px solid var(--line); }
.opt { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.opt .mark { width: 16px; height: 16px; border: 2px solid color-mix(in srgb, var(--muted) 45%, transparent); flex: none; }
.opt .mark.single { border-radius: 50%; }
.opt .mark.multi { border-radius: 4px; }
.add-q { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; border: 1.5px dashed var(--line); background: transparent; border-radius: 12px; padding: 14px; color: var(--muted); cursor: pointer; font-weight: 550; }
.add-q:hover { color: var(--accent); border-color: var(--accent); }
.bar { position: sticky; bottom: 0; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); display: flex; gap: 10px; }

/* admins */
.admins { max-width: 640px; }
.admins .item { cursor: default; align-items: center; }
.admins .item:hover { background: none; }
.admins .intro { margin: -8px 0 16px; }
.admins .hint { margin: 12px 0 0; font-size: 13px; }
.add-admin { display: flex; gap: 10px; padding: 16px; flex-wrap: wrap; }
.add-admin .input { flex: 1; min-width: 140px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { padding: 40px 36px; max-width: 380px; width: 100%; text-align: center; }
.login .logo { font-size: 44px; margin-bottom: 12px; }
.login p { color: var(--muted); margin: 8px 0 28px; }
.err { color: var(--red); font-size: 14px; margin-top: 16px; }
.login form { display: grid; gap: 10px; }
.login form .btn { padding: 12px; font-size: 16px; border-radius: 12px; }
.login .sent { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 550;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}

@media (max-width: 820px) {
  .top { gap: 6px; padding: 10px 16px; }
  .nav { gap: 0; }
  .nav a { padding: 6px 5px; font-size: 13px; }
  .nav .icon { display: none; }
  .who { display: none; }
  .statuses .arrow { display: none; }
  .q-top { gap: 8px; }
  .q-top .type-select { flex: 1; min-width: 0; }
  .q-top .type-select .select { width: 100%; }
  .q-top .spacer { display: none; }
  .q-top .check { order: 1; flex-basis: 100%; }
  .q-top .btn.ghost.small { padding: 6px 4px; }
  .statuses .btn.ghost.small { padding: 6px 4px; }
  .statuses .count { font-size: 12px; }
  main { padding: 16px; }
  .split { grid-template-columns: 1fr; }
  .split.has-detail .list { display: none; }
  .split:not(.has-detail) .detail { display: none; }
  .detail { position: static; padding: 18px; }
  .back { display: inline-flex; }
  .cols { grid-template-columns: 1fr; gap: 0; }
  .brand, .who span { display: none; }
  .filters > * { flex: 1 1 100%; min-width: 0; max-width: none !important; }
  .filters .seg { display: flex; }
  .filters .seg button { flex: 1; padding: 5px 2px; }
  .filters.has-detail { display: none; }
  .add-admin .btn { flex: 1 1 100%; }
  .detail .seg { display: flex; }
  .detail .seg button { flex: 1; padding: 5px 8px; }
}

.btn.destructive { background: #d93f3f; color: #fff; }
.confirm {
  border: 0; padding: 28px 24px 20px; border-radius: 18px; width: min(400px, calc(100% - 32px));
  background: var(--surface); color: var(--text); text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}
.confirm::backdrop { background: rgba(10, 10, 16, .55); backdrop-filter: blur(4px); }
.confirm[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.confirm-icon {
  width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 14px;
  display: grid; place-items: center; background: var(--red-soft); color: var(--red); font-weight: 800; font-size: 22px;
}
.confirm p { color: var(--muted); margin: 8px 0 22px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions .btn { padding: 11px; }

/* history and journal */
.history { margin: 4px 0 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.history.card { margin: 16px 0 0; padding: 20px 24px; }
.history h3 { display: flex; align-items: center; gap: 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; font-weight: 650; }
.event { position: relative; padding: 0 0 14px 18px; }
.event:last-child { padding-bottom: 0; }
.event::before { content: ""; position: absolute; left: 0; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.event:not(:last-child)::after { content: ""; position: absolute; left: 3px; top: 19px; bottom: 3px; width: 2px; border-radius: 1px; background: var(--line); }
.event .text { font-size: 14px; font-weight: 550; }
.event .by { font-size: 13px; color: var(--muted); }
.author { margin: -12px 0 16px; font-size: 14px; }
.journal { max-width: 760px; }
.journal .item { cursor: default; align-items: center; }
.journal .item:hover { background: none; }
.journal .action { font-size: 14px; }
.switch:has(input:disabled) { opacity: .5; cursor: default; }
.switch input:disabled { cursor: default; }

/* rich description */
.rich { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.rich:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rich-bar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); }
.rich-bar button { width: 30px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.rich-bar button:hover { background: var(--surface-2); color: var(--text); }
.rich-bar button.on { background: var(--accent-soft); color: var(--accent); }
.rich-text { min-height: 120px; max-height: 480px; overflow-y: auto; padding: 9px 12px; outline: none; white-space: pre-wrap; word-break: break-word; }
.rich-text:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }

/* cover */
.cover-add {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s;
}
.cover-add:hover { color: var(--accent); border-color: var(--accent); }
.cover-add b { font-weight: 550; color: var(--text); margin-top: 4px; }
.cover-add span { font-size: 13px; }
.cover-edit { position: relative; }
.cover-edit img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.cover-actions { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; }
.cover-actions .btn { background: var(--surface); box-shadow: var(--shadow-sm); }
.vac-cover { display: block; margin: -18px -18px 0; width: calc(100% + 36px); aspect-ratio: 16 / 9; object-fit: cover; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.vac .desc { white-space: pre-line; }

/* Telegram formatting, in the editor and the vacancy card */
.rich-text tg-spoiler, .desc tg-spoiler { background: repeating-linear-gradient(-45deg, var(--line) 0 3px, transparent 3px 6px); border-radius: 4px; }
.rich-text code, .desc code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border-radius: 4px; padding: 1px 4px; }
.rich-text blockquote, .desc blockquote { margin: 4px 0; padding: 2px 0 2px 10px; border-left: 3px solid var(--accent); }
.rich-text a, .desc a { color: var(--accent); }
.rich-bar .sep { width: 1px; margin: 4px 4px; background: var(--line); }
.rich-bar button { display: grid; place-items: center; }
.rich-link { display: flex; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); }
.rich-link .input { padding: 5px 10px; }
.cover-place { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; }
.q-hint { margin: 8px 0 0; font-size: 13px; }
.q-limits { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-top: 10px; }
.q-limits .input { width: 84px; padding: 4px 8px; font-size: 14px; }

/* application name and comment */
.detail h2 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rename { padding: 4px 6px; }
.rename-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.rename-form .input { flex: 1 1 100%; padding: 6px 10px; }
.tg-name { font-size: 13px; }
.comment-label { display: flex; align-items: center; gap: 6px; margin-top: 18px; }
.comment { min-height: 64px; }

/* settings */
.section-title { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 8px 0 6px; }
.section-title .icon { color: var(--accent); }
.admins > div { margin-top: 32px; }
.admins .section-title + .intro { margin: 0 0 12px; }
.statuses .item { align-items: center; gap: 8px; padding: 8px 12px; }
.input.bare { border-color: transparent; background: transparent; padding: 6px 8px; flex: 1; min-width: 0; }
.input.bare:hover { border-color: var(--line); }
.statuses .count { font-size: 13px; white-space: nowrap; }
.move-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; background: var(--red-soft); border-bottom: 1px solid var(--line); font-size: 14px; }
.move-row .select { width: auto; padding-top: 6px; padding-bottom: 6px; }
.move-actions { display: flex; gap: 8px; }

/* search, question type, files and links */
.search { position: relative; display: block; width: 260px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.filters .search .input { padding-left: 36px; max-width: none; }
.type-select { position: relative; display: flex; align-items: center; }
.type-select .icon { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.type-select .select { width: auto; padding: 6px 34px 6px 32px; font-size: 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); margin: 0; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.file { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: border-color .15s; }
.file:hover { border-color: var(--accent); }
.file-open { display: flex; flex-direction: column; width: 100%; padding: 0 0 6px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.file-preview { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); overflow: hidden; }
.file-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-size { padding: 0 8px; font-size: 12px; color: var(--muted); }
.file-download {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); opacity: 0; transition: opacity .15s;
}
.file:hover .file-download, .file-download:focus-visible { opacity: 1; }
@media (hover: none) { .file-download { opacity: 1; } }
.file-name { padding: 6px 8px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 550; }
.links { display: grid; gap: 6px; justify-items: start; }
.links a { display: inline-flex; align-items: center; gap: 6px; word-break: break-all; }
.links .icon { flex: none; }

/* status color and icon */
.status-look { width: 30px; height: 30px; border-radius: 8px; border: 0; cursor: pointer; flex: none; display: grid; place-items: center; transition: box-shadow .15s; }
.status-look.open, .status-look:hover { box-shadow: 0 0 0 2px currentColor; }
.status-look:empty::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.look-row { display: grid; gap: 12px; padding: 12px 16px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.look-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 13px currentColor; }
.swatch.on { box-shadow: inset 0 0 0 2px currentColor, inset 0 0 0 5px var(--surface-2), inset 0 0 0 13px currentColor; }
.look-icons { display: grid; grid-template-columns: repeat(auto-fill, 34px); gap: 4px; }
.look-icons button { width: 34px; height: 34px; border: 0; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.look-icons button:not(.on) { background: var(--surface); color: var(--muted); }
.look-icons button:not(.on):hover { color: var(--text); }
.look-icons button.on { box-shadow: inset 0 0 0 1.5px currentColor; }
.look-icons .none { font-size: 14px; }
.look-preview { display: flex; align-items: center; justify-content: space-between; }
.detail .seg button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }

.look-pop {
  position: fixed; inset: auto; margin: 0; width: 330px; padding: 14px; display: none; gap: 12px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.look-pop:popover-open { display: grid; animation: pop .14s ease-out; }

/* drag and drop of questions */
.grip { width: 22px; height: 28px; margin: 0 -6px 0 -6px; border: 0; background: transparent; color: var(--muted); cursor: grab; display: grid; place-items: center; touch-action: none; border-radius: 6px; }
.grip .icon { stroke-width: 3.2; }
.grip:hover { color: var(--text); background: var(--surface-2); }
.drag-ghost { opacity: .4; }
.sortable-chosen .grip { cursor: grabbing; }

/* attachment popup */
.lightbox {
  width: min(1000px, calc(100% - 32px)); height: min(86vh, 900px); padding: 0; border: 0; border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
}
.lightbox[open] { display: flex; flex-direction: column; animation: pop .16s ease-out; }
.lightbox::backdrop { background: rgba(10, 10, 16, .7); backdrop-filter: blur(4px); }
.lightbox header { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.lightbox header b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox header .muted { font-size: 13px; white-space: nowrap; }
.lightbox-body { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; background: var(--surface-2); }
.lightbox-body img, .lightbox-body video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-body iframe { width: 100%; height: 100%; border: 0; }
.lightbox-empty { display: grid; justify-items: center; gap: 10px; padding: 24px; text-align: center; color: var(--muted); max-width: 360px; }
.lightbox-empty p { margin: 0; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 2px 10px rgba(0, 0, 0, .2); }
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }
@media (max-width: 820px) {
  .lightbox { width: 100%; height: 100%; max-width: none; max-height: none; border-radius: 0; }
}

/* bot texts */
.texts { max-width: 760px; }
.texts .intro { margin: -8px 0 20px; }
.text-list { overflow: hidden; }
.text-item { padding: 16px; display: grid; gap: 8px; }
.text-item + .text-item { border-top: 1px solid var(--line); }
.text-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.text-item .rich-text { min-height: 60px; }
.text-vars { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.text-vars code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); color: var(--text); padding: 1px 6px; border-radius: 6px; }
.text-actions { display: flex; gap: 8px; }
.mobile-logout { margin-top: 28px; }
@media (min-width: 821px) { .mobile-logout, .mobile-only { display: none; } }
.tg .mobile-logout { display: none; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 14px; }
