:root {
  /* StarLit Solutions: white mark on brand navy #1b2430 */
  --bg: #1b2430; --panel: #232d3b; --panel2: #2b3647; --line: #3b4759;
  --text: #ffffff; --muted: #9aa6b6; --accent: #ffffff; --accent-ink: #1b2430;
  --good: #22c55e; --bad: #ef4444; --info: #60a5fa; --warn: #f5b041;
  --r: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.center { display: grid; place-items: center; min-height: 70vh; text-align: center; padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }

/* layout */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(27, 36, 48, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.brand img { height: 40px; width: auto; display: block; }
.brand .app { font-size: 12px; font-weight: 600; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.loginlogo { width: 210px; max-width: 70%; height: auto; display: block; margin: 0 auto 8px; }
.top .who { margin-left: auto; text-align: right; font-size: 13px; line-height: 1.3; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 520px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 16px; }
.tab { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: none; cursor: pointer; white-space: nowrap; }
.tab.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi b { display: block; font-size: 26px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* forms */
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 16px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); cursor: pointer; font-weight: 600; min-height: 44px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { border-color: var(--bad); color: var(--bad); background: none; }
.btn.ghost { background: none; }
.btn.sm { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tblwrap { overflow-x: auto; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.pill.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.pill.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 50%, transparent); }

/* switch */
.switch { position: relative; width: 46px; height: 26px; border-radius: 999px; background: var(--line); border: none; cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on { background: var(--good); }
.switch.on::after { transform: translateX(20px); }

/* recorder */
.mic { width: 132px; height: 132px; border-radius: 50%; border: none; background: var(--accent); color: var(--accent-ink); cursor: pointer; display: grid; place-items: center; margin: 8px auto 4px;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .08); }
.mic svg { width: 54px; height: 54px; }
.mic.rec { background: var(--bad); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 100% { box-shadow: 0 0 0 26px rgba(239, 68, 68, 0); } }
.hint { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.sent { display: grid; gap: 8px; }
.sent .row { justify-content: space-between; }
.addrcheck { display: grid; gap: 8px; padding: 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.addrcheck:empty { display: none; }
.addrcheck.ok { border-color: color-mix(in srgb, var(--good) 50%, transparent); background: color-mix(in srgb, var(--good) 8%, transparent); }
.addrcheck h3 { margin: 0; }
.addropt { display: grid; gap: 2px; text-align: left; padding: 10px 12px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; font-size: 15px; }
.leadlist { display: grid; gap: 8px; }
.leaditem { display: flex; justify-content: space-between; gap: 8px; padding: 12px; border-radius: 10px; background: var(--panel2); }
pre { white-space: pre-wrap; word-break: break-word; background: var(--panel2); padding: 10px; border-radius: 8px; font-size: 12px; margin: 6px 0 0; }
details summary { cursor: pointer; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; }
#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(120px); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: transform .2s; z-index: 50; max-width: 90vw; }
#toast.show { transform: translateX(-50%) translateY(0); }
.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
@media (max-width: 640px) { .hide-sm { display: none; } .brand .app { display: none; } .wrap { padding: 12px; } }
