/* SprintDeck */
/* SprintDeck identity: teal/emerald palette + horizontal top navigation
   (deliberately distinct from TC Manager's indigo + left sidebar) */
:root {
  --bg: #f3f6f4;
  --panel: #ffffff;
  --text: #0f2e2b;
  --text-muted: #5f7470;
  --border: #d9e2de;
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --green: #16a34a;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #0284c7;
  --purple: #7c3aed;
  --header-start: #042f2e;
  --header-end: #115e59;
  --radius: 14px;
  --shadow: 0 2px 6px rgba(4,47,46,.05), 0 14px 34px -20px rgba(4,47,46,.28);
  --shadow-lift: 0 6px 14px rgba(4,47,46,.10), 0 22px 44px -20px rgba(4,47,46,.32);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background: radial-gradient(ellipse at 85% -10%, rgba(13,148,136,.10), transparent 40%), var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
button { font-family: inherit; }
a { color: var(--primary); }

/* ── Buttons / inputs ─────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--border); background: #fff; color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .12s, box-shadow .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(4,47,46,.10); }
.btn:active { transform: translateY(0); }
.btn:hover { background: #f1f2f4; }
.btn.primary { background: linear-gradient(135deg, #0d9488, #0f766e); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(13,148,136,.35); }
.btn.primary:hover { background: linear-gradient(135deg, #0fa396, #115e59); box-shadow: 0 6px 18px rgba(13,148,136,.45); }
.btn.danger { background: #fff; border-color: #f5c2c0; color: #b91c1c; }
.btn.danger:hover { background: #fdecea; }
.btn.small { padding: 5px 12px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #ebecf0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input, .textarea, select.input { width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 11px; font-size: 14px; font-family: inherit; color: var(--text); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 148, 136, .18); }
.textarea { min-height: 90px; resize: vertical; }
label.field { display: block; margin-bottom: 12px; }
label.field .meta { display: block; margin-bottom: 5px; }
.meta { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); }
.small-muted { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #e7ede9; font-size: 11.5px; font-weight: 700; }
.chip.green { background: #e3fcef; color: #006644; }
.chip.amber { background: #fff7e6; color: #974f0c; }
.chip.red { background: #ffebe6; color: #bf2600; }
.chip.blue { background: #deebff; color: #0747a6; }
.chip.purple { background: #ede9fe; color: #5b21b6; }
.toolbar { display: flex; gap: 8px; align-items: center; }
.toolbar.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ── Auth / cards ─────────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card h3 { margin: 0 0 2px; font-size: 16.5px; letter-spacing: -.2px; }
.card .card-sub { margin: 0 0 14px; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #042f2e 0%, #0d9488 100%); }
.auth-box { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-box h1 { margin: 0 0 4px; font-size: 22px; }
.auth-logo { font-weight: 800; font-size: 18px; color: var(--primary); margin-bottom: 18px; }

/* ── App shell: horizontal top navigation ──────── */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.sidebar {
  width: 100%; flex-shrink: 0;
  background: linear-gradient(90deg, var(--header-start), var(--header-end));
  color: #ccfbf1;
  display: flex; flex-direction: row; align-items: center;
  padding: 0 16px; gap: 4px; min-height: 60px;
  box-shadow: 0 4px 18px rgba(4,47,46,.25);
  position: sticky; top: 0; z-index: 30;
  overflow-x: auto; scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar .logo { font-weight: 800; font-size: 19px; color: #fff; padding: 0 20px 0 2px; letter-spacing: .3px; white-space: nowrap; }
.sidebar .logo span { color: #5eead4; }
.nav-item { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 99px; color: #99f6e4; font-size: 14px; font-weight: 600; cursor: pointer; border: none; background: transparent; text-align: left; width: auto; white-space: nowrap; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(94,234,212,.5); }
.nav-item .ico { width: 21px; height: 21px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 800; background: rgba(255,255,255,.14); }
.sidebar .spacer { flex: 1; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 13px 24px; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 60px; z-index: 20; }
.topbar .grow { flex: 1; }
.topbar select.input { width: auto; min-width: 160px; }
.topbar .search { max-width: 320px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; cursor: pointer; }
.content { padding: 26px 24px; flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; }
.page-title { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.page-title h2 { margin: 0; font-size: 24px; letter-spacing: -.4px; }

/* ── Board ────────────────────────────────────── */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 18px; }
.board-col { background: linear-gradient(180deg, #e9f0ec, #e2ebe6); border: 1px solid rgba(13,148,136,.10); border-radius: 16px; padding: 12px; width: 314px; flex-shrink: 0; }
.board-col.drag-over { outline: 2px dashed var(--primary); outline-offset: -2px; }
.board-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.board-col-head .meta { font-size: 11.5px; }
.board-cards { display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.issue-card { background: #fff; border-radius: 12px; padding: 13px 14px; box-shadow: 0 1px 3px rgba(4,47,46,.10); cursor: pointer; border: 1px solid transparent; transition: transform .12s, box-shadow .15s, border-color .15s; }
.issue-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.issue-card.dragging { opacity: .35; }
.drag-ghost {
  position: fixed; z-index: 80; pointer-events: none;
  box-shadow: 0 14px 38px rgba(9, 30, 66, .35);
  transform: rotate(2.5deg) scale(1.03);
  border: 1px solid var(--primary);
}
.issue-card { user-select: none; -webkit-user-select: none; }

/* ── Full-page ticket ─────────────────────────── */
.issue-page { max-width: 880px; }
.issue-page-head { margin-bottom: 14px; }
.issue-page-body { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.issue-card .title { font-size: 13.5px; font-weight: 600; margin-bottom: 9px; line-height: 1.4; }
.issue-card .foot { display: flex; align-items: center; gap: 6px; }
.issue-card .foot .grow { flex: 1; }
.issue-card .mini-avatar { width: 22px; height: 22px; border-radius: 50%; background: #6b778c; color: #fff; font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.type-badge { width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; color: #fff; flex-shrink: 0; }
.type-epic { background: var(--purple); }
.type-story { background: var(--green); }
.type-task { background: var(--blue); }
.type-bug { background: var(--red); }
.prio { font-size: 11px; font-weight: 800; }
.prio-Critical { color: #bf2600; }
.prio-High { color: #de350b; }
.prio-Medium { color: #974f0c; }
.prio-Low { color: #006644; }
.key { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.quick-add { width: 100%; margin-top: 8px; }

/* ── Tables ───────────────────────────────────── */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th { text-align: left; padding: 12px 14px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
table.table td { padding: 11px 14px; border-bottom: 1px solid #eef2ef; vertical-align: middle; font-size: 13.5px; }
table.table tr:last-child td { border-bottom: none; }
table.table tr.row-click { cursor: pointer; }
table.table tr.row-click:hover { background: #f8f9fb; }
.empty { padding: 26px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ── Drawer ───────────────────────────────────── */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(9, 30, 66, .45); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 96vw); background: var(--panel); z-index: 61; box-shadow: -8px 0 32px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer .grow { flex: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.comment { padding: 10px 12px; background: #f8f9fb; border-radius: 8px; margin-bottom: 8px; }
.comment .who { font-weight: 700; font-size: 12.5px; margin-bottom: 3px; }
.activity-row { display: flex; gap: 8px; padding: 6px 0; font-size: 12.5px; color: var(--text-muted); border-bottom: 1px solid #f1f2f4; }

/* ── Settings tabs ────────────────────────────── */
.settings-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tab-btn { padding: 7px 14px; border-radius: 8px; border: 1px solid transparent; background: transparent; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.tab-btn:hover { background: #ebecf0; }
.tab-btn.active { background: var(--panel); border-color: var(--border); color: var(--primary); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.plan-card { border: 2px solid var(--border); border-radius: 12px; padding: 16px; background: #fff; }
.plan-card.highlight { border-color: var(--primary); }
.plan-card .price { font-size: 32px; font-weight: 800; margin: 6px 0; letter-spacing: -.5px; }
.plan-card ul { margin: 10px 0; padding-left: 18px; font-size: 13px; color: var(--text-muted); }
.plan-card ul li { margin: 4px 0; }
.usage-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; background: #deebff; color: #0747a6; font-size: 13px; }
.usage-banner.warn { background: #fff7e6; color: #974f0c; }
.token-box { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: #f4f5f7; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; word-break: break-all; }

/* ── Reports / burndown ───────────────────────── */
.bar-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.bar-row .bar-label { width: 110px; font-size: 12.5px; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.bar-row .bar-track { flex: 1; background: #ebecf0; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 6px; background: var(--primary); display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; color: #fff; font-size: 10.5px; font-weight: 700; min-width: 4px; }
.burndown svg { width: 100%; height: auto; background: #fff; border-radius: 8px; }

/* ── Global search / sprint banner ─────────────── */
.gsearch { position: relative; flex: 1 1 220px; max-width: 360px; }
.gsearch-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(4, 47, 46, .22); overflow: hidden; padding: 4px;
}
.gsearch-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 10px; border: none; background: transparent; cursor: pointer;
  font-size: 13px; border-radius: 8px; color: var(--text);
}
.gsearch-item:hover { background: #eef5f1; }
.gsearch-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsearch-empty { padding: 12px; font-size: 12.5px; color: var(--text-muted); }
.sprint-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(90deg, #ecfdf5, #fff); border: 1px solid #a7f3d0;
  border-radius: 12px; padding: 10px 14px; font-size: 13px;
}

/* ── Attachments / lightbox / case preview ─────── */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.att-card { position: relative; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; }
.att-card:hover { border-color: var(--primary); }
.att-thumb { width: 100%; height: 84px; object-fit: cover; display: block; background: #f4f5f7; }
.att-video { display: flex; align-items: center; justify-content: center; background: #1e1e2e; }
.att-play { color: #fff; font-size: 22px; }
.att-name { font-size: 11px; padding: 5px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); }
.att-remove { position: absolute; top: 4px; right: 4px; padding: 1px 7px; background: rgba(255,255,255,.92); }
.lightbox { position: fixed; inset: 0; background: rgba(9, 30, 66, .82); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 18px; }
.lightbox-inner { max-width: min(960px, 96vw); max-height: 94dvh; display: flex; flex-direction: column; }
.lightbox-media { max-width: 100%; max-height: calc(94dvh - 60px); border-radius: 12px; object-fit: contain; background: #000; }
.tc-preview { background: #fff; border-radius: 14px; padding: 20px; max-width: min(680px, 96vw); max-height: 90dvh; overflow-y: auto; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.tc-prose { font-size: 13px; line-height: 1.55; white-space: pre-wrap; background: #f8f9fb; border-radius: 8px; padding: 10px 12px; margin-top: 6px; }
.tc-step { display: flex; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 7px; font-size: 13px; align-items: flex-start; }
.tc-step-num { width: 22px; height: 22px; border-radius: 50%; background: #ccfbf1; color: #115e59; font-weight: 800; font-size: 10.5px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Dialog ───────────────────────────────────── */
.app-dialog-overlay { position: fixed; inset: 0; background: rgba(9,30,66,.5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.app-dialog-box { background: #fff; border-radius: 14px; padding: 26px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.app-dialog-icon { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.app-dialog-icon-warning { background: #fff7e6; color: #974f0c; }
.app-dialog-msg { font-size: 14px; line-height: 1.5; margin-bottom: 18px; }
.app-dialog-actions { display: flex; gap: 10px; justify-content: center; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1e1e2e; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 13.5px; z-index: 120; box-shadow: 0 8px 30px rgba(0,0,0,.3); max-width: 90vw; }
.toast.error { background: #b91c1c; }
.toast.success { background: #047857; }

/* ── Landing ──────────────────────────────────── */
.landing { background: #fff; color: #172b4d; }
.landing-nav { position: sticky; top: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); z-index: 50; }
.landing-nav-inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 14px 22px; }
.landing-logo { font-weight: 800; font-size: 19px; color: var(--primary); }
.landing-nav .grow { flex: 1; }
.landing-hero { text-align: center; padding: 90px 22px 70px; background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%); }
.landing-hero h1 { font-size: clamp(30px, 5vw, 52px); margin: 14px 0; line-height: 1.12; letter-spacing: -1px; }
.landing-hero p { max-width: 560px; margin: 0 auto 26px; color: var(--text-muted); font-size: 17px; line-height: 1.6; }
.hero-badge { display: inline-block; padding: 6px 14px; border-radius: 99px; background: #ccfbf1; color: #115e59; font-size: 12.5px; font-weight: 700; }
.landing-section { max-width: 1080px; margin: 0 auto; padding: 60px 22px; }
.landing-section h2 { text-align: center; font-size: 28px; margin: 0 0 8px; }
.landing-section .section-sub { text-align: center; color: var(--text-muted); margin: 0 auto 36px; max-width: 540px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.feature-card { border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.feature-card .f-ico { width: 38px; height: 38px; border-radius: 9px; color: #fff; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.feature-card h3 { margin: 0 0 6px; font-size: 15.5px; }
.feature-card p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; align-items: stretch; }
.faq-item { border-bottom: 1px solid var(--border); padding: 16px 0; max-width: 720px; margin: 0 auto; }
.faq-item h4 { margin: 0 0 6px; font-size: 15px; }
.faq-item p { margin: 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }
.landing-cta { text-align: center; padding: 70px 22px; background: linear-gradient(135deg, #042f2e, #0d9488); color: #fff; }
.landing-cta h2 { font-size: 30px; margin: 0 0 10px; }
.landing-footer { text-align: center; padding: 26px; color: var(--text-muted); font-size: 12.5px; border-top: 1px solid var(--border); }

img, svg, video { max-width: 100%; }
svg { height: auto; }
html, body { overflow-x: hidden; }

/* ── Responsive ───────────────────────────────── */
/* Tablet / small laptop: compact top nav (icons only) */
@media (max-width: 860px) {
  .sidebar { padding: 0 8px; min-height: 54px; }
  .sidebar .logo { font-size: 14px; padding-right: 10px; }
  .sidebar .logo .logo-full { display: inline; }
  .nav-item { padding: 8px 9px; }
  .nav-item .label { display: none; }
  .content { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; padding: 10px 12px; top: 54px; }
  .drawer { width: 100vw; }
  .grid2 { grid-template-columns: 1fr; }
  .input, .textarea, select.input { font-size: 16px; min-height: 44px; }
  .textarea { min-height: 90px; }
  .board-col { width: 270px; }
}

/* Phone: bottom tab bar navigation */
@media (max-width: 640px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; height: auto;
    flex-direction: row; align-items: stretch;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    gap: 0; overflow-x: auto; z-index: 40;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .3);
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar .logo, .sidebar .spacer { display: none; }
  .nav-item {
    flex: 1 1 0; width: auto; min-width: 52px;
    flex-direction: column; gap: 3px;
    padding: 7px 4px; justify-content: center;
    border-radius: 10px;
  }
  .nav-item .label { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .2px; }
  .nav-item .ico { width: 26px; height: 26px; font-size: 9px; }
  .main { min-height: 100dvh; }
  .content { padding: 12px 10px calc(86px + env(safe-area-inset-bottom, 0px)); }
  .topbar { padding: 8px 10px; gap: 8px; position: static; }
  .topbar select.input { min-width: 0; flex: 1 1 130px; max-width: none; }
  .topbar .search { flex: 1 1 100%; order: 9; max-width: none; }
  .page-title { flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
  .page-title h2 { font-size: 17px; }

  /* Board: swipeable full-ish-width columns with snap */
  .board { gap: 10px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .board-col { width: 82vw; max-width: 330px; scroll-snap-align: start; }

  /* Drawer is the whole screen */
  .drawer { width: 100vw; }
  .drawer-head { padding: 12px 12px; }
  .drawer-body { padding: 14px 12px calc(20px + env(safe-area-inset-bottom, 0px)); }

  /* Cards, tables, toolbars */
  .card { padding: 14px 12px; }
  .stack { gap: 12px; }
  .toolbar.wrap > .btn { flex: 1 1 auto; justify-content: center; }
  table.table th, table.table td { padding: 8px 8px; font-size: 12.5px; }
  .settings-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; flex: 0 0 auto; }
  .token-box { font-size: 11px; }
  .plan-card .price { font-size: 22px; }
  .usage-banner { font-size: 12.5px; }
  .app-dialog-box { padding: 20px 16px; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

  /* Landing */
  .landing-hero { padding: 56px 18px 44px; }
  .landing-section { padding: 38px 16px; }
  .landing-nav-inner { padding: 10px 14px; gap: 10px; }
  .landing-cta { padding: 48px 18px; }
  .pricing-grid, .feature-grid { grid-template-columns: 1fr; }
  .bar-row .bar-label { width: 78px; font-size: 11px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .nav-item { min-width: 48px; padding: 6px 4px; }
  .nav-item .label { font-size: 8.5px; }
  .board-col { width: 88vw; }
  .btn { padding: 8px 10px; font-size: 12.5px; }
}

/* Activity links */
.activity-link { font-weight: 700; color: var(--primary); text-decoration: none; }
.activity-link:hover { text-decoration: underline; }

/* Comments */
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.comment { display: flex; gap: 10px; align-items: flex-start; background: transparent; padding: 0; margin: 0; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #0d9488, #115e59); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.comment-body { flex: 1; min-width: 0; background: #f2f7f4; border: 1px solid #e2ebe6; border-radius: 4px 14px 14px 14px; padding: 10px 13px; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.comment-head strong { font-size: 13px; }
.comment-delete { margin-left: auto; cursor: pointer; color: var(--text-muted); font-size: 12px; padding: 0 3px; }
.comment-delete:hover { color: var(--red); }
.comment-text { font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-empty { padding: 14px 0 4px; font-size: 12.5px; color: var(--text-muted); font-style: italic; }
.comment-composer { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.comment-composer .comment-input { min-height: 42px; flex: 1; }

/* Linked run rows with live progress */
.run-link-row { width: 100%; background: #f6faf8; border: 1px solid #e2ebe6; border-radius: 12px; padding: 10px 12px; }
.run-bar { display: flex; height: 8px; border-radius: 4px; background: #e3eae6; overflow: hidden; margin-top: 8px; }
.run-bar-pass { background: linear-gradient(90deg, #16a34a, #22c55e); }
.run-bar-done { background: #f59e0b; }

/* Run detail line */
.run-bar-fail { background: linear-gradient(90deg, #dc2626, #ef4444); }
.run-detail { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 7px; }
.run-stat { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.run-stat.pass { color: #15803d; }
.run-stat.fail { color: #b91c1c; }
.run-stat.skip { color: #b45309; }

/* Backlog drag targets + resizable text fields */
.backlog-drop { outline: 2px dashed var(--primary); outline-offset: -2px; }
tr[data-issue-id] { touch-action: manipulation; }
textarea, .textarea { resize: vertical; }

/* ═══ Modern polish pass ═══ */
html { scroll-behavior: smooth; }
::selection { background: rgba(13, 148, 136, .22); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(95, 116, 112, .35); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: rgba(95, 116, 112, .55); }
*::-webkit-scrollbar-track { background: transparent; }
.board::-webkit-scrollbar { height: 12px; }
.app-dialog-overlay, .lightbox, .drawer-backdrop { backdrop-filter: blur(3px); }
.card { transition: box-shadow .18s; }
.card:hover { box-shadow: var(--shadow-lift); }

/* ── Checklist / bell / dark mode ───────────────── */
.check-progress { height: 6px; background: #e3eae6; border-radius: 3px; overflow: hidden; margin: 7px 0; }
.check-progress-fill { height: 100%; background: linear-gradient(90deg, #16a34a, #22c55e); border-radius: 3px; transition: width .25s; }
.check-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.check-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 9px; background: var(--panel-soft, #f6faf8); border: 1px solid var(--border); cursor: pointer; font-size: 13.5px; }
.check-item.done .check-text { text-decoration: line-through; color: var(--text-muted); }
.check-item .check-text { flex: 1; }
.check-remove { color: var(--text-muted); cursor: pointer; padding: 0 4px; font-size: 12px; }
.check-remove:hover { color: var(--red); }
.notify-wrap { position: relative; }
.notify-btn { position: relative; font-size: 15px; }
.notify-dot { position: absolute; top: -4px; right: -5px; background: var(--red); color: #fff; font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 99px; }
.notify-panel { position: absolute; top: calc(100% + 8px); right: 0; width: min(330px, 92vw); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 50px rgba(4,47,46,.28); padding: 8px; z-index: 70; }
.notify-item { display: block; width: 100%; text-align: left; border: none; background: transparent; padding: 8px 9px; border-radius: 9px; cursor: pointer; font-size: 12.5px; color: var(--text); }
.notify-item:hover { background: var(--panel-soft, #eef5f1); }

/* Dark theme */
[data-theme="dark"] {
  --bg: #0b1614;
  --panel: #13211e;
  --panel-soft: #1a2b27;
  --text: #e2ece8;
  --text-muted: #8aa39d;
  --border: #24382f;
  --header-start: #04201f;
  --header-end: #0b3b36;
  --shadow: 0 2px 6px rgba(0,0,0,.3), 0 14px 34px -20px rgba(0,0,0,.6);
  --shadow-lift: 0 6px 14px rgba(0,0,0,.4), 0 22px 44px -20px rgba(0,0,0,.7);
}
[data-theme="dark"] body { background: radial-gradient(ellipse at 85% -10%, rgba(13,148,136,.14), transparent 40%), var(--bg); }
[data-theme="dark"] .btn { background: #1a2b27; border-color: var(--border); color: var(--text); }
[data-theme="dark"] .btn:hover { background: #21352f; }
[data-theme="dark"] .btn.ghost { background: transparent; }
[data-theme="dark"] .input, [data-theme="dark"] .textarea, [data-theme="dark"] select.input { background: #0f1c19; border-color: var(--border); color: var(--text); }
[data-theme="dark"] .board-col { background: linear-gradient(180deg, #142420, #11201c); border-color: #1f332c; }
[data-theme="dark"] .issue-card, [data-theme="dark"] .auth-box { background: #1a2b27; color: var(--text); }
[data-theme="dark"] .topbar { background: rgba(19, 33, 30, .92); }
[data-theme="dark"] .chip { background: #21352f; color: #b9cdc7; }
[data-theme="dark"] table.table td { border-bottom-color: #1c2e29; }
[data-theme="dark"] table.table tr.row-click:hover { background: #182a25; }
[data-theme="dark"] .comment-body, [data-theme="dark"] .run-link-row, [data-theme="dark"] .tc-prose, [data-theme="dark"] .check-item { background: #1a2b27; border-color: var(--border); }
[data-theme="dark"] .gsearch-item:hover, [data-theme="dark"] .notify-item:hover { background: #21352f; }
[data-theme="dark"] .tc-preview, [data-theme="dark"] .app-dialog-box { background: #13211e; color: var(--text); }
[data-theme="dark"] .sprint-banner { background: linear-gradient(90deg, #0e2420, #13211e); border-color: #1f4d40; }
[data-theme="dark"] .usage-banner { background: #0e2a36; color: #9ed3ee; }
[data-theme="dark"] .usage-banner.warn { background: #332508; color: #f0c87a; }
[data-theme="dark"] .att-card, [data-theme="dark"] .plan-card { background: #1a2b27; }
[data-theme="dark"] .drawer, [data-theme="dark"] .issue-page-body { background: #13211e; }
[data-theme="dark"] .check-progress, [data-theme="dark"] .run-bar { background: #24382f; }

/* ── Jira-parity drop: subtasks, roadmap, automation, charts ── */
.type-subtask { background: #64748b; font-size: 7px; }
.subtask-list { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.subtask-row { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); }
.subtask-title { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subtask-title.done { text-decoration: line-through; color: var(--text-muted); }
.subtask-status { width: auto !important; min-height: 32px !important; font-size: 12px !important; padding: 4px 8px !important; }
.mention { background: rgba(13,148,136,.14); color: var(--primary-dark); font-weight: 700; padding: 0 4px; border-radius: 4px; }
[data-theme="dark"] .mention { background: rgba(13,148,136,.3); color: #5eead4; }
.auto-rule { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 7px; }

/* Gantt */
.gantt { overflow-x: auto; }
.gantt-head, .gantt-row { display: flex; align-items: center; min-height: 34px; border-bottom: 1px solid var(--border); }
.gantt-row:last-child { border-bottom: none; }
.gantt-label { width: 240px; flex-shrink: 0; display: flex; align-items: center; gap: 7px; font-size: 13px; padding-right: 10px; cursor: pointer; overflow: hidden; }
.gantt-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-track { flex: 1; position: relative; min-width: 420px; height: 30px; }
.gantt-months { border-left: 1px solid var(--border); }
.gantt-month { position: absolute; top: 6px; font-size: 10.5px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; border-left: 1px solid var(--border); padding-left: 5px; height: 100%; }
.gantt-today { position: absolute; top: 0; bottom: -600px; width: 2px; background: var(--red); opacity: .5; z-index: 1; }
.gantt-bar { position: absolute; top: 6px; height: 18px; border-radius: 9px; opacity: .85; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; }
.gantt-bar.done { background: #16a34a !important; opacity: .5; }
.gantt-bar.overdue { box-shadow: 0 0 0 2px var(--red); }
.gantt-due { font-size: 9px; color: #fff; font-weight: 800; }
.gantt-sprint { position: absolute; top: 4px; height: 22px; border-radius: 6px; background: rgba(13,148,136,.15); border: 1px dashed rgba(13,148,136,.5); font-size: 9.5px; font-weight: 800; color: var(--primary-dark); display: flex; align-items: center; justify-content: center; text-transform: uppercase; }
.gantt-sprint.active { background: rgba(13,148,136,.28); }
[data-theme="dark"] .gantt-bar.done { background: #15803d !important; }

/* CFD */
.cfd { width: 100%; height: auto; background: var(--panel); border-radius: 10px; }
.cfd-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; }

/* Prevent text selection while dragging cards */
body.sd-dragging, body.sd-dragging * { user-select: none !important; -webkit-user-select: none !important; cursor: grabbing !important; }

/* Test-case preview: contain long unbroken strings */
.tc-preview { overflow-x: hidden; width: min(680px, 96vw); }
.tc-preview h3, .tc-preview .tc-prose, .tc-preview .meta { overflow-wrap: anywhere; word-break: break-word; }
.tc-step > div { min-width: 0; flex: 1; overflow-wrap: anywhere; word-break: break-word; }
.tc-step .small-muted { overflow-wrap: anywhere; }
.tc-preview .chip, .tc-preview .prio { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Suite activity chips */
.suite-chip { display: inline-flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 800; letter-spacing: .4px; color: #fff; border-radius: 4px; padding: 2px 6px; vertical-align: middle; margin-right: 4px; }
