/* Tickets (Diamond.Tickets.Blazor). Moved from Diamond.AppHost app.css in Phase 2b with the rule order
   kept: the generic tk- rules that sat in the Users section stay between the first and second blocks, so
   which rule wins is unchanged. Pages also use host shell classes (action-button, empty-state, sc-modal,
   sc-edit-hint, sc-token, sc-edit-errors, upc-status); a host without them styles those itself. */

/* Ticket colors (also defined in Diamond.AppHost app.css; identical). */
:root {
    --tk-bad: #B3273A;
    --tk-bad-soft: #FBE7EB;
    --tk-warn-soft: #FBEEDC;
    --tk-good-soft: #DDF3E8;
    --tk-purple: #5B4B9E;
    --tk-purple-soft: #E8E3F7;
    --tk-amber: #8A6A00;
    --tk-amber-soft: #FFF5D6;
}

/* ── Tickets ───────────────────────────────────────────────────────────────────────── */

.tk-page {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    position: relative;
}

.tk-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tk-head h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.tk-head-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tk-new {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tk-new svg {
    width: 1rem;
    height: 1rem;
}

.tk-seg {
    display: inline-flex;
    background: var(--field);
    border-radius: var(--r-sm);
    padding: 3px;
    gap: 2px;
}

.tk-seg button {
    border: none;
    background: none;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.tk-seg button.on {
    background: var(--card);
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(20, 40, 63, 0.14);
}

.tk-seg button:disabled {
    opacity: 0.35;
    cursor: default;
}

.tk-seg-wide {
    display: flex;
}

.tk-seg-wide button {
    flex: 1;
}

.tk-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.6rem;
}

.tk-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.6rem 0.8rem;
    text-align: left;
    color: var(--ink);
}

button.tk-stat:hover {
    border-color: var(--accent);
}

.tk-stat-v {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.tk-stat-k {
    font-size: 0.76rem;
    color: var(--muted);
}

.tk-stat-bad .tk-stat-v { color: var(--tk-bad); }
.tk-stat-warn .tk-stat-v { color: var(--warn); }

.tk-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.tk-filters select, .tk-search {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0.45rem 0.6rem;
    font-size: 0.86rem;
    color: var(--ink);
    font-family: inherit;
}

.tk-search {
    flex: 1 1 15rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.tk-search svg {
    width: 1rem;
    height: 1rem;
    color: var(--muted);
    flex: none;
}

.tk-search input {
    border: none;
    outline: none;
    background: none;
    font: inherit;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.tk-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.84rem;
    color: var(--muted);
    cursor: pointer;
}

.tk-hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
}

/* Board: assignee lanes × status columns (desktop only; phones use .tk-groups). */
.tk-board {
    display: grid;
    grid-template-columns: 11rem repeat(var(--tk-cols, 4), minmax(12rem, 1fr));
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: auto;
}

.tk-colhead {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.7rem;
    background: var(--ground);
    border-bottom: 1px solid var(--line);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.tk-lanecol {
    border-right: 1px solid var(--line);
}

.tk-count {
    background: var(--field);
    border-radius: 999px;
    padding: 0 0.45rem;
    font-variant-numeric: tabular-nums;
}

.tk-lanehead {
    padding: 0.7rem;
    background: var(--ground);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tk-lane-total {
    font-size: 0.75rem;
    color: var(--muted);
}

.tk-who {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 650;
    font-size: 0.88rem;
}

.tk-avatar {
    flex: none;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--accent);
}

.tk-avatar-sys {
    background: var(--field);
    color: var(--muted);
}

.tk-cell {
    padding: 0.5rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 3.5rem;
    min-width: 0;
}

.tk-card {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--r-md);
    padding: 0.5rem 0.65rem;
    box-shadow: var(--sh-card);
    font-size: 0.82rem;
    min-width: 0;
}

.tk-card:hover {
    border-color: var(--accent);
    box-shadow: var(--sh-pop);
}

.tk-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.tk-card-work {
    border-left-style: dashed;
}

.tk-stripe-warn { border-left-color: var(--warn); }
.tk-stripe-bad { border-left-color: var(--tk-bad); }
.tk-stripe-ok { border-left-color: var(--good); }

.tk-card-top {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--muted);
    font-size: 0.74rem;
    min-width: 0;
}

.tk-card-number {
    font-family: Consolas, monospace;
}

.tk-card-category {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tk-card-headline {
    font-weight: 650;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.tk-card-title {
    color: var(--ink);
    overflow-wrap: anywhere;
}

.tk-card-line {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.tk-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.3rem;
    flex-wrap: wrap;
}

.tk-card-due {
    font-size: 0.75rem;
}

.tk-type {
    display: inline-flex;
    align-items: center;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.tk-type-wt {
    background: var(--tk-good-soft);
    color: #176B47;
}

.tk-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    font-weight: 650;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--field);
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tk-chip-lg {
    font-size: 0.84rem;
    padding: 0.35rem 0.75rem;
}

.tk-st-new { background: var(--accent-soft); color: var(--accent-deep); }
.tk-st-research { background: var(--tk-purple-soft); color: var(--tk-purple); }
.tk-st-customer { background: var(--tk-warn-soft); color: var(--warn); }
.tk-st-internal { background: var(--tk-amber-soft); color: var(--tk-amber); }
.tk-st-resolved { background: var(--tk-good-soft); color: var(--good); }
.tk-st-closed { background: var(--field); color: var(--muted); }

.tk-age-ok { background: var(--field); color: var(--muted); }
.tk-age-warn { background: var(--tk-warn-soft); color: var(--warn); }
.tk-age-bad { background: var(--tk-bad-soft); color: var(--tk-bad); }

.tk-due { color: var(--muted); font-size: 0.78rem; }
.tk-due-soon { color: var(--warn); font-weight: 600; font-size: 0.78rem; }
.tk-due-over { color: var(--tk-bad); font-weight: 700; font-size: 0.78rem; }

.tk-money {
    font-family: Consolas, monospace;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tk-neg { color: var(--tk-bad); }
.tk-mono { font-family: Consolas, monospace; }
.tk-strong { font-weight: 650; }
.tk-muted { color: var(--muted); }
.tk-warn-text { color: var(--warn); font-size: 0.86rem; }
.tk-priority-high { color: var(--tk-bad); font-weight: 700; }

.tk-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-deep);
    font-weight: 600;
    font-size: 0.84rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

/* List view */
.tk-table-wrap {
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}

.tk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.tk-table th {
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    padding: 0.6rem 0.7rem;
    background: var(--ground);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.tk-table td {
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.tk-table .r { text-align: right; }

.tk-table a {
    color: var(--accent-deep);
    font-weight: 600;
    text-decoration: none;
}

.tk-row-link {
    cursor: pointer;
}

.tk-row-link:hover td {
    background: var(--field);
}

/* Phone groups (lanes as collapsible lists) */
.tk-groups {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
}

.tk-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tk-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 0.3rem 0.1rem;
    color: var(--ink);
}

.tk-fab {
    display: none;
}

/* Forms and detail */
.tk-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-card);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tk-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: 1rem;
    align-items: start;
}

.tk-side {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.tk-main {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.tk-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 0.9rem;
}

.tk-span-2 {
    grid-column: 1 / -1;
}

.tk-field, .tk-details {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.76rem;
    font-weight: 650;
    color: var(--muted);
    min-width: 0;
}

.tk-field-label {
    font-size: 0.76rem;
    font-weight: 650;
    color: var(--muted);
}

.tk-field input, .tk-field select, .tk-field textarea,
.tk-details textarea, .tk-textarea, .tk-composer textarea, .tk-tokens select {
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.55rem 0.7rem;
    font-size: 0.92rem;
    color: var(--ink);
    font-family: inherit;
    font-weight: 400;
    width: 100%;
    min-width: 0;
}

.tk-field input.tk-mono {
    font-family: Consolas, monospace;
}

.tk-field input:focus, .tk-field select:focus, .tk-field textarea:focus,
.tk-details textarea:focus, .tk-textarea:focus, .tk-composer textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    background: var(--card);
}

.tk-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.tk-tokens select {
    width: auto;
    padding: 0.3rem 0.5rem;
    font-size: 0.82rem;
}

.tk-variance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--field);
    border-radius: var(--r-md);
    padding: 0.55rem 0.7rem;
    font-size: 0.95rem;
    color: var(--ink);
}

.tk-variance-neg { background: var(--tk-bad-soft); }
.tk-variance-neg .tk-money { color: var(--tk-bad); }
.tk-variance-pos { background: var(--tk-good-soft); }

.tk-picker {
    position: relative;
}

.tk-picker input {
    width: 100%;
}

.tk-picker-chosen {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.55rem 0.7rem;
    font-size: 0.92rem;
    color: var(--ink);
    font-weight: 400;
}

.tk-picker-list {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    max-height: 18rem;
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-pop);
    display: flex;
    flex-direction: column;
}

.tk-picker-group, .tk-picker-buyer {
    border: none;
    background: none;
    text-align: left;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.86rem;
    color: var(--ink);
    font-weight: 600;
}

.tk-picker-group {
    background: var(--ground);
    border-top: 1px solid var(--line);
}

.tk-picker-group:first-child {
    border-top: none;
}

.tk-picker-buyer {
    padding-left: 1.5rem;
    font-weight: 400;
}

.tk-picker-group, .tk-picker-buyer { cursor: pointer; }

.tk-picker-group:hover, .tk-picker-buyer:hover, .tk-picker-active {
    background: var(--accent-soft);
}

.tk-picker-more {
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.tk-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-radius: var(--r-md);
    padding: 0.65rem 0.85rem;
    font-size: 0.88rem;
}

.tk-banner-warn {
    background: var(--tk-warn-soft);
    border: 1px solid #E8C79C;
    color: #7A4410;
}

.tk-banner-bad {
    background: var(--tk-bad-soft);
    border: 1px solid #E6B8B8;
    color: #8C2B2B;
}

.tk-banner-actions, .tk-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.tk-actions {
    justify-content: flex-end;
}

.tk-composer-hint {
    margin-right: auto;
    font-size: 0.78rem;
}

.tk-dhead {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.tk-dhead-main {
    min-width: 0;
    flex: 1 1 24rem;
}

.tk-dhead-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.tk-dhead-actions select {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0.45rem 0.6rem;
    font-size: 0.86rem;
    font-family: inherit;
    color: var(--ink);
}

.tk-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--muted);
}

.tk-title {
    margin: 0.35rem 0 0.15rem;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.tk-subline {
    color: var(--muted);
    font-size: 0.88rem;
}

.tk-resolve {
    border-color: var(--good);
}

/* Snooze: quick picks plus a date, in a panel under the header. */
.tk-snooze {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tk-snooze-picks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.tk-snooze-picks button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    color: var(--ink);
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.tk-snooze-picks button:hover:not(:disabled) {
    border-color: var(--accent);
}

.tk-snooze-custom {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.tk-snooze-custom .tk-field {
    flex: 0 1 220px;
}

.tk-snooze-chip {
    background: var(--field);
    color: var(--muted);
}

.tk-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tk-ev {
    display: grid;
    grid-template-columns: 1.9rem minmax(0, 1fr);
    gap: 0.6rem;
    align-items: start;
}

.tk-ev .tk-avatar {
    width: 1.8rem;
    height: 1.8rem;
}

.tk-sys {
    padding-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.tk-sys b {
    color: var(--ink);
    font-weight: 600;
}

.tk-comment {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 0.65rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.tk-comment-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.tk-comment-head b {
    color: var(--ink);
}

.tk-comment-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
}

.tk-composer {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tk-kv {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem 0.9rem;
    margin: 0;
}

.tk-kv dt {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.tk-kv dd {
    margin: 0.1rem 0 0;
    font-weight: 600;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.tk-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--line);
}

.tk-tabs button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 0.5rem 0.8rem;
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--muted);
}

.tk-tabs button.on {
    color: var(--accent-deep);
    border-bottom-color: var(--accent);
}

.tk-prefs-page {
    max-width: 46rem;
    width: 100%;
    margin: 0 auto;
}

.tk-prefs-email {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.tk-prefs-app {
    margin: 0.4rem 0 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.tk-pref {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.tk-pref-text {
    flex: 1 1 14rem;
    font-size: 0.86rem;
}

.tk-phone-only { display: none; }
.tk-sticky-actions { display: none; }

@media (max-width: 979.98px) {
    .tk-board { display: none; }
    .tk-table-wrap { display: none; }
    .tk-groups { display: flex; }

    .tk-detail-grid { grid-template-columns: minmax(0, 1fr); }

    .tk-fab {
        display: grid;
        place-items: center;
        position: fixed;
        right: 1rem;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        width: 3.25rem;
        height: 3.25rem;
        border-radius: 50%;
        border: none;
        background: var(--accent);
        color: var(--on-accent);
        box-shadow: 0 8px 20px rgba(20, 40, 63, 0.3);
        z-index: 50;
    }

    .tk-fab svg {
        width: 1.5rem;
        height: 1.5rem;
    }

    .tk-new { display: none; }
}

@media (max-width: 640px) {
    .tk-form-grid, .tk-kv { grid-template-columns: minmax(0, 1fr); }

    .tk-head-actions .tk-seg { flex: 1; }
    .tk-head-actions .tk-seg button { flex: 1; }

    .tk-desktop-only { display: none; }
    .tk-phone-only { display: flex; }
    .tk-phone-hidden { display: none; }

    .tk-sticky-actions {
        display: flex;
        position: sticky;
        bottom: 0;
        gap: 0.5rem;
        justify-content: flex-end;
        padding: 0.6rem 0 calc(0.6rem + env(safe-area-inset-bottom, 0px));
        background: var(--ground);
        border-top: 1px solid var(--line);
        z-index: 40;
    }

    .tk-sticky-actions .action-button { flex: 1; }

    .tk-new-page .tk-fab, .tk-ticket-page .tk-fab { display: none; }

    .tk-dhead-actions { width: 100%; }
    .tk-dhead-actions select { flex: 1; }

    .tk-seg-channels { width: 100%; }
    .tk-seg-channels button { flex: 1; padding: 0.45rem 0.3rem; }

    .tk-filters select { flex: 1 1 45%; }
}

/* ── Tickets: generic rules formerly in the Users (Admin) section ──────────────────── */

.tk-new-always {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tk-new-always svg {
    width: 1rem;
    height: 1rem;
}

.tk-banner-ok {
    background: var(--tk-good-soft);
    border: 1px solid #A9D9C1;
    color: #145C3D;
}

.tk-phone-flex { display: none; }

/* .tk-field stretches inputs to full width; checkboxes and radios keep their own size. */
.tk-field input[type="checkbox"], .tk-field input[type="radio"] {
    width: auto;
    flex: none;
}

@media (max-width: 979.98px) {
    .tk-phone-flex { display: inline-flex; }
}

/* ── Tickets: attachments and pasted email (Phase 2) ───────────────────────────────── */

.tk-hidden-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.tk-attach-buttons {
    display: inline-flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tk-attach-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.84rem;
    overflow: hidden;
}

.tk-attach-btn svg {
    width: 1rem;
    height: 1rem;
}

.tk-attach-btn:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.tk-camera-btn { display: none; }

.tk-composer .tk-actions { justify-content: flex-start; }
.tk-composer .tk-actions > .action-button:last-child { margin-left: auto; }

.tk-dropzone {
    position: relative;
}

.tk-dropzone-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: none;
    place-items: center;
    border: 2px dashed var(--accent);
    border-radius: var(--r-lg);
    background: rgba(220, 235, 248, 0.92);
    color: var(--accent-deep);
    font-weight: 650;
}

.tk-dropzone-overlay span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    pointer-events: none;
}

.tk-dropzone-overlay svg { width: 1.2rem; height: 1.2rem; }

.tk-dropzone-overlay input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: copy;
}

.tk-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.tk-files-stack {
    flex-direction: column;
    align-items: stretch;
}

.tk-file {
    display: inline-flex;
    align-items: stretch;
    max-width: 100%;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 0.8rem;
    min-width: 0;
}

.tk-file-open {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    padding: 0.3rem 0.5rem;
    color: var(--ink);
    min-width: 0;
    text-align: left;
    flex: 1;
}

.tk-file-open:hover:not(:disabled) .tk-file-name { text-decoration: underline; }
.tk-file-open:disabled { cursor: default; }

.tk-file-badge {
    flex: none;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
    background: var(--muted);
    border-radius: 3px;
    padding: 0.1rem 0.25rem;
}

.tk-file-pdf { background: var(--tk-bad); }
.tk-file-image { background: var(--accent); }
.tk-file-sheet { background: var(--good); }
.tk-file-doc { background: var(--accent-deep); }
.tk-file-email { background: var(--tk-purple); }

.tk-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.tk-file-size {
    flex: none;
    color: var(--muted);
    font-size: 0.72rem;
}

.tk-file-act {
    background: none;
    border: none;
    border-left: 1px solid var(--line);
    color: var(--muted);
    padding: 0 0.5rem;
    font-size: 0.95rem;
}

.tk-file-act:hover { color: var(--ink); background: var(--card); }

.tk-file-removed { opacity: 0.6; }
.tk-file-removed .tk-file-name { text-decoration: line-through; }

.tk-removed-file {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
}

.tk-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.tk-panel-head .tk-camera-btn { display: none; }

.tk-paste-offer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    background: var(--accent-soft);
    color: var(--accent-deep);
    border-radius: var(--r-md);
    padding: 0.5rem 0.7rem;
    font-size: 0.84rem;
}

.tk-pasted-email {
    border: 1px solid var(--line);
    border-left: 3px solid var(--tk-purple);
    border-radius: var(--r-md);
    background: var(--ground);
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
}

.tk-pasted-email-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.tk-pasted-email-text {
    color: var(--muted);
    overflow-wrap: anywhere;
}

/* Sanitized pasted email inside a comment. */
.tk-comment-html {
    white-space: normal;
}

.tk-comment-html p { margin: 0 0 0.5rem; }

.tk-comment-html blockquote {
    margin: 0.4rem 0 0;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--tk-purple);
    border-radius: var(--r-md);
    background: var(--ground);
    font-size: 0.85rem;
    overflow-x: auto;
    max-height: 28rem;
    overflow-y: auto;
}

.tk-comment-html blockquote p { margin: 0 0 0.4rem; }

.tk-comment-html table {
    border-collapse: collapse;
    font-size: 0.8rem;
}

.tk-comment-html td, .tk-comment-html th {
    border: 1px solid var(--line);
    padding: 0.2rem 0.4rem;
    vertical-align: top;
}

@media (max-width: 979.98px) {
    .tk-camera-btn, .tk-panel-head .tk-camera-btn { display: inline-flex; }
}

/* ── Phase 4: drag and drop, bulk, shortcuts, settings ─────────────────────────────── */

.tk-board .tk-card[draggable="true"] { cursor: grab; }
.tk-board.tk-dragging .tk-cell { outline: 1px dashed transparent; }
.tk-board.tk-dragging .tk-cell.tk-drop {
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
    background: var(--accent-soft);
}

.tk-selcol { width: 2.2rem; text-align: center; }
.tk-selcol input { width: auto; cursor: pointer; }
.tk-row-selected td { background: var(--accent-soft); }

.tk-bulkbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--accent);
    border-radius: var(--r-md);
    background: var(--card);
    box-shadow: var(--sh-card);
}

.tk-bulk-problems {
    margin: 0.25rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.88rem;
}

.tk-kbd-hint {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.tk-shortcuts dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 0.9rem;
    margin: 0 0 0.75rem;
}

.tk-shortcuts dt, .tk-shortcuts dd { margin: 0; }

kbd {
    display: inline-block;
    min-width: 1.6rem;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: var(--r-sm);
    background: var(--field);
    font: 600 0.82rem ui-monospace, SFMono-Regular, Consolas, monospace;
    text-align: center;
}

.tk-settings-page .tk-seg { margin: 0.25rem 0 1rem; }
.tk-options { margin-bottom: 1rem; }

.tk-option-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.tk-option {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
}

.tk-option-retired .tk-option-text { opacity: 0.6; }

.tk-option-move { display: flex; flex-direction: column; }
.tk-option-move button {
    border: none;
    background: none;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1;
    padding: 0.1rem 0.3rem;
    cursor: pointer;
}
.tk-option-move button:disabled { opacity: 0.3; cursor: default; }

.tk-option-text {
    flex: 1 1 12rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tk-option-count { white-space: nowrap; }

.tk-option-input, .tk-option-add input {
    flex: 1 1 14rem;
    min-width: 0;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    color: var(--ink);
    font: inherit;
}

.tk-option-add { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Drop zones: the overlay shows while files are dragged anywhere over the page (JS adds the class). */
.tk-dropzone-on .tk-dropzone-overlay { display: grid; pointer-events: none; }
.tk-dropzone-input { display: none; }

/* "← All tickets" above a ticket. */
.tk-backlink {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
    color: var(--accent-deep);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
}
.tk-backlink:hover { text-decoration: underline; }

/* Ticket page, layout A: description card, quiet feed with a history toggle, one Details panel. */
.tk-byline { margin-top: 0.15rem; }
.tk-phone-only-inline { display: none; }
@media (max-width: 979.98px) { .tk-phone-only-inline { display: inline; } }
.tk-desc {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}
.tk-desc .tk-comment-body { font-size: 0.95rem; }
.tk-history-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    margin: 0.2rem 0 0.8rem;
    padding: 0.2rem 0.25rem;
    border: none;
    background: none;
    color: var(--accent-deep);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.tk-history-toggle span:first-child { white-space: nowrap; }
.tk-history-rule { flex: 1; height: 1px; background: var(--line); }
.tk-history-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.tk-details { gap: 0; }
.tk-details .tk-panel-head { margin-bottom: 0.4rem; }
.tk-details-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-block: 0.8rem;
    border-top: 1px solid var(--line);
}
.tk-details-section.tk-details-first { border-top: none; padding-top: 0.2rem; }
.tk-details-edit { padding-bottom: 0.8rem; display: flex; flex-direction: column; gap: 0.6rem; }
.tk-details-section:last-child { padding-bottom: 0; }

/* Required-field marker and the note that explains it. */
.tk-req { color: var(--tk-bad, #B3273A); margin-left: 0.15rem; font-weight: 700; }
.tk-req-note { color: var(--muted); font-size: 0.8rem; }
/* Phone list: one flat list instead of groups. */
.tk-flat { gap: 0.6rem; }
.tk-card-assignee { color: var(--muted); font-size: 0.78rem; }

/* ════ Tickets refresh, option C: roomy and warm (2026-10-09) ════ */
:root {
    --tkc-teal: #138A8A;   --tkc-teal-soft: #E3F3F2;
    --tkc-plum: #8E4F9E;   --tkc-plum-soft: #F4ECF7;
    --tkc-amber: #D98A1C;  --tkc-amber-soft: #FDF2E2;  --tkc-amber-ink: #9C5F0E;
    --tkc-coral: #D9534F;  --tkc-coral-soft: #FCE9E8;
    --tkc-mint: #2F9E6E;   --tkc-mint-soft: #E6F5EE;
    --tkc-blue-soft: #E8F1FB;
    --tkc-card-line: #E6EAF0;
}

.tkc-late { color: var(--tkc-coral); font-weight: 700; }
.tkc-soon { color: var(--tkc-amber-ink); font-weight: 600; }
.tkc-grow { flex: 1; }
.tkc-type { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; color: #fff; border-radius: 0.35rem; padding: 0.12rem 0.4rem; line-height: 1.2; }
.tkc-type-ar { background: var(--tkc-teal); }
.tkc-type-wt { background: var(--tkc-plum); }

/* Board: one column per person. */
.tkc-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: 1rem; align-items: start; }
.tkc-lane { display: flex; flex-direction: column; gap: 0.65rem; min-width: 0; }
.tkc-lane-head { display: flex; align-items: center; gap: 0.6rem; }
.tkc-lane-head b { display: block; font-size: 0.98rem; }
.tkc-lane-head small { color: var(--muted); font-size: 0.78rem; }
.tkc-av { width: 2rem; height: 2rem; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.84rem; flex: 0 0 auto; }
.tkc-lane-cards { display: flex; flex-direction: column; gap: 0.65rem; min-height: 4rem; border-radius: 1rem; padding: 0.15rem; }
.tk-board.tk-dragging .tkc-lane-cards { outline: 2px dashed transparent; }
.tk-board.tk-dragging .tkc-lane-cards.tk-drop { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--accent-soft); }
.tkc-drag-hint { margin-top: 0.25rem; }

/* The card. */
.tkc {
    position: relative; display: flex; flex-direction: column; gap: 0.35rem;
    background: var(--card); border: 1px solid var(--tkc-card-line); border-radius: 1rem;
    padding: 0.75rem 0.9rem; font-size: 0.82rem; min-width: 0;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.tkc:hover { border-color: #C9D5E2; box-shadow: 0 6px 18px rgba(20, 40, 63, 0.08); }
.tkc:focus-within { border-color: var(--accent); }
.tkc-drag { cursor: grab; }
.tkc-top { display: flex; align-items: center; gap: 0.4rem; }
.tkc-high { font-size: 0.66rem; font-weight: 800; color: var(--tkc-coral); text-transform: uppercase; letter-spacing: 0.05em; }
.tkc-title { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.93rem; line-height: 1.3; overflow-wrap: anywhere; }
.tkc-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tkc-title:focus-visible { outline: none; }
.tkc-title:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.tkc-sub { color: var(--ink); opacity: 0.8; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tkc-meta { color: var(--muted); font-size: 0.76rem; overflow-wrap: anywhere; }
.tkc-num { font-family: Consolas, ui-monospace, monospace; }
.tkc-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--muted); flex-wrap: wrap; }

.tkc-status {
    position: relative; z-index: 2;
    border: none; border-radius: 999px; padding: 0.15rem 0.6rem; font: inherit; font-size: 0.72rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: 0.35rem; line-height: 1.4; max-width: 12rem;
}
span.tkc-status::before { content: ""; width: 0.38rem; height: 0.38rem; border-radius: 50%; background: currentColor; }
select.tkc-status { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 1.3rem;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 0.65rem) 55%, calc(100% - 0.4rem) 55%; background-size: 0.25rem 0.25rem; background-repeat: no-repeat; }
select.tkc-status:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tkc-s-new { background-color: var(--tkc-blue-soft); color: var(--accent-deep); }
.tkc-s-res { background-color: var(--tkc-amber-soft); color: var(--tkc-amber-ink); }
.tkc-s-cus { background-color: var(--tkc-plum-soft); color: var(--tkc-plum); }
.tkc-s-int { background-color: var(--tkc-teal-soft); color: var(--tkc-teal); }
.tkc-s-done { background-color: var(--tkc-mint-soft); color: var(--tkc-mint); }
.tkc-s-closed { background-color: var(--field); color: var(--muted); }

.tkc-meter { height: 0.32rem; border-radius: 999px; background: #EDF0F4; overflow: hidden; display: block; }
.tkc-meter i { display: block; height: 100%; border-radius: 999px; }
.tkc-m-ok { background: var(--tkc-mint); }
.tkc-m-aging { background: #E2B23B; }
.tkc-m-warn { background: var(--tkc-amber); }
.tkc-m-bad { background: var(--tkc-coral); }
.tkc-m-snooze { background: #AFC0D1; }
.tkc-overdue { border-color: #F2C9C7; }

/* Phone groups and list reuse the card. */
.tk-groups .tkc { margin: 0; }
.tk-group { gap: 0.6rem; }

/* Home tile line. */
/* Tickets home tile: count of tickets assigned to you, top right; red when any are overdue. */
.app-tile { position: relative; }
.app-tile-badge {
    position: absolute; top: 0.6rem; right: 0.6rem;
    min-width: 1.5rem; height: 1.5rem; padding: 0 0.4rem; border-radius: 999px;
    display: inline-grid; place-items: center;
    background: #fff; color: var(--accent-deep); font-size: 0.78rem; font-weight: 800; font-variant-numeric: tabular-nums;
    box-shadow: 0 1px 3px rgba(20, 40, 63, 0.25);
}
.app-tile-badge-late { background: var(--tkc-coral); color: #fff; }

/* Type tags elsewhere (list, ticket page) follow the same teal/plum. */
.tk-type-ar { background: var(--tkc-teal-soft) !important; color: var(--tkc-teal) !important; }
.tk-type-wt { background: var(--tkc-plum-soft) !important; color: var(--tkc-plum) !important; }

/* Option C board: no outer frame or cell rules from the status grid. */
.tk-board.tkc-board { background: transparent; border: none; border-radius: 0; overflow: visible; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); }
.tk-cell.tkc-lane-cards { border-bottom: none; padding: 0.15rem; min-height: 4rem; }

/* Board layout B (2026-10-09): a white panel per person, status columns inside. */
.tk-board.tkc-board.tkc-panels { display: flex; flex-direction: column; align-items: stretch; gap: 1rem; }
.tkc-panel { background: var(--card); border: 1px solid var(--tkc-card-line); border-radius: 1.1rem; padding: 0.85rem 0.9rem 0.95rem; box-shadow: 0 1px 3px rgba(20, 40, 63, 0.06); display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.tkc-cols { display: grid; grid-template-columns: repeat(var(--tkc-cols, 4), minmax(13rem, 1fr)); gap: 0.65rem; overflow-x: auto; padding-bottom: 0.1rem; }
.tkc-col { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.tkc-colname { display: flex; justify-content: space-between; align-items: center; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); padding: 0 0.2rem; }
.tkc-colname b { font-size: 0.72rem; color: var(--ink); background: var(--field); border-radius: 999px; padding: 0 0.45rem; letter-spacing: 0; }
.tk-cell.tkc-stack { background: #F5F8FB; border: none; border-radius: 0.8rem; padding: 0.4rem; min-height: 4.5rem; gap: 0.5rem; flex: 1 1 auto; align-content: flex-start; justify-content: flex-start; }
.tkc-stack .tkc { box-shadow: 0 1px 2px rgba(20, 40, 63, 0.08); }
.tk-board.tk-dragging .tkc-stack.tk-drop { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }

/* ════ Forms refresh (2026-10-09): white fields, grey border, blue focus ring, labels in ink ════
   Applies to every form built on the Tickets field classes: New ticket, the ticket edit panel,
   Ticket settings, Users and Notification preferences. */
.tk-field, .tk-details { color: var(--ink); font-size: 0.8rem; gap: 0.35rem; }
.tk-field-label { color: var(--ink); font-size: 0.8rem; }
.tk-field input, .tk-field select, .tk-field textarea,
.tk-details textarea, .tk-textarea, .tk-composer textarea, .tk-tokens select, .tk-picker input {
    background: #fff;
    border: 1px solid #CFD8E3;
    border-radius: 0.65rem;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.tk-field input:hover, .tk-field select:hover, .tk-field textarea:hover,
.tk-details textarea:hover, .tk-composer textarea:hover, .tk-picker input:hover { border-color: #AFC0D1; }
.tk-field input:focus, .tk-field select:focus, .tk-field textarea:focus,
.tk-details textarea:focus, .tk-textarea:focus, .tk-composer textarea:focus, .tk-tokens select:focus, .tk-picker input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(46, 124, 192, 0.18);
    background: #fff;
}
.tk-field input::placeholder, .tk-field textarea::placeholder, .tk-details textarea::placeholder,
.tk-composer textarea::placeholder, .tk-picker input::placeholder { color: #8C9CAD; }
.tk-field input[type="checkbox"], .tk-field input[type="radio"] { box-shadow: none; }
.tk-variance { background: #F2F5F8; border-radius: 0.65rem; }
.tk-variance-neg { background: var(--tkc-coral-soft); }
.tk-variance-neg .tk-money { color: #A93A36; }
.tk-variance-pos { background: var(--tkc-mint-soft); }

/* New ticket, option A: type tiles, numbered sections, pinned Save/Cancel. */
.ntk { gap: 1rem; padding-bottom: 0; }
/* Header: the board's navy band (.tkb-hero) with a back link above the title. */
.ntk-hero { display: flex; flex-direction: column; gap: 0.35rem; }
.ntk-hero-flat { padding-bottom: 1.1rem; }
.ntk-backlink { color: rgba(255, 255, 255, 0.75); text-decoration: none; font-size: 0.85rem; font-weight: 600; align-self: flex-start; }
.ntk-backlink:hover { color: #fff; text-decoration: underline; }
.ntk-backlink:focus-visible { outline: 2px solid #4FB3FF; outline-offset: 2px; border-radius: 4px; }
.ntk-req-note { color: rgba(255, 255, 255, 0.75); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.ntk-req-note .tk-req { color: #FF9C96; }

/* Type tiles pull up over the band's bottom edge, like the board's number tiles. */
.ntk-types {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.75rem;
    margin: calc(-2.6rem - 1rem) 1.1rem 0; position: relative;
}
.ntk-type {
    --c: #1E5C93;
    display: flex; gap: 0.85rem; align-items: flex-start; text-align: left;
    background: #fff; border: 1px solid transparent; border-top: 3px solid var(--c); border-radius: 14px; padding: 0.8rem 1rem;
    font: inherit; color: var(--ink); cursor: pointer;
    box-shadow: 0 6px 18px rgba(20, 40, 63, 0.10); transition: box-shadow 0.12s ease;
}
.ntk-type-ar { --c: var(--tkc-teal); }
.ntk-type-wt { --c: var(--tkc-plum); }
.ntk-type:hover { box-shadow: 0 8px 22px rgba(20, 40, 63, 0.16); }
.ntk-type:not(.on) { border-top-color: #D5DEE8; }
.ntk-type:focus-visible { outline: 2px solid #4FB3FF; outline-offset: 2px; }
.ntk-type-icon { width: 2.4rem; height: 2.4rem; border-radius: 0.75rem; display: grid; place-items: center; font-size: 1.15rem; font-weight: 800; flex: 0 0 auto; }
.ntk-type-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ntk-type-text b { font-size: 1rem; }
.ntk-type-text small { color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.ntk-type-ar .ntk-type-icon { background: var(--tkc-teal-soft); color: var(--tkc-teal); }
.ntk-type-wt .ntk-type-icon { background: var(--tkc-plum-soft); color: var(--tkc-plum); }
.ntk-type.on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 6px 18px rgba(20, 40, 63, 0.12); }
.ntk-type:not(.on) .ntk-type-icon { filter: grayscale(0.6); opacity: 0.75; }

.ntk-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.ntk-main, .ntk-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
/* Sections are the board's people panels: white, soft shadow, no border. */
.ntk-section { background: #fff; border: none; border-radius: 14px; box-shadow: 0 1px 3px rgba(20, 40, 63, 0.08), 0 4px 14px rgba(20, 40, 63, 0.04); padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; }
.ntk-section h2 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 0.55rem; }
.ntk-num { width: 1.45rem; height: 1.45rem; border-radius: 7px; background: #14283F; color: #fff; font-size: 0.74rem; font-weight: 800; display: inline-grid; place-items: center; }
.ntk-section .tk-form-grid { gap: 0.85rem 1rem; }

.ntk-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.ntk-pill { border: 1px solid #CFD8E3; background: #fff; color: var(--ink); border-radius: 9px; padding: 0.4rem 0.95rem; font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer; }
.ntk-pill:hover { border-color: #AFC0D1; }
.ntk-pill.on { background: #14283F; border-color: #14283F; color: #fff; }
.ntk-pill-high.on { background: var(--tkc-coral); border-color: var(--tkc-coral); }
.ntk-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Recent-assignee quick picks under every assignee picker (AssigneePills). */
.tk-quickpick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.4rem 0 0.2rem; }
.tk-quickpick-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted, #62778C); margin-right: 0.15rem; }
.tk-quickpick-pill {
    border: 1px solid #CFE0F3; background: var(--tkc-blue-soft); color: #1E4A75;
    border-radius: 999px; padding: 0.25rem 0.7rem; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
    max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
/* Hover stays in the same pastel blue, one step deeper, so it reads as "this one" without a jump in color. */
.tk-quickpick-pill:hover:not(:disabled) { background: #D9E8F8; border-color: #B5CFEC; color: #14283F; }
.tk-quickpick-pill:active:not(:disabled) { background: #CFE0F3; }
/* The person already picked: a firmer outline in the same family rather than a dark fill. */
.tk-quickpick-pill.on { background: #D9E8F8; border-color: var(--accent); color: #14283F; box-shadow: inset 0 0 0 1px var(--accent); }
.tk-quickpick-pill.on:hover:not(:disabled) { background: #CFE0F3; }
.tk-quickpick-pill:disabled { opacity: 0.55; cursor: default; }
.tk-quickpick-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tk-bulkbar .tk-quickpick { margin: 0; }

/* Close on a resolved card or list row: one click, in the "done" mint so it reads as finishing up. */
.tk-close-btn {
    position: relative; z-index: 2;   /* above the card's stretched title link */
    border: 1px solid #BFE3D1; background: var(--tkc-mint-soft); color: #1F7A52;
    border-radius: 999px; padding: 0.15rem 0.7rem; font: inherit; font-size: 0.75rem; font-weight: 700; cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}
.tk-close-btn:hover:not(:disabled) { background: #D3EEE1; border-color: #9DD3B9; }
.tk-close-btn:disabled { opacity: 0.55; cursor: default; }
.tk-close-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
td .tk-close-btn { margin-left: 0.4rem; }

/* Delete on the ticket page, and its confirm button. */
.tkd-deletebtn { color: var(--tkc-coral); }
.tk-danger-button { background: var(--tkc-coral); border-color: var(--tkc-coral); color: #fff; }
.tk-danger-button:hover:not(:disabled) { background: #C2413D; border-color: #C2413D; }

.ntk-footer {
    position: sticky; bottom: 0; z-index: 4;
    display: flex; justify-content: flex-end; gap: 0.6rem;
    margin: 0.25rem calc(-1 * var(--ntk-gutter, 0px)) 0;
    padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(244, 247, 250, 0), var(--ground) 30%);
}
.ntk-btn { border-radius: 9px; padding: 0.6rem 1.3rem; font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; border: 1px solid transparent; }
.ntk-btn-primary { background: linear-gradient(135deg, #14283F 0%, #1E4A75 100%); color: #fff; box-shadow: 0 4px 14px rgba(20, 40, 63, 0.18); }
.ntk-btn-primary:hover { background: #1E4A75; }
.ntk-btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.ntk-btn:disabled { opacity: 0.6; cursor: default; }
.ntk-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 979.98px) {
    .ntk-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .ntk-types { grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: calc(-2.3rem - 1rem) 0.6rem 0; }
    .ntk-hero-flat { padding-bottom: 0.85rem; }
    .ntk-type { padding: 0.65rem; gap: 0.55rem; }
    .ntk-type-icon { width: 1.9rem; height: 1.9rem; font-size: 0.95rem; }
    .ntk-type-text small { display: none; }
    .ntk-section { padding: 0.85rem; }
    .ntk-section .tk-form-grid { grid-template-columns: 1fr; }
    .ntk-footer .ntk-btn { flex: 1; }
}

/* ── Tickets board header, layout B: navy band + overlapping number tiles (C's colors) ── */
.tkb-hero {
    background: linear-gradient(135deg, #14283F 0%, #1E4A75 100%);
    color: #fff;
    border-radius: 16px;
    padding: 1.1rem 1.25rem 3.4rem;
}
.tkb-hero-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.tkb-hero h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.01em; color: #fff; }
.tkb-controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

.tkb-seg {
    display: inline-flex; flex-wrap: nowrap; flex: none;
    background: rgba(255, 255, 255, 0.12); border-radius: 9px; padding: 3px; gap: 2px;
}
.tkb-seg button {
    border: none; background: none; cursor: pointer; white-space: nowrap;
    padding: 0.35rem 0.8rem; border-radius: 7px;
    font: inherit; font-size: 0.85rem; font-weight: 600; color: rgba(255, 255, 255, 0.78);
}
.tkb-seg button:hover { color: #fff; }
.tkb-seg button.on { background: #fff; color: #14283F; }
.tkb-seg button:focus-visible, .tkb-ghost:focus-visible, .tkb-new:focus-visible, .tkb-tile:focus-visible {
    outline: 2px solid #4FB3FF; outline-offset: 2px;
}

.tkb-ghost {
    border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); color: #fff;
    border-radius: 9px; padding: 0.4rem 0.8rem; font: inherit; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
}
.tkb-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
.tkb-ghost:disabled { opacity: 0.5; cursor: default; }
.tkb-kbd { width: 2rem; padding-left: 0; padding-right: 0; }

.tkb-new {
    display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap;
    border: none; border-radius: 9px; padding: 0.45rem 0.95rem; cursor: pointer;
    background: #1A76CC; color: #fff; font: inherit; font-size: 0.88rem; font-weight: 800;
}
.tkb-new svg { width: 1rem; height: 1rem; }
/* White text needs the deeper blue (4.7:1); the old light blue only worked with dark text. */
.tkb-new:hover { background: #2385DE; }

/* The tiles pull up over the hero's bottom edge; the page gap would otherwise push them down. */
.tkb-tiles {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.65rem;
    margin: calc(-2.6rem - 0.85rem) 1.1rem 0;
    position: relative;
}
.tkb-tile {
    --c: #1E5C93;
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
    background: var(--card, #fff); border: 1px solid transparent; border-top: 3px solid var(--c);
    border-radius: 14px; padding: 0.7rem 0.9rem; cursor: pointer; font: inherit; color: inherit;
    box-shadow: 0 6px 18px rgba(20, 40, 63, 0.10);
}
.tkb-tile b { font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--c); }
.tkb-tile span { font-size: 0.78rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tkb-tile:hover { box-shadow: 0 8px 22px rgba(20, 40, 63, 0.16); }
.tkb-tile.on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 6px 18px rgba(20, 40, 63, 0.12); }
.tkb-t-open { --c: #1E5C93; }
.tkb-t-mine { --c: var(--tkc-teal); }
.tkb-t-bad { --c: var(--tkc-coral); }
.tkb-t-warn { --c: var(--tkc-amber-ink); }
.tkb-t-quiet { --c: var(--tkc-mint); }

.tkb-filters { flex-wrap: nowrap; }
.tkb-filters .tk-search { min-width: 12rem; }
.tkb-filters select, .tkb-filters .tk-check { flex: none; white-space: nowrap; }
.tkb-checks { display: inline-flex; align-items: center; gap: 0.9rem; flex: none; }
.tkb-filters select.tkb-picked { border-color: var(--accent); color: var(--accent-deep); font-weight: 600; }

@media (max-width: 900px) {
    .tkb-filters { flex-wrap: wrap; }
}

@media (max-width: 640px) {
    .tkb-hero { padding: 0.85rem 0.9rem 3rem; border-radius: 14px; }
    .tkb-hero h1 { font-size: 1.3rem; }
    /* One line: title and both switches. New ticket is the floating + button on phones. */
    .tkb-hero-row { flex-wrap: nowrap; gap: 0.4rem; }
    .tkb-controls { flex-wrap: nowrap; gap: 0.35rem; }
    /* Scoped to the board toolbar: the ticket page's Close ticket button shares the class. */
    .tkb-controls .tkb-new { display: none; }
    .tkb-seg button { padding: 0.3rem 0.5rem; font-size: 0.8rem; }
    /* Five tiles don't fit a phone: they scroll sideways in their own strip. */
    .tkb-tiles {
        display: flex; overflow-x: auto; scrollbar-width: none;
        margin: calc(-2.3rem - 0.85rem) 0 0; padding: 0 0.6rem 0.4rem;
        scroll-snap-type: x proximity;
    }
    .tkb-tiles::-webkit-scrollbar { display: none; }
    .tkb-tile { flex: 0 0 8.2rem; scroll-snap-align: start; padding: 0.55rem 0.75rem; }
    .tkb-tile b { font-size: 1.35rem; }
    .tkb-filters .tk-search { flex: 1 1 100%; min-width: 0; }
    .tkb-filters select { flex: 1 1 45%; }
}

/* ── Ticket page, layout A ("case file"): navy band + status steps, number tiles, conversation + side column ── */
.tkd { gap: 0.85rem; }
.tkd-hero { display: flex; flex-direction: column; gap: 0.5rem; }
.tkd-eyebrow { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; font-size: 0.82rem; color: rgba(255, 255, 255, 0.8); }
.tkd-eyebrow .tk-mono { color: #fff; }
.tkd-chip { background: rgba(255, 255, 255, 0.14); color: #fff; border-radius: 999px; padding: 0.05rem 0.55rem; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.tkd-chip-high { background: var(--tkc-coral); }
.tkd-titlerow { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.tkd-titlerow h1 { margin: 0; font-size: 1.55rem; line-height: 1.2; color: #fff; text-wrap: balance; min-width: 0; flex: 1 1 18rem; overflow-wrap: anywhere; }
.tkd-actions { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; justify-content: flex-end; }
.tkd-actions .tkb-new:disabled, .tkd-actions .tkb-ghost:disabled { opacity: 0.55; cursor: default; }

.tkd-steps { display: inline-flex; align-self: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 3px; gap: 2px; }
.tkd-steps::-webkit-scrollbar { display: none; }
.tkd-steps > * { flex: none; white-space: nowrap; border: none; background: none; font: inherit; font-size: 0.82rem; font-weight: 700; padding: 0.32rem 0.8rem; border-radius: 8px; color: rgba(255, 255, 255, 0.72); }
.tkd-steps button { cursor: pointer; }
.tkd-steps button:hover:not(:disabled) { color: #fff; background: rgba(255, 255, 255, 0.1); }
.tkd-steps button:disabled { cursor: default; opacity: 0.6; }
.tkd-steps button:focus-visible { outline: 2px solid #4FB3FF; outline-offset: 1px; }
.tkd-steps .on { background: #fff; color: #14283F; }

.tkb-tiles.tkd-tiles { grid-template-columns: repeat(var(--tkd-n, 5), minmax(0, 1fr)); }
.tkd-tile { cursor: default; }
.tkd-tile:hover { box-shadow: 0 6px 18px rgba(20, 40, 63, 0.10); }
.tkd-tile b { font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tkd-tile b.tk-money { font-family: inherit; }

.tkd-cols { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(17rem, 1fr); gap: 1rem; align-items: start; }
.tkd-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.tkd-panel { background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(20, 40, 63, 0.08), 0 4px 14px rgba(20, 40, 63, 0.04); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.tkd-panel.tk-details { gap: 0.75rem; }
.tkd-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.tkd-panel-head h2 { margin: 0; font-size: 1rem; }
.tkd-panel-head h2 small { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.tkd-panel .tk-kv { gap: 0.6rem 0.9rem; }
.tkd-reporter { font-size: 0.84rem; }
.tkd-reporter b { color: var(--ink); }
.tkd-dropnote { border: 1.5px dashed #CFD8E3; border-radius: 10px; padding: 0.7rem; text-align: center; color: var(--muted); font-size: 0.84rem; }

.tkd-desc { background: #F5F8FB; border-radius: 10px; padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.35rem; }
.tkd-desc .tk-comment-body { font-size: 0.95rem; }
.tkd-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.tkd-msg { display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); gap: 0.6rem; align-items: start; }
.tkd-msg .tk-avatar { width: 1.8rem; height: 1.8rem; }
.tkd-msg-body { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.tkd-note { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted); padding-left: 0.35rem; }
.tkd-note > span:first-child { width: 1.2rem; text-align: center; flex: none; opacity: 0.8; }
.tkd-note b { color: var(--ink); font-weight: 600; }
.tkd-quiet { margin: 0; font-size: 0.88rem; }
/* The reply box is part of the conversation panel, so it drops its own card look. */
.tkd-convo .tk-composer { border: none; padding: 0; background: none; border-top: 1px solid var(--line); padding-top: 0.85rem; border-radius: 0; }

.tkd-ptabs { background: #fff; border: none; border-radius: 10px; padding: 3px; gap: 2px; box-shadow: 0 1px 3px rgba(20, 40, 63, 0.07); }
.tkd-ptabs button { flex: 1; border-radius: 8px; border-bottom: none !important; margin: 0; }
.tkd-ptabs button.on { background: #14283F; color: #fff; }

@media (max-width: 979.98px) {
    .tkd-cols { grid-template-columns: minmax(0, 1fr); }
    .tkd-tile { padding: 0.6rem 0.75rem; }
    .tkd-tile b { font-size: 1.05rem; }
}

@media (max-width: 640px) {
    .tkd-titlerow h1 { font-size: 1.2rem; flex-basis: 100%; }
    .tkd-actions { justify-content: flex-start; }
    .tkb-tiles.tkd-tiles { display: flex; }
    .tkd-tile b { font-size: 1.05rem; }
    .tkd-panel { padding: 0.85rem; }
    .tkd-side.tk-phone-hidden, .tkd-convo.tk-phone-hidden { display: none; }

    /* Reply bar pinned to the bottom of the screen: one line (attach, field, send) until you tap in
       or have a draft, then a full box. The page keeps room under the conversation for it. */
    .tkd:has(.tkd-convo:not(.tk-phone-hidden) > .tkd-reply) { padding-bottom: 5rem; }
    .tkd-convo > .tkd-reply {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        background: #fff; border-top: 1px solid var(--line);
        box-shadow: 0 -6px 16px rgba(20, 40, 63, 0.08);
        padding: 0.55rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    }
    .tkd-convo .tk-composer { border-top: none; padding-top: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
    .tkd-convo .tk-composer > * { flex: 1 1 100%; order: 5; min-width: 0; }
    .tkd-convo .tk-composer > textarea {
        order: 2; flex: 1 1 0; height: 2.4rem; min-height: 2.4rem; resize: none;
        border-radius: 1.2rem; padding: 0.5rem 0.85rem; line-height: 1.35;
    }
    .tkd-convo .tk-composer > .tk-actions { display: contents; }
    .tkd-convo .tk-composer .tk-attach-buttons { order: 1; flex: none; display: inline-flex; gap: 0.3rem; }
    .tkd-convo .tk-composer .tk-attach-btn { padding: 0.45rem 0.55rem; }
    .tkd-convo .tk-composer .tk-attach-btn > span { display: none; }
    .tkd-convo .tk-composer .tk-camera-btn { display: none; }
    .tkd-convo .tk-composer .tk-composer-hint { display: none; }
    .tkd-convo .tk-composer .tk-actions > .action-button:last-child { order: 3; flex: none; margin-left: 0; }

    .tkd-convo .tk-composer:focus-within > textarea, .tkd-convo .tk-composer.tk-has-draft > textarea {
        order: 0; flex: 1 1 100%; height: 6.5rem; border-radius: 10px;
    }
    .tkd-convo .tk-composer:focus-within .tk-camera-btn, .tkd-convo .tk-composer.tk-has-draft .tk-camera-btn { display: inline-flex; }
    .tkd-convo .tk-composer:focus-within .tk-composer-hint, .tkd-convo .tk-composer.tk-has-draft .tk-composer-hint {
        display: block; order: 2; flex: 1 1 0; font-size: 0.75rem;
    }
}

.tkd-short { display: none; }
@media (max-width: 640px) {
    .tkd-convo .tkd-long { display: none; }
    .tkd-convo .tkd-short { display: inline; }
}

/* Ticket page: Edit button and the edit dialog. */
.tkd-editbtn { display: inline-flex; align-items: center; gap: 0.35rem; }
.tkd-editbtn svg { width: 0.95rem; height: 0.95rem; }
.tkd-closedrow { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.tkd-closedby { color: rgba(255, 255, 255, 0.78); font-size: 0.84rem; }
.tkd-eyebrow b { color: #fff; font-weight: 700; }
/* Centred when it fits; a tall AR form starts at the top and the backdrop scrolls. */
.tkd-modal-backdrop { align-items: flex-start; overflow-y: auto; padding: 2rem 1rem; }
.tkd-modal-backdrop > .tkd-modal { margin-block: auto; }
.sc-modal.tkd-modal {
    width: min(100%, 40rem); padding: 0; border: none; border-radius: 16px; overflow: hidden;
    display: flex; flex-direction: column; max-height: calc(100dvh - 4rem);
}
.tkd-modal .sc-modal-header { background: linear-gradient(135deg, #14283F 0%, #1E4A75 100%); color: #fff; padding: 0.85rem 1.1rem; margin: 0; }
.tkd-modal .sc-modal-header h3 { color: #fff; }
.tkd-modal .sc-modal-header { align-items: center; }
.tkd-modal .sc-modal-close { background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 1.35rem; cursor: pointer; }
.tkd-modal .sc-modal-close:hover { background: rgba(255, 255, 255, 0.24); color: #fff; }
.tkd-modal .sc-modal-close:focus-visible { outline: 2px solid #4FB3FF; outline-offset: 2px; }
.tkd-modal-body { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; }
.tkd-modal-body .tk-form-grid { gap: 0.85rem 1rem; }
.tkd-modal-section { border-top: 1px solid var(--line); padding-top: 0.9rem; display: flex; flex-direction: column; gap: 0.75rem; }
.tkd-modal-section h4 { margin: 0; font-size: 0.95rem; }
.tkd-modal-foot { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 0.75rem 1.1rem calc(0.75rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: #F8FAFC; }
@media (max-width: 640px) {
    .tkd-modal-backdrop { padding: 0; align-items: stretch; }
    .sc-modal.tkd-modal { width: 100%; max-height: none; min-height: 100dvh; border-radius: 0; }
    .tkd-modal-body { flex: 1; }
    .tkd-modal-body .tk-form-grid { grid-template-columns: 1fr; }
    .tkd-modal-foot .ntk-btn { flex: 1; }
}

/* A page-wide drop zone (the ticket page): while dragging, the highlight covers the window. */
.tk-dropzone-page.tk-dropzone-on .tk-dropzone-overlay {
    position: fixed; inset: 0.75rem; z-index: 300; border-radius: 16px; border-width: 3px; font-size: 1.15rem;
}

/* Files panel: the ticket page's only drop target. Dashed while files are dragged over the page,
   filled while they're over the panel; uploads start on drop. */
.tk-dropzone-ready .tkd-files .tkd-dropnote { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
.tkd-files .tkd-dropnote { padding: 1rem 0.7rem; transition: background 0.12s ease, border-color 0.12s ease; }
.tkd-files .tkd-dropnote.tkd-uploading { border-style: solid; border-color: var(--accent); color: var(--accent-deep); }
@media (prefers-reduced-motion: reduce) { .tkd-files .tkd-dropnote { transition: none; } }

/* New ticket: the Files section is the page's only drop target, styled like the ticket page's Files panel. */
.ntk-files-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ntk-files-head h2 small { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
.ntk-files .tkd-dropnote { padding: 1rem 0.7rem; transition: background 0.12s ease, border-color 0.12s ease; }
.tk-dropzone-ready .ntk-files .tkd-dropnote { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { .ntk-files .tkd-dropnote { transition: none; } }

/* Drop hints follow the input device, not the width: a touch screen can't drag files in. */
.tk-drop-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
    .tk-drop-mouse { display: none; }
    .tk-drop-touch { display: inline; }
}

/* The board uses the whole window on desktop: with every status column showing (resolved and
   closed included) the shell's 1180px cap left columns too narrow and the panels scrolled. */
.shell-body:has(.tk-board-page) { max-width: none; padding-inline: 1.5rem; }
@media (max-width: 640px) {
    .shell-body:has(.tk-board-page) { padding-inline: 0.9rem; }
}

/* Files panels: the whole card is the drop zone. While files are dragged over the page the card is
   outlined; over the card, the overlay fills it. */
.tk-dropzone-zoneonly > .tk-dropzone-overlay { border-radius: 14px; font-size: 1rem; }
.tk-dropzone-zoneonly > .tkd-panel, .tk-dropzone-zoneonly > .ntk-section { transition: box-shadow 0.12s ease; }
.tk-dropzone-ready > .tkd-panel, .tk-dropzone-ready > .ntk-section { box-shadow: 0 0 0 2px var(--accent), 0 4px 14px rgba(20, 40, 63, 0.08); }
@media (prefers-reduced-motion: reduce) { .tk-dropzone-zoneonly > .tkd-panel, .tk-dropzone-zoneonly > .ntk-section { transition: none; } }
