/* Токены из утверждённого макета (docs/superpowers/specs, раздел 3) */
:root {
  --bg: #0c0c0d; --card: #161617; --card2: #1d1d1f; --line: #2a2a2d;
  --text: #f2f2f0; --dim: #8b8b90;
  --y: #e9efa6; --l: #c9c4ee; --b: #bcd3ee;
  --holo: linear-gradient(135deg, #eef2a8 0%, #d9d7ee 50%, #b9cdee 100%);
  --del-bg: #2a1715; --del: #ff7a6b; --del-text: #ffb3a8;
  --light: #ecece8;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { background: var(--bg); color: var(--text); font: 500 14px/1.4 Manrope, system-ui, sans-serif; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }

#app { max-width: 480px; margin: 0 auto; padding: 16px 16px 100px; }
.screen { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.mono { font: 400 10px "Space Mono", monospace; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); }
.dim { color: var(--dim); }
.strong { font-weight: 800; margin-top: 2px; }
.error { color: var(--del); margin-top: 12px; font-size: 13px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; min-height: 36px; }
.pill { background: var(--card2); border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; font-size: 12px; font-weight: 600; }
.round { width: 36px; height: 36px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 15px; flex: none; }
.round:active, .btn:active { transform: scale(.96); }

.search { margin-bottom: 12px; }
input[type=search], input[type=password], textarea, select, input[type=time], .stepper input {
  background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; outline: none; width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--l); }

.hero { background: var(--holo); color: #111; border-radius: 26px; padding: 18px; margin-bottom: 12px; }
.hero .mono { color: #33332f; }
.dots { font: 900 56px/1 Doto, monospace; margin: 8px 0 6px; letter-spacing: .02em; }
.hero p { font-size: 12px; font-weight: 700; opacity: .75; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 14px; margin-bottom: 12px; }
.card.light { background: var(--light); color: #111; border: 0; }
.card.light .mono { color: #555; }
.big { font: 800 30px Manrope; margin-top: 4px; }
.bars { display: flex; gap: 6px; align-items: flex-end; height: 46px; margin-top: 10px; }
.bars i { flex: 1; background: #3a3a3e; border-radius: 5px; min-height: 4px; }
.bars i.on { background: var(--y); }

.sec { margin: 18px 2px 8px; }
.dg { cursor: pointer; }
.dg h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.dg .chev { margin-left: auto; color: var(--dim); transition: transform .2s; }
.dg.open .chev { transform: rotate(90deg); }
.dg .body { display: none; }
.dg.open .body { display: block; }
.dg .preview { color: #cfcfcc; font-size: 13px; margin-top: 8px; }
.dg.open .preview { display: none; }
.tag { display: inline-block; font: 700 10px "Space Mono", monospace; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 99px; margin: 12px 0 6px; color: #111; }
.tag.t-topics { background: var(--y); } .tag.t-decisions { background: var(--l); } .tag.t-tasks { background: var(--b); } .tag.t-bot_replies { background: var(--light); }
.badge { font: 700 9px "Space Mono", monospace; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); }
.badge.holo { background: var(--holo); color: #111; border: 0; }
.dg ul { list-style: none; padding: 0; font-size: 13px; line-height: 1.5; color: #d8d8d6; }
.dg li { padding-left: 14px; position: relative; margin-bottom: 3px; }
.dg li::before { content: ""; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.dg .actions { display: flex; gap: 8px; margin-top: 12px; }
.empty { text-align: center; color: var(--dim); padding: 30px 10px; }
mark { background: var(--y); color: #111; border-radius: 3px; padding: 0 2px; }

a.btn { text-decoration: none; color: var(--text); }
.btn { display: block; width: 100%; padding: 13px; border-radius: 16px; font-weight: 700; text-align: center; margin-top: 10px; }
.btn.primary { background: var(--text); color: #111; }
.btn.ghost { border: 1px solid var(--line); color: var(--dim); }
.btn.small { display: inline-block; width: auto; padding: 8px 12px; border-radius: 99px; font-size: 12px; margin: 0; border: 1px solid var(--line); }

.filters { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filters::-webkit-scrollbar { display: none; }
.filters button { font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); white-space: nowrap; }
.filters button.on { background: var(--text); color: #111; border-color: var(--text); }

.list { padding: 4px 12px; }
.chat-row { display: flex; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.chat-row:last-child { border: 0; }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #111; flex: none; position: relative; }
.av .new-dot { position: absolute; top: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--del); border: 2px solid var(--card); }
.chat-row .info { min-width: 0; flex: 1; }
.chat-row b { font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row small { color: var(--dim); font-size: 12px; }
.sws { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.swr { display: flex; align-items: center; gap: 6px; }
.swr small { font: 400 9px "Space Mono", monospace; color: var(--dim); }

.sw { width: 42px; height: 24px; border-radius: 99px; background: #34343a; position: relative; flex: none; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #888; transition: .2s; }
.sw.on { background: var(--y); }
.sw.on::after { left: 21px; background: #111; }
.sw:disabled { opacity: .3; cursor: not-allowed; }
.sws .sw { width: 36px; height: 21px; }
.sws .sw::after { width: 15px; height: 15px; }
.sws .sw.on::after { left: 18px; }
.card.light .sw { background: #cfcfca; }
.card.light .sw.on { background: #111; }
.card.light .sw.on::after { background: var(--y); }

.msg { max-width: 82%; padding: 10px 13px; border-radius: 18px; font-size: 13.5px; line-height: 1.4; margin-bottom: 8px; background: var(--card2); border-bottom-left-radius: 6px; word-wrap: break-word; white-space: pre-wrap; }
.msg.me { margin-left: auto; background: #e9e9e6; color: #111; border-radius: 18px 18px 6px 18px; }
.msg.bot { margin-left: auto; background: var(--holo); color: #111; border-radius: 18px 18px 6px 18px; }
.msg.del { border: 1px dashed var(--del); background: var(--del-bg); color: var(--del-text); }
.msg.del .t { text-decoration: line-through; opacity: .85; }
.msg .meta { display: block; font: 400 9px "Space Mono", monospace; opacity: .6; margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; }
.msg .edited { text-decoration: underline dotted; cursor: pointer; }
.who { font: 700 11px Manrope; color: var(--l); display: block; margin-bottom: 2px; }
.day-sep { text-align: center; margin: 14px 0 10px; }

.field { padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.field:last-child { border: 0; padding-bottom: 2px; }
.field.col { display: flex; flex-direction: column; gap: 8px; }
.field input[type=time], .field select { width: auto; padding: 8px 12px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper input { width: 56px; text-align: center; padding: 8px 4px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { display: none; }
.stepper button { width: 32px; height: 32px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 1 auto; font-size: 12px; font-weight: 700; padding: 9px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--dim); background: var(--card2); }
.seg button.on { background: var(--holo); color: #111; border-color: transparent; }
#custom-tone input { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; width: 100%; outline: none; font-weight: 500; }
#custom-tone input:focus { border-color: var(--l); }
.hint { display: block; margin-top: 6px; }
textarea { resize: vertical; min-height: 90px; font-weight: 500; }

.tabs { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); width: calc(100% - 28px); max-width: 452px; background: #1a1a1ccc; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 26px; display: flex; padding: 6px; z-index: 10; }
.tabs a { flex: 1; text-align: center; font-size: 11px; font-weight: 700; color: var(--dim); padding: 10px 0; border-radius: 20px; text-decoration: none; transition: .2s; }
.tabs a.on { background: var(--text); color: #111; }

.sheet-bg { position: fixed; inset: 0; background: #0009; z-index: 20; }
.sheet { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; max-height: 80vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 10px 16px 28px; z-index: 21; animation: up .2s ease; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { font-size: 18px; margin-bottom: 4px; }
.sheet .chev { display: none; }
.sheet .hist { background: var(--card2); border-radius: 14px; padding: 10px 12px; margin-top: 8px; font-size: 13px; }
.sheet input { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; width: 100%; outline: none; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@keyframes up { from { transform: translate(-50%, 30%); opacity: 0; } }

.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: var(--text); color: #111; padding: 10px 16px; border-radius: 99px; font-weight: 700; font-size: 13px; z-index: 30; animation: fade .2s; max-width: 90%; text-align: center; }
.toast.err { background: var(--del); }

.login-box { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.lock { font: 900 40px Doto, monospace; background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .1em; margin-bottom: 10px; }
.login-box h1 { font-size: 26px; }
.login-box form { margin-top: 20px; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.hint { text-align: left; padding: 6px 4px; line-height: 1.5; }
.hint b { display: block; margin-bottom: 6px; font-size: 15px; }
.hint ol { padding-left: 20px; color: var(--dim); }
.hint li + li { margin-top: 6px; }
.spin { display: inline-block; animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* пользователи */
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.user-row .info { flex: 1; min-width: 0; }
.user-row b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row small { color: var(--dim); font-size: 11px; display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.user-row .btn.small { flex: none; }
.badge.ok { background: var(--y); color: #111; border: 0; }
.badge.wait { background: var(--b); color: #111; border: 0; }
.badge.off { background: var(--del-bg); color: var(--del-text); border-color: var(--del); }
#add-user-form input, #password-form input { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; outline: none; font-weight: 500; }
.login-box input + input { margin-top: 8px; }
