/* Shared presentation layer: restrained surfaces, consistent type and spacing.
   Metric values, semantic colours, layouts and analysis behavior stay intact. */
:root {
    --dashboard-panel: #0c1418;
    --dashboard-raised: #111b20;
    --dashboard-line: rgba(186, 207, 202, 0.12);
    --dashboard-muted: #99aaa9;
}

body { color: #e8eeec; -webkit-font-smoothing: antialiased; }
body::before { filter: brightness(0.42) saturate(0.65); }
body::after { background: linear-gradient(180deg, rgba(5, 12, 13, 0.32), rgba(5, 12, 13, 0.82)); }
.brandmark::after { content: none; }
.brandmark { background: none; color: #edf2ed; -webkit-text-fill-color: #edf2ed; }
.brandmark-slash { -webkit-text-fill-color: var(--ember); }

/* The familiar command header becomes quieter once results are on screen. */
#appContainer:not(.landing-mode):not(.loading-mode) .brandmark { font-size: 1.65rem; letter-spacing: -0.055em; }
#appContainer:not(.landing-mode):not(.loading-mode) .entry-display,
#appContainer:not(.landing-mode):not(.loading-mode) .entry-input { font-size: clamp(1.25rem, 2.4vw, 1.8rem); letter-spacing: -0.05em; }
#appContainer:not(.landing-mode):not(.loading-mode) #searchSection { padding-bottom: 20px; border-bottom: 1px solid var(--dashboard-line); }
.recent-search-row { border-radius: 5px 0 0 5px; background: rgba(12, 20, 24, 0.94); box-shadow: inset 2px 0 rgba(163, 230, 53, 0.3); }
.suggestion:hover, .suggestion.is-selected { transform: none; }
.analyze, .guild-seed-button { box-shadow: none; }
#appContainer.landing-mode #searchSection { max-width: 1040px; }
#appContainer.landing-mode .brandmark { font-size: clamp(2.5rem, 7vw, 6rem); }
#appContainer.landing-mode .entry-display,
#appContainer.landing-mode .entry-input { font-size: clamp(2rem, 6vw, 4.6rem); }
.command-example { background: rgba(12, 20, 24, 0.75); border-radius: 6px; box-shadow: none; }
.command-example-label { color: var(--dashboard-muted); letter-spacing: 0.06em; }

/* One outer surface, a lighter inset surface, and fine dividers. */
.boss-tile,
.briefing-frame,
.guild-results-shell,
.not-pulled-shell,
.completion-banner,
#modalBody {
    background: var(--dashboard-panel);
    border-color: var(--dashboard-line);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.boss-tile::before,
.briefing-frame::before,
.briefing-hero-panel::after,
.tile-verdict-band::before,
.modal-verdict-band::before,
.modal-panel::before { content: none; }
.boss-tile:hover { transform: none; border-color: rgba(163, 230, 53, 0.35); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); }
.radar-tile { padding: 20px; }
.tile-analysis-shell { gap: 18px; }
.tile-header { min-height: 44px; }
.tile-boss-title { font-size: 1.35rem; line-height: 1.2; letter-spacing: -0.035em; font-weight: 600; }
.tile-date-meta { margin-bottom: 7px; font-size: 10px; letter-spacing: 0.045em; font-weight: 500; color: var(--dashboard-muted); }

/* Keep the spec visible as a conventional icon rather than a folded corner. */
.tile-spec-fold { width: 28px; height: 28px; clip-path: none; border-radius: 5px; border: 1px solid var(--dashboard-line); }
.tile-spec-fold-corner { display: none; }
.tile-spec-fold-icon { inset: 0; width: 100%; height: 100%; transform: none; opacity: 0.9; filter: none; }
.tile-meta-copy { padding-right: 34px; }
.tile-header-right:empty { display: none; }

.tile-verdict-band { padding: 16px 0; border-radius: 0; border: 0; border-top: 1px solid var(--dashboard-line); border-bottom: 1px solid var(--dashboard-line); background: transparent; }
.tile-overall-row { align-items: center; gap: 16px; }
.tile-overall-score { font-size: 3rem; line-height: 1.1; letter-spacing: -0.045em; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile-overall-label { font-family: 'Manrope', sans-serif; font-size: 0.95rem; line-height: 1.4; letter-spacing: -0.01em; opacity: 1; }
.tile-metric-grid { gap: 0 20px; }
.tile-metric-card { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 13px 0; gap: 9px; align-content: start; border-bottom: 1px solid var(--dashboard-line); }
.tile-metric-card.is-disabled { background: transparent; }
.tile-metric-topline { min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.tile-metric-label { font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 500; color: #b5c3c1; }
.tile-metric-rank { font-size: 10px; letter-spacing: 0; color: var(--dashboard-muted); font-variant-numeric: tabular-nums; }
.tile-metric-value { font-family: 'Manrope', sans-serif; font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile-metric-sub { font-size: 11px; line-height: 1.6; color: var(--dashboard-muted); overflow-wrap: anywhere; }
.tile-metric-bar { height: 3px; border-radius: 1px; margin-top: 3px; }
.tile-metric-bar-fill { opacity: 0.65; }

/* Empty encounters remain present but yield hierarchy to actual results. */
.not-pulled-shell { padding: 18px; background: rgba(12, 20, 24, 0.86); }
.not-pulled-kicker { color: var(--dashboard-muted); letter-spacing: 0.08em; font-weight: 600; }
.not-pulled-grid .radar-tile { min-height: 122px; border-radius: 8px; box-shadow: none; background: transparent; }
.tile-no-signal-shell { border: 0; border-radius: 0; background: transparent; min-height: 88px; padding: 8px; gap: 7px; }
.tile-no-signal-chip { padding: 0; border: 0; background: transparent; border-radius: 0; font-size: 9px; letter-spacing: 0.06em; font-weight: 500; }
.tile-no-signal-icon { width: 22px; height: 22px; }
.tile-no-signal-title { font-family: 'Manrope', sans-serif; font-size: 0.95rem; font-weight: 500; letter-spacing: -0.01em; }

/* Shared summary and loading treatments. */
.briefing-hero-panel, .briefing-stages-panel, .briefing-feed-panel,
.briefing-side-panel, .briefing-log-card, .comeback-card, .queue-card,
.phase-card, .live-stats-bar, .briefing-value-card, .briefing-metric-card {
    border-radius: 8px; background: var(--dashboard-raised); border-color: var(--dashboard-line); box-shadow: none;
}
.briefing-value-card { background: rgba(163, 230, 53, 0.035); }
.briefing-metric-card { background: transparent; }
.completion-summary, .completion-chip, .completion-metric-card { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.completion-summary::before { content: none; }
.completion-chip { border-left: 1px solid var(--dashboard-line); }
.completion-minutes { font-size: 1.65rem; font-weight: 500; }
.completion-eyebrow, .completion-chip-label { color: var(--dashboard-muted); font-weight: 500; letter-spacing: 0.05em; }
.completion-chip-value { font-family: 'Manrope', sans-serif; font-weight: 600; font-variant-numeric: tabular-nums; }
.briefing-value-figure { font-size: 1.65rem; font-weight: 500; }
.briefing-metric-value { font-family: 'Manrope', sans-serif; font-weight: 600; font-variant-numeric: tabular-nums; }
.briefing-value-label, .briefing-metric-label, .briefing-section-kicker,
.briefing-inline-kicker, .phase-title { font-size: 10px; letter-spacing: 0.07em; font-weight: 600; color: var(--dashboard-muted); }
.comparison-toggle, .spec-toggle { border-radius: 8px; background: transparent; }
.comparison-toggle-slider, .spec-toggle-slider { border-radius: 5px; background: rgba(163, 230, 53, 0.1); box-shadow: none; }
.toggle-btn { border-radius: 5px; }
.toggle-btn.pressing { animation: none; }

/* Apply the same surface and type rules to guilds, tables and detail views. */
.guild-boss-card, .guild-metric-tile, .guild-metric-column,
.modal-panel, .modal-command-cell, .readout-cell, .modal-radar-shell {
    border-radius: 8px; background: var(--dashboard-raised); border-color: var(--dashboard-line); box-shadow: none;
}
.guild-boss-card:hover, .guild-boss-card:focus-visible { transform: none; }
.guild-stage-eyebrow, .guild-results-eyebrow, .guild-seed-eyebrow,
.guild-seed-recent-label, .guild-metric-column-head, .guild-metric-chip,
.modal-panel-kicker, .modal-eyebrow { letter-spacing: 0.07em; font-weight: 600; }
.guild-stage-title, .guild-results-title, .guild-seed-title,
.modal-title, .modal-panel-title { font-weight: 600; letter-spacing: -0.03em; line-height: 1.25; }
.guild-metric-row { border-radius: 4px; }
.guild-metric-value, .rtr-player-tile, .modal-stat-value,
.readout-value, .modal-command-value { font-variant-numeric: tabular-nums; }
.rtr-player-tile { border-radius: 6px; box-shadow: none; }
.rtr-player-tile:hover { transform: none; box-shadow: none; }
.rtr-header-tile { border-radius: 6px; }
.leaderboard-hero, .leaderboard-section { background: var(--dashboard-panel); border-color: var(--dashboard-line); border-radius: 12px; box-shadow: none; }
.leaderboard-hero::before { content: none; }
.guild-results-title { max-width: 30ch; font-size: clamp(1.45rem, 2.4vw, 2rem); }
.leaderboard-hero-card, .leaderboard-hero-card.tone-risk,
.leaderboard-hero-card.tone-aqua, .leaderboard-hero-card.tone-discipline { background: var(--dashboard-raised); border-radius: 8px; box-shadow: none; }
.leaderboard-hero-pill { border-radius: 5px; background: transparent; border-color: var(--dashboard-line); }
.leaderboard-hero-pill-label, .leaderboard-hero-card-label { font-weight: 500; letter-spacing: 0.05em; color: var(--dashboard-muted); }
.leaderboard-section-title { font-size: 1.3rem; font-weight: 600; }
.leaderboard-slice-btn, .guild-boss-tab, .leaderboard-section-chip, .leaderboard-metric-toggle { border-radius: 6px; box-shadow: none; }
.leaderboard-metric-card.is-featured { background: var(--dashboard-raised); }
.leaderboard-metric-card:hover, .leaderboard-slice-btn:hover, .guild-boss-tab:hover { transform: none; }
.leaderboard-hero-card-value, .leaderboard-row-value { font-variant-numeric: tabular-nums; }
.modal-verdict-band { background: transparent; border-radius: 8px; box-shadow: none; }
.modal-command-panel { background: var(--dashboard-raised); }
.modal-verdict-score { font-size: 3rem; }
.modal-verdict-line { font-size: 1rem; font-weight: 500; line-height: 1.65; }
.modal-radar-shell { border: 0; background: transparent; }
.modal-verdict-band { border: 0; }
.signal-matrix-card, .avoidable-breakdown-row, .leaderboard-metric-card { border-radius: 8px; box-shadow: none; background: rgba(255, 255, 255, 0.015); }
.signal-matrix-label { font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #b5c3c1; }
.signal-matrix-pct { font-weight: 500; letter-spacing: 0; }
.signal-matrix-value { font-family: 'Manrope', sans-serif; font-variant-numeric: tabular-nums; }
.signal-matrix-bar { height: 3px; }
.modal-stat-label, .readout-label, .modal-command-label { text-transform: none; letter-spacing: 0; font-weight: 500; color: #b5c3c1; }
.modal-mode-pill, .modal-panel-chip, .guild-seed-button { border-radius: 5px; }
#bossModalBackdrop { backdrop-filter: blur(6px); }
#appContainer.modal-blurred { filter: blur(3px) brightness(0.65); }

button:focus-visible, a:focus-visible, .boss-tile:focus-visible {
    outline: 2px solid var(--aqua); outline-offset: 3px;
}
@media (max-width: 900px) {
    #appContainer:not(.landing-mode):not(.loading-mode) .search-shell { grid-template-columns: 1fr; gap: 10px; }
    #appContainer:not(.landing-mode):not(.loading-mode) .search-primary { grid-template-columns: 1fr; gap: 14px; }
    #appContainer:not(.landing-mode):not(.loading-mode) .search-meta { min-width: 0; max-width: none; width: 100%; text-align: left; align-items: flex-start; padding-top: 0; }
    #appContainer:not(.landing-mode):not(.loading-mode) .command-stage { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'entry' 'controls' 'suggestions'; row-gap: 4px; }
    #appContainer:not(.landing-mode):not(.loading-mode) .controls:not(.is-visible) { display: none; }
    #appContainer:not(.landing-mode):not(.loading-mode) .suggestions:empty { display: none; }
    #appContainer:not(.landing-mode):not(.loading-mode) .controls { flex-wrap: wrap; }
    .completion-summary-rail { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'controls summary'; gap: 12px; }
    .completion-summary { padding: 8px; }
    .completion-summary-row { display: grid; grid-template-columns: 1fr; gap: 7px; }
    .completion-title-stack { display: flex; gap: 4px; }
    .completion-chip-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
    .completion-chip { padding: 12px; border-left: 0; border-top: 1px solid var(--dashboard-line); }
    .tile-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .not-pulled-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .radar-tile { padding: 16px; }
    .tile-metric-grid { gap: 0 16px; }
    .tile-overall-score { font-size: 2.6rem; }
    .tile-overall-label { font-size: 0.9rem; }
    #appContainer:not(.landing-mode):not(.loading-mode) .brandmark { font-size: 1.5rem; }
    .not-pulled-shell { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
