:root {
  --accent: #ff5a1f;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 11%, #ffffff);
  --accent-line: color-mix(in srgb, var(--accent) 28%, #ffffff);
  --accent-strong: color-mix(in srgb, var(--accent) 82%, #000000);

  --bg: #f6f5f9;
  --surface: #ffffff;
  --surface-2: #faf9fc;
  --ink: #16141f;
  --ink-2: #474357;
  --muted: #858097;
  --line: #e9e6f0;
  --line-2: #f1eff6;

  --side: #121019;
  --side-2: #1b1825;
  --side-ink: #b9b4c9;

  --green: #12a150; --green-soft: #e7f6ee;
  --amber: #b86e00; --amber-soft: #fdf3dd;
  --red: #d9293b; --red-soft: #fdebed;
  --blue: #2f6fea; --blue-soft: #e9f0fe;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(22, 20, 31, 0.05);
  --shadow: 0 1px 2px rgba(22, 20, 31, 0.04), 0 6px 20px -6px rgba(22, 20, 31, 0.08);
  --shadow-lg: 0 24px 60px -12px rgba(22, 20, 31, 0.28);

  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { font-size: 14.5px; line-height: 1.5; min-height: 100vh; }
a { color: var(--accent-strong); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 750; }
h3 { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
img { display: block; }
::selection { background: var(--accent-soft); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* ---------- brand ---------- */
.brand-mark {
  border-radius: 28%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; flex: none;
}
.brand-logo { width: auto; max-width: 170px; object-fit: contain; flex: none; }
/* A logo usually already contains the company name, so hide the repeated text next to it. */
.brand:has(.brand-logo) > div, .auth-mobile-brand:has(.brand-logo) > b, .topbar:has(.brand-logo) > span { display: none; }
.auth-brand:has(.brand-logo) b { display: none; }
.sidebar .brand:has(.brand-logo) { padding-bottom: 18px; }
.sidebar .brand-logo { max-width: 196px; }
.sidebar .brand-logo, .auth-art .brand-logo, .topbar .brand-logo, .checkin-logo .brand-logo {
  background: #fff; padding: 5px 8px; border-radius: 10px; box-sizing: content-box;
}

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--side); color: var(--side-ink); padding: 22px 14px 16px;
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; color: #fff; min-width: 0; }
.brand b { display: block; font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: #7d7891; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: #6a6580; padding: 16px 12px 6px; font-weight: 700; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--side-ink); font-weight: 600; font-size: 14px; transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--side-2); color: #fff; }
.nav-link.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-link.active svg { color: var(--accent); }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-count { margin-left: auto; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.side-foot { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--side-2); display: flex; align-items: center; gap: 10px; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: 12px; color: #7d7891; }
.icon-btn { background: none; border: 0; color: var(--side-ink); padding: 8px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--side-2); color: #fff; }
.icon-btn svg { width: 18px; height: 18px; }

.main { padding: 32px 36px 64px; min-width: 0; max-width: 1280px; }
.main.enter { animation: enter 0.25s ease-out; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; }
.topbar { display: none; }
.loading { display: flex; gap: 6px; padding: 40px 0; justify-content: center; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 0.9s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: 0.15s; } .loading span:nth-child(3) { animation-delay: 0.3s; }

/* ---------- cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card, .grid + .card { margin-top: 18px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 350px; align-items: start; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.settings-grid > .card + .card { margin-top: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -0.03em; line-height: 1.1; }
.stat .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot.green { background: var(--green); } .dot.amber { background: var(--amber); } .dot.red { background: var(--red); }
.dot.blue { background: var(--blue); } .dot.accent { background: var(--accent); }

.hero {
  background:
    radial-gradient(600px 220px at 100% 0%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%),
    linear-gradient(120deg, #17141f 0%, #241f33 100%);
  color: #fff; border-radius: 20px; padding: 26px 28px; display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 18px; box-shadow: var(--shadow);
}
.hero h1 { color: #fff; }
.hero p { color: #c9c4da; margin-top: 4px; }
.hero .avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15); }
.hero .btn.ghost { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.16); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------- forms ---------- */
.form { display: grid; gap: 15px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field > span em { color: var(--accent); font-style: normal; }
.field small { color: var(--muted); font-size: 12px; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%; min-width: 0; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: #dcd8e5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly], input:disabled, select:disabled { background: var(--surface-2); color: var(--ink-2); }
input[type='color'] { padding: 3px; width: 48px; height: 42px; cursor: pointer; flex: none; }
textarea { resize: vertical; min-height: 84px; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 750; border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 18px; }
.section-title:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.color-row { display: flex; gap: 8px; }
.logo-pick { display: grid; gap: 10px; justify-items: start; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.logo-preview { min-height: 64px; display: flex; align-items: center; }

.btn {
  font: inherit; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  background: var(--accent); color: var(--accent-ink); transition: filter 0.15s, background 0.15s, transform 0.05s;
  box-shadow: 0 1px 2px rgba(22, 20, 31, 0.08);
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.green { background: var(--green); color: #fff; } .btn.red { background: var(--red); color: #fff; }
.btn.subtle-red { background: var(--surface); color: var(--red); border-color: var(--line); }
.btn.subtle-red:hover { background: var(--red-soft); filter: none; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- sign-in pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  background:
    radial-gradient(700px 400px at 0% 0%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 70%),
    radial-gradient(500px 400px at 100% 100%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--side);
}
.auth-art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px); background-size: 22px 22px;
}
.auth-art > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand b { display: block; font-size: 17px; font-weight: 800; }
.auth-brand small { display: block; color: #9c97ae; font-size: 12px; }
.auth-hero h2 { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; line-height: 1.12; letter-spacing: -0.03em; max-width: 520px; color: #fff; }
.auth-foot { color: #6f6a82; font-size: 12.5px; }

.goals { margin-top: 32px; max-width: 520px; }
.goals-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 750; color: var(--accent); margin-bottom: 12px; }
.goals-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.goals-list li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); color: #e4e0ee; font-weight: 550; line-height: 1.45; }
.goal-num { font-weight: 800; font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; padding-top: 1px; flex: none; }
/* On the dark panel, lighten the brand colour so dark logos' colours stay readable. */
.auth-art .goals-label, .auth-art .goal-num { color: color-mix(in srgb, var(--accent) 55%, #ffffff); }
.goals-list.compact { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.goals-list.compact li, .auth-mobile-goals .goals-list li, .join-goals .goals-list li { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.goals-card { border-top: 3px solid var(--accent); }

.auth-form { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 28px; gap: 28px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { margin-bottom: 8px; font-size: 28px; }
.auth-box > p { color: var(--muted); margin-bottom: 26px; }
.auth-box .btn.block { padding: 12px 16px; font-size: 15px; margin-top: 4px; }
.auth-mobile-brand, .auth-mobile-goals { display: none; }

.join { max-width: 780px; margin: 0 auto; padding: 40px 20px 80px; }
.join-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.join-head p { margin-top: 4px; }
.join-goals { margin-bottom: 18px; border-top: 3px solid var(--accent); }
.join-goals h3 { margin-bottom: 4px; }
.join-goals .goals { margin-top: 12px; max-width: none; }

/* ---------- avatar & photo ---------- */
.avatar { border-radius: 50%; object-fit: cover; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-weight: 800; flex: none; overflow: hidden; }
.photo-pick { display: flex; align-items: center; gap: 16px; }
.photo-pick .avatar { width: 84px; height: 84px; font-size: 28px; }

/* ---------- lists & tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 750; padding: 10px 22px; background: var(--surface-2); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 22px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person .avatar { width: 36px; height: 36px; font-size: 14px; }
.person b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person span { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.person:hover { text-decoration: none; }
a.person:hover b { color: var(--accent-strong); }
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 32px 10px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.accent { background: var(--accent-soft); color: var(--accent-strong); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type='search'] { max-width: 300px; }
.toolbar select, .toolbar input[type='date'], .toolbar input[type='month'] { width: auto; }
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 650; font-size: 13px; border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.tabs button:hover { background: var(--surface-2); }
.tabs button.active { background: var(--ink); color: #fff; }

/* ---------- team grid ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.member-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px 20px; text-align: center;
  box-shadow: var(--shadow); color: inherit; display: block; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; font-weight: 400;
}
.member-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 14px 30px -10px rgba(22, 20, 31, 0.18); border-color: var(--accent-line); }
.member-card .avatar { width: 76px; height: 76px; font-size: 26px; margin: 0 auto 14px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.member-card b { display: block; font-size: 15.5px; }
.member-card .muted { font-size: 13px; }
.member-card .pill { margin-top: 14px; }
.member-card.inactive { opacity: 0.55; }

/* ---------- profile header ---------- */
.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-head .avatar { width: 92px; height: 92px; font-size: 32px; }
.profile-head .grow { flex: 1; min-width: 200px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- office QR poster ---------- */
.poster { text-align: center; padding: 36px 24px; }
.poster-brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.poster-brand b { font-size: 22px; font-weight: 800; }
.poster-title { font-size: 28px; font-weight: 800; margin-top: 20px; letter-spacing: -0.03em; }
.poster img:not(.brand-logo) { width: 100%; max-width: 340px; margin: 20px auto; border-radius: 14px; image-rendering: pixelated; border: 6px solid var(--accent); }
.poster-steps { text-align: left; max-width: 380px; margin: 0 auto; padding-left: 22px; color: var(--ink-2); display: grid; gap: 7px; }

/* ---------- phone check-in screen ---------- */
.checkin {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px 16px;
  background: radial-gradient(600px 400px at 50% 0%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%), var(--side);
}
.checkin-logo { display: flex; justify-content: center; }
.checkin-card { background: var(--surface); border-radius: 24px; padding: 30px 24px; width: 100%; max-width: 400px; text-align: center; box-shadow: var(--shadow-lg); animation: enter 0.3s ease-out; }
.checkin-card h1 { font-size: 26px; margin-bottom: 6px; }
.checkin-clock { font-size: 46px; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0 2px; }
.checkin-btn { width: 100%; font-size: 20px; padding: 18px; border-radius: 16px; margin-top: 22px; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.checkin-btn.dark { box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.45); }
.checkin-icon { width: 84px; height: 84px; border-radius: 50%; margin: 4px auto 16px; display: grid; place-items: center; font-size: 42px; font-weight: 800; background: var(--green-soft); color: var(--green); animation: pop 0.35s ease-out; }
.checkin-icon.warn { background: var(--amber-soft); color: var(--amber); }
.checkin-icon.err { background: var(--red-soft); color: var(--red); }

/* ---------- checkbox row ---------- */
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.check span { display: grid; gap: 3px; }
.check small { color: var(--muted); font-size: 12.5px; }

/* ---------- modal & toast ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(18, 16, 25, 0.55); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade 0.15s; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px; box-shadow: var(--shadow-lg); animation: enter 0.2s ease-out; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head button { background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; border-radius: 8px; padding: 2px 8px; }
.modal-head button:hover { background: var(--surface-2); }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-lg); animation: rise 0.2s; max-width: 360px; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

.copy-box { display: flex; gap: 8px; }
.copy-box input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.callout { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 12px; padding: 14px 16px; }
.callout.blue { background: var(--blue-soft); border-color: #cbdcfb; }
.error-text { color: var(--red); font-weight: 600; font-size: 13px; }

.card-head > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }

/* ---------- security ---------- */
.sec-row { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.sec-row:first-of-type { border-top: 0; padding-top: 0; }
.sec-row .grow { flex: 1; min-width: 200px; }
.sec-row p { margin-top: 2px; }
.steps { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.totp-qr { width: 200px; height: 200px; margin: 12px auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; }
code.key, .recovery-grid code { font-family: ui-monospace, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; letter-spacing: 0.04em; }
code.key { display: inline-block; margin-top: 6px; font-size: 13px; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
.recovery-grid code { text-align: center; padding: 8px; font-size: 14px; }
.code-input { font-size: 22px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.card.attention { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft), var(--shadow); margin-bottom: 18px; }
.card.attention h3 { display: flex; align-items: center; gap: 8px; }
.card.attention h3 svg { width: 18px; height: 18px; color: var(--amber); }
.attention-callout { background: var(--amber-soft); border-color: #f3d79c; }
tr.risky td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.notice-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 800; margin-bottom: 16px; }
.notice-icon.warn { background: var(--amber-soft); color: var(--amber); }
.notice-icon.err { background: var(--red-soft); color: var(--red); }

/* ---------- notifications ---------- */
.inbox { display: grid; gap: 10px; }
.note {
  position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: background 0.15s, border-color 0.15s;
}
.note.unread { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); border-color: var(--accent-line); cursor: pointer; }
.note.important { border-left: 4px solid var(--red); }
.note h3 { margin-top: 4px; }
.note-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.note-body { white-space: pre-line; color: var(--ink-2); margin-top: 6px; overflow-wrap: anywhere; }
.note-side { flex: none; }
.note-sys, .announce-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.note-sys svg, .announce-icon svg { width: 19px; height: 19px; }
.unread-dot { position: absolute; top: 20px; right: 20px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.note .grow { flex: 1; min-width: 0; padding-right: 18px; }
.announce-banner {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--accent-line); border-left: 4px solid var(--accent); box-shadow: var(--shadow); animation: enter 0.3s ease-out;
}
.announce-banner .grow { flex: 1; min-width: 200px; }
.announce-banner p { color: var(--ink-2); white-space: pre-line; margin-top: 2px; }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--muted); }
.empty-icon svg { width: 24px; height: 24px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; background: var(--surface); }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.seg label:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.seg input { accent-color: var(--accent); margin: 0; }
.pick { border: 1px solid var(--line); border-radius: 12px; padding: 8px; max-height: 260px; overflow-y: auto; background: var(--surface-2); }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.pick-row:hover { background: var(--surface); }
.pick-row input { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.pick-row .avatar { width: 28px !important; height: 28px !important; }
.pick-row[hidden] { display: none; }
.read-bar { height: 6px; border-radius: 99px; background: var(--line-2); margin: 10px 0 4px; overflow: hidden; max-width: 260px; }
.read-bar span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.sent-body { white-space: pre-line; margin-top: 4px; }
.sent-item .btn-row { flex-wrap: nowrap; }
.topbar .bell { margin-left: auto; position: relative; color: #fff; }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.bell-count[hidden] { display: none; }
@media (max-width: 560px) {
  .note { padding: 14px; gap: 10px; }
  .sent-item { flex-wrap: wrap; }
}

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-side, .settings-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-art { padding: 40px 36px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 276px; z-index: 40; transform: translateX(-100%); transition: transform 0.22s ease; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 30; font-weight: 800; }
  .topbar .icon-btn { color: #fff; }
  .topbar .brand-logo { max-width: 120px; padding: 3px 6px; }
  .main { padding: 22px 16px 60px; }
  h1 { font-size: 23px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  /* Sign-in on phones: brand on top, form, then goals underneath. */
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form { justify-content: flex-start; padding: 32px 20px 40px; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-size: 17px; font-weight: 800; }
  .auth-mobile-goals { display: block; width: 100%; max-width: 400px; padding-top: 24px; border-top: 1px solid var(--line); }
  .auth-mobile-tagline { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
  .auth-mobile-goals .goals { margin-top: 16px; }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .table-wrap { margin: 0 -16px -16px; }
  .card { padding: 16px; }
  .hero { padding: 22px 20px; }
  td, th { padding: 11px 14px; }
  .toolbar input[type='search'] { max-width: none; }
  .stat .value { font-size: 26px; }
}

@media print {
  .sidebar, .topbar, .no-print, #toasts { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .grid-side { display: block; }
  .poster { padding: 40px 0; }
  .poster-title { font-size: 42px; }
  .poster img:not(.brand-logo) { max-width: 520px; }
  .poster-steps { font-size: 18px; max-width: 520px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
