/* Ticket detail page — center timeline + right sidebar. */

.tkdetail-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.tkdetail-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 24px 14px;
    border-bottom: 1px solid var(--wt-border);
}

.tkdetail-back {
    width: 28px; height: 28px; flex-shrink: 0;
    background: transparent; border: 0; color: var(--wt-fg-3); cursor: pointer;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-top: 4px;
}
.tkdetail-back:hover { background: var(--wt-bg-2); color: var(--wt-fg); }

.tkdetail-head-main { flex: 1; min-width: 0; }

.tkdetail-head-line1 {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 4px;
}

.tkdetail-number {
    font-size: 13.5px; font-weight: 700; color: var(--wt-fg);
}

.tkdetail-badge {
    font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
    border: 1px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tkdetail-badge.is-public {
    color: oklch(0.78 0.16 150);
    background: oklch(0.55 0.18 150 / 0.18);
    border-color: oklch(0.65 0.18 150 / 0.50);
}
.tkdetail-badge.is-internal {
    color: oklch(0.82 0.16 75);
    background: oklch(0.55 0.18 60 / 0.20);
    border-color: oklch(0.65 0.18 60 / 0.55);
}

.tkdetail-badge-priority.is-low { color: oklch(0.78 0.18 145); background: oklch(0.50 0.20 145 / 0.18); border-color: oklch(0.60 0.20 145 / 0.50); }
.tkdetail-badge-priority.is-medium { color: oklch(0.20 0.05 85); background: oklch(0.78 0.18 85 / 0.85); border-color: oklch(0.78 0.18 85); }
.tkdetail-badge-priority.is-high { color: white; background: oklch(0.65 0.18 40 / 0.85); border-color: oklch(0.65 0.18 40); }
.tkdetail-badge-priority.is-critical { color: white; background: oklch(0.55 0.22 25 / 0.85); border-color: oklch(0.55 0.22 25); }

.tkdetail-badge-channel { font-weight: 600; }
.tkdetail-badge-queue {
    color: var(--wt-fg-2); background: var(--wt-bg-3); border-color: var(--wt-border);
    font-weight: 600;
}

.tkdetail-subject {
    font-size: 19px; font-weight: 700; margin: 0; color: var(--wt-fg);
    cursor: text;
}
.tkdetail-subject:hover { background: var(--wt-bg-2); border-radius: 6px; padding: 0 4px; margin: 0 -4px; }

.tkdetail-subject-input {
    background: var(--wt-bg-2);
    border: 1px solid var(--wt-primary);
    color: var(--wt-fg);
    font-size: 19px; font-weight: 700;
    padding: 4px 8px; border-radius: 6px;
    width: 100%; outline: none;
}

/* Active viewers strip */
.tkdetail-viewers {
    display: inline-flex;
    align-items: center;
    gap: -4px;
    margin: 6px 8px 0 0;
}
.tkdetail-viewers > .wt-avatar { margin-left: -6px; border: 2px solid var(--wt-bg); }
.tkdetail-viewers > .wt-avatar:first-child { margin-left: 0; }

.tkdetail-head-cta {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid oklch(0.65 0.18 150 / 0.55);
    color: oklch(0.78 0.16 150);
    border-radius: 8px;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
}
.tkdetail-head-cta:hover { background: oklch(0.55 0.18 150 / 0.15); }
.tkdetail-head-cta:disabled { opacity: 0.6; cursor: not-allowed; }

.tkdetail-status-select {
    background: var(--wt-bg-2);
    border: 1px solid var(--wt-border);
    color: var(--wt-fg);
    padding: 7px 32px 7px 12px;
    border-radius: 8px;
    font-size: 12.5px; font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.tkdetail-kebab-wrap { position: relative; margin-top: 4px; }
.tkdetail-kebab {
    width: 32px; height: 32px;
    background: var(--wt-bg-2); border: 1px solid var(--wt-border);
    color: var(--wt-fg-2); cursor: pointer; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
}
.tkdetail-kebab:hover { color: var(--wt-fg); }

.tkdetail-kebab-menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    background: var(--wt-bg-2);
    border: 1px solid var(--wt-border); border-radius: 10px;
    min-width: 240px;
    padding: 4px;
    z-index: 60;
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}
.tkdetail-kebab-backdrop { position: fixed; inset: 0; z-index: 55; }
.tkdetail-kebab-item {
    display: block; width: 100%; text-align: left;
    padding: 9px 12px; border-radius: 6px;
    background: transparent; border: 0; color: var(--wt-fg);
    font-size: 12.5px; cursor: pointer;
}
.tkdetail-kebab-item:hover:not(:disabled) { background: var(--wt-bg-3); }
.tkdetail-kebab-item:disabled { opacity: 0.45; cursor: not-allowed; }
.tkdetail-kebab-item.is-danger { color: oklch(0.7 0.22 25); }

/* Body */
.tkdetail-body { flex: 1; display: flex; overflow: hidden; min-height: 0; }

.tkdetail-main {
    flex: 1; min-width: 0;
    overflow-y: auto;
    padding: 18px 24px 24px;
}

.tkdetail-activities-toggle {
    display: flex; justify-content: flex-end;
    font-size: 11.5px; color: var(--wt-fg-3);
    margin-bottom: 6px;
}
.tkdetail-activities-toggle label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

.tkdetail-wabanner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; gap: 14px;
    background: oklch(0.55 0.18 150 / 0.10);
    border: 1px solid oklch(0.65 0.18 150 / 0.40);
    border-radius: 12px;
    margin-bottom: 16px;
}
.tkdetail-wabanner-text { display: flex; flex-direction: column; align-items: center; flex: 1; }
.tkdetail-wabanner-text strong { color: oklch(0.78 0.16 150); font-size: 13.5px; }
.tkdetail-wabanner-text span { color: oklch(0.72 0.16 150); font-size: 11.5px; }
.tkdetail-wabanner-cta {
    background: oklch(0.55 0.18 150);
    color: white; border: 0; padding: 8px 16px; border-radius: 8px;
    font-weight: 700; font-size: 12.5px; cursor: pointer;
}

/* Composer */
.tkdetail-composer {
    border: 1px solid var(--wt-border); border-radius: 12px;
    overflow: hidden; background: var(--wt-bg-2);
    margin-bottom: 14px;
}
.tkdetail-composer-tabs {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 10px; border-bottom: 1px solid var(--wt-border);
}
.tkdetail-composer-tab {
    background: transparent; border: 0;
    color: var(--wt-fg-3); padding: 6px 12px; border-radius: 6px;
    font-size: 12px; font-weight: 600; cursor: pointer;
}
.tkdetail-composer-tab:hover:not(:disabled) { color: var(--wt-fg); background: var(--wt-bg-3); }
.tkdetail-composer-tab.is-active {
    color: oklch(0.78 0.16 245);
    background: oklch(0.55 0.18 245 / 0.15);
}
.tkdetail-composer-tab:disabled { opacity: 0.5; cursor: not-allowed; }

.tkdetail-composer-action {
    background: transparent; border: 0; color: var(--wt-fg-3);
    font-size: 11.5px; padding: 6px 10px; border-radius: 6px;
    cursor: pointer;
}
.tkdetail-composer-action:disabled { opacity: 0.5; cursor: not-allowed; }

.tkdetail-composer-body.is-internal {
    background: oklch(0.65 0.18 60 / 0.05);
}

.tkdetail-composer-foot {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px 12px; font-size: 12px;
}
.tkdetail-foot-link {
    color: var(--wt-fg-2); cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px;
    font-weight: 600;
}
.tkdetail-foot-link:hover { color: var(--wt-fg); }
.tkdetail-foot-emoji { font-size: 16px; cursor: pointer; opacity: 0.8; }
.tkdetail-foot-emoji:hover { opacity: 1; }
.tkdetail-foot-send {
    background: var(--wt-primary); color: white; border: 0;
    padding: 8px 14px; border-radius: 8px;
    font-weight: 700; font-size: 12.5px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.tkdetail-foot-send.is-internal { background: oklch(0.65 0.18 60); }
.tkdetail-foot-send:disabled { opacity: 0.6; cursor: not-allowed; }
.tkdetail-foot-kbd {
    font-size: 9.5px; font-weight: 600;
    padding: 2px 6px; border-radius: 4px;
    background: rgba(255,255,255,0.20);
}

/* Timeline */
.tkdetail-timeline { display: flex; flex-direction: column; gap: 12px; }

.tkdetail-msg {
    background: var(--wt-bg-2);
    border: 1px solid var(--wt-border);
    border-radius: 10px;
    overflow: hidden;
}
.tkdetail-msg.is-internal {
    background: oklch(0.65 0.18 60 / 0.10);
    border-color: oklch(0.65 0.18 60 / 0.40);
    border-style: dashed;
}
.tkdetail-msg.is-system {
    background: transparent;
    border: 0;
    color: var(--wt-fg-4);
    padding: 4px 12px;
    font-size: 11.5px;
}
.tkdetail-msg.is-system .tkdetail-msg-head { display: none; }
.tkdetail-msg.is-system .tkdetail-msg-body { padding: 0; }

.tkdetail-msg-head {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-bottom: 1px solid var(--wt-border);
    font-size: 12px;
}
.tkdetail-msg-name { font-weight: 700; color: var(--wt-fg); }
.tkdetail-msg-num { color: var(--wt-fg-4); }
.tkdetail-msg-chip {
    background: transparent;
    border: 1px solid;
    padding: 1px 8px; border-radius: 999px;
    font-size: 9.5px; font-weight: 600;
}
.tkdetail-msg-internal-tag {
    background: oklch(0.65 0.18 60 / 0.30);
    color: oklch(0.82 0.16 75);
    padding: 1px 6px; border-radius: 4px;
    font-size: 9.5px; font-weight: 700;
}
.tkdetail-msg-time { color: var(--wt-fg-4); font-variant-numeric: tabular-nums; }
.tkdetail-msg-body {
    padding: 12px 14px;
    color: var(--wt-fg);
    font-size: 13px;
    line-height: 1.45;
}

/* Sidebar */
.tkdetail-side {
    width: 320px;
    flex-shrink: 0;
    border-left: 1px solid var(--wt-border);
    overflow-y: auto;
    padding: 18px 18px 24px;
    background: var(--wt-bg-2);
}
.tkdetail-side-title {
    font-size: 14px; font-weight: 700; margin: 0 0 14px;
}

.tkdetail-side-section {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--wt-border);
}
.tkdetail-side-section:last-child { border-bottom: 0; }

.tkdetail-side-label {
    font-size: 11px; font-weight: 700; color: var(--wt-fg-3);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.tkdetail-side-label-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.tkdetail-side-link {
    background: transparent; border: 0; color: oklch(0.7 0.18 245);
    font-size: 11px; font-weight: 600; cursor: pointer; padding: 0;
}
.tkdetail-side-link:hover { color: oklch(0.8 0.18 245); }

.tkdetail-side-grid-2 {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}

.tkdetail-contact-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px;
    background: var(--wt-bg);
    border: 1px solid var(--wt-border);
    border-radius: 10px;
}
.tkdetail-contact-info { flex: 1; min-width: 0; }
.tkdetail-contact-name {
    font-size: 13px; font-weight: 700; color: oklch(0.7 0.18 245);
}
.tkdetail-contact-meta {
    font-size: 11px; color: var(--wt-fg-3); margin-top: 2px;
}
