/* ============================================================
   The3dogs — base tokens, shell, navigation, overlays
   ============================================================ */

:root {
  --bg: #080b09;
  --bg-soft: #0b0f0c;
  --bg-elev: #0e1310;
  --panel: #111714;
  --panel-2: #151c18;
  --panel-3: #1b241f;
  --line: rgba(233,245,237, 0.07);
  --line-2: rgba(233,245,237, 0.12);
  --line-3: rgba(233,245,237, 0.2);
  --text: #eef4ef;
  --text-2: #bcc7bf;
  --muted: #8b978f;
  --faint: #5f6b64;
  --green: #7be3a8;
  --green-strong: #55d18c;
  --green-soft: #a9f3c9;
  --green-wash: rgba(123,227,168, 0.12);
  --amber: #e9ba7c;
  --amber-wash: rgba(233,186,124, 0.12);
  --red: #e58a80;
  --red-wash: rgba(229,138,128, 0.12);
  --blue: #93b6eb;
  --blue-wash: rgba(147,182,235, 0.12);
  --violet: #b9a0e8;
  --violet-wash: rgba(185,160,232, 0.12);
  --teal: #74d6c7;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 24px 70px rgba(0,0,0, 0.38);
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 560px at 82% -8%, rgba(164,164,164, 0.065), transparent 62%),
    radial-gradient(760px 520px at -12% 46%, rgba(135,135,135, 0.04), transparent 60%);
}
body.overlay-open { overflow: hidden; }

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 550; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; }
::selection { background: rgba(189,189,189, 0.28); color: #fff; }
:focus-visible { outline: 2px solid rgba(189,189,189, 0.7); outline-offset: 2px; border-radius: 6px; }

* { scrollbar-width: thin; scrollbar-color: #303030 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #292929; border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #383838; }

/* ---------------------------------------------------------------- shell */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}
.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
#view { flex: 1; min-width: 0; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  background: linear-gradient(180deg, #0d0d0d 0%, #090909 100%);
  border-right: 1px solid var(--line);
  z-index: 80;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 9px 22px;
  min-width: 0;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex: 0 0 auto;
  position: relative;
  background:
    radial-gradient(circle at 30% 25%, rgba(189,189,189, 0.26), transparent 60%),
    #171717;
  border: 1px solid rgba(189,189,189, 0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255, 0.05);
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border: 1.4px solid var(--green);
  opacity: 0.9;
}
.brand-mark::before {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  left: 8px;
  top: 8px;
}
.brand-mark::after {
  width: 15px;
  height: 6px;
  border-color: rgba(189,189,189, 0.55);
  border-radius: 50%;
  left: 6px;
  top: 12px;
  transform: rotate(-28deg);
}
.brand-word {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: #f3f3f3;
}
.brand-word em { font-style: normal; color: var(--green); }
.brand-ws {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 7px;
}
.side-scroll { flex: 1; overflow-y: auto; padding-bottom: 10px; margin: 0 -4px; }
.nav-label {
  font-size: 9.5px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #5d5d5d;
  padding: 17px 12px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 450;
  position: relative;
  transition: background 160ms ease, color 160ms ease;
}
.nav-item .ic { color: #6f6f6f; transition: color 160ms ease; }
.nav-item:hover { background: rgba(255,255,255, 0.03); color: var(--text-2); }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(189,189,189, 0.09), rgba(255,255,255, 0.025));
  color: var(--text);
}
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: var(--green);
  box-shadow: 0 0 12px rgba(189,189,189, 0.4);
}
.nav-item.is-active .ic { color: var(--green); }
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  font-size: 9.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(164,164,164, 0.12);
  color: var(--red);
  border: 1px solid rgba(164,164,164, 0.15);
}
.side-foot { padding-top: 12px; }
.mini-load {
  border: 1px solid var(--line);
  background: rgba(255,255,255, 0.018);
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 10px;
}
.mini-load-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.mini-load-top span { font-size: 9.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--faint); }
.mini-load-top strong { font-size: 11px; font-weight: 500; color: var(--text-2); }
.mini-load-note { margin-top: 8px; font-size: 10.5px; color: var(--faint); }
.user-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  text-align: left;
  transition: background 160ms ease;
}
.user-card:hover { background: rgba(255,255,255, 0.035); }
.user-card-copy { min-width: 0; flex: 1; }
.user-card-name { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-role { font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .ic { color: var(--faint); }

/* --------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(9,9,9, 0.78);
  backdrop-filter: blur(18px) saturate(1.15);
}
.mobile-menu-btn { display: none; }
.topbar-context {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.01em;
  min-width: 0;
}
.topbar-context strong { color: var(--text-2); font-weight: 500; }
.topbar-context .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: #414141; }
.search-trigger {
  margin-left: auto;
  width: min(360px, 34vw);
  height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #747474;
  background: rgba(255,255,255, 0.018);
  font-size: 12px;
  transition: border-color 160ms ease, background 160ms ease;
}
.search-trigger:hover { border-color: var(--line-2); background: rgba(255,255,255, 0.03); }
.search-trigger .ic { flex: 0 0 auto; }
.search-trigger span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger kbd { margin-left: auto; }
.top-actions { display: flex; align-items: center; gap: 7px; }
.week-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}
.week-pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(189,189,189, 0.5); }
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  flex: 0 0 auto;
}
.icon-btn:hover { background: rgba(255,255,255, 0.045); color: var(--text); border-color: var(--line); }
.icon-btn.has-badge { position: relative; }
.icon-btn.has-badge::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px #0a0a0a;
}
.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 7px 0 5px;
  border-radius: 20px;
  border: 1px solid transparent;
  margin-left: 3px;
  transition: background 160ms ease, border-color 160ms ease;
}
.profile-btn:hover { background: rgba(255,255,255, 0.04); border-color: var(--line); }
.profile-btn .ic { color: var(--faint); }
.profile-name { font-size: 11.5px; color: var(--text-2); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------- layout */
.page {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 34px 36px 80px;
  animation: pageRise 360ms cubic-bezier(0.22, 0.8, 0.3, 1) both;
}
@keyframes pageRise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}
.page-head-copy { min-width: 0; }
.eyebrow {
  font-size: 9.5px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.17em;
  color: #737373;
  font-weight: 500;
}
.page-head h1 {
  font-size: clamp(27px, 2.6vw, 37px);
  line-height: 1.12;
  letter-spacing: -0.04em;
  font-weight: 520;
  margin-top: 8px;
  color: #f2f2f2;
}
.page-head h1 .accent { color: var(--green); }
.page-sub {
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 660px;
  line-height: 1.6;
}
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 3px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.tiny { font-size: 10.5px; }
.strong { color: var(--text); font-weight: 550; }
.text-2 { color: var(--text-2); }
.numeric { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow { flex: 1; min-width: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.divider { height: 1px; background: var(--line); border: 0; margin: 18px 0; }
.link-quiet { color: var(--muted); transition: color 150ms ease; }
.link-quiet:hover { color: var(--green); }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: #424242; display: inline-block; vertical-align: middle; margin: 0 6px; }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255, 0.025);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.btn:hover { background: rgba(255,255,255, 0.055); border-color: var(--line-3); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn .ic { color: currentColor; opacity: 0.85; }
.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #0d0d0d;
  font-weight: 600;
}
.btn-primary:hover { background: var(--green-soft); border-color: var(--green-soft); color: #0d0d0d; }
.btn-primary .ic { opacity: 1; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { border-color: var(--line); background: rgba(255,255,255, 0.035); color: var(--text); }
.btn-danger { color: var(--red); border-color: rgba(164,164,164, 0.22); background: rgba(164,164,164, 0.06); }
.btn-danger:hover { background: rgba(164,164,164, 0.12); border-color: rgba(164,164,164, 0.35); color: #bbbbbb; }
.btn-sm { height: 29px; padding: 0 9px; font-size: 10.5px; border-radius: 7px; gap: 5px; }
.btn-sm .ic { width: 13px; height: 13px; }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); font-size: 11px; font-weight: 500;
  transition: color 160ms ease;
}
.btn-link:hover { color: var(--green); }
.btn-link .ic { width: 13px; height: 13px; }

/* --------------------------------------------------------------- fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--faint); font-weight: 500;
}
.field-hint { font-size: 10px; color: var(--faint); line-height: 1.45; }
.input {
  width: 100%;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: #0d0d0d;
  padding: 0 11px;
  color: var(--text);
  font-size: 12.5px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.input::placeholder { color: #606060; }
.input:hover { border-color: var(--line-3); }
.input:focus { outline: none; border-color: rgba(189,189,189, 0.5); box-shadow: 0 0 0 3px rgba(189,189,189, 0.08); background: #0f0f0f; }
.textarea { height: auto; padding: 10px 11px; line-height: 1.55; resize: vertical; min-height: 76px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2385918a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-note {
  font-size: 10.5px; line-height: 1.55; color: var(--faint);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  background: rgba(255,255,255, 0.015);
}
.check-row { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--text-2); }
.check-row input { accent-color: var(--green); width: 14px; height: 14px; }

/* -------------------------------------------------------------- overlay */
#overlay-root { position: relative; z-index: 120; }
.modal-layer, .drawer-layer { position: fixed; inset: 0; z-index: 130; }
.modal-backdrop, .drawer-backdrop {
  position: absolute; inset: 0; background: rgba(6,6,6, 0.66);
  backdrop-filter: blur(7px); animation: fadeIn 180ms ease both;
}
.modal-layer { display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal {
  position: relative;
  width: 100%;
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #151515, #0f0f0f);
  border: 1px solid rgba(241,241,241, 0.1);
  border-radius: 20px;
  box-shadow: 0 40px 120px rgba(0,0,0, 0.6), inset 0 1px 0 rgba(255,255,255, 0.04);
  animation: modalIn 240ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 22px 24px 16px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 19px; line-height: 1.3; margin-top: 6px; font-weight: 520; }
.modal-sub { margin-top: 6px; font-size: 11.5px; color: var(--muted); line-height: 1.55; max-width: 400px; }
.modal-body { padding: 20px 24px 22px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 24px; border-top: 1px solid var(--line); background: rgba(255,255,255, 0.012);
}
.modal-foot .grow { flex: 1; }
.modal-foot .btn { min-width: 82px; }
.drawer-layer { pointer-events: none; }
.drawer-layer .drawer-backdrop { pointer-events: auto; }
.drawer {
  pointer-events: auto;
  position: absolute; top: 0; right: 0; bottom: 0; width: 100%;
  background: linear-gradient(180deg, #121212, #0d0d0d);
  border-left: 1px solid rgba(241,241,241, 0.09);
  box-shadow: -30px 0 100px rgba(0,0,0, 0.45);
  display: flex; flex-direction: column;
  animation: drawerIn 280ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
@keyframes drawerIn {
  from { transform: translateX(28px); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 22px 16px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 20px; line-height: 1.3; margin-top: 6px; font-weight: 520; }
.drawer-body { padding: 20px 22px 26px; overflow-y: auto; flex: 1; }
.drawer-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 13px 22px; border-top: 1px solid var(--line); background: rgba(255,255,255, 0.014);
}
.drawer-foot .grow { flex: 1; }

/* --------------------------------------------------------------- toasts */
#toast-root {
  position: fixed; z-index: 200; left: 50%; bottom: 26px;
  transform: translateX(-50%); display: flex; flex-direction: column;
  align-items: center; gap: 8px; pointer-events: none; width: min(92vw, 420px);
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; border-radius: 10px;
  background: #1a1a1a; border: 1px solid var(--line-2);
  color: var(--text-2); font-size: 12px;
  box-shadow: 0 16px 50px rgba(0,0,0, 0.45);
  animation: toastIn 220ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.toast.leaving { animation: toastOut 280ms ease both; }
.toast-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: 0 0 auto; box-shadow: 0 0 10px rgba(189,189,189, 0.5); }
.toast-error .toast-dot { background: var(--red); box-shadow: 0 0 10px rgba(164,164,164, 0.5); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ----------------------------------------------------------- mobile nav */
.nav-backdrop {
  display: none; position: fixed; inset: 0; z-index: 75;
  background: rgba(4,4,4, 0.6); backdrop-filter: blur(3px);
}
.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  height: 62px; padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
  background: rgba(11,11,11, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: #6f6f6f; font-size: 8.5px; letter-spacing: 0.02em; border-radius: 9px;
}
.bottom-nav a .ic { width: 19px; height: 19px; }
.bottom-nav a.is-active { color: var(--green); background: rgba(189,189,189, 0.05); }

/* ----------------------------------------------------------------- misc */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 19px; padding: 0 5px;
  border: 1px solid var(--line-2); border-bottom-color: rgba(241,241,241, 0.14);
  border-radius: 5px; background: rgba(255,255,255, 0.025);
  font-family: var(--font); font-size: 9px; color: #7d7d7d; line-height: 1;
}
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 42px 24px; gap: 8px;
}
.empty-ic {
  width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: rgba(189,189,189, 0.06); border: 1px solid rgba(189,189,189, 0.12); color: var(--green);
  margin-bottom: 4px;
}
.empty h3 { font-size: 13.5px; font-weight: 520; color: var(--text-2); }
.empty p { font-size: 11.5px; color: var(--faint); max-width: 320px; line-height: 1.6; }
.empty .btn { margin-top: 8px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1240px) {
  .page { padding: 28px 26px 70px; }
  .topbar { padding: 0 26px; }
  .week-pill { display: none; }
}
@media (max-width: 1040px) {
  .app { grid-template-columns: 226px minmax(0, 1fr); }
  .grid-main { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 264px;
    transform: translateX(-102%); transition: transform 260ms cubic-bezier(0.2, 0.8, 0.25, 1);
    box-shadow: 30px 0 100px rgba(0,0,0, 0.45);
    border-right: 1px solid var(--line-2);
  }
  .sidebar.is-open { transform: none; }
  .nav-backdrop.is-open { display: block; }
  .mobile-menu-btn { display: inline-flex; }
  .topbar { padding: 0 18px; height: 61px; gap: 10px; }
  .search-trigger { width: auto; min-width: 38px; height: 34px; padding: 0 9px; margin-left: 4px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger .ic { margin: 0; }
  .profile-name { display: none; }
  .topbar-context { font-size: 10.5px; }
  .page { padding: 24px 20px 74px; }
  .grid-main, .grid-even { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 22px; }
  .page-actions { padding-bottom: 0; }
}
@media (max-width: 700px) {
  .bottom-nav { display: flex; }
  .page { padding: 20px 15px 86px; }
  .topbar { padding: 0 13px; }
  .topbar-context { display: none; }
  .search-trigger { margin-left: auto; }
  .profile-btn { padding: 0; border: 0; }
  .profile-btn > .ic { display: none; }
  .page-head h1 { font-size: 27px; }
  .page-sub { font-size: 12px; }
  .page-head { margin-bottom: 18px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-main { gap: 14px; }
  .stack, .grid-even { gap: 14px; }
  .modal-layer { padding: 0; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 20px 20px 0 0; border-bottom: 0; animation: sheetIn 260ms cubic-bezier(0.2, 0.8, 0.25, 1) both; }
  @keyframes sheetIn { from { transform: translateY(28px); opacity: 0.6; } to { transform: none; opacity: 1; } }
  .modal-head { padding: 18px 18px 14px; }
  .modal-body { padding: 17px 18px 20px; }
  .modal-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; min-width: 110px; }
  .drawer { width: 100%; max-width: 100% !important; }
  .drawer-head { padding: 18px 17px 14px; }
  .drawer-body { padding: 17px 17px 24px; }
  .drawer-foot { padding: 11px 17px calc(11px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  #toast-root { bottom: 76px; }
  .modal-sub { max-width: none; }
}
@media (max-width: 420px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .page-head h1 { font-size: 25px; }
  .topbar { gap: 4px; }
  .profile-btn { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important; scroll-behavior: auto !important;
}
