/* ═══════════════════════════════════════════════════════════
   Annotator — design system
   ═══════════════════════════════════════════════════════════ */

:root {
  --accent: #5b8cff;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 40%, transparent);
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 56px;
  --rail-w: 54px;
  --side-w: 330px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .28);
  --font: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

[data-accent="blue"]   { --accent: #5b8cff; }
[data-accent="pink"]   { --accent: #ff3b6b; }
[data-accent="green"]  { --accent: #22c55e; }
[data-accent="orange"] { --accent: #f97316; }
[data-accent="purple"] { --accent: #a855f7; }

[data-theme="dark"] {
  --bg: #0e1016;
  --bg-2: #141821;
  --panel: #161a23;
  --panel-2: #1c2130;
  --border: #262c3a;
  --border-soft: #1f2431;
  --text: #e8ecf4;
  --text-dim: #98a2b8;
  --text-faint: #6b7488;
  --canvas-bg: #0a0c11;
  --canvas-grid: rgba(255, 255, 255, .035);
  --input-bg: #10141c;
  --danger: #ff4d5e;
  --ok: #22c55e;
  --warn: #f5a524;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #eef1f7;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f5f7fb;
  --border: #dfe4ee;
  --border-soft: #e9edf5;
  --text: #131722;
  --text-dim: #5a6379;
  --text-faint: #8a93a8;
  --canvas-bg: #e6eaf2;
  --canvas-grid: rgba(0, 0, 0, .045);
  --input-bg: #f5f7fb;
  --danger: #e02437;
  --ok: #16a34a;
  --warn: #d97706;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); font-size: 11.5px; direction: ltr; text-align: left; }
.mobile-only { display: none !important; }

/* ─────────────────── buttons ─────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px var(--accent-soft); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: var(--panel-2); border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 15px;
  transition: background .15s, color .15s;
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.icon-btn:disabled:hover { background: none; color: var(--text-dim); }
/* the prev/next chevrons point the way the list reads: RTL flows right→left,
   so "previous" is the right arrow. LTR gets the mirrored pair. */
html[dir="ltr"] .nav-step svg { transform: scaleX(-1); }

/* ─── active-class picker in the topbar (phones only) ───
   On a phone the class list lives in the side drawer, which is closed while you
   annotate — so the active class gets its own chip next to prev/next. */
.class-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; max-width: 116px; padding: 0 8px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text);
  font-size: 12px; flex: 0 0 auto;
  transition: border-color .15s;
}
.class-chip:hover { border-color: var(--accent); }
.class-chip-dot {
  width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25) inset;
}
.class-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-chip-caret { display: inline-flex; color: var(--text-faint); flex: 0 0 auto; }
.class-chip-caret svg { width: 13px; height: 13px; }
/* `.mobile-only` hides with !important, so the empty state needs an id-level rule */
#topClass[hidden] { display: none !important; }
.icon-btn.danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.ghost-icon {
  width: 32px; height: 32px; border-radius: 50%;
  color: var(--text-dim); font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.ghost-icon:hover { background: var(--panel-2); color: var(--text); }
.link-btn { color: var(--accent); font-size: 13px; padding: 4px 0; }
.link-btn:hover { text-decoration: underline; }

/* ─────────────────── icons (SVG, sized per context) ─────────────────── */
.icon-btn svg, .ghost-icon svg, .btn svg, .link-btn svg,
.brand-logo svg, .drop-icon svg, .empty-icon svg,
.project-icon svg, .search-icon svg, .rail-sep svg { display: block; }
.icon-btn svg { width: 18px; height: 18px; }
.ghost-icon svg { width: 17px; height: 17px; }
.btn svg { width: 16px; height: 16px; }
.link-btn svg { width: 15px; height: 15px; }
.brand-logo svg { width: 19px; height: 19px; color: var(--accent); }
.drop-icon svg { width: 22px; height: 22px; margin: 0 auto; }
.empty-icon svg { width: 46px; height: 46px; margin: 0 auto; }
.project-icon svg { width: 19px; height: 19px; }
.search-icon svg { width: 15px; height: 15px; }

/* search field with a leading icon */
.search-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.search-icon {
  position: absolute; inset-inline-start: 9px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none; display: flex;
}

/* label chips (create-project dialog) */
.label-add { display: flex; gap: 6px; align-items: center; }
.label-add .btn { padding: 7px 11px; flex: 0 0 auto; }
.label-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.label-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--border-soft);
  border-radius: 999px; padding-block: 3px; padding-inline: 10px 4px;
  font-size: 12px; max-width: 100%;
}
.label-chip .swatch { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.label-chip .label-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-chip button { display: inline-flex; align-items: center; color: var(--text-faint); }
.label-chip button svg { width: 13px; height: 13px; }
.label-chip button:hover { color: var(--danger); }

/* ─────────────────── inputs ─────────────────── */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.mini-input { padding: 7px 10px; font-size: 12.5px; }
/* The magnifier sits inside the field, so the text has to start after it.
   This selector has to beat the `input[type=…]` padding rule above (same
   specificity, later in the file wins there) — otherwise the icon lands on
   top of the placeholder text. */
.list-toolbar .search-wrap input { padding-inline-start: 32px; }
.password-wrap { position: relative; }
.password-wrap .ghost-icon { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); }
.color-input {
  width: 40px; height: 34px; padding: 2px;
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; flex: 0 0 auto;
}

/* ═══════════════════ AUTH SCREEN ═══════════════════ */
.auth-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: radial-gradient(1100px 620px at 70% -10%, var(--accent-soft), transparent 60%), var(--bg);
}
.auth-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 400px at 15% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 26px 20px;
  box-shadow: var(--shadow);
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo { font-size: 40px; display: block; line-height: 1; }
.auth-brand h1 { font-size: 23px; margin-top: 8px; letter-spacing: .3px; }
.auth-brand p { color: var(--text-dim); font-size: 12.5px; margin: 4px 0 0; }

.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--panel-2); border-radius: var(--radius-sm); margin-bottom: 18px;
}
.tab {
  flex: 1; padding: 8px; border-radius: 6px; color: var(--text-dim);
  font-weight: 500; font-size: 13.5px; transition: background .18s, color .18s;
}
.tab.is-active { background: var(--accent); color: #fff; box-shadow: 0 2px 10px var(--accent-soft); }

.auth-error {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger);
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 12.5px; margin: 0 0 12px;
}
.auth-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.auth-tools { display: flex; gap: 2px; }
.auth-screen.mode-register .only-register { display: block; }
.auth-screen:not(.mode-register) .only-register { display: none; }

/* ═══════════════════ APP LAYOUT ═══════════════════ */
.app {
  display: grid;
  /* column widths must line up with the area names below: in RTL the first
     column is the visual RIGHT (side panel) and the last is the visual LEFT
     (tool rail) — the reverse of LTR. */
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--rail-w);
  grid-template-rows: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)) minmax(0, 1fr);
  grid-template-areas: "top top top" "side stage rail";
  height: 100dvh;
  overflow: hidden;
}
[dir="ltr"] .app {
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--side-w);
  grid-template-areas: "top top top" "rail stage side";
}

.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 8px;
  padding: env(safe-area-inset-top, 0px) 12px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 7px; font-weight: 700; letter-spacing: .2px; }
.brand-logo { font-size: 18px; }
.brand-name { font-size: 15px; }

.toolbar {
  display: flex; align-items: center; gap: 3px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 3px;
  margin-inline-start: 6px;
}
.tool {
  width: 34px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; color: var(--text-dim);
  transition: background .15s, color .15s;
}
.tool svg { width: 19px; height: 19px; display: block; }
.tool:hover { background: var(--panel); color: var(--text); }
.tool.is-active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px var(--accent-soft); }
.tool:disabled { opacity: .35; cursor: not-allowed; }
.tool:disabled:hover { background: none; color: var(--text-dim); }
.tool-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; flex: 0 0 auto; }

.topbar-actions { display: flex; align-items: center; gap: 3px; margin-inline-start: auto; }
.user-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 3px 10px 3px 4px;
  background: var(--panel-2); border-radius: 999px;
  margin-inline-start: 6px;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.user-name { font-size: 12.5px; color: var(--text-dim); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─────────────────── panels ─────────────────── */
.panel {
  background: var(--panel);
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
/* ─────────────────── side panel (images + classes + labels) ─────────────────── */
.panel-side {
  grid-area: side;
  border-left: 1px solid var(--border);
  /* the column itself only scrolls on very short windows; normally each list
     below is its own scroll box */
  overflow-y: auto;
}
/* Images, classes and labels each get a bounded scroll area showing about five
   rows. `0 0 auto` (no grow / no shrink) is deliberate: a list is as tall as its
   content up to the cap, and never collapses when the window is short — the
   column itself takes over scrolling in that case. */
.panel-side .list,
.panel-side .class-list,
.panel-side .shape-list {
  flex: 0 0 auto;
  overflow-y: auto;
}
.panel-side .list { max-height: 348px; }        /* 5 × 68px card + padding */
.panel-side .class-list { max-height: 192px; }  /* 5 × 38px row */
.panel-side .shape-list { max-height: 182px; }  /* 5 × 36px row */
.panel-side .section,
.panel-side .section.grow { flex: 0 0 auto; }

/* ─────────────────── tool rail (left, Photoshop-style) ─────────────────── */
.toolrail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.toolrail .tool {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
.toolrail .tool svg { width: 21px; height: 21px; }
.toolrail .tool.is-active { box-shadow: 0 3px 12px var(--accent-soft); }
.rail-sep {
  width: 24px;
  height: 1px;
  background: var(--border);
  margin: 7px 0;
  flex: 0 0 auto;
}

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 8px;
  flex: 0 0 auto;
}
.panel-head h2 { font-size: 13.5px; color: var(--text-dim); font-weight: 600; letter-spacing: .2px; }
.panel-foot { padding: 10px 14px; border-top: 1px solid var(--border-soft); flex: 0 0 auto; }

/* ─────────────────── drop zone ─────────────────── */
.drop-zone {
  margin: 0 12px 10px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  flex: 0 0 auto;
}
.drop-zone:hover, .drop-zone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { font-size: 20px; display: block; color: var(--accent); }
.drop-zone p { margin: 6px 0 2px; font-size: 12.5px; color: var(--text-dim); }
.drop-zone small { font-size: 11px; color: var(--text-faint); }

.list-toolbar { display: flex; gap: 6px; align-items: center; padding: 0 12px 8px; flex: 0 0 auto; }
.count-pill {
  background: var(--panel-2); border: 1px solid var(--border-soft);
  color: var(--text-faint); font-size: 11px;
  padding: 3px 8px; border-radius: 999px; flex: 0 0 auto;
}

.list, .shape-list, .class-list { overflow-y: auto; min-height: 0; padding: 0 8px 8px; }
.list { flex: 1 1 auto; }
.shape-list { flex: 1 1 auto; }

/* image cards */
.img-card {
  display: flex; gap: 10px; align-items: center;
  padding: 7px; border-radius: 10px;
  cursor: pointer; border: 1px solid transparent;
  transition: background .15s, border-color .15s;
  /* keeps a 1000-image list scrollable instead of freezing the tab */
  content-visibility: auto;
  contain-intrinsic-size: auto 66px;
}
.img-card:hover { background: var(--panel-2); }
.img-card.is-active { background: var(--accent-soft); border-color: var(--accent-ring); }
.img-card img {
  display: block;                 /* no inline baseline gap — keeps the row 68px */
  width: 52px; height: 52px; object-fit: cover;
  border-radius: 7px; background: var(--canvas-bg); flex: 0 0 auto;
}
.img-thumb { position: relative; display: block; flex: 0 0 auto; }
/* "this image already has labels" tag, pinned to the thumbnail */
.img-tag {
  position: absolute; inset-block-end: -3px; inset-inline-start: -3px;
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  box-shadow: 0 0 0 2px var(--panel);
  pointer-events: none;
}
.img-tag svg { width: 10px; height: 10px; stroke-width: 3.4; }
.img-meta { min-width: 0; flex: 1; }
.img-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-sub { font-size: 11px; color: var(--text-faint); display: flex; gap: 6px; }
.badge {
  background: var(--panel-2); border-radius: 999px; padding: 1px 7px;
  font-size: 10.5px; color: var(--text-dim);
}
.badge.has { background: var(--accent-soft); color: var(--accent); }
.badge.is-empty { background: transparent; color: var(--text-faint); border: 1px solid var(--border-soft); }

/* ─────────────────── stage ─────────────────── */
.stage {
  grid-area: stage;
  position: relative;
  background: var(--canvas-bg);
  overflow: hidden;
  min-width: 0;
}
#canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#canvas.tool-pan { cursor: grab; }
#canvas.is-panning { cursor: grabbing; }
#canvas.tool-select { cursor: default; }

.empty-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 24px; pointer-events: none; color: var(--text-dim);
}
.empty-icon { font-size: 46px; opacity: .55; }

.zoom-bar {
  position: absolute; bottom: 14px; inset-inline-start: 14px;
  display: flex; align-items: center; gap: 2px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 3px;
  box-shadow: var(--shadow);
}
.zoom-value {
  min-width: 54px; padding: 6px 4px; border-radius: 6px;
  font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.zoom-value:hover { background: var(--panel-2); color: var(--text); }

.float-actions {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 15;
  padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: floatIn .18s ease-out;
}
@keyframes floatIn { from { opacity: 0; transform: translateX(-50%) translateY(-6px); } }

.suggestion-bar {
  position: absolute; top: 14px; inset-inline-end: 14px;
  display: flex; align-items: center; gap: 8px; z-index: 16; flex-wrap: wrap;
  padding: 6px 10px; border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: fadeIn .18s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }

.busy {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: color-mix(in srgb, var(--canvas-bg) 78%, transparent);
  backdrop-filter: blur(3px);
  z-index: 20; font-size: 13px; color: var(--text-dim);
  /* While visible this overlay sits on top of the canvas and swallows pointer
     events — that is intentional (you should not draw mid-request), but it
     means any synthetic input must wait for `state.busy` to clear. */
}
body.is-busy { cursor: progress; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────── right panel sections ─────────────────── */
.section { padding: 10px 14px 12px; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; min-height: 0; }
.section.grow { flex: 1 1 auto; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.section-head h3 { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.section-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.section-actions .btn { width: 100%; justify-content: center; }

.class-list { max-height: 190px; padding: 0 0 4px; }
.class-row {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.class-row:hover { background: var(--panel-2); }
.class-row.is-active { background: var(--accent-soft); border-color: var(--accent-ring); }
.class-swatch { width: 15px; height: 15px; border-radius: 4px; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset; }
input.class-swatch {
  padding: 0; border: none; background: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px; border-radius: 5px;
  box-shadow: 0 0 0 1px var(--border) inset;
}
input.class-swatch::-webkit-color-swatch-wrapper { padding: 0; }
input.class-swatch::-webkit-color-swatch { border: none; border-radius: 5px; }
input.class-swatch::-moz-color-swatch { border: none; border-radius: 5px; }
.class-name { flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-count { font-size: 10.5px; color: var(--text-faint); }
.class-actions { display: flex; gap: 1px; opacity: 0; transition: opacity .15s; }
.class-row:hover .class-actions { opacity: 1; }
.class-actions .icon-btn { width: 24px; height: 24px; font-size: 12px; }
.class-add { display: flex; gap: 6px; margin-top: 8px; align-items: center; }

.shape-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 7px; cursor: pointer;
  border: 1px solid transparent; font-size: 12px;
}
.shape-row:hover { background: var(--panel-2); }
.shape-row.is-active { background: var(--accent-soft); border-color: var(--accent-ring); }
.shape-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shape-row .icon-btn { width: 24px; height: 24px; font-size: 12px; }

/* ─────────────────── scrim ─────────────────── */
.scrim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 40;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

/* ─────────────────── scrollbars ───────────────────
   Always visible (not overlay-only) so a long image / label list is obviously
   scrollable instead of looking frozen. */
* { scrollbar-width: thin; scrollbar-color: var(--text-faint) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: color-mix(in srgb, var(--border) 45%, transparent); border-radius: 99px; }
::-webkit-scrollbar-thumb {
  background: var(--text-faint);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
  min-height: 36px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }
.panel-side, .list, .shape-list, .class-list, .modal-body, .toolrail, .auth-screen {
  scrollbar-gutter: stable;
}

/* ═══════════════════ HOME / PROJECTS ═══════════════════ */
.home {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: radial-gradient(1100px 620px at 80% -10%, var(--accent-soft), transparent 60%), var(--bg);
}
.home-topbar {
  display: flex; align-items: center; gap: 8px;
  min-height: var(--topbar-h); padding: env(safe-area-inset-top, 0px) 16px 0; flex: 0 0 auto;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.home-actions { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.home-main { flex: 1 1 auto; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 22px 48px; }
.home-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.home-hero-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.home-hero-text h1 { font-size: 24px; }
.home-hero-text p { color: var(--text-dim); font-size: 13px; margin: 6px 0 0; max-width: 540px; }
.home-hero .plus { font-size: 15px; }
.home-foot { margin-top: 28px; text-align: center; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.project-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer;
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.project-card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.project-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 18px;
  background: var(--accent-soft); color: var(--accent);
}
.project-title { min-width: 0; }
.project-title h3 { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-date { font-size: 11px; color: var(--text-faint); }
.project-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.project-stat {
  font-size: 11px; color: var(--text-dim);
  background: var(--panel-2); border: 1px solid var(--border-soft);
  padding: 3px 9px; border-radius: 999px;
}
.project-model {
  font-size: 11px; color: var(--text-faint); font-family: var(--mono);
  direction: ltr; text-align: start;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-card .card-actions {
  position: absolute; top: 8px; inset-inline-end: 8px;
  display: flex; gap: 2px;
  opacity: 0; transition: opacity .15s;
}
.project-card:hover .card-actions,
.project-card:focus-within .card-actions { opacity: 1; }
.project-card.is-new {
  display: grid; place-items: center; text-align: center;
  border-style: dashed; color: var(--text-dim); min-height: 152px; font-size: 13px;
}
.project-card.is-new:hover { color: var(--accent); }
.project-card.is-new .plus { font-size: 26px; display: block; margin-bottom: 6px; }

/* ═══════════════════ MODAL ═══════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center; padding: 20px; overflow-y: auto;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px);
}
.modal-card {
  width: 100%; max-width: 520px; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow);
  animation: floatIn .18s ease-out;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 4px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px 18px; }
.field-hint { display: block; font-size: 11px; color: var(--text-faint); margin-top: 6px; }
.sam-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.proj-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-pill {
  font-size: 11px; color: var(--text-dim);
  background: var(--panel-2); border: 1px solid var(--border-soft);
  border-radius: 999px; padding: 3px 9px;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* project chip shown in the workspace topbar */
.project-chip {
  display: inline-flex; align-items: center; gap: 6px;
  margin-inline-start: 8px; padding: 3px 12px; max-width: 240px;
  background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 999px;
}
.project-chip-name { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════════════ POPOVERS (settings / account) ═══════════════════ */
.popover {
  position: fixed; z-index: 150;
  top: calc(env(safe-area-inset-top, 0px) + 60px);
  inset-inline-end: 12px;
  width: 236px; max-width: calc(100vw - 24px);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px;
  box-shadow: var(--shadow); font-size: 12.5px;
  animation: popIn .16s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } }
.pop-title { font-size: 11.5px; color: var(--text-dim); margin: 6px 4px; }
.pop-title:first-child { margin-top: 2px; }
.popover .tabs { margin-bottom: 6px; }
.accent-row { display: flex; gap: 8px; margin: 0 4px 10px; }
.accent-row button {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid transparent; transition: transform .12s;
}
.accent-row button:hover { transform: scale(1.1); }

.pop-user { display: flex; align-items: center; gap: 10px; padding: 6px 6px 8px; }
.pop-user .avatar { width: 34px; height: 34px; font-size: 14px; flex: 0 0 auto; }
.pop-user-text { min-width: 0; display: flex; flex-direction: column; }
.pop-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-email { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-divider { height: 1px; background: var(--border-soft); margin: 6px 4px; }
.pop-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border-radius: 8px; color: var(--text-dim);
  font-size: 13px; text-align: start;
  transition: background .15s, color .15s;
}
.pop-item:hover { background: var(--panel-2); color: var(--text); }
.pop-item.is-danger:hover { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.pop-item svg { width: 17px; height: 17px; flex: 0 0 auto; }

/* class list inside the phone header picker */
.class-pick { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto; }
.class-pick-row {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border-radius: 8px; color: var(--text-dim);
  font-size: 13px; text-align: start;
  transition: background .15s, color .15s;
}
.class-pick-row:hover { background: var(--panel-2); color: var(--text); }
.class-pick-row.is-active { background: var(--accent-soft); color: var(--text); }
.class-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.class-pick-check { display: inline-flex; color: var(--accent); opacity: 0; flex: 0 0 auto; }
.class-pick-check svg { width: 15px; height: 15px; }
.class-pick-row.is-active .class-pick-check { opacity: 1; }

/* ═══════════════════ ADMIN PANEL ═══════════════════ */
.admin { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.admin-main { flex: 1 1 auto; width: 100%; max-width: 1080px; margin: 0 auto; padding: 20px 18px 48px; }
.admin-tabs { max-width: 360px; }
.admin-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.admin-form {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto auto; gap: 8px;
  align-items: center; margin-bottom: 14px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
}
.admin-form .auth-error { grid-column: 1 / -1; margin: 0; }
.admin-list { display: flex; flex-direction: column; gap: 6px; }
.admin-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.admin-row .avatar { flex: 0 0 auto; }
.admin-row .project-icon { width: 34px; height: 34px; font-size: 16px; }
.admin-row-text { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.admin-row-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row-sub { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row .pill {
  font-size: 11px; color: var(--text-dim); background: var(--panel-2);
  border: 1px solid var(--border-soft); border-radius: 999px; padding: 3px 9px; flex: 0 0 auto;
}
.admin-row-actions { display: flex; gap: 2px; flex: 0 0 auto; }
.admin-row-actions .icon-btn { width: 30px; height: 30px; }
.admin-row-actions .icon-btn svg { width: 16px; height: 16px; }

/* indeterminate progress bar inside the busy overlay */
.progress {
  width: 168px; height: 4px; border-radius: 99px;
  background: var(--border); overflow: hidden;
}
.progress span {
  display: block; width: 40%; height: 100%;
  border-radius: 99px; background: var(--accent);
  animation: indeterminate 1.1s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}

/* ─────────── upload progress (create task dialog / drop zone) ───────────
   A genuine, determinate bar: XHR reports how many bytes of the request body
   have actually left the browser, so the percentage is real and not a spinner
   pretending to be one. */
.upload-progress {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px);
}
.up-card {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px 22px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow);
  animation: floatIn .18s ease-out;
}
.up-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.up-title { font-size: 14px; font-weight: 600; color: var(--text); }
.up-percent {
  font-size: 20px; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; direction: ltr;
}
.up-bar { height: 8px; border-radius: 999px; overflow: hidden; background: var(--border-soft); }
.up-bar span {
  display: block; width: 0; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff));
  transition: width .18s ease-out;
}
.up-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 11.5px; color: var(--text-faint);
}
/* Filenames are Latin or Persian — `plaintext` lets each one pick its own
   direction instead of inheriting the UI's RTL and scrambling the name. */
.up-file {
  direction: ltr; unicode-bidi: plaintext;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62%;
}
.up-bytes { direction: ltr; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 1180px) {
  :root { --side-w: 288px; }
}

@media (max-width: 1000px) {
  :root { --topbar-h: 50px; --rail-w: 46px; }

  /* phone layout: the tool rail stays on the LEFT — no bottom toolbar */
  .app {
    grid-template-columns: minmax(0, 1fr) var(--rail-w);
    grid-template-areas: "top top" "stage rail";
  }
  [dir="ltr"] .app {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    grid-template-areas: "top top" "rail stage";
  }
  .mobile-only { display: inline-flex !important; }

  .toolrail { padding: 6px 0; gap: 4px; }
  .toolrail .tool { width: 40px; height: 40px; border-radius: 11px; }
  .toolrail .tool svg { width: 21px; height: 21px; }

  /* the side panel is always anchored to the physical right edge */
  .panel-side {
    position: fixed;
    top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
    bottom: 0; right: 0;
    width: min(86vw, 350px);
    z-index: 50;
    box-shadow: var(--shadow);
    transform: translateX(100%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  }
  .panel-side.is-open { transform: translateX(0); }

  .zoom-bar { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .float-actions { top: 48px; }
  .suggestion-bar {
    top: auto; bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    inset-inline: 12px; justify-content: center; font-size: 12px;
  }

  .brand-name { display: none; }
  /* keep the mobile topbar uncluttered: theme/lang/account live on the home
     screen, and shapes can be deleted from the label list instead */
  .topbar .brand,
  .topbar #btnTheme,
  .topbar #btnLang,
  .topbar #btnDeleteShape,
  .topbar .user-chip { display: none; }
  /* the project name chip gives its room to the class picker — the back arrow
     and the image list already say which task you are in */
  .topbar .project-chip { display: none; }
}

@media (max-width: 560px) {
  .topbar { gap: 4px; padding: 0 8px; }
  .topbar > .icon-btn { width: 32px; height: 32px; }
  .topbar-actions .icon-btn { width: 32px; height: 32px; }
  /* the two extra nav buttons must not push the topbar over on a phone */
  .topbar-actions .tool-sep { display: none; }
  .topbar-actions .nav-step { width: 30px; }
  .class-chip { max-width: 82px; height: 28px; padding: 0 7px; font-size: 11.5px; }
  .user-name { display: none; }
  .user-chip { padding: 3px; }
  #btnSave { padding: 6px 10px; font-size: 12px; }
  .zoom-bar { inset-inline-start: 8px; }
  .auth-card { padding: 22px 18px 16px; }
  .home-main { padding: 18px 14px 40px; }
  .home-hero { align-items: stretch; }
  .home-hero-actions { width: 100%; }
  .home-hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .project-chip { max-width: 110px; }
  .modal { padding: 0; }
  .modal-card { max-width: none; max-height: 100dvh; border-radius: 0; }
}

/* small phones (iPhone SE / 360px): one more squeeze so the topbar — which now
   also carries prev/next and the class picker — still fits without overflowing */
@media (max-width: 400px) {
  .topbar { gap: 2px; padding: 0 6px; }
  .topbar > .icon-btn,
  .topbar-actions .icon-btn { width: 30px; height: 30px; }
  .topbar-actions .nav-step { width: 28px; }
  .class-chip { max-width: 74px; padding: 0 6px; }
  #btnSave { padding: 6px 8px; font-size: 11.5px; }
}

/* ═══════════════════ ADMIN — stat tiles, reports, logs ═══════════════════ */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.stat-tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 1px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  transition: border-color .15s, transform .1s;
}
.stat-tile:hover { border-color: var(--accent-ring); transform: translateY(-1px); }
.stat-tile b {
  font-size: 20px; font-weight: 700; letter-spacing: -.2px;
  font-variant-numeric: tabular-nums; line-height: 1.3;
}
.stat-tile small { font-size: 11px; color: var(--text-faint); }
.stat-icon { position: absolute; top: 11px; inset-inline-end: 11px; color: var(--accent); opacity: .45; }
.stat-icon svg { width: 16px; height: 16px; display: block; }
.stat-tile.is-accent {
  border-color: var(--accent-ring);
  background: linear-gradient(180deg, var(--accent-soft), transparent 72%), var(--panel);
}

.report-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  gap: 14px; margin-bottom: 14px;
}
.report-card {
  min-width: 0; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px 16px;
}
.report-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.report-head h3 { font-size: 13.5px; color: var(--text-dim); font-weight: 600; }
.report-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-faint); }
.report-legend .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.report-legend .dot.is-work { background: var(--accent); }
.report-legend .dot.is-shape { background: var(--ok); }
.report-legend span + .dot { margin-inline-start: 8px; }
.log-filter { width: auto; min-width: 128px; padding: 5px 9px; }

/* daily bars: time worked vs labels created */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 136px; padding-top: 8px; }
.chart-col {
  flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.chart-bars {
  flex: 1 1 auto; width: 100%;
  display: flex; align-items: flex-end; justify-content: center; gap: 3px;
}
.chart-bars .bar {
  width: 9px; min-height: 3px; border-radius: 4px 4px 2px 2px;
  transition: height .25s ease-out;
}
.chart-bars .bar.is-work {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 40%, transparent));
}
.chart-bars .bar.is-shape {
  background: linear-gradient(180deg, var(--ok), color-mix(in srgb, var(--ok) 35%, transparent));
}
.chart-col small { font-size: 10px; color: var(--text-faint); direction: ltr; }

/* compact data table (per-user report) */
.table-wrap { overflow-x: auto; scrollbar-gutter: stable; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  text-align: start; white-space: nowrap;
  font-weight: 500; font-size: 11px; color: var(--text-faint);
  padding: 6px 8px; border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 8px; white-space: nowrap;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover td { background: var(--panel-2); }
.data-table td.is-name { color: var(--text); font-weight: 500; }
.data-table td.is-work { color: var(--accent); font-weight: 500; }

/* activity feed */
.log-list { display: flex; flex-direction: column; max-height: 430px; overflow-y: auto; }
.log-row {
  display: grid; align-items: center; gap: 10px;
  grid-template-columns: 104px minmax(88px, 140px) minmax(0, 1fr) 96px;
  padding: 8px 6px; border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.log-row:last-child { border-bottom: none; }
.log-kind {
  font-size: 11px; text-align: center; padding: 2px 8px;
  border-radius: 999px; color: var(--text-dim);
  background: var(--panel-2); border: 1px solid var(--border-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.log-who { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-what { color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-when { color: var(--text-faint); font-size: 11.5px; text-align: end; }
.log-row.is-login .log-kind { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.log-row.is-upload .log-kind,
.log-row.is-export .log-kind { color: var(--accent); border-color: var(--accent-ring); }
.log-row.is-user_delete .log-kind { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.log-row.is-work .log-kind { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

/* progress bar used on project cards + task rows */
.mini-progress {
  display: block; height: 5px; margin-top: 8px;
  border-radius: 999px; overflow: hidden; background: var(--border-soft);
}
.mini-progress i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #fff));
  transition: width .3s ease-out;
}

/* pills that carry an icon */
.admin-row .pill { display: inline-flex; align-items: center; gap: 5px; }
.admin-row .pill svg { width: 12px; height: 12px; display: block; }
.admin-row .pill.is-role { font-size: 10px; letter-spacing: .4px; text-transform: uppercase; }
.admin-row .pill.is-work { color: var(--accent); border-color: var(--accent-ring); }
.admin-row .mini-progress { max-width: 320px; }

/* ═══════════════════ POLISH ═══════════════════ */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn:focus-visible, .btn:focus-visible, .tab:focus-visible, .tool:focus-visible {
  outline-offset: 1px;
}
.home-hero-text h1 { letter-spacing: -.3px; }
.project-card { will-change: transform; }
.project-card.is-new { transition: border-color .15s, color .15s, background .15s; }
.project-card.is-new:hover { background: var(--panel-2); }
.admin-row { transition: border-color .15s, background .15s; }
.admin-row:hover { border-color: var(--accent-ring); }
.tab { transition: background .18s, color .18s; }
.data-table th:first-child, .data-table td:first-child { padding-inline-start: 2px; }
.log-list::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { height: 10px; }

@media (max-width: 1000px) {
  .report-grid { grid-template-columns: minmax(0, 1fr); }
  .log-row { grid-template-columns: 92px minmax(0, 1fr) 84px; }
  .log-what { display: none; }
  .admin-row .pill.is-work, .admin-row .pill.is-total { display: none; }
}

@media (max-width: 620px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .log-row { grid-template-columns: 80px minmax(0, 1fr); }
  .log-when { display: none; }
  .chart { height: 112px; }
  .chart-bars .bar { width: 7px; }
}
