/* ==========================================================================
   Johtamisen Kolmio — Nordic Editorial Design
   Aesthetic: Kinfolk meets Finnish design houses
   Fonts: Cormorant Garamond (display) + DM Sans (body)
   Palette: warm ivory, deep navy, burnished gold
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --navy: #1a2744;
    --navy-mid: #243352;
    --navy-light: #2e4066;
    --gold: #b8892e;
    --gold-light: #d4a84a;
    --gold-muted: rgba(184, 137, 46, 0.15);
    --gold-hover: #a37a28;
    --ivory: #f8f5f0;
    --ivory-dark: #efe9e0;
    --cream: #faf8f5;
    --white: #ffffff;
    --text: #2c2c2c;
    --text-light: #6b6560;
    --text-muted: #9e9790;
    --border: #e8e2da;
    --green: #3a7d5c;
    --green-muted: rgba(58, 125, 92, 0.15);
    --red: #9b2c2c;
    --red-light: #fde8e8;

    --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius: 6px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 3px rgba(26, 39, 68, 0.06);
    --shadow-md: 0 4px 12px rgba(26, 39, 68, 0.08);
    --shadow-lg: 0 8px 30px rgba(26, 39, 68, 0.12);
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--ivory);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---------- App Container ---------- */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* dynamic viewport height — fixes mobile browser chrome */
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Header ---------- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 52px;
    background: var(--navy);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ivory);
    letter-spacing: 0.01em;
}

.phase-label {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gold-light);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.restart-btn {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(248, 245, 240, 0.5);
    background: none;
    border: 1px solid rgba(248, 245, 240, 0.15);
    border-radius: var(--radius);
    padding: 4px 12px;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.02em;
}

.restart-btn:hover {
    color: var(--ivory);
    border-color: rgba(248, 245, 240, 0.4);
}

/* ---------- Main Content ---------- */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ---------- Chat Panel ---------- */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--cream);
    min-width: 0;
}

/* ---------- Messages ---------- */
.messages-container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 28px 36px;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    margin-bottom: 18px;
    animation: msgIn 0.35s ease;
}

.message-user { justify-content: flex-end; }
.message-coach { justify-content: flex-start; }
.message-system { justify-content: center; }

.message-bubble {
    max-width: 72%;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 0.92rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.bubble-user {
    background: var(--navy);
    color: var(--ivory);
    border-bottom-right-radius: 3px;
}

.bubble-coach {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    border-bottom-left-radius: 3px;
    box-shadow: var(--shadow-sm);
}

.bubble-system {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
}

/* ---------- Thinking ---------- */
.thinking {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.thinking-dots {
    display: flex;
    gap: 5px;
}

.thinking-dots span {
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.16s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   WELCOME SCREEN
   ========================================================================== */

.welcome-screen {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(184, 137, 46, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(26, 39, 68, 0.03) 0%, transparent 50%),
        var(--cream);
}

.welcome-content {
    text-align: center;
    max-width: 480px;
    animation: welcomeIn 0.6s ease;
}

@keyframes welcomeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-eyebrow {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 20px;
}

.welcome-content h2 {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.welcome-body {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.65;
    margin-bottom: 40px;
}

/* Time Selector */
.time-selector {
    margin-bottom: 36px;
}

.time-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}

.time-options {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.time-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px 12px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 100px;
    box-shadow: var(--shadow-sm);
}

.time-btn:hover {
    border-color: var(--gold-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.time-btn.selected {
    border-color: var(--gold);
    background: var(--gold-muted);
    box-shadow: 0 2px 8px rgba(184, 137, 46, 0.15);
}

.time-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}

.time-unit {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.time-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 400;
}

.time-btn.selected .time-value {
    color: var(--gold);
}

/* Start Button */
.btn-start {
    font-family: var(--font-body);
    display: inline-block;
    padding: 14px 48px;
    background: var(--navy);
    color: var(--ivory);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-md);
}

.btn-start:hover {
    background: var(--navy-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-start:disabled {
    background: var(--navy-mid);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loading-dots {
    display: inline-flex;
    gap: 3px;
    vertical-align: middle;
    margin-right: 4px;
}

.btn-loading-dots span {
    width: 5px;
    height: 5px;
    background: var(--ivory);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
    opacity: 0.7;
}

.btn-loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.btn-loading-dots span:nth-child(3) { animation-delay: 0.32s; }

/* Footer */
.welcome-footer {
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0.45;
}

.welcome-powered {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.powered-logo {
    height: 16px;
    width: auto;
}

/* ==========================================================================
   INPUT AREA
   ========================================================================== */

.input-area {
    display: flex;
    padding: 12px 24px 16px;
    background: var(--cream);
    border-top: 1px solid var(--border);
}

.input-row {
    display: flex;
    flex: 1;
    gap: 10px;
    align-items: flex-end;
}

.input-wrapper {
    display: flex;
    flex: 1;
    align-items: flex-end;
    gap: 8px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    transition: border-color var(--transition);
    box-shadow: var(--shadow-sm);
    cursor: text;
}

.input-wrapper:focus-within {
    border-color: var(--navy-light);
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--text);
    resize: none;
    line-height: 1.5;
    max-height: 120px;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    color: var(--ivory);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
}

.send-btn:hover:not(:disabled) {
    background: var(--navy-light);
}

.send-btn:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Skip Button */
.skip-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.skip-btn:hover {
    color: var(--gold);
    border-color: var(--gold);
}

/* ==========================================================================
   SIDE PANEL — Journey Map
   ========================================================================== */

.side-panel {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    padding: 28px 20px;
    background: var(--ivory-dark);
    overflow-y: auto;
    border-left: 1px solid var(--border);
}

.journey-section {
    flex: 1;
}

.journey-map {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Corner */
.journey-corner {
    transition: all 0.3s ease;
}

.journey-corner-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 4px;
}

.journey-corner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.journey-corner-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

/* Corner states */
.journey-corner.active .journey-corner-dot {
    background: var(--gold);
    border-color: var(--gold);
    box-shadow: 0 0 6px rgba(184, 137, 46, 0.3);
}

.journey-corner.active .journey-corner-name {
    color: var(--navy);
}

.journey-corner.completed .journey-corner-dot {
    background: var(--green);
    border-color: var(--green);
}

.journey-corner.completed .journey-corner-name {
    color: var(--text-muted);
}

/* Topics */
.journey-topics {
    padding-left: 14px;
    margin-left: 3px;
    border-left: 1px solid var(--border);
    margin-bottom: 4px;
}

.journey-topic {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.topic-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.topic-name {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    transition: color 0.3s ease;
}

/* Topic states */
.journey-topic.active .topic-dot {
    background: var(--gold);
    box-shadow: 0 0 5px rgba(184, 137, 46, 0.25);
}

.journey-topic.active .topic-name {
    color: var(--navy);
    font-weight: 500;
}

.journey-topic.completed .topic-dot {
    background: var(--green);
}

.journey-topic.completed .topic-name {
    color: var(--text-light);
}

/* Active corner border */
.journey-corner.active .journey-topics {
    border-left-color: var(--gold-muted);
}

.journey-corner.completed .journey-topics {
    border-left-color: var(--green-muted);
}

/* ---------- Results Link ---------- */
.results-link {
    display: inline-block;
    padding: 12px 28px;
    background: var(--navy);
    color: var(--ivory);
    text-decoration: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    box-shadow: var(--shadow-md);
}

.results-link:hover {
    background: var(--navy-light);
    box-shadow: var(--shadow-lg);
}

.synthesis-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.restart-link {
    font-family: var(--font-body);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color var(--transition);
}

.restart-link:hover {
    color: var(--navy);
}

/* Results preview card in chat */
.results-preview {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: msgIn 0.4s ease;
}

.preview-header {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 20px;
}

.preview-corners {
    display: flex;
    justify-content: space-around;
    margin-bottom: 24px;
}

.preview-corner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.preview-label {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.preview-score {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
}

/* ---------- Mobile Toggle ---------- */
.side-panel-toggle {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    color: var(--ivory);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

/* ---------- General Buttons ---------- */
.btn-primary {
    font-family: var(--font-body);
    display: inline-block;
    padding: 14px 32px;
    background: var(--navy);
    color: var(--ivory);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--navy-light);
}

.btn-primary:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ==========================================================================
   RESULTS PAGE
   ========================================================================== */

.results-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 32px 24px;
    background: var(--cream);
    min-height: 100vh;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
}

.results-header .logo {
    color: var(--navy);
}

.results-header .subtitle {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

.leader-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-light);
    font-style: italic;
}

.results-loading {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: 44px;
}

.results-section h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gold);
    display: inline-block;
}

/* Results triangle */
.results-triangle {
    max-width: 380px;
    margin: 0 auto;
}

.results-triangle-svg { width: 100%; }

.corner-label-lg {
    font-size: 13px;
    font-weight: 600;
    fill: var(--navy);
    font-family: var(--font-body);
    letter-spacing: 0.04em;
}

.corner-score {
    font-size: 22px;
    font-weight: 700;
    fill: var(--gold);
    font-family: var(--font-display);
}

/* Big picture cards */
.big-picture {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.big-picture-card {
    background: var(--white);
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.big-picture-card h3 {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.big-picture-card p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.55;
}

/* Pattern cards */
.patterns-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pattern-card {
    background: var(--white);
    padding: 20px 22px;
    border-radius: var(--radius);
    border-left: 3px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.pattern-card.severity-high { border-left-color: var(--red); }
.pattern-card.severity-medium-high { border-left-color: var(--gold); }
.pattern-card.severity-medium { border-left-color: var(--text-muted); }

.pattern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pattern-id {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--navy);
    text-transform: capitalize;
}

.pattern-severity {
    font-size: 0.68rem;
    padding: 2px 10px;
    border-radius: 10px;
    background: var(--ivory);
    color: var(--text-light);
    font-weight: 500;
}

.pattern-insight {
    font-size: 0.88rem;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.55;
}

.pattern-coaching {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--gold);
    font-style: italic;
}

.no-patterns {
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
}

/* Score heatmap */
.heatmap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.heatmap-table th {
    text-align: left;
    padding: 10px 14px;
    background: var(--navy);
    color: var(--ivory);
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.heatmap-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

.heatmap-table tr.score-high td:last-child {
    background: var(--green-muted);
    color: var(--green);
    font-weight: 600;
}

.heatmap-table tr.score-mid td:last-child {
    background: var(--gold-muted);
    color: var(--gold);
    font-weight: 600;
}

.heatmap-table tr.score-low td:last-child {
    background: var(--red-light);
    color: var(--red);
    font-weight: 600;
}

.heatmap-table tr.no-score td:last-child {
    color: var(--text-muted);
}

/* Results CTA */
.results-cta {
    text-align: center;
    padding: 36px 0;
}

/* ---------- Feedback Section ---------- */
.feedback-section {
    border-top: 2px solid var(--gold);
    padding-top: 36px;
    margin-top: 8px;
}

.feedback-intro {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.92rem;
}

.feedback-q {
    margin-bottom: 28px;
}

.feedback-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--navy);
    margin-bottom: 12px;
}

.feedback-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-options button {
    font-family: var(--font-body);
    text-align: left;
    padding: 11px 18px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.feedback-options button:hover {
    border-color: var(--gold-light);
    box-shadow: var(--shadow-md);
}

.feedback-options button.selected {
    background: var(--navy);
    color: var(--ivory);
    border-color: var(--navy);
}

.feedback-submit {
    margin-top: 28px;
    width: 100%;
}

.feedback-thanks {
    text-align: center;
    padding: 36px 0;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--navy);
    font-weight: 600;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .app-container {
        height: 100%;
        max-height: none;
        overflow: visible;
    }

    .app-header {
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .main-content {
        flex-direction: column;
        overflow: visible;
        flex: 1;
    }

    .chat-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .messages-container {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px;
    }

    .input-area {
        position: sticky;
        bottom: 0;
        z-index: 50;
        background: var(--cream);
        border-top: 1px solid var(--border);
    }

    /* Prevent iOS zoom on input focus — font must be >= 16px */
    .message-input {
        font-size: 16px;
    }

    .side-panel {
        position: fixed;
        top: 0;
        right: -100%;
        width: 240px;
        height: 100vh;
        z-index: 200;
        transition: right 0.3s ease;
        box-shadow: -4px 0 20px rgba(26, 39, 68, 0.1);
    }

    .side-panel.open {
        right: 0;
    }

    .side-panel-toggle {
        display: flex;
    }

    .welcome-content h2 {
        font-size: 2rem;
    }

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

    .heatmap-table td,
    .heatmap-table th {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0 16px;
        height: 48px;
    }

    .logo {
        font-size: 1rem;
    }

    .messages-container {
        padding: 16px;
    }

    .input-area {
        padding: 10px 16px;
    }

    .welcome-content h2 {
        font-size: 1.7rem;
    }

    .time-options {
        gap: 8px;
    }

    .time-btn {
        min-width: 80px;
        padding: 12px 6px 10px;
    }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--navy-light);
    outline-offset: 2px;
}

/* Let the input wrapper handle its own focus, no outline on the textarea */
.message-input:focus-visible {
    outline: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
