:root {
    --bg: #f3ede2;
    --bg-deep: #d7c6aa;
    --sidebar: #10202c;
    --sidebar-soft: #162c3b;
    --panel: rgba(255, 252, 245, 0.82);
    --panel-strong: #fffaf1;
    --panel-muted: rgba(255, 248, 236, 0.62);
    --line: rgba(20, 31, 42, 0.12);
    --line-strong: rgba(20, 31, 42, 0.2);
    --text: #1c2530;
    --muted: #66727e;
    --accent: #b78349;
    --accent-strong: #8d5f2d;
    --accent-soft: rgba(183, 131, 73, 0.16);
    --success: #2d7a57;
    --warning: #9f6a21;
    --danger: #a54848;
    --shadow-lg: 0 24px 80px rgba(16, 32, 44, 0.14);
    --shadow-md: 0 12px 36px rgba(16, 32, 44, 0.1);
    --shadow-sm: 0 6px 20px rgba(16, 32, 44, 0.08);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --dock-height: 84px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "DM Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 35%),
        radial-gradient(circle at bottom right, rgba(183, 131, 73, 0.2), transparent 30%),
        linear-gradient(135deg, #f7f2ea 0%, var(--bg) 48%, #efe4d4 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

strong,
h1,
h2,
h3,
h4 {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.03em;
}

.app-body {
    overflow-x: hidden;
}

.app-shell {
    position: relative;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100vh;
    padding: 28px 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%),
        linear-gradient(180deg, var(--sidebar) 0%, #09141d 100%);
    color: #f4efe5;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 30;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #f2d7b0, var(--accent));
    color: #13202b;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
}

.brand-name {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(102, 114, 126, 0.92);
}

.app-sidebar .eyebrow {
    color: rgba(242, 224, 194, 0.72);
}

.sidebar-summary {
    padding: 18px 18px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-summary-label {
    color: rgba(244, 239, 229, 0.68);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
}

.sidebar-summary-value {
    margin-top: 10px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 2.5rem;
    line-height: 1;
}

.sidebar-summary p {
    margin: 10px 0 0;
    color: rgba(244, 239, 229, 0.7);
    font-size: 0.92rem;
    line-height: 1.5;
}

.sidebar-nav {
    display: grid;
    gap: 22px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.sidebar-group {
    display: grid;
    gap: 8px;
}

.sidebar-group-label {
    padding: 0 12px;
    color: rgba(244, 239, 229, 0.48);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(244, 239, 229, 0.84);
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.sidebar-link:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.05);
    color: #fff7eb;
}

.sidebar-link.is-active {
    background: linear-gradient(90deg, rgba(183, 131, 73, 0.3), rgba(183, 131, 73, 0.08));
    color: #fff9f0;
    box-shadow: inset 0 0 0 1px rgba(242, 215, 176, 0.1);
}

.nav-badge {
    min-width: 28px;
    height: 28px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #f7ead6;
    font-size: 0.82rem;
    font-weight: 700;
}

.sidebar-footer {
    display: grid;
    gap: 14px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar-close {
    display: none;
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #f7ead6;
    box-shadow: none;
}

.sidebar-user-name {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
}

.sidebar-user-meta {
    margin-top: 4px;
    color: rgba(244, 239, 229, 0.64);
    font-size: 0.88rem;
}

.nav-form {
    margin: 0;
}

.nav-link-button {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #f7ead6;
    font-weight: 700;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.nav-link-button:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
}

.shell-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.shell-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 30px 18px;
    background: rgba(243, 237, 226, 0.78);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(16, 32, 44, 0.06);
}

.topbar-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.topbar-title {
    margin-top: 0;
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.5;
}

.topbar-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(16, 32, 44, 0.08);
    box-shadow: var(--shadow-sm);
    text-align: right;
    white-space: nowrap;
}

.topbar-chip-label {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.nav-toggle {
    display: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(16, 32, 44, 0.1);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow-sm);
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-direction: column;
}

.nav-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
}

.shell-content {
    padding: 30px;
}

.shell-content > * {
    animation: rise-in 0.55s ease both;
}

.shell-content > *:nth-child(2) {
    animation-delay: 0.05s;
}

.shell-content > *:nth-child(3) {
    animation-delay: 0.1s;
}

.shell-content > *:nth-child(4) {
    animation-delay: 0.15s;
}

.flash-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}

.flash {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.flash-danger {
    background: rgba(165, 72, 72, 0.1);
    border-color: rgba(165, 72, 72, 0.18);
    color: #7b2626;
}

.flash-success {
    background: rgba(45, 122, 87, 0.12);
    border-color: rgba(45, 122, 87, 0.18);
    color: #1d5d40;
}

.page-intro,
.card,
.section-shell,
.table-shell {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.page-intro {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 28px 30px;
    margin-bottom: 20px;
    overflow: hidden;
}

.page-intro::after {
    content: "";
    position: absolute;
    right: -36px;
    bottom: -56px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(183, 131, 73, 0.24) 0%, rgba(183, 131, 73, 0.02) 68%, transparent 72%);
    pointer-events: none;
}

.page-intro > * {
    position: relative;
    z-index: 1;
}

.page-intro h1,
.page-intro h2 {
    margin: 10px 0 10px;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 0.98;
}

.page-summary {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    justify-content: flex-end;
}

.meta-chip,
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(16, 32, 44, 0.08);
    color: var(--text);
    font-size: 0.92rem;
}

.status-pill.pending {
    background: rgba(183, 131, 73, 0.12);
    color: var(--warning);
}

.status-pill.done {
    background: rgba(45, 122, 87, 0.12);
    color: var(--success);
}

.status-pill.secondary {
    background: rgba(26, 86, 128, 0.1);
    color: var(--ink);
}

.metric-grid,
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.metric-card,
.kpi-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 249, 239, 0.7));
    border: 1px solid rgba(16, 32, 44, 0.08);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.metric-card:hover,
.kpi-card:hover,
.card:hover,
.section-shell:hover,
.notification-row:hover,
.announcement-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.metric-label,
.kpi-label {
    color: var(--muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.metric-value,
.kpi-value {
    margin-top: 10px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2rem, 2.8vw, 2.7rem);
    line-height: 1;
}

.metric-detail {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.92rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.span-4 {
    grid-column: span 4;
}

.span-5 {
    grid-column: span 5;
}

.span-6 {
    grid-column: span 6;
}

.span-7 {
    grid-column: span 7;
}

.span-8 {
    grid-column: span 8;
}

.span-12 {
    grid-column: span 12;
}

.card,
.section-shell,
.table-shell {
    padding: 22px;
    margin-bottom: 18px;
}

.section-head,
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.section-head h2,
.section-head h3,
.page-head h2,
.page-head h3,
.card h2,
.card h3 {
    margin: 0;
}

.section-note {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.action-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

button,
.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff8ee;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(141, 95, 45, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover,
.btn-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(141, 95, 45, 0.22);
}

.btn-link.secondary,
button.secondary {
    background: rgba(255, 255, 255, 0.76);
    color: var(--text);
    border-color: rgba(16, 32, 44, 0.08);
    box-shadow: var(--shadow-sm);
}

.btn-link.is-current-scope {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff8ee;
    border-color: transparent;
}

.small-btn {
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 0.82rem;
}

.muted,
.muted-text {
    color: var(--muted);
}

.ok-text {
    color: var(--success);
    font-weight: 700;
}

.warn-text {
    color: var(--warning);
    font-weight: 700;
}

.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-row input,
.form-row textarea,
.form-row select,
.search-form input,
.search-form textarea,
.search-form select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(16, 32, 44, 0.12);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.form-row textarea,
textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus,
.search-form input:focus,
.search-form textarea:focus,
.search-form select:focus {
    outline: none;
    border-color: rgba(183, 131, 73, 0.55);
    box-shadow: 0 0 0 4px rgba(183, 131, 73, 0.14);
    background: #ffffff;
}

select[multiple] {
    min-height: 180px;
}

.search-form {
    margin-top: 0;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 14px;
    align-items: end;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 16px;
    align-items: start;
}

.form-grid .span-2 {
    grid-column: span 2;
}

.field-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form.stacked {
    display: grid;
}

.inline-form input[type="text"] {
    width: 240px;
}

.table-shell {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.table-wrap {
    overflow-x: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.app-dock {
    display: none;
}

.table thead th {
    padding: 14px 12px;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    border-bottom: 1px solid var(--line-strong);
}

.table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(16, 32, 44, 0.08);
    vertical-align: top;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.42);
}

.table tbody tr.table-row-overdue {
    background: rgba(165, 72, 72, 0.08);
}

.table tbody tr.table-row-overdue:hover {
    background: rgba(165, 72, 72, 0.12);
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.stack-list {
    display: grid;
    gap: 12px;
}

.stack-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(16, 32, 44, 0.08);
}

.stack-item-title {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
}

.stack-item-meta {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.9rem;
}

.ticket-title-line {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
}

.ticket-context-line {
    color: var(--muted);
    font-size: 0.9rem;
}

.status-pill.sla-neutral {
    background: rgba(26, 86, 128, 0.1);
    color: var(--ink);
}

.status-pill.sla-warning {
    background: rgba(183, 131, 73, 0.12);
    color: var(--warning);
}

.status-pill.sla-critical {
    background: rgba(165, 72, 72, 0.14);
    color: var(--danger);
}

.meta-chip.meta-chip-alert {
    background: rgba(165, 72, 72, 0.12);
    color: var(--danger);
    border-color: rgba(165, 72, 72, 0.18);
}

.ticket-escalation-line {
    margin-top: 6px;
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ticket-controls-disclosure {
    border: 1px solid rgba(26, 86, 128, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    padding: 14px 16px;
}

.ticket-controls-disclosure summary {
    cursor: pointer;
    list-style: none;
}

.ticket-controls-disclosure summary::-webkit-details-marker {
    display: none;
}

.ticket-controls-disclosure summary span {
    display: block;
}

.ticket-controls-disclosure[open] summary {
    margin-bottom: 14px;
}

.dashboard-hero {
    background:
        radial-gradient(circle at top right, rgba(183, 131, 73, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 245, 236, 0.82));
}

.dashboard-meta {
    align-items: flex-start;
}

.dashboard-control-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-kpi-card {
    display: grid;
    gap: 8px;
    min-height: 160px;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 246, 239, 0.84));
    border: 1px solid rgba(16, 32, 44, 0.08);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(183, 131, 73, 0.24);
}

.dashboard-kpi-card.is-warning {
    background: linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(255, 246, 230, 0.9));
}

.dashboard-kpi-card.is-critical {
    background: linear-gradient(180deg, rgba(255, 248, 247, 0.98), rgba(255, 238, 235, 0.92));
}

.dashboard-kpi-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 700;
}

.dashboard-kpi-value {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.9rem, 2.3vw, 2.7rem);
    line-height: 1;
    color: var(--ink);
}

.dashboard-kpi-detail {
    color: var(--muted);
    line-height: 1.5;
}

.dashboard-performance-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-performance-card {
    display: grid;
    gap: 8px;
    min-height: 168px;
    margin-bottom: 0;
}

.dashboard-performance-value {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.8rem, 2.2vw, 2.6rem);
    line-height: 1;
    color: var(--ink);
}

.dashboard-trend-shell,
.dashboard-sla-mix-shell {
    margin-bottom: 18px;
}

.dashboard-trend-list {
    display: grid;
    gap: 12px;
}

.dashboard-trend-row {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(16, 32, 44, 0.07);
}

.dashboard-trend-date {
    font-weight: 700;
    color: var(--ink);
}

.dashboard-trend-bars {
    display: grid;
    gap: 10px;
}

.dashboard-trend-bar-group {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 40px;
    gap: 10px;
    align-items: center;
}

.dashboard-trend-label,
.dashboard-trend-count {
    font-size: 0.84rem;
    color: var(--muted);
    font-weight: 700;
}

.dashboard-trend-track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(16, 32, 44, 0.08);
    overflow: hidden;
}

.dashboard-trend-bar {
    height: 100%;
    border-radius: 999px;
}

.dashboard-trend-bar.is-created {
    background: linear-gradient(90deg, rgba(26, 86, 128, 0.85), rgba(26, 86, 128, 0.45));
}

.dashboard-trend-bar.is-resolved {
    background: linear-gradient(90deg, rgba(45, 122, 87, 0.85), rgba(45, 122, 87, 0.45));
}

.dashboard-trend-bar.is-breached {
    background: linear-gradient(90deg, rgba(165, 72, 72, 0.88), rgba(165, 72, 72, 0.46));
}

.dashboard-state-item,
.dashboard-pressure-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dashboard-pressure-values {
    display: grid;
    gap: 4px;
    text-align: right;
    font-weight: 700;
}

.stack-value {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 700;
}

.chat-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.chat-sidebar,
.chat-stage,
.chat-inspector,
.main-card {
    min-width: 0;
}

.chat-stage,
.chat-inspector {
    display: grid;
    gap: 18px;
}

.chat-inspector {
    position: sticky;
    top: 98px;
    align-self: start;
}

.channel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.channel-card {
    display: block;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(16, 32, 44, 0.08);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.channel-card:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.9);
}

.channel-card.is-active {
    background: linear-gradient(180deg, rgba(255, 251, 244, 0.96), rgba(255, 242, 222, 0.9));
    border-color: rgba(183, 131, 73, 0.28);
    box-shadow: 0 18px 40px rgba(141, 95, 45, 0.12);
}

.channel-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.channel-card-name {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
    font-weight: 700;
}

.channel-card-meta {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.chat-stage-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.chat-stage-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.message-box {
    position: relative;
    border-radius: 24px;
    border: 1px solid rgba(16, 32, 44, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 249, 239, 0.7)),
        radial-gradient(circle at top, rgba(183, 131, 73, 0.08), transparent 42%);
    padding: 0;
    min-height: 56vh;
    max-height: 64vh;
    overflow-y: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.conversation-stream,
.message-thread {
    display: grid;
    gap: 14px;
    padding: 20px;
    min-height: 100%;
}

.conversation-row {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(16, 32, 44, 0.08);
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.conversation-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.conversation-row.is-active {
    border-color: rgba(183, 131, 73, 0.35);
    box-shadow: 0 18px 40px rgba(141, 95, 45, 0.14);
    background: linear-gradient(180deg, rgba(255, 251, 244, 0.96), rgba(255, 244, 229, 0.9));
}

.conversation-row.is-unread {
    border-left: 4px solid var(--accent);
}

.conversation-open {
    display: grid;
    gap: 12px;
    width: 100%;
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    box-shadow: none;
}

.conversation-open:hover {
    transform: none;
    box-shadow: none;
}

.conversation-open-head,
.conversation-meta,
.thread-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.conversation-author-block {
    display: grid;
    gap: 4px;
}

.conversation-author-block span,
.conversation-latest,
.conversation-footnote {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.conversation-head-badges,
.thread-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.conversation-preview {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.08rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.conversation-count {
    font-weight: 700;
    color: var(--accent-strong);
}

.conversation-footnote {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(16, 32, 44, 0.06);
}

.conversation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reaction-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reaction-chip {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(16, 32, 44, 0.1);
    background: rgba(255, 255, 255, 0.84);
    color: var(--text);
    box-shadow: none;
    font-family: "DM Sans", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
}

.reaction-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.reaction-chip.is-active {
    background: rgba(183, 131, 73, 0.16);
    border-color: rgba(183, 131, 73, 0.35);
    color: var(--accent-strong);
}

.reaction-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(16, 32, 44, 0.08);
}

.pinned-list {
    display: grid;
    gap: 10px;
}

.pinned-item {
    display: grid;
    gap: 10px;
    width: 100%;
    min-height: auto;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(16, 32, 44, 0.08);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.pinned-item:hover {
    box-shadow: var(--shadow-md);
}

.pinned-item.is-active {
    border-color: rgba(183, 131, 73, 0.34);
    background: linear-gradient(180deg, rgba(255, 251, 244, 0.96), rgba(255, 244, 229, 0.9));
}

.pinned-item-head,
.pinned-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pinned-item-head span,
.pinned-item-meta {
    color: var(--muted);
    font-size: 0.8rem;
}

.pinned-item-body {
    line-height: 1.6;
    white-space: pre-wrap;
}

.thread-badge,
.thread-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(183, 131, 73, 0.14);
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
}

.thread-panel-shell {
    display: grid;
    gap: 16px;
}

.thread-message-list {
    display: grid;
    gap: 14px;
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 4px;
}

.thread-form {
    padding: 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 249, 239, 0.78));
    border: 1px solid rgba(16, 32, 44, 0.08);
}

.thread-upload-form {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(16, 32, 44, 0.08);
}

.unread-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--accent-strong);
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.unread-divider::before,
.unread-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(183, 131, 73, 0.32);
}

.message-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.message-row.is-self {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, rgba(16, 32, 44, 0.9), rgba(44, 70, 92, 0.72));
    color: #f7ead6;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.message-row.is-self .message-avatar {
    background: linear-gradient(145deg, rgba(183, 131, 73, 0.94), rgba(141, 95, 45, 0.82));
    color: #fff8ec;
}

.message-bubble {
    width: min(100%, 820px);
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(16, 32, 44, 0.08);
    box-shadow: var(--shadow-sm);
}

.message-row.is-self .message-bubble {
    background: linear-gradient(180deg, rgba(255, 248, 240, 0.96), rgba(252, 237, 216, 0.92));
    border-color: rgba(183, 131, 73, 0.2);
}

.message-row.is-root .message-bubble {
    border-color: rgba(183, 131, 73, 0.25);
    box-shadow: 0 18px 30px rgba(141, 95, 45, 0.1);
}

.message-row.is-unread .message-bubble {
    border-left: 4px solid var(--accent);
}

.message-row.is-deleted .message-bubble {
    opacity: 0.78;
}

.message-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 10px;
}

.message-author-block {
    display: grid;
    gap: 4px;
}

.message-author {
    font-size: 0.98rem;
}

.message-time {
    font-size: 0.78rem;
    color: var(--muted);
}

.message-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.message-body {
    line-height: 1.65;
    white-space: pre-wrap;
}

.message-attachment {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(16, 32, 44, 0.08);
}

.message-attachment a {
    font-weight: 700;
}

.message-actions,
.notification-actions,
.admin-action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.admin-action-stack {
    flex-direction: column;
    align-items: flex-start;
}

.message-row.is-self .message-actions {
    justify-content: flex-end;
}

.message-form,
.upload-form {
    margin-top: 0;
}

.message-form textarea {
    min-height: 132px;
}

.chat-composer .action-cluster {
    align-items: center;
}

.message-disclosure {
    width: auto;
}

.message-disclosure summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(16, 32, 44, 0.08);
    background: rgba(255, 255, 255, 0.76);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.message-disclosure summary::-webkit-details-marker {
    display: none;
}

.message-disclosure[open] {
    width: 100%;
}

.message-disclosure[open] summary {
    margin-bottom: 10px;
}

.message-disclosure .inline-form {
    display: grid;
    gap: 8px;
    width: 100%;
}

.message-disclosure .inline-form input[type="text"] {
    width: 100%;
}

.reply-context,
.reply-banner {
    border-left: 4px solid var(--accent);
    background: rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.reply-context-text,
.reply-quote {
    margin-top: 6px;
    color: var(--muted);
    white-space: pre-wrap;
}

.reply-banner.is-hidden {
    display: none;
}

.announcement-row,
.notification-row {
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(16, 32, 44, 0.08);
    margin-bottom: 14px;
}

.notification-unread,
.priority-critical {
    border-left: 4px solid var(--accent);
}

.priority-high {
    border-left: 4px solid #d39953;
}

.priority-normal {
    border-left: 4px solid #6d889d;
}

.priority-low {
    border-left: 4px solid #5e8c72;
}

.notification-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 18px;
}

.profile-box {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(16, 32, 44, 0.08);
}

.profile-box h3 {
    margin: 0 0 14px;
}

.profile-box > div + div {
    margin-top: 10px;
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.directory-person {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 18px;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(18, 31, 43, 0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.directory-person:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(26, 86, 128, 0.18);
}

.directory-person-avatar,
.directory-profile-avatar,
.profile-avatar-large {
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(18, 31, 43, 0.94), rgba(52, 78, 96, 0.88));
    color: #f7f2e8;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.directory-person-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.25rem;
}

.directory-person-body {
    display: grid;
    gap: 12px;
}

.directory-person-head,
.directory-profile-hero,
.profile-hero-shell {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.directory-person-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.directory-person-meta,
.directory-person-foot,
.directory-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.directory-person-meta,
.directory-person-foot {
    color: var(--muted);
    font-size: 0.92rem;
}

.directory-profile-hero,
.profile-hero-shell {
    margin-bottom: 18px;
}

.directory-profile-avatar,
.profile-avatar-large {
    width: 92px;
    height: 92px;
    font-size: 2rem;
    flex: 0 0 auto;
}

.directory-profile-copy h2,
.profile-hero-copy h2 {
    margin: 0 0 6px;
}

.directory-profile-copy p,
.profile-hero-copy p {
    margin: 0 0 12px;
    color: var(--muted);
}

.profile-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.profile-stat-card {
    padding: 16px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(18, 31, 43, 0.06);
}

.profile-stat-card .metric-value {
    font-size: 1.9rem;
}

.detail-list {
    display: grid;
    gap: 12px;
}

.detail-item {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(16, 32, 44, 0.08);
}

.detail-item-label {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.detail-item-value {
    margin-top: 8px;
    font-weight: 700;
}

.profile-pic-card {
    margin-top: 18px;
}

.login-card,
.auth-card {
    width: min(520px, calc(100vw - 32px));
    margin: 48px auto;
    padding: 30px;
    border-radius: 32px;
    background: rgba(255, 250, 241, 0.88);
    border: 1px solid rgba(16, 32, 44, 0.08);
    box-shadow: var(--shadow-lg);
}

.auth-page {
    min-height: 100vh;
    padding: 32px 16px;
    display: grid;
    place-items: center;
}

.auth-card h1,
.auth-card h2,
.login-card h1,
.login-card h2 {
    margin: 8px 0 8px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.auth-copy {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.7;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    margin-left: 8px;
    border-radius: 999px;
    background: rgba(183, 131, 73, 0.16);
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
}

.nav-scrim {
    position: fixed;
    inset: 0;
    background: rgba(8, 18, 26, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 24;
}

.empty-state {
    padding: 24px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.46);
    border: 1px dashed rgba(16, 32, 44, 0.14);
    color: var(--muted);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1400px) {
    .chat-layout {
        grid-template-columns: 280px minmax(0, 1fr) 320px;
    }
}

.meta-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.channel-card-flags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.live-chip {
    background: rgba(45, 122, 87, 0.12);
    border: 1px solid rgba(45, 122, 87, 0.18);
    color: var(--success);
}

.thread-panel-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.thread-follow-note {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(183, 131, 73, 0.08);
    border: 1px solid rgba(183, 131, 73, 0.18);
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.file-center-grid {
    align-items: start;
}

.file-preview-shell {
    display: grid;
    gap: 14px;
}

.file-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.file-preview-name {
    margin: 0;
    font-weight: 700;
}

.file-preview-meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.file-preview-image,
.file-preview-frame {
    width: 100%;
    min-height: 320px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(16, 32, 44, 0.1);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.file-preview-image {
    object-fit: contain;
    padding: 12px;
}

.file-preview-frame {
    padding: 0;
}

.file-pill-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.file-context {
    display: grid;
    gap: 8px;
}

.file-cell {
    display: grid;
    gap: 6px;
}

.file-mix-list .detail-item-value {
    display: grid;
    gap: 8px;
}

.mix-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.file-table td {
    vertical-align: top;
}

.thread-follow-note a,
.detail-item-hint a {
    color: var(--accent-strong);
    font-weight: 700;
}

.mention-helper {
    display: grid;
    gap: 10px;
}

.mention-helper-note {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.mention-suggestions {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(16, 32, 44, 0.08);
}

.mention-suggestions.is-hidden {
    display: none;
}

.mention-suggestions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.84rem;
    color: var(--muted);
}

.mention-suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mention-suggestion {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(16, 32, 44, 0.1);
    background: rgba(255, 252, 245, 0.92);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.mention-suggestion:hover {
    transform: translateY(-1px);
    border-color: rgba(183, 131, 73, 0.38);
    box-shadow: var(--shadow-sm);
}

.mention-suggestion-name {
    font-weight: 700;
}

.mention-suggestion-handle {
    color: var(--accent-strong);
    font-size: 0.86rem;
}

.typing-indicator {
    min-height: 20px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.live-stream-banner {
    margin-bottom: 12px;
}

.live-thread-banner {
    margin-bottom: 0;
}

.live-stream-banner.is-hidden {
    display: none;
}

.detail-item-hint {
    margin-top: 8px;
    font-size: 0.84rem;
}

.preference-grid {
    display: grid;
    gap: 16px;
}

.preference-card {
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(16, 32, 44, 0.08);
    box-shadow: var(--shadow-sm);
}

.preference-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.preference-card h3 {
    margin: 0 0 4px;
}

.preference-form {
    display: grid;
    gap: 12px;
}

@media (max-width: 1180px) {
    .metric-grid,
    .kpi-grid,
    .dashboard-kpi-grid,
    .dashboard-performance-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chat-layout,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-control-shell {
        grid-template-columns: 1fr;
    }

    .chat-inspector {
        position: static;
        grid-template-columns: 1fr;
    }

    .chat-stage-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .conversation-open-head,
    .conversation-meta,
    .thread-panel-header,
    .preference-card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-trend-row {
        grid-template-columns: 1fr;
    }

    .message-bubble {
        width: 100%;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8,
    .span-12 {
        grid-column: span 12;
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(320px, calc(100vw - 48px));
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: var(--shadow-lg);
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }

    .nav-toggle {
        display: inline-flex;
    }

    .app-sidebar-close {
        display: inline-flex;
    }

    .shell-topbar,
    .shell-content {
        padding-left: 20px;
        padding-right: 20px;
    }

    .shell-content {
        padding-bottom: calc(28px + var(--dock-height) + env(safe-area-inset-bottom));
    }

    .topbar-copy {
        flex: 1;
    }

    .sidebar-summary {
        padding: 16px;
    }

    .app-body.nav-open .app-sidebar {
        transform: translateX(0);
    }

    .app-body.nav-open .nav-scrim {
        opacity: 1;
        pointer-events: auto;
    }

    .app-body.nav-open {
        overflow: hidden;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .span-2 {
        grid-column: auto;
    }

    .chat-inspector {
        grid-template-columns: 1fr;
    }

    .message-box {
        min-height: 48vh;
        max-height: none;
    }

    .thread-message-list {
        max-height: none;
    }

    .chat-layout {
        gap: 14px;
    }

    .chat-sidebar {
        padding: 16px;
    }

    .chat-sidebar .section-note {
        font-size: 0.9rem;
    }

    .channel-list {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(240px, 78vw);
        overflow-x: auto;
        padding-bottom: 4px;
        scroll-snap-type: x proximity;
    }

    .channel-card {
        scroll-snap-align: start;
    }

    .app-dock {
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        z-index: 26;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        border-radius: 24px;
        background: rgba(255, 250, 242, 0.9);
        border: 1px solid rgba(16, 32, 44, 0.08);
        box-shadow: 0 20px 34px rgba(16, 32, 44, 0.16);
        backdrop-filter: blur(16px);
    }

    .app-dock-link {
        position: relative;
        display: grid;
        place-items: center;
        min-height: 54px;
        padding: 8px 6px;
        border-radius: 18px;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 700;
        text-align: center;
        transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
    }

    .app-dock-link:hover {
        transform: translateY(-1px);
        background: rgba(255, 255, 255, 0.76);
        color: var(--text);
    }

    .app-dock-link.is-active {
        background: linear-gradient(135deg, rgba(183, 131, 73, 0.18), rgba(141, 95, 45, 0.14));
        color: var(--accent-strong);
    }

    .app-dock-label {
        line-height: 1.2;
    }

    .app-dock-badge {
        position: absolute;
        top: 6px;
        right: 10px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        background: var(--accent);
        color: #fff8ee;
        font-size: 0.7rem;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .page-intro,
    .card,
    .section-shell,
    .table-shell,
    .login-card,
    .auth-card {
        padding: 20px;
        border-radius: 22px;
    }

    .page-intro {
        flex-direction: column;
        gap: 16px;
    }

    .chat-stage-meta {
        justify-content: flex-start;
    }

    .shell-topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 14px;
    }

    .topbar-chip {
        width: 100%;
        text-align: left;
    }

    .topbar-title {
        font-size: 0.94rem;
        line-height: 1.45;
    }

    .page-intro h1,
    .page-intro h2 {
        font-size: clamp(1.6rem, 7vw, 2.1rem);
    }

    .page-summary {
        font-size: 0.94rem;
        line-height: 1.6;
    }

    .metric-grid,
    .kpi-grid,
    .dashboard-kpi-grid,
    .dashboard-performance-strip {
        grid-template-columns: 1fr;
    }

    .dashboard-trend-bar-group {
        grid-template-columns: 64px minmax(0, 1fr) 36px;
    }

    .search-actions,
    .page-head,
    .section-head,
    .notification-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .inline-form,
    .notification-actions,
    .message-actions {
        width: 100%;
    }

    .inline-form input[type="text"] {
        width: 100%;
    }

    .message-row,
    .message-row.is-self {
        flex-direction: column;
    }

    .message-avatar {
        display: none;
    }

    .directory-person,
    .directory-profile-hero,
    .profile-hero-shell {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .profile-stat-grid {
        grid-template-columns: 1fr;
    }

    .table {
        min-width: 560px;
    }

    .table thead th,
    .table tbody td {
        padding: 12px 10px;
    }

    .action-cluster {
        gap: 8px;
    }

    .action-cluster > .btn-link,
    .action-cluster > button,
    .search-actions > .btn-link,
    .search-actions > button {
        width: 100%;
    }

    .app-dock {
        left: 10px;
        right: 10px;
        gap: 6px;
        border-radius: 20px;
    }

    .app-dock-link {
        min-height: 50px;
        padding: 8px 4px;
        font-size: 0.72rem;
    }
}

@media (max-width: 540px) {
    .shell-topbar,
    .shell-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .page-intro,
    .card,
    .section-shell,
    .table-shell,
    .login-card,
    .auth-card {
        padding: 16px;
        border-radius: 18px;
    }

    .nav-toggle {
        width: 44px;
        height: 44px;
    }

    .topbar-chip {
        padding: 9px 12px;
    }

    .channel-list {
        grid-auto-columns: minmax(220px, 84vw);
    }

    .conversation-stream,
    .message-thread {
        padding: 14px;
    }

    .conversation-row,
    .message-bubble,
    .thread-form,
    .thread-upload-form {
        border-radius: 18px;
    }

    .app-dock-label {
        font-size: 0.68rem;
    }
}
