/* Greffier Panel — burnt-orange / navy retro TUI */

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: local("IBM Plex Mono"), local("IBMPlexMono-Regular");
}

@font-face {
    font-family: "VT323";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local("VT323");
}

:root {
    --navy-deep: #07111f;
    --navy: #0c1a2e;
    --navy-panel: #12243a;
    --navy-raised: #1a3050;
    --navy-line: #2a4a6e;
    --orange: #c45c26;
    --orange-hot: #e07038;
    --orange-ember: #8a3a14;
    --amber: #e8c49a;
    --amber-dim: #b8956a;
    --phosphor: #d4a574;
    --steel: #6e8aab;
    --steel-dim: #4a6280;
    --ok: #7a9e6a;
    --danger: #b84a3a;
    --scan: rgba(196, 92, 38, 0.04);
    --font-ui: "IBM Plex Mono", "Courier New", Courier, "Liberation Mono", monospace;
    --font-display: "VT323", "Courier New", Courier, monospace;
    --radius: 0;
    --border: 1px solid var(--navy-line);
    --border-hot: 1px solid var(--orange);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--navy-deep);
    color: var(--amber);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: none;
    text-rendering: optimizeSpeed;
}

body {
    background:
        linear-gradient(180deg, transparent 50%, var(--scan) 50%),
        radial-gradient(ellipse at 50% 0%, #152a45 0%, var(--navy-deep) 70%);
    background-size: 100% 4px, 100% 100%;
    background-attachment: fixed;
}

a {
    color: var(--orange-hot);
    text-decoration: none;
}
a:hover {
    color: var(--amber);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Shell */
.tui-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.tui-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1rem;
    background: var(--navy);
    border-bottom: 2px solid var(--orange);
    box-shadow: inset 0 -1px 0 var(--orange-ember);
}

.tui-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.tui-menu {
    position: relative;
}

.tui-menu-trigger {
    list-style: none;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--amber);
    background: var(--navy-panel);
    border: 1px solid var(--navy-line);
    border-radius: 2px;
    padding: 0.35rem 0.65rem;
}

.tui-menu-trigger::-webkit-details-marker {
    display: none;
}

.tui-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 11rem;
    background: var(--navy-panel);
    border: 1px solid var(--navy-line);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 20;
    display: flex;
    flex-direction: column;
}

.tui-menu-item {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    text-align: left;
    color: var(--text);
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--navy-line);
    padding: 0.65rem 0.85rem;
    cursor: pointer;
}

.tui-menu-item:last-child {
    border-bottom: 0;
}

.tui-menu-item:hover:not(:disabled) {
    background: rgba(255, 140, 0, 0.08);
    color: var(--amber);
}

.tui-menu-item:disabled {
    opacity: 0.5;
    cursor: wait;
}

.tui-menu-link {
    display: block;
    text-decoration: none;
    box-sizing: border-box;
}

.tui-menu-link.active {
    color: var(--orange-hot);
    background: rgba(255, 140, 0, 0.08);
}

.tui-status-menu {
    position: relative;
}

.tui-status-trigger {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--steel);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    padding: 0.35rem 0.55rem;
}

.tui-status-trigger::-webkit-details-marker {
    display: none;
}

.tui-status-menu[open] .tui-status-trigger {
    border-color: var(--navy-line);
    background: var(--navy-panel);
}

.tui-action-banner {
    margin: 0;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--navy-line);
}

.tui-action-banner.is-ok {
    background: rgba(46, 160, 67, 0.12);
    color: var(--ok);
}

.tui-action-banner.is-error {
    background: rgba(248, 81, 73, 0.12);
    color: var(--danger);
}

.tui-brand {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 0.12em;
    color: var(--orange-hot);
    text-transform: uppercase;
    line-height: 1;
}

.tui-brand span {
    color: var(--steel);
    font-size: 0.55em;
    letter-spacing: 0.2em;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.tui-status-trigger::before {
    content: none;
}

.tui-status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 6px var(--ok);
}

.tui-status-trigger.is-offline .tui-status-dot {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

.tui-status-trigger.is-connecting,
.tui-status-trigger.is-syncing,
.tui-status-trigger.is-offline {
    color: var(--amber);
}

.tui-status-spinner {
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid var(--navy-line);
    border-top-color: var(--orange-hot);
    border-radius: 50%;
    animation: tui-spin 0.7s linear infinite;
}

@keyframes tui-spin {
    to { transform: rotate(360deg); }
}

.panel-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
    background: var(--navy-panel);
    border-bottom: var(--border);
}

.panel-nav a,
.panel-nav a.nav-item {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--amber-dim);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.65rem 1rem;
    border-right: var(--border);
    border-bottom: 2px solid transparent;
}

.panel-nav a:hover,
.panel-nav a.nav-item:hover {
    color: var(--amber);
    background: var(--navy-raised);
    text-decoration: none;
}

.panel-nav a.active,
.panel-nav a.nav-item.active,
.panel-nav a.active:hover,
.panel-nav a.nav-item.active:hover {
    color: var(--orange-hot);
    background: var(--navy-raised);
    border-bottom-color: var(--orange-hot);
    font-weight: 600;
}

.panel-nav a:focus-visible {
    outline: 1px solid var(--orange);
    outline-offset: -2px;
}

.tui-main {
    flex: 1;
    width: 100%;
    max-width: 44rem;
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
}

.tui-frame {
    border: var(--border-hot);
    background: var(--navy-panel);
    box-shadow:
        0 0 0 1px var(--orange-ember),
        inset 0 0 40px rgba(7, 17, 31, 0.55);
    padding: 1rem 1.1rem 1.25rem;
}

/* Type */
h3 {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 400;
    color: var(--orange-hot);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 0.35rem;
    line-height: 1;
}

h3::before {
    content: "> ";
    color: var(--orange);
}

/* FocusOnNavigate focuses the page h3 — kill the browser's default white focus ring */
h3:focus,
h3:focus-visible {
    outline: none;
}

h4 {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--steel);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin: 0 0 0.65rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px dashed var(--navy-line);
}

h4::before {
    content: "[ ";
    color: var(--orange);
}
h4::after {
    content: " ]";
    color: var(--orange);
}

p {
    color: var(--amber-dim);
    margin: 0 0 0.85rem;
}

section {
    margin-bottom: 1.4rem;
    padding: 0.75rem 0.85rem;
    background: rgba(7, 17, 31, 0.45);
    border: var(--border);
}

section:last-child {
    margin-bottom: 0;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

li {
    padding: 0.55rem 0;
    border-bottom: 1px dotted var(--navy-line);
    color: var(--phosphor);
}

li:last-child {
    border-bottom: none;
}

li strong {
    color: var(--amber);
    font-weight: 600;
}

ul.queue-list li {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 1.5rem 0;
}

ul.queue-list li.is-archive-pending {
    overflow: hidden;
}

ul.queue-list li.is-archive-leaving {
    animation: archive-row-out 280ms ease-in forwards;
}

.archive-undo {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    padding: 0.55rem 0.15rem 0.7rem;
    animation: archive-undo-in 220ms ease-out;
}

.archive-undo-message {
    margin: 0;
    flex: 1 1 12rem;
    color: var(--steel);
    font-size: 0.9rem;
    line-height: 1.35;
}

.archive-undo-cancel {
    margin: 0;
    flex: 0 0 auto;
    background: transparent;
    border-color: var(--navy-line);
    color: var(--amber);
    text-transform: none;
    letter-spacing: 0.02em;
}

.archive-undo-cancel:hover:not(:disabled) {
    border-color: var(--amber);
    background: var(--navy-raised);
}

.archive-undo-cancel:disabled {
    opacity: 0.45;
    cursor: default;
}

.archive-undo-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--navy-line);
    transform-origin: left center;
    animation: archive-undo-countdown 10s linear forwards;
}

@keyframes archive-undo-in {
    from {
        opacity: 0;
        transform: translateY(-0.35rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes archive-row-out {
    from {
        opacity: 1;
        max-height: 6rem;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        max-height: 0;
        margin: 0;
        padding: 0;
        transform: translateX(1.25rem);
    }
}

@keyframes archive-undo-countdown {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

ul.queue-list .queue-top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.65rem;
    width: 100%;
}

ul.queue-list .queue-top-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    margin-left: auto;
    text-align: right;
    max-width: min(100%, 22rem);
}

ul.queue-list .queue-date {
    color: var(--steel-dim);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

ul.queue-list .queue-title {
    flex: 1 1 12rem;
    color: var(--amber);
}

ul.queue-list .queue-attr {
    color: var(--steel);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

a.queue-attr.queue-source {
    color: var(--steel);
    text-decoration: none;
    flex: 0 1 auto;
}

a.queue-attr.queue-source:hover {
    color: var(--orange-hot);
    text-decoration: underline;
    text-underline-offset: 3px;
}

ul.queue-list .queue-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
}

ul.queue-list .queue-archive-row,
ul.queue-list .live-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    margin-top: 0.75rem;
}

ul.queue-list .queue-archive-row {
    justify-content: flex-start;
}

ul.queue-list .queue-archive {
    margin: 0;
}

ul.queue-list .queue-feedback-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

ul.queue-list .queue-feedback {
    margin: 0;
    min-width: 1.75rem;
    text-transform: none;
    letter-spacing: 0;
    background: transparent;
    border-color: var(--navy-line);
    color: var(--navy-line);
}

ul.queue-list .queue-feedback:hover {
    background: var(--navy-raised);
    border-color: var(--steel);
    color: var(--steel);
}

ul.queue-list .queue-feedback:active {
    background: var(--navy-deep);
    border-color: var(--steel-dim);
    color: var(--steel-dim);
}

ul.queue-list .live-actions .queue-accept-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

ul.queue-list .live-actions .queue-accept-group button {
    margin: 0;
}

ul.queue-list .queue-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 0;
}

.tag-row {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.15rem 0;
    align-items: baseline;
}

.tag-chip {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: lowercase;
    color: var(--steel);
    background: none;
    border: none;
    padding: 0;
}

.tag-chip + .tag-chip::before {
    content: "·";
    margin: 0 0.35rem;
    color: var(--steel-dim);
    font-weight: 400;
}

button.tag-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 0 0.35rem;
    padding: 0 0.2rem;
    min-width: 1rem;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--steel-dim);
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

button.tag-add:hover {
    background: transparent;
    border: none;
    color: var(--amber);
}

button.tag-add:active {
    background: transparent;
    color: var(--orange-hot);
}

.tag-picker .tag-edit {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 1.75rem;
    min-height: 1.75rem;
    max-height: 1.75rem;
    margin: 0 0 0.35rem;
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.2;
    resize: none;
}

.tag-picker {
    display: flex;
    flex-direction: column;
    flex: 0 1 16rem;
    width: 16rem;
    max-width: min(16rem, 100%);
    min-width: 12rem;
    padding: 0.4rem 0.45rem;
    background: var(--navy-deep);
    border: 1px solid var(--navy-line);
}

.tag-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 10rem;
    overflow: auto;
    border: 1px solid var(--navy-line);
    background: var(--navy-raised);
}

.tag-picker-list li {
    padding: 0;
    border-bottom: 1px dotted var(--navy-line);
}

.tag-picker-list li:last-child {
    border-bottom: none;
}

.tag-picker-option {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.3rem 0.45rem;
    color: var(--steel);
    font-size: 0.75rem;
    text-transform: lowercase;
    cursor: pointer;
}

.tag-picker-option.is-selected {
    color: var(--amber);
    background: rgba(232, 168, 74, 0.08);
}

.tag-picker-option input {
    display: inline-block;
    width: auto;
    margin: 0;
    padding: 0;
    accent-color: var(--orange);
}

.tag-picker-create {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.35rem 0.45rem;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--orange-hot);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
}

.tag-picker-create:hover {
    background: rgba(232, 168, 74, 0.1);
    color: var(--amber);
    border: none;
}

.tag-picker-empty {
    padding: 0.4rem 0.45rem;
    color: var(--steel-dim);
    font-size: 0.75rem;
}

.tag-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.tag-picker-actions button {
    margin: 0;
}

.why-note {
    margin-top: 0.35rem;
    padding: 0.4rem 0.55rem;
    background: var(--navy-deep);
    border-left: 3px solid var(--danger);
    color: var(--amber-dim);
    font-size: 0.85rem;
}

.why-note span {
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 0.35rem;
}

pre {
    margin: 0;
    padding: 0.65rem 0.75rem;
    background: var(--navy-deep);
    border: 1px solid var(--navy-line);
    color: var(--phosphor);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 22rem;
    overflow: auto;
}

/* Controls */
input,
textarea {
    display: block;
    width: 100%;
    margin: 0.35rem 0;
    padding: 0.45rem 0.55rem;
    background: var(--navy-deep);
    border: 1px solid var(--navy-line);
    border-radius: var(--radius);
    color: var(--amber);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    caret-color: var(--orange-hot);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: inset 0 0 0 1px var(--orange-ember);
}

input::placeholder,
textarea::placeholder {
    color: var(--steel-dim);
}

button {
    display: inline-block;
    margin: 0.3rem 0.35rem 0.3rem 0;
    padding: 0.35rem 0.7rem;
    background: var(--navy-raised);
    border: 1px solid var(--orange);
    border-radius: var(--radius);
    color: var(--orange-hot);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

button:hover {
    background: var(--orange);
    color: var(--navy-deep);
}

button:active {
    background: var(--orange-ember);
    color: var(--amber);
}

button:focus-visible {
    outline: 1px dashed var(--amber);
    outline-offset: 2px;
}

button.btn-primary {
    background: var(--orange);
    border-color: var(--orange-hot);
    color: var(--navy-deep);
}

button.btn-primary:hover {
    background: var(--orange-hot);
    color: var(--navy-deep);
}

button.btn-quiet {
    border-color: var(--navy-line);
    color: var(--steel);
    background: transparent;
}

button.btn-quiet:hover {
    border-color: var(--amber-dim);
    color: var(--amber);
    background: var(--navy-raised);
}

button.btn-danger {
    border-color: var(--danger);
    color: var(--danger);
}

button.btn-danger:hover {
    background: var(--danger);
    color: var(--amber);
}

.tools-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.page-header h3 {
    margin: 0;
}

button.page-help-toggle {
    flex: 0 0 auto;
    min-width: 2rem;
    font-size: 1rem;
    font-weight: 700;
}

.page-help {
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    background: rgba(7, 17, 31, 0.45);
    border: 1px solid var(--navy-line);
}

.page-help p {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--steel-dim);
}

.page-help p:last-child {
    margin-bottom: 0;
}

.page-help strong {
    color: var(--amber);
    font-weight: 600;
}

.tools-header h3 {
    margin-bottom: 0.15rem;
}

.tools-header .meta {
    margin: 0;
}

.tools-filter {
    max-width: 28rem;
}

.tool-list .tool-url {
    margin-top: 0.45rem;
    font-size: 0.75rem;
    word-break: break-all;
}

.tool-list .tool-url a {
    color: var(--steel);
}

.tool-list .tool-url a:hover {
    color: var(--orange-hot);
}

.tool-notes {
    margin-top: 0.4rem;
    padding: 0.4rem 0.55rem;
    background: var(--navy-deep);
    border-left: 3px solid var(--steel);
    color: var(--amber-dim);
    font-size: 0.85rem;
}

.tool-notes span {
    display: block;
    color: var(--steel);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.tool-notes pre {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    max-height: none;
    font-size: 0.85rem;
}

.rule-out-panel {
    margin-top: 0.45rem;
    padding: 0.55rem;
    background: var(--navy-deep);
    border: 1px solid var(--navy-line);
}

.tool-card-actions {
    align-items: center;
}

/* Tools rows: tags flush left; action buttons stay on the right. */
ul.tool-list .live-actions.tool-card-actions .queue-tags {
    justify-content: flex-start;
    flex: 1 1 auto;
    min-width: 0;
}

ul.tool-list .live-actions.tool-card-actions > button:first-of-type {
    margin-left: auto;
}

.tool-menu {
    position: relative;
    display: inline-flex;
    margin: 0.3rem 0.35rem 0.3rem 0;
}

button.btn-icon,
button.tool-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    margin: 0;
    padding: 0.25rem 0.45rem;
    background: transparent;
    border: 1px solid var(--navy-line);
    border-radius: var(--radius);
    color: var(--steel);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1;
}

button.btn-icon:hover,
button.tool-menu-toggle:hover {
    background: var(--navy-raised);
    border-color: var(--steel);
    color: var(--amber);
}

button.btn-icon:active,
button.tool-menu-toggle:active {
    background: var(--navy-deep);
    color: var(--amber);
}

.tool-menu-pop {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    z-index: 25;
    min-width: 9rem;
    padding: 0.25rem;
    background: var(--navy-raised);
    border: 1px solid var(--navy-line);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

button.tool-menu-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.65rem;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--amber-dim);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

button.tool-menu-item:hover {
    background: var(--navy-deep);
    color: var(--orange-hot);
}

button.tool-menu-item:active {
    background: var(--navy-deep);
    color: var(--amber);
}

.ruled-out-section {
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--navy-line);
}

.ruled-out-toggle {
    margin: 0 0 0.65rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(7, 17, 31, 0.78);
}

.modal-panel {
    width: min(28rem, 100%);
    max-height: min(90vh, 40rem);
    overflow: auto;
    padding: 1rem 1.1rem 1.1rem;
    background: var(--navy-panel);
    border: var(--border-hot);
    box-shadow: 0 0 0 1px var(--navy-deep);
}

.modal-panel h4 {
    margin: 0 0 0.75rem;
}

.modal-panel label.meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.5rem 0;
    cursor: pointer;
}

.modal-panel label.meta.modal-field-label {
    display: block;
    margin: 0.55rem 0 0.25rem;
    cursor: default;
}

.modal-panel .tool-notes {
    margin: 0.35rem 0 0.65rem;
}

.modal-panel label.meta input[type="checkbox"] {
    display: inline-block;
    width: auto;
    margin: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

code {
    color: var(--orange-hot);
    font-family: var(--font-ui);
}

.list-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0 0 1rem;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
}

.filter-row button.tab-active,
.list-tabs button.tab-active {
    color: var(--orange-hot);
    border-color: var(--orange);
    background: var(--navy-raised);
}

.list-tabs button {
    margin: 0;
    border-color: var(--navy-line);
    color: var(--amber-dim);
    background: var(--navy-deep);
}

.filter-row button {
    margin: 0;
}

.tab-count {
    margin-left: 0.35rem;
    color: var(--steel);
    font-weight: 400;
}

.queue-section-toggle {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    width: 100%;
    margin: 0 0 0.65rem;
    padding: 0 0 0.35rem;
    border: none;
    border-bottom: 1px dashed var(--navy-line);
    border-radius: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
    text-transform: none;
    letter-spacing: normal;
    font-weight: inherit;
    font-size: inherit;
}

.queue-section-toggle:hover {
    background: transparent;
    color: inherit;
}

.queue-section-toggle:hover .queue-section-heading {
    color: var(--amber);
}

.queue-section-toggle:active {
    background: transparent;
    color: inherit;
}

.queue-section-toggle:focus-visible {
    outline: 1px solid var(--orange);
    outline-offset: 2px;
}

.queue-section-arrow {
    flex: 0 0 auto;
    width: 0.85rem;
    color: var(--orange);
    font-size: 0.85rem;
    line-height: 1;
}

.queue-section-heading {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--steel);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.queue-section-heading::before {
    content: "[ ";
    color: var(--orange);
}

.queue-section-heading::after {
    content: " ]";
    color: var(--orange);
}

.queue-section.is-collapsed .queue-section-toggle {
    margin-bottom: 0;
}

.queue-section-body > .meta:first-child {
    margin-top: 0;
}

.section-label {
    margin: 0.85rem 0 0.45rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--steel);
}

.meta {
    font-size: 0.75rem;
    color: var(--steel-dim);
}

.live-list li {
    padding: 0.65rem 0;
}

.live-title {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
}

.live-id {
    font-size: 0.7rem;
    color: var(--steel-dim);
}

.live-detail {
    margin-top: 0.25rem;
    color: var(--amber-dim);
    font-size: 0.85rem;
}

.live-actions {
    margin-top: 0.35rem;
}

.agent-selected {
    border-left: 3px solid var(--orange-hot);
    padding-left: 0.55rem;
    background: rgba(196, 92, 38, 0.08);
}

.pane-output {
    max-height: 16rem;
    overflow: auto;
    margin: 0.5rem 0;
}

/* Scrollbars */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-track {
    background: var(--navy-deep);
}
*::-webkit-scrollbar-thumb {
    background: var(--orange-ember);
    border: 1px solid var(--navy-line);
}

@media (max-width: 520px) {
    .tui-brand {
        font-size: 1.55rem;
    }
    .tui-status-trigger {
        font-size: 0.65rem;
    }
    .tui-status-label {
        max-width: 9rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .panel-nav a {
        flex: 1 1 auto;
        text-align: center;
        border-right: none;
        border-bottom: 1px solid var(--navy-line);
    }
}
