:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #243144;
  --border: #334155;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --accent: #06b6d4;
  --accent-dim: #0e7490;
  --accent-rgb: 6, 182, 212;
  --accent-soft: 34, 211, 238;
  --q1: #ef4444;
  --q2: #3b82f6;
  --q3: #eab308;
  --q4: #64748b;
  --radius: 14px;
  --nav-h: 72px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --pulse-cyan: #06b6d4;
  --pulse-cyan-light: #22d3ee;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; }
a { color: inherit; }

#app { max-width: 720px; margin: 0 auto; min-height: 100%; }

/* ---------- header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15,23,42,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 18px 12px;
}
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand .brand-logo { height: 38px; width: auto; display: block; }
.greeting { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin-top: 12px; letter-spacing: -0.01em; }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Workspace toggle is a tri-state segmented control pinned in the header. */
.ws-toggle {
  display: flex; width: 100%; margin-top: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px;
}
.ws-toggle button {
  flex: 1; border: none; background: transparent; color: var(--text-dim);
  font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px;
  cursor: pointer; transition: background 120ms ease, color 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.ws-toggle button.active { background: var(--accent); color: #0f172a; }
.ws-toggle button:not(.active):hover { color: var(--text); }

.icon-btn {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- main ---------- */
main { padding: 16px 16px calc(var(--nav-h) + 28px); }

.section { margin-bottom: 26px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.section-head h2 { font-family: var(--font-display); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.section-head .count { font-size: 11px; color: var(--text-faint); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.section-head .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  margin-bottom: 9px;
  display: flex; gap: 11px; align-items: flex-start;
}
.card.muted { opacity: 0.55; }
.card .check {
  flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border);
  cursor: pointer; margin-top: 1px; display: grid; place-items: center; background: transparent;
}
.card .check svg { width: 14px; height: 14px; color: #0f172a; opacity: 0; }
.card .check.done { background: var(--accent); border-color: var(--accent); }
.card .check.done svg { opacity: 1; }
.card .body { flex: 1; min-width: 0; }
.card .title { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.card.completed .title { text-decoration: line-through; color: var(--text-faint); }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; align-items: center; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }
.tag.q { color: #fff; border: none; }
.tag.due { color: #fca5a5; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); }
.tag.from { color: var(--accent); background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.3); }
.card .actions { display: flex; gap: 6px; flex: none; }
.card .mini { background: transparent; border: none; color: var(--text-faint); cursor: pointer; padding: 4px; }
.card .mini svg { width: 16px; height: 16px; }
.card .mini:hover { color: var(--accent); }

/* event card */
.event-card { display: flex; gap: 12px; align-items: stretch; }
.event-card .time { flex: none; width: 56px; text-align: right; }
.event-card .time .t { font-weight: 700; font-size: 13px; }
.event-card .time .ampm { font-size: 10px; color: var(--text-faint); }
.event-card .spine { flex: none; width: 3px; border-radius: 3px; background: var(--accent); }

/* ---------- empty / loading ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty .big { font-family: var(--font-display); font-size: 20px; color: var(--text-dim); margin-bottom: 6px; }
.skeleton { height: 64px; border-radius: var(--radius); background: linear-gradient(90deg,var(--surface) 25%,var(--surface-2) 50%,var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin-bottom: 9px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- matrix ---------- */
.matrix-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.matrix-grid .quad { min-width: 0; }
.matrix-grid * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.quad { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px; min-height: 150px; }
.quad.dragover { outline: 2px dashed var(--accent); outline-offset: -2px; }
.quad h3 { font-family: var(--font-display); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.quad .sub { font-weight: 500; color: var(--text-faint); text-transform: none; letter-spacing: 0; font-size: 11px; }
.quad .mcard { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 9px; font-size: 12.5px; margin-bottom: 7px; cursor: grab; line-height: 1.3; min-width: 0; max-width: 100%; }
.quad .mcard:active { cursor: grabbing; }
.quad-empty { font-size: 11px; color: var(--text-faint); padding: 6px 0; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.filters select { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 9px; padding: 7px 10px; font-size: 12.5px; }
.range-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.range-toggle button { border: none; background: transparent; color: var(--text-dim); font-size: 12.5px; font-weight: 600; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.range-toggle button.active { background: var(--accent); color: #0f172a; }

.date-group-head { font-family: var(--font-display); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin: 18px 0 9px; }

/* ---------- accounts ---------- */
.acct-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.acct-row { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #0f172a; display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); flex: none; }
.acct-info { flex: 1; min-width: 0; }
.acct-info .n { font-weight: 600; }
.acct-info .e { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row.linked { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.acct-head { margin-bottom: 10px; }
.acct-head .label { font-weight: 600; }
.acct-head .sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.avatar-img { object-fit: cover; }
.acct-card .btn.small { width: auto; padding: 8px 14px; margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.acct-card .btn.small svg { width: 16px; height: 16px; }
.acct-row .mini.danger { color: var(--text-faint); }
.acct-row .mini.danger:hover { color: #ef4444; }
.ws-tag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.ws-tag.ws-business { background: rgba(249, 115, 22, 0.16); color: #fdba74; }
.ws-tag.ws-personal { background: rgba(167, 139, 250, 0.18); color: #c4b5fd; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-top: 1px solid var(--border); }
.setting-row:first-of-type { border-top: none; }
.setting-row .label { font-size: 14px; }
.setting-row .sub { font-size: 12px; color: var(--text-faint); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: 0.2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.btn {
  width: 100%; background: var(--accent); color: #0f172a; border: none; border-radius: 11px;
  padding: 13px; font-weight: 700; font-size: 14.5px; cursor: pointer; margin-top: 8px;
}
.btn:active { transform: scale(0.99); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.hour-select { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 13px; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; max-width: 720px; margin: 0 auto;
  background: rgba(30,41,59,0.96); backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px);
  min-height: var(--nav-h);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--text-faint); text-decoration: none;
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  padding: 4px 2px; border-radius: 10px;
  min-width: 0; /* allow flex children to shrink so labels don't push past the edge */
  -webkit-tap-highlight-color: transparent;
  transition: color 120ms ease, background 120ms ease;
}
.bottom-nav a span {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bottom-nav a svg { width: 24px; height: 24px; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a.active svg { transform: translateY(-1px); }
@media (max-width: 360px) {
  .bottom-nav a { font-size: 10px; gap: 3px; }
  .bottom-nav a svg { width: 22px; height: 22px; }
}

/* ---------- login ---------- */
.login-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 30px; text-align: center; }
.login-wrap .login-logo { width: 320px; max-width: 86%; height: auto; margin-bottom: 28px; display: block; }
.login-wrap h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.login-wrap p { color: var(--text-dim); margin: 10px 0 30px; max-width: 320px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  background: #fff; color: #1f2937; border: none; border-radius: 12px;
  padding: 14px 22px; font-weight: 600; font-size: 15px; cursor: pointer; width: 100%; max-width: 340px;
}
.google-btn:active { transform: scale(0.99); }
.login-wrap .foot { margin-top: 22px; font-size: 12px; color: var(--text-faint); }

.err-banner { margin: 0 16px 12px; padding: 10px 14px; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35); color: #fecaca; border-radius: 12px; font-size: 13px; }
.toast { position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 10px 18px; border-radius: 999px; font-size: 13px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }

/* ---------- matrix add buttons + FAB ---------- */
.quad h3 { display: flex; align-items: center; gap: 6px; }
.quad h3 .quad-title { font-weight: 600; }
.quad-add {
  margin-left: auto;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  width: 26px; height: 26px; font-size: 18px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; padding: 0;
}
.quad-add:active { transform: scale(0.95); }
.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px);
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #0f172a;
  border: none; font-size: 32px; line-height: 1; font-weight: 600;
  box-shadow: 0 8px 24px rgba(6,182,212,0.35);
  cursor: pointer; z-index: 30;
}
.fab:active { transform: scale(0.96); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px 16px 16px 16px;
  width: 100%; max-width: 480px; max-height: 90vh;
  display: flex; flex-direction: column;
  animation: slideUp 0.2s ease;
  overflow: hidden;
}
@media (min-width: 600px) {
  .modal-backdrop { align-items: center; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.modal-close {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.modal-body {
  padding: 16px 18px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 18px; border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.modal-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.modal-meta .tag.link { color: var(--accent); text-decoration: none; }

.f-row { display: flex; flex-direction: column; gap: 4px; }
.f-row > span { font-size: 12px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.f-row input[type="text"], .f-row input[type="date"], .f-row textarea, .f-row select {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; color: var(--text);
  font-size: 15px; font-family: inherit; outline: none;
  width: 100%;
}
.f-row input:focus, .f-row textarea:focus, .f-row select:focus { border-color: var(--accent); }
.f-row textarea { resize: vertical; min-height: 64px; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  background: var(--accent); color: #0f172a;
  border: none; border-radius: 10px; padding: 10px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: transparent; color: var(--q1); border: 1px solid var(--q1); }
.btn.small { padding: 8px 12px; font-size: 13px; }
.btn:active { transform: scale(0.97); }

/* ---------- blocklist UI ---------- */
.acct-head { padding-bottom: 8px; }
.acct-head .label { font-weight: 600; }
.acct-head .sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.4; }
.bl-add { display: flex; gap: 8px; margin: 10px 0; }
.bl-add input {
  flex: 1; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; color: var(--text);
  font-size: 14px; outline: none; font-family: inherit;
}
.bl-add input:focus { border-color: var(--accent); }
.bl-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.bl-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--surface-2); border-radius: 8px;
  font-size: 14px; color: var(--text);
}
.bl-list li .mini { background: transparent; border: none; color: var(--text-dim); cursor: pointer; padding: 4px; }
.bl-list li .mini:hover { color: var(--q1); }
.bl-list li .mini svg { width: 16px; height: 16px; }
.bl-empty { color: var(--text-faint); font-size: 13px; padding: 6px 0; font-style: italic; }
.bl-row { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.bl-kind {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.bl-kind.k-sender  { color: #38bdf8; background: rgba(56,189,248,0.12); border: 1px solid rgba(56,189,248,0.30); }
.bl-kind.k-domain  { color: #a78bfa; background: rgba(167,139,250,0.12); border: 1px solid rgba(167,139,250,0.30); }
.bl-kind.k-keyword { color: #f97316; background: rgba(249,115,22,0.12); border: 1px solid rgba(249,115,22,0.30); }
.bl-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-hint {
  font-size: 11px;
  color: var(--text-faint);
  padding: 4px 2px 0;
  line-height: 1.5;
}
.bl-hint code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- touch drag ---------- */
.mcard { transition: transform 0.12s ease, opacity 0.12s ease; touch-action: manipulation; }
.mcard.drag-source { opacity: 0.35; }
.drag-ghost {
  background: var(--surface-2) !important;
  border: 1px solid var(--accent) !important;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  color: var(--text);
  transform: scale(1.04) rotate(-1.5deg);
  pointer-events: none;
}
.quad.dragover { background: rgba(6,182,212,0.08); border-color: var(--accent); }

/* ---------- email preview drawer (Gmail tasks) ---------- */
.modal.modal-email {
  max-width: 720px;
  max-height: 92vh;
}
@media (min-width: 600px) {
  .modal.modal-email { max-width: 720px; }
}
.email-head {
  align-items: flex-start;
  gap: 12px;
}
.email-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.email-subject {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}
.email-from {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 13px; color: var(--text);
  align-items: baseline;
}
.email-from-name { font-weight: 500; }
.email-from-addr { color: var(--text-dim); font-size: 12px; }
.email-date {
  font-size: 12px; color: var(--text-dim);
}
.email-preview-body {
  padding: 0 !important;
  flex: 1 1 auto;
  min-height: 200px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.email-frame {
  width: 100%;
  flex: 1 1 auto;
  border: 0;
  background: #f8fafc;
  min-height: 50vh;
}
.email-text {
  margin: 0; padding: 16px 18px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  white-space: pre-wrap; word-wrap: break-word;
  overflow-y: auto;
}
.email-foot { gap: 10px; }
.email-foot .btn.ghost { margin-right: auto; }

/* Tappable preview pill in task-edit modal */
.modal-meta button.tag.link {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 4px 10px;
  border-radius: 999px;
}
.modal-meta button.tag.link:hover {
  border-color: var(--accent);
  background: rgba(6,182,212,0.08);
}

/* ---------- Tag system v1 ---------- */
.tag.cat { font-weight: 600; }
.tag.dur { color: var(--text-dim); background: rgba(148,163,184,0.10); border-color: rgba(148,163,184,0.30); font-variant-numeric: tabular-nums; }
.tag.imp { letter-spacing: 1px; padding: 2px 6px; }
.tag.imp-1 { color: #94a3b8; background: rgba(148,163,184,0.10); border-color: rgba(148,163,184,0.30); }
.tag.imp-2 { color: #94a3b8; background: rgba(148,163,184,0.12); border-color: rgba(148,163,184,0.30); }
.tag.imp-3 { color: #eab308; background: rgba(234,179,8,0.12); border-color: rgba(234,179,8,0.35); }
.tag.imp-4 { color: #f97316; background: rgba(249,115,22,0.12); border-color: rgba(249,115,22,0.35); }
.tag.imp-5 { color: #ef4444; background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.40); }

/* Small matrix cards — stacked: title row, then tag row. */
.mcard { display: block; overflow: hidden; }
.mcard .mc-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.mcard .mc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.mc-tag {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  white-space: nowrap;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.mc-tag.mc-cat { /* color/bg set inline from category */ }
.mc-tag.mc-imp { letter-spacing: 0.5px; }
.mc-tag.mc-imp.imp-1, .mc-tag.mc-imp.imp-2 { color: #94a3b8; background: rgba(148,163,184,0.10); border-color: rgba(148,163,184,0.30); }
.mc-tag.mc-imp.imp-3 { color: #eab308; background: rgba(234,179,8,0.12); border-color: rgba(234,179,8,0.35); }
.mc-tag.mc-imp.imp-4 { color: #f97316; background: rgba(249,115,22,0.12); border-color: rgba(249,115,22,0.35); }
.mc-tag.mc-imp.imp-5 { color: #ef4444; background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.40); }
.mc-tag.mc-age { color: var(--text-faint); }
.mc-tag.mc-age.stale { color: #f97316; background: rgba(249,115,22,0.10); border-color: rgba(249,115,22,0.35); }

/* Age chip on the big task card. */
.tag.age { color: var(--text-faint); background: rgba(148,163,184,0.08); border-color: rgba(148,163,184,0.25); font-variant-numeric: tabular-nums; }
.tag.age.stale { color: #f97316; background: rgba(249,115,22,0.10); border-color: rgba(249,115,22,0.35); }

/* Star picker in modal */
.star-row { display: flex; align-items: center; gap: 4px; padding: 6px 0; }
.star-btn { background: transparent; border: none; cursor: pointer; color: #475569; font-size: 22px; line-height: 1; padding: 2px 4px; border-radius: 4px; transition: color 0.15s, transform 0.1s; }
.star-btn:hover { color: var(--accent); transform: scale(1.1); }
.star-btn.on { color: var(--accent); }
.star-clear { background: transparent; border: 1px solid var(--border); color: var(--text-dim); font-size: 11px; padding: 4px 8px; border-radius: 4px; margin-left: 8px; cursor: pointer; }
.star-clear:hover { border-color: var(--accent); color: var(--accent); }

/* Created-at display inside the task-edit modal. */
.modal-created {
  font-size: 11px;
  color: var(--text-faint);
  padding: 8px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* AI briefing card — shown read-only above the editable notes textarea in the task-edit modal */
.brief-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 8px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.brief-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brief-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
}
.brief-label-action {
  color: var(--accent);
}
.brief-body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.brief-body-action {
  font-weight: 600;
  color: var(--text);
  background: rgba(6,182,212,0.08);
  border-left: 2px solid var(--accent);
  padding: 6px 8px;
  border-radius: 4px;
}
.brief-sender {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

/* ---------- bulk select ---------- */
.bulk-toggle.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.filters-spacer { flex: 1; }

.bulk-check {
  width: 24px; height: 24px;
  flex: 0 0 24px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; line-height: 1;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  padding: 0;
}
.bulk-check:hover { border-color: var(--accent); }
.bulk-check.on {
  background: var(--accent);
  border-color: var(--accent);
}
.card.bulk { cursor: pointer; }
.card.bulk .body { cursor: pointer; }
.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 0 12px rgba(6,182,212,0.18);
  background: rgba(6,182,212,0.05);
}
/* Hide the row action buttons while bulk mode is on so the user focuses on
   selection. Edit modal can still be reached after exiting bulk. */
.card.bulk .actions { display: none; }


/* ---------- bulk action bar (compact, mobile-first) ---------- */
.bulk-bar {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  transform: translateX(-50%);
  width: min(680px, calc(100vw - 16px));
  z-index: 80;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(6,182,212,0.18);
  padding: 8px 10px;
  animation: bulk-bar-in 0.18s ease;
}
@keyframes bulk-bar-in {
  from { transform: translate(-50%, 12px); opacity: 0; }
  to   { transform: translate(-50%, 0);    opacity: 1; }
}
.bulk-bar-inner {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: nowrap; min-width: 0;
}
.bulk-count {
  font-size: 13px; color: var(--text-dim);
  white-space: nowrap;
  display: inline-flex; align-items: baseline; gap: 4px;
  flex: 0 0 auto;
}
.bulk-count strong {
  color: var(--accent);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.bulk-count-lbl { color: var(--text-dim); }

.bulk-actions {
  display: flex; align-items: center; gap: 6px;
  flex: 1 1 auto; justify-content: flex-end;
  min-width: 0; flex-wrap: nowrap;
}

/* Subtle text link for 'All' */
.bulk-link {
  background: transparent;
  color: var(--text-dim);
  border: 0;
  padding: 6px 4px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(148,163,184,0.4);
  flex: 0 0 auto;
}
.bulk-link:hover { color: var(--text); text-decoration-color: var(--text); }

/* Icon buttons — square, compact */
.bulk-icon {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.bulk-icon:hover:not(:disabled) { border-color: var(--accent); }
.bulk-icon:disabled { opacity: 0.35; cursor: not-allowed; }
.bulk-icon .bulk-glyph { font-size: 15px; line-height: 1; display: inline-block; }
.bulk-icon.ok { background: rgba(6,182,212,0.12); color: var(--accent); border-color: rgba(6,182,212,0.4); }
.bulk-icon.ok:hover:not(:disabled) { background: rgba(6,182,212,0.20); }
.bulk-icon.danger { background: rgba(239,68,68,0.12); color: #ef4444; border-color: rgba(239,68,68,0.4); }
.bulk-icon.danger:hover:not(:disabled) { background: rgba(239,68,68,0.20); }
.bulk-icon.ghost { background: transparent; color: var(--text-dim); }
.bulk-icon.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--text-dim); }

/* Move-to wrapper: glyph + native select stacked together as one pill */
.bulk-move-wrap {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 4px 0 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 130px;
}
.bulk-move-wrap:focus-within { border-color: var(--accent); }
.bulk-move-wrap .bulk-glyph { color: var(--text-dim); font-size: 14px; line-height: 1; }
.bulk-move {
  background: transparent;
  color: var(--text);
  border: 0;
  padding: 7px 4px;
  font-size: 13px;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
}
.bulk-move:disabled { opacity: 0.4; cursor: not-allowed; }
.bulk-move:focus { outline: none; }

/* When bulk bar is visible, push list content up so cards aren't hidden behind it */
body.bulk-mode main { padding-bottom: 160px; }

/* Mobile: hide text labels, icon-only buttons, drop ' selected' label */
@media (max-width: 600px) {
  .bulk-bar { width: calc(100vw - 12px); border-radius: 12px; padding: 6px 8px; }
  .bulk-bar-inner { gap: 6px; }
  .bulk-actions { gap: 4px; }
  .bulk-count-lbl { display: none; }
  .bulk-icon-lbl { display: none; }
  .bulk-icon { padding: 7px 9px; min-width: 38px; }
  .bulk-move-wrap { max-width: 88px; padding: 0 2px 0 6px; }
  .bulk-move { font-size: 12px; padding: 7px 2px; }
  .bulk-link { padding: 6px 2px; font-size: 12px; }
  body.bulk-mode main { padding-bottom: 140px; }
}

/* Cancel keeps its text label even on mobile (distinguishes it from Delete) */
.bulk-cancel-btn { font-weight: 500; padding: 7px 12px; }
@media (max-width: 600px) {
  .bulk-cancel-btn { padding: 7px 10px; font-size: 12px; }
}

/* ---------- matrix + today header / optimize toggle ---------- */
.matrix-head {
  display: flex; justify-content: flex-end; align-items: center;
  padding: 0 4px 10px 4px;
  gap: 10px;
}
.today-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px 12px 4px;
}
.today-strip-stat {
  color: var(--text-dim);
  font-size: 12px; font-weight: 500;
  line-height: 1.2;
}
.opt-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.opt-toggle:hover { border-color: var(--accent); color: var(--text); }
.opt-toggle .opt-glyph {
  font-size: 14px; line-height: 1;
  color: var(--text-faint);
  transition: color 0.12s;
}
.opt-toggle.on {
  background: rgba(6,182,212,0.14);
  border-color: rgba(6,182,212,0.55);
  color: var(--accent);
}
.opt-toggle.on .opt-glyph { color: var(--accent); }

/* ---------- Optimize chips, due-color chips, flag chips ---------- */
.tag.today-pill, .mc-tag.today-pill {
  color: var(--accent);
  background: rgba(6,182,212,0.14);
  border-color: rgba(6,182,212,0.55);
  font-weight: 600;
}
.tag.pin-pill, .mc-tag.pin-pill {
  color: var(--accent);
  background: rgba(6,182,212,0.10);
  border-color: rgba(6,182,212,0.40);
}
.tag.due.due-overdue, .mc-tag.mc-due.due-overdue {
  color: #ef4444;
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.45);
  font-weight: 600;
}
.tag.due.due-soon, .mc-tag.mc-due.due-soon {
  color: #eab308;
  background: rgba(234,179,8,0.12);
  border-color: rgba(234,179,8,0.40);
}
.tag.due.due-later, .mc-tag.mc-due.due-later {
  color: var(--text-dim);
  background: var(--surface-2);
  border-color: var(--border);
}
.tag.flag.blocks-crew {
  color: #f59e0b;
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.40);
}
.tag.flag.client-promised {
  color: #38bdf8;
  background: rgba(56,189,248,0.12);
  border-color: rgba(56,189,248,0.40);
}

/* Accent border on cards in today's optimized plan */
.card.opt-today {
  border-color: rgba(6,182,212,0.55);
  box-shadow: 0 0 0 1px rgba(6,182,212,0.20) inset;
}
.mcard.opt-today {
  border-color: rgba(6,182,212,0.55);
  box-shadow: 0 0 0 1px rgba(6,182,212,0.20) inset;
}

/* Edit modal flag checkboxes row */
.f-flags {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  padding: 2px 2px 4px 2px;
}
.f-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.f-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.f-check:hover { color: var(--text); }

@media (max-width: 600px) {
  .matrix-head { padding: 0 2px 8px 2px; }
  .today-strip { padding: 0 2px 10px 2px; }
  .opt-toggle { padding: 5px 10px; font-size: 12px; }
  .today-strip-stat { font-size: 11px; }
}

/* =========================================================
   DESKTOP LAYOUT  — ≥ 1024 px wide
   Mobile stays unchanged (everything above this block).
   - #app shell widens to 1180 px max.
   - Bottom tab bar transforms into a left sidebar.
   - Today gets a 2-column layout (Schedule | Do First & tasks).
   - Matrix 2×2 grid gets larger cells and tighter spacing.
   ========================================================= */
/* Default: single-column grid (mobile). Desktop @media overrides. */
.today-grid { display: block; }
.today-col { min-width: 0; }

@media (min-width: 1024px) {
  /* Shell + sidebar */
  #app {
    max-width: 1440px;
    padding-left: 220px;
    padding-bottom: 0;
    position: relative;
  }
  .app-header {
    margin-left: 0;
    padding: 18px 28px 14px;
  }
  #main {
    padding: 0 28px 40px;
    display: block;
  }

  /* Bottom nav becomes a vertical side rail */
  .bottom-nav {
    position: fixed;
    top: 0; left: 0; bottom: 0; right: auto;
    width: 200px; height: 100vh;
    max-width: none; margin: 0;
    flex-direction: column; justify-content: flex-start;
    padding: 24px 14px;
    gap: 4px;
    background: rgba(15, 23, 42, 0.96);
    border-top: none;
    border-right: 1px solid var(--border);
    min-height: 100vh;
  }
  .bottom-nav::before {
    content: "";
    display: block;
    height: 64px;                  /* spacer where a desktop logo could sit */
  }
  .bottom-nav a {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 10px;
    width: 100%;
  }
  .bottom-nav a svg { width: 20px; height: 20px; }
  .bottom-nav a:hover {
    background: var(--surface-2);
    color: var(--text);
  }
  .bottom-nav a.active {
    background: rgba(6,182,212,0.14);
    color: var(--accent);
  }
  .bottom-nav a.active svg { transform: none; }

  /* Today: real 2-column layout. Schedule left, tasks right.
     .one-col modifier collapses back to single column when there's no
     schedule today so tasks don't sit next to a dead left rail. */
  .today-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
  }
  .today-grid.one-col { grid-template-columns: minmax(0, 1fr); }
  .today-col-left { position: sticky; top: 16px; }
  .today-col .section:last-child { margin-bottom: 0; }

  /* Constrain reading width on List, Upcoming, Done */
  .list-wrap, .upcoming-wrap, .done-wrap { max-width: 880px; }

  /* Matrix: still 2×2, but with more padding so cells feel intentional */
  .matrix-grid {
    gap: 18px;
  }
  .quad {
    min-height: 260px;
  }

  /* Modals: more breathing room on desktop */
  .modal { max-width: 560px; }

  /* FAB floats inside the content column, not against viewport edge */
  .fab {
    right: 32px;
    bottom: 32px;
  }

  /* Hide the small-screen header-meta if it'd be redundant — keep workspace toggle */
  .app-header { padding-top: 22px; }
}

/* Wider desktop (≥ 1600 px): give the matrix even more room. We don't grow
   #app any further — 1440 already eliminates the right gutter Brian saw. */
@media (min-width: 1600px) {
  .matrix-grid { gap: 22px; }
  .quad { min-height: 300px; }
}

/* ----- Compact event cards on desktop (≥ 1024 px) -----
   Target: ~52 px tall. Mobile cards stay roomier because these rules only
   apply inside the desktop schedule columns. */
@media (min-width: 1024px) {
  .today-col-left .event-card,
  .today-grid .event-card,
  .upcoming-wrap .event-card {
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    min-height: 52px;
    line-height: 1.25;
  }
  .today-col-left .event-card .time,
  .today-grid .event-card .time {
    width: 48px;
    display: flex; flex-direction: row; align-items: baseline; gap: 3px;
    justify-content: flex-end;
  }
  .today-col-left .event-card .time .t,
  .today-grid .event-card .time .t { font-size: 13px; }
  .today-col-left .event-card .time .ampm,
  .today-grid .event-card .time .ampm { font-size: 10px; }
  /* Title + location share one row — location truncates with ellipsis. */
  .today-col-left .event-card .body,
  .today-grid .event-card .body {
    display: flex; flex-direction: row; align-items: center;
    gap: 10px; min-width: 0; flex: 1;
  }
  .today-col-left .event-card .title,
  .today-grid .event-card .title {
    flex: 0 1 auto;
    font-size: 14px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
  }
  /* Neutralize the location chip in .meta into a soft inline label so the
     card stays one row. .tag normally has bg/border/padding which forces
     a chip pill — we strip those just inside the schedule columns. */
  .today-col-left .event-card .meta,
  .today-grid .event-card .meta {
    display: flex; flex: 1 1 auto;
    align-items: center; min-width: 0;
  }
  .today-col-left .event-card .meta .tag,
  .today-grid .event-card .meta .tag {
    flex: 1 1 auto;
    font-size: 12px; font-weight: 400;
    color: var(--text-dim);
    background: transparent;
    border: none; padding: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 0;
    text-transform: none;
    letter-spacing: 0;
  }
  /* External-link icon stays compact and right-aligned. */
  .today-col-left .event-card .actions,
  .today-grid .event-card .actions {
    flex: 0 0 auto;
  }
}

/* ===== Deploy v3: Filter strip (Matrix + List) ===== */
.fstrip {
  margin: 4px 0 14px;
}
.fstrip.compact {
  /* On Matrix, sits between optimize toggle and grid; tighter spacing. */
  margin: 2px 0 10px;
}
.fstrip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.fstrip-toggle:hover { background: var(--surface-2); }
.fstrip-toggle.has-active {
  background: rgba(6,182,212,0.12);
  border-color: rgba(6,182,212,0.5);
  color: var(--accent);
}
.fstrip-icon { font-size: 11px; letter-spacing: 1px; opacity: 0.7; }
.fstrip.compact .fstrip-body { margin-top: 10px; }
.fstrip-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.fgroup {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.flabel {
  flex: 0 0 auto;
  min-width: 64px;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.fchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
}
.fchip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.fchip:hover {
  background: var(--surface);
  color: var(--text);
}
.fchip.on {
  background: rgba(6,182,212,0.18);
  border-color: rgba(6,182,212,0.6);
  color: var(--accent);
}
.fchip.clear {
  margin-left: auto;
  background: transparent;
  border-color: var(--border);
  color: var(--text-faint);
  font-size: 11.5px;
}
.fchip.clear:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* Mobile: stack labels above chips for breathing room */
@media (max-width: 640px) {
  .fstrip-body { padding: 10px; gap: 11px; }
  .fgroup { flex-direction: column; align-items: stretch; gap: 5px; }
  .flabel { min-width: 0; }
  .fchip.clear { margin-left: 0; align-self: flex-start; }
}

/* ---------- v3: Drive attachments ---------- */
.att-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.att-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.att-head .att-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}
.att-head .att-count {
  font-size: 12px;
  color: var(--text-dim);
}
.att-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.att-row {
  display: grid;
  grid-template-columns: 20px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.att-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.att-icon img {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}
.att-name {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-name:hover {
  color: var(--accent);
  text-decoration: underline;
}
.att-size {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.att-rm {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-faint);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
.att-rm:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.30);
}
.att-rm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.att-drop {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.att-drop:hover {
  border-color: var(--accent);
  color: var(--text);
}
.att-drop.over {
  border-color: var(--accent);
  background: rgba(6,182,212,0.08);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.15);
}
.att-drop.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: solid;
}
.att-drop.disabled:hover {
  border-color: var(--border);
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.01);
}
.att-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
}
.att-status {
  font-size: 12px;
  color: var(--text-dim);
  min-height: 16px;
}
.att-status.err {
  color: #ef4444;
}
.att-empty {
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
}
.mc-tag.att-clip,
.tag.att-clip {
  color: var(--accent);
  background: rgba(6,182,212,0.10);
  border-color: rgba(6,182,212,0.35);
  font-variant-numeric: tabular-nums;
}
