:root {
  --bg: #15171c; --card: #1f2229; --line: #2c3039; --text: #e8e8ea; --muted: #9aa0aa;
  --accent: #6c8cff; --ok: #3ecf8e; --bad: #ef5a5a; --warn: #f0b429; --btn: #2d313a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
button { background: var(--btn); color: var(--text); border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; font: inherit; }
button:hover { filter: brightness(1.25); }
button.primary { background: var(--accent); color: #fff; font-weight: 600; }
button.danger { background: #4a2a2e; color: #ffb4b4; }
input, select { background: var(--btn); color: var(--text); border: 1px solid transparent; border-radius: 8px; padding: 9px 10px; font: inherit; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.muted { color: var(--muted); }
.err { color: var(--bad); min-height: 1.2em; }

/* auth pages */
.auth { max-width: 360px; margin: 12vh auto; padding: 0 16px; }
.auth h1 { font-size: 22px; margin: 0 0 4px; }
.auth form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

/* app */
header { display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header .brand { font-weight: 700; font-size: 17px; }
nav { display: flex; gap: 4px; }
nav button { background: none; color: var(--muted); }
nav button.on { background: var(--btn); color: var(--text); }
header .me { margin-left: auto; display: flex; align-items: center; gap: 10px; }
main { padding: 20px; }
.hidden { display: none !important; }

#phones { display: flex; flex-wrap: wrap; gap: 20px; }
.card { background: var(--card); border-radius: 14px; padding: 12px; width: 340px; max-width: 100%; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.name { font-weight: 600; }
.top select.q { padding: 4px 6px; font-size: 12px; }
.st { font-size: 12px; color: var(--muted); text-align: right; }
.st.ok { color: var(--ok); } .st.bad { color: var(--bad); } .st.warn { color: var(--warn); }
.screen { position: relative; width: 100%; aspect-ratio: 375/812; background: #000; border-radius: 22px; overflow: hidden; }
.screen img { width: 100%; height: 100%; display: block; cursor: pointer; user-select: none; -webkit-user-drag: none; }
.screen .ripple { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: rgba(108, 140, 255, .55); pointer-events: none; animation: ripple .45s ease-out forwards; }
.screen .trail { position: absolute; height: 4px; background: rgba(108, 140, 255, .6); transform-origin: 0 50%;
  pointer-events: none; border-radius: 2px; animation: fade .5s ease-out forwards; }
@keyframes ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes fade { from { opacity: 1; } to { opacity: 0; } }
.screen .off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 20px; }
.row { display: flex; gap: 6px; margin-top: 8px; }
.row > * { flex: 1; min-width: 0; }
.row button { padding: 8px 4px; font-size: 12px; white-space: nowrap; }
.row input { flex: 3; }

.panel { background: var(--card); border-radius: 14px; padding: 16px; max-width: 900px; margin-bottom: 20px; }
.panel h2 { font-size: 16px; margin: 0 0 12px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline input { flex: 1; min-width: 200px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--btn); font-size: 12px; }
.linkbox { margin-top: 10px; padding: 10px; background: var(--btn); border-radius: 8px; word-break: break-all; }
