/* =========================================================================
   /demo — playable Kanban board
   The board, cards, filter bar and task quick-view are ports of the app's own
   markup and CSS (LogMyBusiness.Client/Pages/Tasks.razor + app.css), so what a
   visitor plays with here is what they get after signing up. Class names are
   deliberately the same as the app's (.kanban-*, .qe-*, .quickview-*) to keep
   the two in sync; only page chrome uses a demo- prefix.

   The app renders through MudBlazor. The .mudish-* classes below stand in for
   the MudBlazor controls (buttons, outlined inputs, menus, icon buttons) using
   the marketing tokens in site.css.
   ========================================================================= */

:root {
    /* Priority + status hues, lifted from the app's app.css tokens. */
    --prio-low:      #10B981;
    --prio-medium:   #F59E0B;
    --prio-high:     #EF4444;
    --prio-critical: #B91C1C;
    --space-1: 4px;
    --text-disabled: #9CA3AF;
}

/* The board wants more room than the marketing 1120px measure. */
.container--wide { max-width: 1320px; }

/* ------------------------------------------------------------------- hero */
.demo-hero { background: var(--gradient-primary); color: #fff; padding-block: var(--space-12) var(--space-8); }
.demo-hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); }
.demo-hero__eyebrow {
    background: rgba(255,255,255,.16); color: #fff;
    font-size: .78rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    padding: 5px 14px; border-radius: 999px;
}
.demo-hero__title { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 700; margin: 0; }
.demo-hero__sub { font-size: 1.12rem; opacity: .95; max-width: 64ch; margin: 0; }
.demo-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; margin-top: var(--space-2); }

/* ------------------------------------------------------------ demo section */
.demo-section { padding-block: var(--space-8) var(--space-12); }

.demo-notice {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
    background: rgba(var(--primary-rgb), .08);
    border: 1px solid rgba(var(--primary-rgb), .3);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    font-size: .92rem;
}
.demo-notice__text { margin: 0; flex: 1 1 320px; color: var(--text); }

/* ---------------------------------------------------------- browser chrome */
.demo-shell {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.demo-shell__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.demo-shell__dot { width: 10px; height: 10px; border-radius: 50%; background: #d7dbe3; flex: none; }
.demo-shell__url {
    margin-left: var(--space-3); flex: 1; min-width: 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
    padding: 3px 12px; font-size: .78rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================================
   MudBlazor stand-ins (.mudish-*)
   ============================================================ */
.mudish-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-size: .8125rem; font-weight: 500; letter-spacing: 0; text-transform: none;
    padding: 5px 12px; min-height: 32px; border-radius: 8px; cursor: pointer;
    border: 1px solid rgba(0,0,0,.23); background: transparent; color: var(--text);
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap; text-decoration: none;
}
.mudish-btn:hover { background: rgba(0,0,0,.04); text-decoration: none; }
.mudish-btn:disabled { color: var(--text-disabled); border-color: rgba(0,0,0,.12); cursor: default; }
.mudish-btn:disabled:hover { background: transparent; }
.mudish-btn--filled { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.mudish-btn--filled:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-fg); }
.mudish-btn--outline-primary { border-color: var(--primary); color: var(--primary); }
.mudish-btn--outline-primary:hover { background: rgba(var(--primary-rgb), .08); }
.mudish-btn--text { border-color: transparent; }
.mudish-btn--text:hover { background: rgba(0,0,0,.04); }
.mudish-btn--sm { min-height: 28px; padding: 3px 10px; font-size: .78rem; }
.mudish-btn__icon { width: 18px; height: 18px; fill: currentColor; flex: none; }
.mudish-btn__icon--end { margin-left: -2px; }

/* button group (view switcher) */
.mudish-btngroup { display: inline-flex; }
.mudish-btngroup .mudish-btn { border-radius: 0; margin-left: -1px; }
.mudish-btngroup .mudish-btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.mudish-btngroup .mudish-btn:last-child { border-radius: 0 8px 8px 0; }
.mudish-btngroup .mudish-btn--filled { position: relative; z-index: 1; }

/* icon button */
.mudish-iconbtn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--primary); cursor: pointer;
    transition: background-color .15s ease;
}
.mudish-iconbtn:hover { background: rgba(var(--primary-rgb), .1); }
.mudish-iconbtn--error { color: var(--status-blocked); }
.mudish-iconbtn--error:hover { background: rgba(239,68,68,.12); }
.mudish-iconbtn--muted { color: var(--text-muted); }
.mudish-iconbtn--muted:hover { background: rgba(0,0,0,.06); }
.mudish-iconbtn svg { width: 19px; height: 19px; fill: currentColor; }
.mudish-iconbtn--sm { width: 24px; height: 24px; }
.mudish-iconbtn--sm svg { width: 16px; height: 16px; }

/* outlined inputs (text / number / date / select) */
.mudish-input, .mudish-select, .mudish-textarea {
    font: inherit; font-size: .875rem; color: var(--text); width: 100%;
    background: var(--surface); border: 1px solid rgba(0,0,0,.23); border-radius: 4px;
    padding: 7px 10px; min-height: 36px;
}
.mudish-input:hover, .mudish-select:hover, .mudish-textarea:hover { border-color: rgba(0,0,0,.45); }
.mudish-input:focus, .mudish-select:focus, .mudish-textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary);
}
.mudish-select { cursor: pointer; appearance: none; background-image: none; padding-right: 26px; }
.mudish-select-wrap { position: relative; display: block; }
.mudish-select-wrap::after {
    content: ""; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 0; height: 0; pointer-events: none;
    border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid var(--text-muted);
}
.mudish-textarea { resize: vertical; line-height: 1.55; }

.mudish-search { position: relative; flex: 0 1 300px; min-width: 190px; }
.mudish-search .mudish-input { padding-left: 34px; }
.mudish-search__icon {
    position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
    width: 19px; height: 19px; fill: var(--text-muted); pointer-events: none;
}
.mudish-search__clear { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }

/* menus (MudMenu stand-in) */
.mudish-menu {
    position: fixed; z-index: 1300; min-width: 200px; max-width: 320px;
    max-height: min(420px, 70vh); overflow-y: auto;
    background: var(--surface); border-radius: 4px; padding: 6px 0;
    box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);
}
.mudish-menuitem {
    display: flex; align-items: center; gap: 10px; width: 100%;
    font: inherit; font-size: .875rem; text-align: left; color: var(--text);
    background: none; border: 0; padding: 6px 16px; cursor: pointer;
}
.mudish-menuitem:hover { background: rgba(0,0,0,.04); }
.mudish-menuitem svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.mudish-menuitem__dot { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.mudish-menu__divider { height: 1px; background: var(--border); margin: 6px 0; }
.mudish-menu__pad { padding: 8px 12px; }

/* =========================================================================
   Board (ported from Tasks.razor)
   ========================================================================= */
.tasks-header {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
    padding: var(--space-4) var(--space-6) var(--space-2);
}
.tasks-header__crumbs { font-size: .78rem; color: var(--text-muted); }
.tasks-header__title { font-size: 1.5rem; font-weight: 500; margin: 2px 0 0; }
.tasks-header__actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }

.kanban-toolbar { padding: 4px 8px; margin: 0 var(--space-4) var(--space-2); }
.kanban-toolbar__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* Search sits left; every filter control is pushed to the right edge. */
.kanban-toolbar__spacer { flex: 1 1 auto; }
.kanban-filter-btn { text-transform: none; font-weight: 500; letter-spacing: 0; border-radius: 8px; }

.kanban-container { padding: 0 var(--space-4) var(--space-6); background: var(--bg); }
.kanban-board {
    display: flex; flex-direction: row; flex-wrap: nowrap; gap: var(--space-4);
    overflow-x: auto; overflow-y: hidden; min-height: 520px; padding: var(--space-4) 0 var(--space-2);
}
.kanban-column {
    display: flex; flex-direction: column;
    flex: 1 0 288px; min-width: 288px; max-height: 620px;
    background-color: transparent; border-radius: 12px; padding: 12px 10px 10px;
}
.kanban-column-header { flex-shrink: 0; margin-bottom: 8px; }
.kanban-status-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 6px 4px 4px; border-radius: 999px; color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.kanban-status-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 26px; height: 26px; padding: 0 8px;
    background: rgba(255,255,255,.92); color: var(--pill-color, #333);
    border-radius: 999px; font-size: .78rem; font-weight: 700; line-height: 1;
}
.kanban-status-name { flex: 1; font-size: .85rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-status-add {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0; border: 0; border-radius: 999px;
    background: rgba(255,255,255,.22); color: #fff; cursor: pointer; transition: background .15s ease;
}
.kanban-status-add:hover { background: rgba(255,255,255,.38); }
.kanban-status-add svg { width: 16px; height: 16px; fill: currentColor; }
.kanban-column-subtitle { margin-top: 4px; padding-left: 6px; font-size: .7rem; color: var(--text-muted); }

.kanban-dropzone { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 100px; padding: 2px; }
.kanban-dropzone.is-over { background: rgba(var(--primary-rgb), .06); border-radius: 10px; }
.kanban-column-empty { padding: var(--space-6) var(--space-3); text-align: center; color: var(--text-muted); font-size: .84rem; }

/* ----------------------------------------------------------------- card */
.kanban-card {
    background-color: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(17,24,39,.04), 0 1px 3px rgba(17,24,39,.06);
    margin: 6px 2px;
    cursor: grab;
    transition: box-shadow .15s ease, transform .15s ease;
    overflow: hidden;
    touch-action: pan-y; /* touch scrolls the column; a short hold starts a drag */
}
.kanban-card:hover { box-shadow: 0 2px 4px rgba(17,24,39,.06), 0 4px 10px rgba(17,24,39,.08); transform: translateY(-1px); }
.kanban-card:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .25); }
.kanban-card.is-dragging { opacity: .35; }

.kanban-card-cover { width: 100%; max-height: 160px; overflow: hidden; background-color: var(--surface-2); border-bottom: 1px solid var(--border); }
.kanban-card-cover img { display: block; width: 100%; max-height: 160px; object-fit: cover; }

.kanban-card-content { padding: 12px; }
.kanban-card-body { display: flex; flex-direction: column; gap: 8px; }
.kanban-card-line { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 4px; }
.kanban-card-badges { display: flex; flex-direction: row; align-items: center; gap: 8px; }

.kanban-title-row { font-size: .875rem; }
.kanban-title-row .kanban-card-id-actions {
    float: right; display: inline-flex; align-items: center; gap: 2px;
    margin-left: 6px; margin-bottom: 2px;
}
.kanban-open-details {
    display: inline-flex; align-items: center; justify-content: center;
    border: none; background: transparent; padding: 2px; border-radius: 4px; cursor: pointer;
    color: var(--text-disabled); transition: background-color .15s ease, color .15s ease;
}
.kanban-open-details:hover { background-color: rgba(60,108,195,.08); color: var(--primary); }
.kanban-open-details-icon { width: 15px; height: 15px; fill: currentColor; display: block; }

.kanban-title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis; word-break: break-word;
    font-weight: 600; font-size: .9rem; line-height: 1.35; color: var(--text);
}
.kanban-card-parent { font-size: .7rem; color: var(--text-muted); opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.task-id-badge {
    font-size: .78rem; font-weight: 600; font-family: monospace;
    color: var(--text-muted); background-color: transparent;
    padding: 2px 4px; border-radius: 4px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
    border: 0; transition: background-color .15s ease, color .15s ease;
}
.task-id-badge:hover { background-color: rgba(60,108,195,.08); color: var(--primary); }

.kanban-card-meta {
    font-size: .7rem; color: var(--text-muted); line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    display: flex; align-items: center; gap: 2px;
}
.kanban-card-meta-icon { width: .85rem; height: .85rem; fill: currentColor; opacity: .75; flex-shrink: 0; }

.kanban-pill-btn {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px;
    font: inherit; font-size: .7rem; font-weight: 500; line-height: 1;
    border: none; border-radius: 999px;
    color: var(--pill-color, var(--text-muted));
    background-color: color-mix(in srgb, var(--pill-color, transparent) 14%, transparent);
    cursor: pointer; white-space: nowrap; transition: background-color .15s ease;
}
.kanban-pill-btn:hover { background-color: color-mix(in srgb, var(--pill-color, var(--text-muted)) 24%, transparent); }
.kanban-pill-icon { width: .9rem; height: .9rem; fill: currentColor; flex-shrink: 0; }

.kanban-due { font-size: .7rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.kanban-due-overdue { color: var(--status-blocked); }

.hours-badge {
    display: inline-flex; align-items: center; gap: 2px;
    font: inherit; font-size: .7rem; font-weight: 500; color: var(--text-muted);
    background-color: rgba(60,108,195,.06); border: 0;
    padding: 2px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
    transition: background-color .15s ease, color .15s ease;
}
.hours-badge:hover { background-color: rgba(60,108,195,.18); color: var(--primary); }
.hours-badge .badge-icon { width: .85rem; height: .85rem; fill: currentColor; flex-shrink: 0; }

/* tag chips + quick add buttons (QuickTagPicker / QuickAssigneePicker) */
.quick-tag-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.quick-tag-chip {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px; font-size: .72rem; border-radius: 4px;
    border: 1px solid var(--tag-color); background-color: color-mix(in srgb, var(--tag-color) 10%, transparent);
    color: var(--tag-color); white-space: nowrap;
}
.quick-tag-chip svg { width: .8rem; height: .8rem; fill: currentColor; }
.quick-tag-chip__close { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; font-size: .9rem; line-height: 1; opacity: .75; }
.quick-tag-chip__close:hover { opacity: 1; }

.quick-assignee-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.quick-assignee-picker > .user-avatar { margin-left: -4px; cursor: pointer; }
.user-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%; flex: none;
    font-size: .65rem; font-weight: 600; color: #fff;
}
.user-avatar--lg { width: 32px; height: 32px; font-size: .78rem; }

.quick-add-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; padding: 0; border: none; border-radius: 50%;
    background-color: transparent; color: var(--text-muted); cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.quick-add-btn:hover { background-color: rgba(60,108,195,.12); color: var(--primary); }
.quick-add-icon { width: 1rem; height: 1rem; fill: currentColor; }

/* drag ghost + drop placeholder */
.kanban-drag-ghost {
    position: fixed; z-index: 1200; pointer-events: none;
    box-shadow: var(--shadow-lg); transform: rotate(2deg); opacity: .95;
    border-radius: 10px; overflow: hidden; background: var(--surface);
}
.kanban-drop-ph {
    border: 2px dashed rgba(var(--primary-rgb), .55);
    background: rgba(var(--primary-rgb), .07);
    border-radius: 10px; margin: 6px 2px;
}

/* inline "add a card" composer */
.kanban-composer { background: var(--surface); border: 1px solid var(--primary); border-radius: 10px; padding: 8px; margin: 6px 2px; }
.kanban-composer__actions { display: flex; gap: var(--space-2); margin-top: 8px; }

/* =========================================================================
   Task quick-view (.qe-* / .quickview-*) — ported from app.css
   ========================================================================= */
.quickview-backdrop {
    position: fixed; inset: 0; z-index: 1000; background: rgba(17,24,39,.5);
    display: flex; align-items: center; justify-content: center; padding: var(--space-6) var(--space-4);
}
.quickview-dialog {
    width: 100%; max-width: 1240px; max-height: calc(100vh - 64px);
    background: var(--surface); border-radius: 4px;
    box-shadow: 0 11px 15px -7px rgba(0,0,0,.2), 0 24px 38px 3px rgba(0,0,0,.14);
    display: flex; flex-direction: column; overflow: hidden;
}
.quickview-dialog__title { padding: 16px 24px 8px; }
.quickview-dialog__content { padding: 0 24px; overflow-y: auto; }
.quickview-dialog__actions { padding: 12px 24px 16px; }

.qe-header { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-width: 0; flex-wrap: wrap; }
.qe-header-heading { display: flex; flex-direction: column; min-width: 140px; flex: 1 1 220px; gap: 1px; }
.qe-header-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: 0 0 auto; }
.qe-sub-dot { color: var(--text-muted); margin: 0 4px; }

.quickview-id {
    flex: 0 0 auto; background: none; border: none; cursor: pointer;
    font-weight: 700; font-size: 1.35rem; line-height: 1; color: var(--text-muted);
    padding: 2px 4px; border-radius: 6px; transition: color .12s, background-color .12s;
}
.quickview-id:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.quickview-title-text { font-size: 1.25rem; font-weight: 500; line-height: 1.6; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.quickview-title-project { font-size: .78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quickview-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.quickview-empty { color: var(--text-muted); font-size: .84rem; }
.quickview-status-inline { display: inline-flex; align-items: center; gap: 6px; }
.quickview-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }

/* ----- Body: editor column + tabbed rail ----- */
.qe-body { display: flex; gap: var(--space-4); align-items: stretch; height: min(70vh, 700px); }
.qe-main { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); min-height: 0; }
.quickview-desc-section { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.quickview-editor { flex: 1 1 auto; min-height: 180px; display: flex; }
.quickview-editor textarea { flex: 1 1 auto; min-height: 0; border-radius: 4px; }
.qe-tags-row {
    display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
    padding-top: var(--space-1); border-top: 1px solid var(--border);
}
.qe-rail {
    flex: 0 0 400px; max-width: 420px; min-width: 0;
    display: flex; flex-direction: column; min-height: 0;
    border-left: 1px solid var(--border); padding-left: var(--space-4);
}

/* ----- Tab strip ----- */
.qe-tabstrip { display: flex; gap: 0; border-bottom: 1px solid var(--border); flex: 0 0 auto; overflow: hidden; }
.qe-tab {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    flex: 1 1 0; min-width: 0; background: none; border: none;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    padding: 8px 4px 9px; font: inherit; font-size: .8rem; font-weight: 500;
    color: var(--text-muted); cursor: pointer; white-space: nowrap;
}
.qe-tab > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.qe-tab:hover { color: var(--text); }
.qe-tab--active { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }
.qe-count {
    font-size: .68rem; font-weight: 600; padding: 1px 5px; border-radius: 6px;
    background: var(--surface-2); color: var(--text-muted);
}
.qe-tab--active .qe-count { background: var(--primary); color: #fff; }

/* ----- Panels ----- */
.qe-panels { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.qe-panel {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding: var(--space-4) 2px var(--space-4) 0;
    display: flex; flex-direction: column; gap: var(--space-4);
}
.qe-panel--comments { overflow: hidden; padding-bottom: 0; gap: 0; }

.qe-section { display: flex; flex-direction: column; gap: 6px; }
.qe-section-divider { height: 0; border-top: 1px solid var(--border); margin-block: calc(-1 * var(--space-2)); }
.qe-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.qe-section-head-actions { display: flex; align-items: center; gap: var(--space-3); }
.qe-link { background: none; border: none; padding: 0; font: inherit; font-size: .78rem; font-weight: 600; color: var(--primary); cursor: pointer; }
.qe-link:hover { text-decoration: underline; }

.qe-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.qe-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.qe-field-label { font-size: .72rem; color: var(--text-muted); }
.qe-subtasks { display: flex; flex-direction: column; gap: 6px; }
.qe-subtask { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text); }
.qe-subtask input { flex: 0 0 auto; cursor: pointer; accent-color: var(--primary); }
.qe-subtask-title { flex: 1; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-subtask-title:hover { color: var(--primary); }
.qe-subtask-done { text-decoration: line-through; color: var(--text-muted); }

/* Customer */
.qe-cust-head { display: flex; align-items: center; gap: var(--space-3); }
.qe-cust-avatar {
    width: 34px; height: 34px; flex: 0 0 auto; border-radius: 8px;
    display: grid; place-items: center; font-weight: 600; font-size: .8rem;
    background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary);
}
.qe-cust-headmain { min-width: 0; flex: 1 1 auto; }
.qe-cust-name { font-weight: 600; font-size: .95rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-contact-actions, .qe-addr-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.qe-btn {
    display: inline-flex; align-items: center; gap: 5px;
    height: 28px; padding: 0 12px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface);
    font: inherit; font-size: .78rem; font-weight: 600; color: var(--text);
    cursor: pointer; text-decoration: none;
}
.qe-btn:hover { border-color: var(--primary); color: var(--primary); }
.qe-btn svg { width: 15px; height: 15px; fill: currentColor; }
.qe-note { font-size: .82rem; line-height: 1.5; color: var(--text); white-space: pre-wrap; }

/* Items */
.qe-items { display: flex; flex-direction: column; }
.qe-item-row {
    display: grid; grid-template-columns: 1fr 40px 56px 64px 40px;
    align-items: center; gap: 4px; padding: 8px 0;
    border-top: 1px solid var(--border); font-size: .84rem;
}
.qe-item-head { border-top: none; color: var(--text-muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.qe-item-name { display: flex; flex-direction: column; min-width: 0; }
.qe-item-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-item-sub { font-size: .72rem; color: var(--text-muted); }
.qe-num { text-align: right; font-variant-numeric: tabular-nums; }
.qe-strong { font-weight: 600; }
.qe-item-actions { display: flex; justify-content: flex-end; align-items: center; }
.qe-item-subtotal {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 0 0; margin-top: 4px; border-top: 1px solid var(--border);
    font-size: .82rem; color: var(--text-muted);
}
.qe-item-subtotal strong { color: var(--text); }

/* Files */
.qe-file-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.qe-file-card {
    display: flex; flex-direction: column; text-align: left; position: relative;
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    background: none; cursor: pointer; padding: 0; color: inherit; text-decoration: none;
}
.qe-file-card:hover { border-color: var(--primary); text-decoration: none; }
.qe-file-thumb { height: 84px; display: grid; place-items: center; overflow: hidden; background: color-mix(in srgb, var(--text-muted) 8%, transparent); }
.qe-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qe-file-thumb svg { width: 2rem; height: 2rem; fill: var(--text-muted); }
.qe-file-meta { padding: 7px 8px; min-width: 0; }
.qe-file-name { display: block; font-size: .78rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qe-file-sub { font-size: .7rem; color: var(--text-muted); }
.qe-file-remove { position: absolute; top: 3px; right: 3px; background: rgba(255,255,255,.9); }
.qe-dropzone {
    border: 1px dashed var(--border); border-radius: var(--radius);
    padding: var(--space-4); text-align: center; color: var(--text-muted);
    background: var(--surface-2); cursor: pointer; font-size: .82rem;
}
.qe-dropzone:hover, .qe-dropzone.is-over { border-color: var(--primary); color: var(--primary); background: rgba(var(--primary-rgb), .06); }

/* Comments */
.qe-comments-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0; padding: 0 2px 0 0; }
.qe-comments-scroll > .qe-comment,
.qe-comments-scroll > .qe-activity { padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.qe-comments-scroll > .qe-comment:first-child,
.qe-comments-scroll > .qe-activity:first-child { border-top: none; }
.qe-comment { display: flex; gap: 9px; }
.qe-comment-avatar {
    width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%;
    display: grid; place-items: center; font-size: .7rem; font-weight: 600; color: #fff;
}
.qe-comment-body { min-width: 0; flex: 1; }
.qe-comment-head { font-size: .78rem; color: var(--text); }
.qe-comment-head strong { font-weight: 600; }
.qe-comment .comment-body { font-size: .84rem; line-height: 1.5; color: var(--text); margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.qe-activity-heading {
    font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); padding: var(--space-3) 0 4px; margin-top: var(--space-2);
    border-top: 1px solid var(--border);
}
.qe-activity-heading + .qe-activity { border-top: none !important; }
.qe-activity { display: flex; gap: 9px; align-items: flex-start; }
.qe-activity-dot { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--text-muted) 12%, transparent); }
.qe-activity-dot svg { width: .9rem; height: .9rem; fill: var(--text-muted); }
.qe-activity-text { font-size: .8rem; line-height: 1.45; color: var(--text-muted); }
.qe-activity-text strong { color: var(--text); font-weight: 600; }
.qe-comment-composer { flex: 0 0 auto; border-top: 1px solid var(--border); padding: var(--space-3) 0; }
.qe-comment-composer-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); }
.qe-muted { color: var(--text-muted); font-size: .78rem; }

/* ----- Footer ----- */
.qe-footer { display: flex; align-items: center; gap: var(--space-4); width: 100%; flex-wrap: wrap; }
.qe-footer-time { display: flex; align-items: center; gap: var(--space-2); font-size: .84rem; color: var(--text); }
.qe-footer-time > svg { width: 18px; height: 18px; fill: var(--text-muted); }
.qe-progress { width: 56px; height: 5px; border-radius: 3px; background: var(--border); position: relative; overflow: hidden; }
.qe-progress-fill { position: absolute; inset: 0 auto 0 0; background: var(--primary); border-radius: 3px; }
.qe-footer-divider { width: 1px; height: 22px; background: var(--border); }
.qe-footer-totals { display: flex; align-items: center; gap: var(--space-3); font-size: .82rem; color: var(--text-muted); }
.qe-billable { padding: 3px 9px; border-radius: var(--radius); background: color-mix(in srgb, var(--status-done) 16%, transparent); color: var(--status-done); font-weight: 600; }
.qe-footer-spacer { flex: 1 1 auto; }

/* small centred dialog (log time) */
.demo-dialog { width: 100%; max-width: 420px; background: var(--surface); border-radius: 4px; box-shadow: 0 11px 15px -7px rgba(0,0,0,.2), 0 24px 38px 3px rgba(0,0,0,.14); }
.demo-dialog__title { padding: 16px 24px 4px; font-size: 1.15rem; font-weight: 500; }
.demo-dialog__content { padding: 8px 24px 0; display: flex; flex-direction: column; gap: var(--space-3); }
.demo-dialog__actions { padding: 16px 24px; display: flex; justify-content: flex-end; gap: var(--space-2); }

/* preview banner inside read-only panels */
.qe-preview-note {
    background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.35);
    border-radius: var(--radius); padding: 8px 12px; font-size: .8rem; color: var(--text);
}

/* --------------------------------------------------------------- toasts */
.demo-toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1400; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.demo-toast {
    background: var(--text); color: #fff; font-size: .88rem; font-weight: 500;
    padding: 9px 18px; border-radius: 18px; box-shadow: var(--shadow-lg);
    max-width: min(440px, calc(100vw - 32px)); text-align: center;
    animation: demo-toast-in .18s ease both;
}
@keyframes demo-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .demo-toast { animation: none; } }

/* ------------------------------------------------------- timeline view */
.demo-timeline { padding: var(--space-4) var(--space-6) var(--space-6); background: var(--bg); }
.demo-timeline__note {
    background: rgba(var(--primary-rgb), .08); border: 1px solid rgba(var(--primary-rgb), .3);
    border-radius: var(--radius); padding: var(--space-3) var(--space-4);
    font-size: .9rem; margin-bottom: var(--space-4);
}
.demo-timeline__figure {
    margin: 0; border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); line-height: 0;
}
.demo-timeline__figure img { width: 100%; height: auto; display: block; }
.demo-timeline__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }

/* -------------------------------------------------------- what to try */
.demo-try-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-6); }

/* The "things worth trying" cards use the site-wide branded icon tile (site.css). */

/* ---------------------------------------------------------- responsive */
@media (max-width: 900px) {
    .qe-body { height: auto; flex-direction: column; }
    .qe-main { height: auto; }
    .qe-rail { flex-basis: auto; max-width: none; border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: var(--space-3); min-height: 360px; }
    .quickview-dialog { max-height: calc(100vh - 32px); }
    .quickview-backdrop { padding: var(--space-4) var(--space-2); align-items: flex-start; }
}
@media (max-width: 780px) {
    .kanban-column { flex: 0 0 264px; min-width: 264px; padding: 8px 6px 6px; }
    .qe-fields-grid { grid-template-columns: 1fr; }
    .qe-file-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .mudish-search { flex: 1 1 100%; max-width: none; }
    .tasks-header__actions { margin-left: 0; width: 100%; overflow-x: auto; }
}
