.widget-view {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.widget-view-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(10, 45, 73, 0.18) transparent;
}

.widget-bar--home { padding: 0.875rem 0.75rem 0.625rem 1.25rem; }

.widget-home-logo {
    display: block;
    height: 1.3125rem;
    width: auto;
    flex-shrink: 0;
}

.widget-bar-actions {
    display: flex;
    gap: 0.125rem;
    margin-left: auto;
}

.widget-home-scroll { padding: 0 0.875rem 1rem; }

.widget-tabs {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.25rem;
    padding: 0 0.25rem;
    border-bottom: 1px solid var(--w-line);
}

.widget-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 2.625rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--w-muted);
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s var(--ease-std);
}

.widget-tab:hover,
.widget-tab[aria-selected="true"] { color: var(--w-text); }

.widget-tab[aria-selected="true"]::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--w-text);
}

.widget-tab-badge {
    display: grid;
    place-items: center;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.3125rem;
    border-radius: 999px;
    background: var(--w-blue);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.widget-tabpanel { animation: content-in 220ms var(--ease-std) both; }

.widget-label {
    margin: 1.25rem 0.125rem 0.5rem;
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--w-muted);
}

.widget-live {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--w-line);
    border-radius: 0.875rem;
    background: var(--w-surface);
    color: var(--w-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s var(--ease-std);
}

.widget-live:hover { border-color: var(--w-line-2); }

.widget-live-go { width: 1rem; height: 1rem; flex-shrink: 0; color: var(--w-muted-2); }

.widget-live-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: var(--w-good-bg);
    color: var(--w-good);
}

.widget-live-glyph { width: 1.1875rem; height: 1.1875rem; }

.widget-live-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

.widget-live-title { font-size: var(--text-sm); font-weight: 600; }

.widget-live-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-2xs);
    color: var(--w-muted);
}

.widget-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    flex-shrink: 0;
    height: 1.375rem;
    padding: 0 0.5625rem;
    border-radius: 999px;
    font-size: var(--text-3xs);
    font-weight: 600;
}

.widget-chip--live { background: var(--w-good-bg); color: var(--w-good); }

.widget-chip--live::before {
    content: "";
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 999px;
    background: var(--verdant);
}

.widget-chip--wait { background: var(--w-warn-bg); color: var(--w-warn); }

.widget-rows {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 1px solid var(--w-line);
    border-radius: 0.875rem;
    background: var(--w-surface);
    list-style: none;
}

.widget-rows > li + li { border-top: 1px solid var(--w-line); }

.widget-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5625rem 0.75rem;
    border: 0;
    background: none;
    color: var(--w-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s var(--ease-std);
}

.widget-item:hover { background: var(--w-soft); }

.widget-item--ticket {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4375rem;
    padding: 0.75rem 0.875rem;
}

.widget-item-top {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.widget-item-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-xs);
    font-weight: 500;
}

.widget-item--ticket .widget-item-title { font-weight: 600; }
.widget-item .widget-item-title--loud { font-weight: 700; }

.widget-item-when {
    flex-shrink: 0;
    font-size: var(--text-3xs);
    color: var(--w-muted);
}

.widget-new {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--text-3xs);
    font-weight: 600;
    color: var(--w-blue);
}

.widget-item-when--new {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.widget-new::before,
.widget-item-when--new::before {
    content: "";
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 999px;
    background: var(--w-blue);
}

.widget-item-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--text-3xs);
    color: var(--w-muted);
}

.widget-item-status { margin-left: 0.25rem; font-weight: 600; color: var(--w-text-2); }

.widget-item-icon {
    display: grid;
    flex-shrink: 0;
    color: var(--w-muted-2);
}

.widget-item-glyph { width: 1rem; height: 1rem; }

.widget-progress { display: inline-flex; flex-shrink: 0; gap: 2px; }

.widget-progress i {
    width: 0.75rem;
    height: 3px;
    border-radius: 3px;
    background: var(--w-line);
}

.widget-progress--0 i:nth-child(1),
.widget-progress--1 i:nth-child(-n + 2) { background: var(--w-blue); }
.widget-progress--done i { background: var(--verdant); }

.widget-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.widget-step {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.widget-step-bar {
    display: block;
    height: 3px;
    border-radius: 3px;
    background: var(--w-line);
}

.widget-step--done .widget-step-bar,
.widget-step--now .widget-step-bar { background: var(--w-blue); }
.widget-steps--done .widget-step .widget-step-bar { background: var(--verdant); }

.widget-step-label {
    font-size: var(--text-2xs);
    font-weight: 500;
    color: var(--w-muted);
}

.widget-step--done .widget-step-label { color: var(--w-text-2); }
.widget-step--now .widget-step-label { font-weight: 600; color: var(--w-text); }

.widget-steps-meaning {
    margin: 0.75rem 0 0;
    font-size: var(--text-xs);
    line-height: 1.5;
    color: var(--w-text-2);
}

.widget-legend { margin-top: 1rem; }

.widget-legend-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.375rem 0.125rem;
    border: 0;
    background: none;
    color: var(--w-text-2);
    font: inherit;
    font-size: var(--text-2xs);
    font-weight: 600;
    cursor: pointer;
}

.widget-legend-toggle:hover { color: var(--w-text); }
.widget-legend-glyph { width: 0.9375rem; height: 0.9375rem; color: var(--w-muted-2); }
.widget-legend-chevron { width: 0.875rem; height: 0.875rem; color: var(--w-muted-2); }

.widget-legend-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin: 0.375rem 0 0;
    padding: 0.875rem 1rem;
    border-radius: 0.875rem;
    background: var(--w-soft);
    list-style: none;
    animation: rise-in 260ms var(--ease-expo) both;
}

.widget-legend-list li {
    display: grid;
    grid-template-columns: 2.625rem 1fr;
    align-items: baseline;
    gap: 0.75rem;
    font-size: var(--text-2xs);
    line-height: 1.5;
    color: var(--w-text-2);
}

.widget-legend-list strong { font-weight: 600; color: var(--w-text); }

.widget-signin {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.875rem;
    padding: 0.875rem;
    border-radius: 1rem;
    background: var(--w-soft);
}

.widget-signin-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

.widget-signin-title { font-size: var(--text-sm); font-weight: 600; color: var(--w-text); }
.widget-signin-hint { font-size: var(--text-2xs); color: var(--w-muted); }

.widget-signin-btn {
    flex-shrink: 0;
    padding: 0.5rem 0.875rem;
    border-radius: 0.75rem;
    background: var(--w-blue);
    color: #fff;
    font-size: var(--text-2xs);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s var(--ease-std);
}

.widget-signin-btn:hover { background: var(--w-blue-hover); }

.widget-none {
    margin-top: 0.875rem;
    padding: 0.875rem 1rem;
    border-radius: 1rem;
    background: var(--w-soft);
    font-size: var(--text-xs);
    line-height: 1.5;
    color: var(--w-text-2);
}

.widget-hours {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4375rem;
    flex-shrink: 0;
    padding: 0.6875rem 1rem 0.75rem;
    border-top: 1px solid var(--w-line);
    background: var(--w-surface);
    font-size: var(--text-3xs);
    color: var(--w-muted);
}

.widget-hours strong { font-weight: 600; color: var(--w-text-2); }
.widget-hours-glyph { width: 0.875rem; height: 0.875rem; }

.widget-skel {
    position: relative;
    overflow: hidden;
    margin-top: 0.875rem;
    animation: ghost-in var(--dur-mid) var(--ease-std) var(--ghost-delay) backwards;
}

.widget-skel .widget-rows { border: 0; gap: 0.5rem; background: none; }
.widget-skel .widget-rows > li + li { border-top: 0; }

.widget-card {
    border-radius: 0.875rem;
    background: var(--w-surface);
    box-shadow: 0 0 0 1px var(--w-line);
}

.widget-skel-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
}

.widget-skel-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 0.625rem;
    background: var(--w-fill);
}

.widget-skel-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.widget-skel-line {
    display: block;
    height: 0.5rem;
    border-radius: var(--r-chip);
    background: var(--w-fill);
}

.widget-skel-line--title { width: 55%; height: 0.625rem; }
.widget-skel-line--sub { width: 80%; }
.widget-skel-line--head { width: 70%; height: 1rem; margin-bottom: 0.5rem; }
.widget-skel-line--last { width: 40%; }

.widget-skel-prose {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.5rem 0;
}

.widget-sheen {
    position: absolute;
    inset-block: 0;
    left: 0;
    width: 40%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
}

.widget-blank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    text-align: center;
}

.widget-blank-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0.25rem;
    border-radius: 0.875rem;
    background: var(--w-tint);
    color: var(--w-blue);
}

.widget-blank-glyph { width: 1.25rem; height: 1.25rem; }

.widget-blank-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--w-text);
}

.widget-blank-hint {
    margin: 0;
    max-width: 22rem;
    font-size: var(--text-xs);
    line-height: 1.5;
    color: var(--w-muted);
}

.widget-thread-head {
    gap: 0.625rem;
    min-height: 4.125rem;
    padding-left: 0.625rem;
    background: var(--w-surface);
    border-bottom: 1px solid var(--w-line);
}

.widget-thread-titles {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    padding-left: 0.125rem;
}

.widget-thread-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--w-text);
}

.widget-thread-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    font-size: var(--text-2xs);
    color: var(--w-muted);
}

.widget-thread-meta .widget-ref { font-size: inherit; }

.widget-ticket-status {
    flex-shrink: 0;
    padding: 0.875rem 1.125rem 1rem;
    border-bottom: 1px solid var(--w-line);
    background: var(--w-surface);
}

.widget-ticket-status .widget-steps-meaning { margin-top: 0.625rem; }

.widget-request {
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--w-line);
    border-radius: 0.875rem;
    background: var(--w-surface);
}

.widget-request-label {
    margin: 0 0 0.375rem;
    font-size: var(--text-2xs);
    font-weight: 600;
    color: var(--w-muted);
}

.widget-request-body {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--w-text);
}

.widget-request-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.375rem;
    margin-top: 0.625rem;
    font-size: var(--text-2xs);
    color: var(--w-muted);
}

.widget-request-links { display: flex; gap: 0.875rem; margin-left: auto; }

.widget-request-link {
    padding: 0.125rem 0;
    border: 0;
    background: none;
    color: var(--w-blue);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.widget-request-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.widget-request-link:disabled { cursor: default; opacity: 0.7; text-decoration: none; }

.widget-transcript { margin-bottom: 0.875rem; }

.widget-transcript-body {
    padding: 0.25rem 0 0.25rem 0.625rem;
    border-left: 2px solid var(--w-line-2);
}

.widget-waiting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin: 0;
    border-top: 1px solid var(--w-line);
    padding: 0.625rem 1rem;
    background: var(--w-surface);
    font-size: var(--text-2xs);
    line-height: 1.5;
    color: var(--w-muted);
}

.widget-waiting-glyph {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    color: var(--w-muted-2);
}

.widget-reply {
    display: flex;
    align-items: flex-end;
    gap: 0.125rem;
    flex-shrink: 0;
    margin: 0.625rem 0.875rem 0.875rem;
    padding: 0.3125rem 0.3125rem 0.3125rem 0.75rem;
    border: 1px solid var(--w-line-2);
    border-radius: 1rem;
    background: var(--w-surface);
    transition: background-color 0.2s var(--ease-std), border-color 0.2s var(--ease-std),
        box-shadow 0.2s var(--ease-std);
}

.widget-reply:focus-within {
    border-color: var(--signal-500);
    background: var(--w-surface);
    box-shadow: 0 0 0 4px rgba(36, 148, 242, 0.14);
}

.widget-reply .att-btn { width: 2.375rem; height: 2.375rem; border-radius: 0.75rem; }

.widget-reply-input {
    flex: 1;
    min-height: 2.5rem;
    max-height: 6rem;
    resize: none;
    border: 0;
    padding: 0.5625rem 0.25rem;
    background: transparent;
    color: var(--w-text);
    font: inherit;
    font-size: var(--text-sm);
    line-height: 1.375rem;
    outline: none;
}

.widget-reply-input::placeholder { color: var(--w-muted); }
.widget-reply-input:disabled { opacity: 0.6; }

.widget-reply-send {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--w-blue);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s var(--ease-std);
}

.widget-reply-send:hover { background: var(--w-blue-hover); }
.widget-reply-send:active { scale: 0.95; }
.widget-reply-send:disabled { background: #d5e2ee; color: #fff; cursor: default; }
.widget-reply-send-glyph { width: 1.0625rem; height: 1.0625rem; }

.widget-reply-count {
    margin: -0.375rem 1rem 0.5rem;
    font-size: var(--text-2xs);
    text-align: right;
}

@media (max-width: 40rem) {
    .widget-bar--home { padding-left: 1rem; }
    .widget-home-scroll { padding: 0 0.75rem 1rem; }
}

@media (pointer: coarse) and (max-width: 40rem), (pointer: coarse) and (max-height: 31.25rem) {
    .widget-panel[role="dialog"] .widget-request-link { min-height: 2.75rem; }
    .widget-panel[role="dialog"] .widget-reply-input { font-size: 1rem; }

    .widget-panel[role="dialog"] .widget-reply-send {
        width: 2.75rem;
        height: 2.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .widget-tabpanel,
    .widget-legend-list { animation: none; }
}
