:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --border: #e2e7ef;
  --text: #1b2336;
  --muted: #667089;
  --brand: #1666d6;
  --brand-strong: #0f55b8;
  --brand-soft: #e9f1fd;
  --nav-active: #e8eef7;
  --banner-from: #0d5bb5;
  --banner-to: #1e88e5;
  --value: #3a9a1c;
  --spark: #a9dc8c;
  --spark-2: #c9ebb6;
  --danger: #c2341f;
  --warn-bg: #fff4e0;
  --warn-text: #8a5300;
  --productive: #3a9a1c;
  --neutral: #8f9bb3;
  --unproductive: #de4b3f;
  --idle: #dfe4ec;
  --private: #8e6bd6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141c;
    --surface: #171e29;
    --surface-2: #1c2432;
    --border: #2a3445;
    --text: #e6eaf2;
    --muted: #93a0b8;
    --brand: #5c9dff;
    --brand-strong: #7fb2ff;
    --brand-soft: #1d2c47;
    --nav-active: #212c3d;
    --banner-from: #0b4b96;
    --banner-to: #1667c2;
    --value: #6fcf4a;
    --spark: #3f6e2c;
    --spark-2: #2c4a22;
    --danger: #ff7a66;
    --warn-bg: #3a2c12;
    --warn-text: #ffcf7a;
    --productive: #5cc23a;
    --neutral: #7d8aa3;
    --unproductive: #f06b66;
    --idle: #2a3343;
    --private: #a68af0;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* components with their own display: … must still hide */
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 14px; font-weight: 650; }
h3 { font-size: 13px; margin: 18px 0 4px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.boot { padding: 40px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.ico { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------ status banner */
.topbanner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 48px; color: #fff; font-size: 14px; position: relative; text-align: center;
  background: linear-gradient(90deg, var(--banner-from), var(--banner-to));
}
.topbanner.warn { background: var(--warn-bg); color: var(--warn-text); border-bottom: 1px solid color-mix(in srgb, var(--warn-text) 25%, transparent); }
.topbanner.private { background: var(--private); }
.banner-x { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: inherit; padding: 4px; }
.banner-x:hover { background: rgba(255,255,255,.15); }
.banner-btn { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.5); color: #fff; padding: 4px 10px; border-radius: 8px; font-size: 13px; }
.topbanner.warn .banner-btn { background: transparent; border-color: currentColor; color: inherit; }
a.banner-btn:hover { text-decoration: none; filter: brightness(1.1); }

/* ------------------------------------------------------------ top bar */
.topbar {
  display: flex; align-items: center; gap: 16px; height: 72px; padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { display: flex; align-items: center; }
.brand-logo img { height: 34px; width: auto; display: block; }
.brand-sep { width: 1px; height: 30px; background: var(--border); margin: 0 8px; }
.brand-app { font-size: 21px; color: var(--brand); font-weight: 500; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 999px; padding: 0 12px; height: 40px; color: var(--muted); background: var(--surface-2); }
.search input { border: 0; background: transparent; padding: 0; width: 200px; outline: none; }
.search:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }
.iconbtn { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%; border: 0; background: transparent; color: var(--text); }
.iconbtn .ico { width: 26px; height: 26px; }
.iconbtn:hover { background: var(--surface-2); }
.iconbtn.bordered { border: 1px solid var(--border); border-radius: 10px; width: 46px; height: 46px; background: var(--surface); }
.iconbtn.bordered .ico { width: 22px; height: 22px; }
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: 48px; z-index: 20; min-width: 230px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(16,24,40,.15); padding: 6px;
}
.menu-pop a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.menu-pop a:hover { background: var(--surface-2); text-decoration: none; }
.menu-who { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: -6px -6px 6px; background: var(--surface-2); border-radius: 12px 12px 0 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.menu-who div { display: flex; flex-direction: column; line-height: 1.35; }
.menu-who strong { font-size: 15px; color: var(--text); }
.profile-pop { min-width: 300px; }
.profile-pop a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; font-size: 15px; }
.profile-pop a .ico { width: 20px; height: 20px; color: var(--muted); }
.profile-pop a.danger-link { color: var(--danger); border-top: 1px solid var(--border); margin-top: 4px; border-radius: 0 0 8px 8px; }
.profile-pop a.danger-link .ico { color: var(--danger); }
.avatar-btn .avatar { width: 38px; height: 38px; font-size: 14px; }
.avatar-btn:hover { background: transparent; box-shadow: 0 0 0 3px var(--brand-soft); }
.menu-dot { width: 9px; height: 9px; border-radius: 50%; background: #e8590c; margin-left: auto; }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .02em; }

/* ------------------------------------------------------------ layout */
.shell { display: grid; grid-template-columns: 300px 1fr; min-height: calc(100vh - 72px); }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 28px 14px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a, .navgroup summary {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 10px;
  color: var(--text); font-size: 17px; cursor: pointer; list-style: none;
}
.nav a .ico, .navgroup summary .ico { width: 24px; height: 24px; color: var(--muted); }
.nav a:hover, .navgroup summary:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--nav-active); font-weight: 600; }
.nav a.active .ico { color: var(--text); }
.navgroup summary::-webkit-details-marker { display: none; }
.navgroup summary .chev { margin-left: auto; width: 18px; height: 18px; transition: transform .15s; }
.navgroup[open] summary .chev { transform: rotate(180deg); }
.navgroup summary.within { font-weight: 600; }
.nav a.sub { font-size: 15px; padding: 9px 16px 9px 54px; }
.main { padding: 30px 32px 90px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-bottom: 26px; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 230px 1fr; }
  .nav a, .navgroup summary { font-size: 15px; padding: 10px 12px; }
  .nav a.sub { padding-left: 48px; }
}
@media (max-width: 760px) {
  .topbanner { padding: 10px 44px 10px 16px; font-size: 13px; justify-content: flex-start; text-align: left; }
  .topbar { height: 60px; padding: 0 16px; gap: 8px; }
  .brand-app { font-size: 17px; }
  .brand-logo img { height: 24px; }
  .brand-sep { margin: 0 2px; height: 24px; }
  .search input { width: 110px; }
}
@media (max-width: 520px) {
  .search { display: none; }
  .shell { grid-template-columns: 1fr; min-height: 0; }
  .side { padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .nav { flex-direction: row; gap: 4px; }
  .nav a, .navgroup summary { font-size: 14px; padding: 8px 10px; white-space: nowrap; gap: 8px; }
  .nav a .ico, .navgroup summary .ico { width: 18px; height: 18px; }
  .navgroup { display: contents; }
  .navgroup summary { display: none; }
  .nav a.sub { padding: 8px 10px; font-size: 14px; }
  .main { padding: 18px 16px 90px; }
  h1 { font-size: 22px; }
}

/* ------------------------------------------------------------ page-head controls */
button, .btn {
  font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 13px; border-radius: 9px; cursor: pointer; line-height: 1.2;
  display: inline-flex; align-items: center; gap: 8px;
}
button:hover { background: var(--surface-2); }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-strong); }
button.danger { color: var(--danger); }
button.outline { height: 46px; padding: 0 16px; border-radius: 10px; font-size: 15px; }
button.outline.accent { border: 2px solid var(--brand); color: var(--brand); font-weight: 600; }
button.outline.accent:hover { background: var(--brand-soft); }
button.private-on { background: var(--private); border-color: var(--private); color: #fff; }
button:disabled { opacity: .45; cursor: default; }
a.btn { color: var(--text); text-decoration: none; }
a.btn:hover { background: var(--surface-2); text-decoration: none; }
a.btn.primary-link { background: var(--brand); border-color: var(--brand); color: #fff; }
a.btn.primary-link .muted { color: rgba(255,255,255,.8); }
a.btn.primary-link:hover { background: var(--brand-strong); }
.btn.disabled { opacity: .5; cursor: not-allowed; }
.btn .ico { width: 18px; height: 18px; }
.datenav { display: flex; align-items: center; height: 46px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.navbtn { border: 0; background: transparent; height: 44px; padding: 0 12px; border-radius: 10px; }
.navbtn:hover:not(:disabled) { background: var(--border); }
.datelabel { position: relative; padding: 0 18px; font-size: 15px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.datelabel input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; padding: 0; border: 0; }
.datelabel input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.segmented { display: flex; gap: 2px; padding: 3px; height: 46px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.segmented button { border: 0; background: transparent; padding: 0 14px; color: var(--muted); font-size: 15px; border-radius: 8px; }
.segmented button .ico { width: 18px; height: 18px; }
.segmented button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.12); }
select.picker { height: 46px; border-radius: 10px; padding: 0 12px; font-size: 15px; }

/* ------------------------------------------------------------ KPI tiles with sparklines */
.ktiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 22px; }
.ktile {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 26px 0; min-height: 228px; overflow: hidden; display: flex; flex-direction: column;
}
.ktile-head { display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: 600; }
.hint { color: var(--muted); display: inline-grid; cursor: help; border-radius: 50%; }
.hint .ico { width: 24px; height: 24px; }
.hint:focus-visible { outline: 2px solid var(--brand); }
.kval { font-size: 42px; font-weight: 600; color: var(--value); margin-top: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; position: relative; z-index: 1; white-space: nowrap; }
.kval .u { font-size: .62em; font-weight: 500; margin-left: 1px; }
.kval.dim { color: var(--muted); font-size: 30px; }
.kval.private { color: var(--private); }
.spark { display: block; width: calc(100% + 52px); margin: auto -26px 0; height: 92px; }
.spark path { fill: var(--spark); }
.spark-empty { height: 92px; margin: auto -26px 0; background: linear-gradient(transparent 70%, var(--spark-2) 70%); opacity: .6; }
.ktiles.four .ktile { min-height: 190px; }
.ktiles.four .spark, .ktiles.four .spark-empty { height: 70px; }
@media (max-width: 1250px) { .ktiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .ktiles { gap: 12px; }
  .ktile { padding: 16px 16px 0; min-height: 160px; }
  .ktile-head { font-size: 14px; }
  .hint .ico { width: 18px; height: 18px; }
  .kval { font-size: 28px; margin-top: 10px; }
  .kval.dim { font-size: 20px; }
  .spark, .spark-empty { width: calc(100% + 32px); margin: auto -16px 0; height: 60px; }
}

/* ------------------------------------------------------------ cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 26px; margin-bottom: 20px; min-width: 0;
}
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ productivity bar */
.pbar { display: flex; height: 30px; border-radius: 6px; overflow: hidden; background: var(--idle); }
.pbar span { display: block; height: 100%; }
.pbar .productive { background: var(--productive); }
.pbar .neutral { background: var(--neutral); }
.pbar .unproductive { background: var(--unproductive); }

/* ------------------------------------------------------------ forms */
input, select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 10px; min-width: 0;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
td.r, th.r { text-align: right; }
td.num, td.r { white-space: nowrap; }
.truncate { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

.pill { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.pill.productive { color: var(--productive); border-color: currentColor; }
.pill.unproductive { color: var(--unproductive); border-color: currentColor; }
.pill.neutral { color: var(--neutral); }
.pill.warn { color: #b7791f; border-color: currentColor; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--idle); margin-right: 8px; vertical-align: 1px; }
.dot.on { background: var(--productive); box-shadow: 0 0 0 3px color-mix(in srgb, var(--productive) 22%, transparent); }

.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.p > span { background: var(--productive); }

/* ------------------------------------------------------------ timeline */
.timeline { position: relative; height: 40px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 6px 0 4px; }
.timeline .seg { position: absolute; top: 0; bottom: 0; }
.timeline .seg.idle { background: repeating-linear-gradient(135deg, var(--idle) 0 4px, transparent 4px 8px); }
.timeline .seg.private { background: var(--private); opacity: .55; }
.timeline .seg.productive { background: var(--productive); }
.timeline .seg.neutral { background: var(--neutral); }
.timeline .seg.unproductive { background: var(--unproductive); }
.timeline .now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .5; }
.ticks { position: relative; height: 16px; font-size: 11px; color: var(--muted); }
.ticks span { position: absolute; transform: translateX(-50%); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
.legend strong { color: var(--text); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend i.productive { background: var(--productive); } .legend i.neutral { background: var(--neutral); }
.legend i.unproductive { background: var(--unproductive); } .legend i.private { background: var(--private); }
.legend i.idle { background: repeating-linear-gradient(135deg, var(--neutral) 0 2px, transparent 2px 4px); }

/* ------------------------------------------------------------ day chart */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 180px; }
.week.many { gap: 4px; }
.week .col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; cursor: pointer; min-width: 0; }
.week .stack { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; border-radius: 5px 5px 0 0; overflow: hidden; background: var(--surface-2); }
.week .stack span { display: block; }
.week .stack .productive { background: var(--productive); }
.week .stack .neutral { background: var(--neutral); }
.week .stack .unproductive { background: var(--unproductive); }
.week .lbl { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.25; }
.week .col.sel .lbl { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------ misc */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 400px; padding: 32px; }
.login .brand { justify-content: center; flex-wrap: wrap; }
.login .brand-app { font-size: 19px; }
.login .brand-logo img { height: 40px; }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.login button.primary { justify-content: center; padding: 11px; }
.error { color: var(--danger); font-size: 13px; min-height: 1em; }
.ok-msg { color: var(--productive); font-size: 13px; line-height: 1.45; }
.login h2 { margin: 0; }
.forgot { text-align: center; font-size: 13px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
pre.summary { white-space: pre; word-break: normal; font-size: 12.5px; }
.titles { margin: 6px 0 2px 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.titles li { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; }
details > summary { cursor: pointer; }
/* ------------------------------------------------------------ productivity bar (5-minute columns) */
.pchart { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; margin-top: 6px; }
.pc-y { display: flex; flex-direction: column; justify-content: space-between; height: 150px; font-size: 11px; color: var(--muted); text-align: right; padding-bottom: 0; }
.pc-y span:last-child { margin-bottom: 30px; }
.pc-main { min-width: 0; }
.pc-plot { position: relative; height: 150px;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), var(--border) calc(25% - 1px), var(--border) 25%); }
.pc-col { position: absolute; bottom: 0; top: 0; display: flex; align-items: flex-end; padding: 0 0.5px; cursor: default; }
.pc-col:hover, .pc-col.hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.pc-stack { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 2px 2px 0 0; overflow: hidden; min-height: 2px; }
.pc-stack span { display: block; }
.pc-stack .productive { background: var(--productive); }
.pc-stack .neutral { background: var(--neutral); }
.pc-stack .unproductive { background: var(--unproductive); }
.pchart .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: .45; }
.pc-strip { position: relative; height: 14px; margin: 3px 0 6px; background: var(--surface-2); border-radius: 3px; }
.pc-strip span { position: absolute; top: 0; bottom: 0; }
.pc-here { background: #2f8fe6; border-radius: 2px; }
.pc-strip span.pc-away { top: 6px; bottom: auto; height: 0; border-top: 2px dashed var(--muted); }
.pchart .ticks span { white-space: nowrap; }
.pchart .ticks span:last-child { transform: translateX(-100%); }
.pc-private { background: var(--private); opacity: .6; }
.legend i.here { background: #2f8fe6; }
.legend i.away { background: transparent; border: 1.5px dashed var(--neutral); width: 12px; height: 6px; vertical-align: 1px; }

.tip { position: fixed; z-index: 40; min-width: 240px; max-width: 320px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 10px 30px rgba(16,24,40,.22); padding: 10px 12px; font-size: 13px; pointer-events: none; }
.tip-head { font-weight: 700; margin-bottom: 6px; }
.tip-row { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; }
.tip-row i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
.tip-row i.productive { background: var(--productive); } .tip-row i.neutral { background: var(--neutral); }
.tip-row i.unproductive { background: var(--unproductive); } .tip-row i.private { background: var(--private); }
.tip-row i.idle { background: repeating-linear-gradient(135deg, var(--neutral) 0 2px, transparent 2px 4px); }
.tip-row .truncate { max-width: 210px; }
.tip-apps { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.tip-total { text-align: right; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }

/* ------------------------------------------------------------ my profile */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -8px 0 22px; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--brand); }
.profile-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; margin-bottom: 8px; }
.profile-intro h2 { margin-bottom: 6px; }
.photo-row { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.photo-big .avatar { width: 88px; height: 88px; font-size: 30px; }
img.avatar { object-fit: cover; display: block; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
input.ro { background: var(--surface-2); color: var(--muted); cursor: default; }
input.ro:focus { outline: none; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; gap: 8px; } .form-grid.two { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ no agent yet: sidebar card + locked page */
.side-install { font-size: 12.5px; line-height: 1.45; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; margin: -8px 2px 18px; box-shadow: var(--shadow); }
.green-link { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; background: #3a7d14; color: #fff;
  font-weight: 600; font-size: 13px; border-radius: 7px; padding: 8px 10px; }
.green-link:hover { background: #326c11; text-decoration: none; }
.green-link .ico { width: 16px; height: 16px; }
.green-link.big { display: inline-flex; font-size: 15px; padding: 11px 20px; margin: 4px 0 12px; box-shadow: 0 6px 18px rgba(58,125,20,.3); }
.main.locked { position: relative; }
.main.locked > *:not(.lock-cta) { filter: blur(7px); pointer-events: none; user-select: none; }
/* sticky + zero height: the call to action stays in the middle of the visible area while the blurred page scrolls */
.lock-cta { position: sticky; top: 32vh; z-index: 5; height: 0; overflow: visible; display: flex; flex-direction: column; align-items: center; text-align: center; }
.lock-cta p { font-size: 20px; font-weight: 600; margin: 0 0 14px; line-height: 1.35; }
@media (max-width: 760px) { .side-install { display: none; } }

/* ------------------------------------------------------------ add team members */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; margin-bottom: 14px; }
.back .ico { width: 18px; height: 18px; }
.info-box { display: flex; align-items: center; gap: 12px; border: 1px solid var(--brand); background: var(--brand-soft); border-radius: 10px; padding: 14px 18px; margin-bottom: 18px; }
.info-box .ico { color: var(--brand); flex: none; }
.member-row { display: grid; grid-template-columns: 28px repeat(4, minmax(0, 1fr)) 36px; gap: 12px; align-items: end; padding: 10px 0; }
.member-row .field input, .member-row .field select { height: 44px; }
.member-row .field label { font-weight: 600; color: var(--text); font-size: 13px; }
.member-no { font-weight: 700; padding-bottom: 12px; }
.row-x { width: 36px; height: 36px; margin-bottom: 4px; }
.row-x .ico { width: 18px; height: 18px; color: var(--muted); }
.row-result { grid-column: 2 / -1; font-size: 13px; color: var(--danger); min-height: 0; }
.row-result:empty { display: none; }
.member-row.row-bad input[name=email] { border-color: var(--danger); }
.add-row { text-align: center; margin: 6px 0 14px; }
.linklike { border: 0; background: transparent; color: var(--brand); font-weight: 600; font-size: 15px; }
.linklike:hover { background: var(--brand-soft); }
.bulk-foot { border-top: 1px solid var(--border); padding-top: 16px; margin-bottom: 8px; }
button.green { background: #3a7d14; border-color: #3a7d14; color: #fff; font-weight: 600; height: 44px; padding: 0 20px; }
button.green:hover { background: #326c11; }
label.btn { cursor: pointer; }
@media (max-width: 900px) {
  .member-row { grid-template-columns: 24px 1fr 36px; }
  .member-row .field { grid-column: 2 / 3; }
  .row-x { grid-column: 3; grid-row: 1; }
}

/* ------------------------------------------------------------ join / reset page */
.join { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); min-height: 100vh; background: var(--surface); }
.join-side { margin: 18px; border-radius: 16px; background: var(--brand-soft); padding: 40px 44px; display: flex; flex-direction: column; }
.join-side .brand-logo img { height: 36px; }
.join-art { width: min(440px, 80%); margin: auto; display: block; }
.ja-card { fill: var(--surface); stroke: var(--border); }
.ja-front { filter: drop-shadow(0 10px 24px rgba(16, 24, 40, .12)); }
.ja-bar { fill: var(--surface-2); }
.ja-dot { fill: var(--value); }
.ja-line { fill: var(--border); }
.ja-soft { opacity: .6; }
.ja-tile { fill: var(--surface-2); }
.ja-spark { fill: var(--spark); }
.ja-col { fill: var(--productive); }
.ja-btn { fill: var(--value); }
.ja-check { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.join-main { display: grid; place-items: center; padding: 32px 24px; }
.join-box { width: 100%; max-width: 360px; text-align: center; }
.join-box h1 { font-size: 24px; margin: 18px 0 10px; }
.join-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: var(--brand-soft); color: var(--brand); }
.join-icon.bad { color: var(--danger); }
.join-mail { color: var(--value); font-size: 17px; }
.join-form { text-align: left; display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.join-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.join-label label { font-size: 13px; font-weight: 600; color: var(--text); }
.req { color: var(--danger); }
.pw-rule { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.pw-rule .ico { width: 14px; height: 14px; }
.pw-rule.ok { color: var(--value); }
.pw-rule.bad { color: var(--danger); }
#pw-match { color: var(--value); }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 42px; height: 44px; }
.eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; padding: 6px; color: var(--muted); }
.eye .ico { width: 18px; height: 18px; }
.join-submit { justify-content: center; height: 46px; background: #3a7d14; border-color: #3a7d14; color: #fff; font-weight: 600; font-size: 15px; }
.join-submit:hover { background: #326c11; }
@media (max-width: 860px) { .join { grid-template-columns: 1fr; } .join-side { display: none; } }

.guide { margin: 0 0 14px; padding-left: 20px; line-height: 1.55; }
.guide li { margin-bottom: 10px; }
.helplist { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 12px; }
.helplist dt { font-weight: 600; }
.helplist dd { margin: 0; color: var(--muted); }

.support {
  position: fixed; right: 24px; bottom: 24px; z-index: 15; display: inline-flex; align-items: center; gap: 10px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 16px; padding: 14px 24px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(22, 102, 214, .35);
}
.support:hover { background: var(--brand-strong); text-decoration: none; }
button.support { border: 0; height: auto; }
.support-panel { position: fixed; right: 24px; bottom: 24px; z-index: 25; width: 360px; max-width: calc(100vw - 32px); height: min(560px, calc(100vh - 48px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 48px rgba(16,24,40,.25); overflow: hidden; }
.support-panel header { display: flex; align-items: center; justify-content: center; position: relative; padding: 14px; background: var(--brand); color: #fff; font-weight: 700; }
.sp-min { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #fff; padding: 6px; }
.sp-min:hover { background: rgba(255,255,255,.15); }
.sp-min .ico { width: 18px; height: 18px; }
.sp-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sp-bubble { margin: 0; align-self: flex-start; background: var(--surface-2); border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.sp-ok { color: var(--value); display: flex; gap: 6px; align-items: flex-start; }
.sp-ok .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.sp-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sp-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.sp-item:last-child { border-bottom: 0; }
.sp-item:hover { background: var(--surface-2); text-decoration: none; }
.sp-title { display: flex; gap: 8px; align-items: flex-start; color: var(--brand); font-weight: 600; font-size: 13.5px; }
.sp-title .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.sp-text { font-size: 12.5px; color: var(--muted); padding-left: 24px; }
.sp-form { border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sp-form textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; resize: none; }
.sp-foot { display: flex; justify-content: space-between; align-items: center; }
.support .ico { width: 24px; height: 24px; }

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 30;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--danger); color: #fff; }

dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 24px; width: min(600px, calc(100vw - 32px)); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 15, 25, .45); }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
