/* TIX Clock web tool - shared styling. */
:root {
  --bg: #0b0d12;
  --bg2: #0f131a;
  --panel: #151a23;
  --panel2: #1b212c;
  --edge: #262e3b;
  --edge2: #333d4e;
  --fg: #eef2f8;
  --muted: #93a0b4;
  --accent: #5b8cff;
  --accent2: #7aa2ff;
  --ok: #3ad07f;
  --bad: #ff6b6b;
  --warn: #ffce5a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; color: var(--fg); line-height: 1.55;
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(91, 140, 255, .16), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(122, 162, 255, .08), transparent 55%),
    var(--bg);
}

/* Header */
header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .85rem 1.25rem;
  background: rgba(11, 13, 18, .72); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 650; letter-spacing: .01em; }
.brand .logo {
  width: 1.6rem; height: 1.6rem; border-radius: 6px; display: grid;
  grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px; padding: 3px;
  background: linear-gradient(160deg, #22304d, #141a24); border: 1px solid var(--edge2);
}
.brand .logo i { border-radius: 1px; background: #2a3446; }
.brand .logo i:nth-child(2), .brand .logo i:nth-child(3), .brand .logo i:nth-child(6) { background: var(--accent); }
.brand small { color: var(--muted); font-weight: 500; }
.grow { flex: 1; }
nav.tabs { display: flex; gap: .3rem; }
nav.tabs a {
  color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 550;
  padding: .35rem .7rem; border-radius: 8px; border: 1px solid transparent;
}
nav.tabs a:hover { color: var(--fg); background: var(--panel); }
nav.tabs a.active { color: var(--fg); background: var(--panel); border-color: var(--edge2); }

/* Layout */
main { max-width: 760px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; display: grid; gap: 1.25rem; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--edge); border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow);
}
.card > h2 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem;
}
.card > h2 .num {
  width: 1.35rem; height: 1.35rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel2); border: 1px solid var(--edge2); color: var(--accent2); font-size: .72rem; letter-spacing: 0;
}

/* Controls */
button {
  font: inherit; color: var(--fg); background: var(--panel2); border: 1px solid var(--edge2);
  border-radius: 9px; padding: .55rem 1rem; cursor: pointer; transition: border-color .15s, background .15s, transform .05s;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: linear-gradient(180deg, var(--accent2), var(--accent)); border-color: var(--accent); color: #fff; font-weight: 600; }
button.big { padding: .7rem 1.4rem; font-weight: 600; font-size: 1rem; }
.row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }

.field { display: flex; align-items: center; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--edge); }
.field:first-of-type { border-top: 0; }
.field > label { flex: 1; font-weight: 500; }
.field .hint { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
input[type=color] { width: 3.2rem; height: 2.2rem; padding: 0; border: 1px solid var(--edge2); border-radius: 8px; background: none; cursor: pointer; }
input[type=text], input[type=time], input[type=number] {
  font: inherit; background: #0b0e14; color: var(--fg); border: 1px solid var(--edge2); border-radius: 8px; padding: .45rem .6rem;
}
input[type=text].mono { font-family: ui-monospace, monospace; width: 6.5rem; }
input[type=range] { flex: 1; accent-color: var(--accent); }
.val { font-family: ui-monospace, monospace; color: var(--muted); min-width: 3ch; text-align: right; }

/* Status pill */
.status { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .88rem;
  padding: .35rem .7rem; border: 1px solid var(--edge2); border-radius: 999px; background: var(--panel); }
.dot { width: .62rem; height: .62rem; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 0 rgba(58,208,127,.5); }
.dot.on { background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(58,208,127,.45);} 70% { box-shadow: 0 0 0 6px rgba(58,208,127,0);} 100% { box-shadow: 0 0 0 0 rgba(58,208,127,0);} }

/* Firmware drop zone */
.drop {
  display: block; border: 1.5px dashed var(--edge2); border-radius: 12px; padding: 1.25rem 1rem;
  text-align: center; color: var(--muted); background: var(--bg2);
  transition: border-color .15s, background .15s; cursor: pointer;
}
details > summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: .3rem 0; }
details > summary:hover { color: var(--fg); }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(91,140,255,.06); color: var(--fg); }
.drop b { color: var(--fg); }
progress { width: 100%; height: .55rem; margin-top: .9rem; border: 0; border-radius: 999px; background: #0b0e14; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #0b0e14; border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 999px; }

/* Logs / status text */
.statusline { margin-top: .55rem; font-size: .9rem; }
.statusline.ok { color: var(--ok); }
.statusline.bad { color: var(--bad); }
pre.log {
  margin: .7rem 0 0; max-height: 220px; overflow: auto; background: #0b0e14; border: 1px solid var(--edge); border-radius: 10px;
  padding: .65rem .75rem; font-family: ui-monospace, monospace; font-size: .78rem; color: #b7c0d0; white-space: pre-wrap; word-break: break-all;
}
.muted { color: var(--muted); font-size: .88rem; }
a { color: var(--accent2); }
code { font-family: ui-monospace, monospace; background: #0b0e14; padding: .05rem .35rem; border-radius: 5px; font-size: .9em; }
.hide { display: none !important; }
