:root {
    --bg: #f5efe2;
    --panel: rgba(255, 250, 242, 0.78);
    --panel-strong: rgba(255, 252, 246, 0.96);
    --line: rgba(99, 76, 53, 0.15);
    --ink: #2f271e;
    --muted: #786b5c;
    --accent: #d36f4b;
    --accent-deep: #b24d29;
    --accent-soft: rgba(211, 111, 75, 0.12);
    --teal: #2b756c;
    --teal-soft: rgba(43, 117, 108, 0.12);
    --danger: #a1473d;
    --shadow: 0 20px 60px rgba(87, 63, 43, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body,
#root {
    min-height: 100%;
    margin: 0;
}

body {
    color: var(--ink);
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    line-height: 1.45;
    background:
        radial-gradient(circle at top left, rgba(211, 111, 75, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(43, 117, 108, 0.16), transparent 26%),
        linear-gradient(180deg, #f9f4ea 0%, #f2ebdc 55%, #ece2cf 100%);
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: "Fraunces", serif;
    font-weight: 700;
}

p {
    margin: 0;
}

.eyebrow {
    margin-bottom: 0.3rem;
    color: var(--accent-deep);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.68rem;
    font-weight: 700;
}

.lede,
.muted,
.tiny-note,
.empty-copy {
    color: var(--muted);
}

.tiny-note {
    font-size: 0.78rem;
}

.app-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 300px;
    gap: 1rem;
    min-height: 100vh;
    max-width: 1660px;
    margin: 0 auto;
    padding: 1rem;
    align-items: start;
}

.app-shell.left-collapsed {
    grid-template-columns: 116px minmax(0, 1fr) 300px;
}

.app-shell.right-collapsed {
    grid-template-columns: 300px minmax(0, 1fr) 116px;
}

.app-shell.left-collapsed.right-collapsed {
    grid-template-columns: 116px minmax(0, 1fr) 116px;
}

.panel,
.login-card,
.loading-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.panel {
    padding: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.left-panel,
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.center-panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    max-width: 980px;
    justify-self: center;
    max-height: none;
    overflow: visible;
}

.panel-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 0;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-toggle {
    min-width: 88px;
}

.panel.is-collapsed .panel-header {
    flex-direction: column;
    align-items: stretch;
}

.panel.is-collapsed .panel-header-actions {
    justify-content: flex-start;
}

.user-chip {
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal);
    font-size: 0.84rem;
    font-weight: 700;
}

.task-list,
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.center-panel .timeline-list {
    overflow: visible;
    padding-right: 0;
}

.info-stack {
    overflow-y: auto;
    padding-right: 0.2rem;
}

.task-card,
.composer-card,
.post-card,
.info-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-strong);
}

.task-card,
.info-card {
    padding: 0.85rem;
}

.composer-card,
.post-card {
    padding: 0.95rem;
}

.panel h2 {
    font-size: 1.55rem;
}

.task-card h3,
.post-card h3,
.info-card h3 {
    font-size: 1.1rem;
}

.task-row,
.composer-actions,
.card-actions,
.post-topline,
.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.task-row,
.post-header,
.composer-actions {
    align-items: flex-start;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field span {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid rgba(99, 76, 53, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    padding: 0.78rem 0.9rem;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(43, 117, 108, 0.5);
    box-shadow: 0 0 0 4px rgba(43, 117, 108, 0.12);
    background: rgba(255, 255, 255, 0.95);
}

.compact textarea {
    min-height: 72px;
}

.primary-button,
.secondary-button,
.danger-button,
.switch-pill,
.file-pill {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 0.66rem 0.95rem;
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.switch-pill:hover,
.file-pill:hover {
    transform: translateY(-1px);
}

.primary-button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: white;
    box-shadow: 0 14px 28px rgba(178, 77, 41, 0.18);
}

.secondary-button,
.switch-pill,
.file-pill {
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    border: 1px solid rgba(99, 76, 53, 0.12);
}

.danger-button {
    background: rgba(161, 71, 61, 0.12);
    color: var(--danger);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.large {
    width: 100%;
    justify-content: center;
}

.full-width {
    width: 100%;
}

.file-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.file-pill input {
    display: none;
}

.file-chip {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.5rem 0.72rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-size: 0.8rem;
    font-weight: 700;
}

.collapsed-preview {
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    border: 1px dashed rgba(99, 76, 53, 0.2);
    background: rgba(255, 252, 246, 0.82);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.4;
}

.error-banner,
.empty-state {
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(161, 71, 61, 0.16);
}

.error-banner {
    background: rgba(161, 71, 61, 0.08);
    color: var(--danger);
}

.empty-state {
    background: rgba(255, 252, 246, 0.78);
    color: var(--muted);
}

.timeline-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0 0.1rem;
}

.load-more-button {
    align-self: center;
    margin-top: 0.25rem;
}

.timeline-day {
    width: 100%;
    border: 1px solid rgba(99, 76, 53, 0.12);
    border-radius: 20px;
    background: var(--panel-strong);
    overflow: hidden;
}

.timeline-day-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.9rem 0.95rem;
    border: none;
    background: var(--panel-strong);
    color: var(--ink);
    text-align: left;
}

.timeline-day-toggle:hover {
    background: var(--panel-strong);
}

.timeline-day-toggle h3 {
    font-size: 1rem;
}

.timeline-day-meta {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.timeline-day-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0 0.8rem 0.8rem;
}

.post-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-post {
    border-color: rgba(43, 117, 108, 0.18);
    background: linear-gradient(180deg, rgba(244, 251, 250, 0.94), rgba(255, 252, 246, 0.95));
}

.post-topline {
    font-size: 0.76rem;
    color: var(--muted);
}

.post-kind {
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--teal);
}

.post-time {
    text-align: right;
}

.post-content {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.post-content p {
    line-height: 1.5;
    white-space: pre-wrap;
}

.post-engagement {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.reaction-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(99, 76, 53, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 700;
}

.reaction-chip.active {
    background: var(--accent-soft);
    color: var(--accent-deep);
    border-color: rgba(211, 111, 75, 0.18);
}

.reaction-emoji {
    font-size: 0.96rem;
    line-height: 1;
}

.comment-section {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.comment-item {
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(99, 76, 53, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.54);
}

.comment-item p {
    margin-top: 0.2rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.comment-form {
    display: flex;
    align-items: flex-end;
    gap: 0.7rem;
}

.comment-field {
    flex: 1 1 auto;
}

.post-image {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid rgba(99, 76, 53, 0.12);
    background: rgba(255, 255, 255, 0.72);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--muted);
}

.standout {
    background:
        linear-gradient(135deg, rgba(211, 111, 75, 0.15), rgba(255, 252, 246, 0.92) 42%),
        linear-gradient(200deg, rgba(43, 117, 108, 0.12), transparent 55%);
}

.clock-face {
    margin-bottom: 0.35rem;
    font-family: "Fraunces", serif;
    font-size: clamp(1.7rem, 3.8vw, 2.45rem);
    line-height: 1;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 0.8rem 0;
}

.metric-grid div {
    padding: 0.7rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(99, 76, 53, 0.12);
}

.metric-label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.user-card {
    margin-top: auto;
}

.login-shell,
.loading-screen {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1.25rem;
}

.login-card,
.loading-card {
    width: min(520px, 100%);
    padding: 1.6rem;
    background:
        linear-gradient(140deg, rgba(255, 252, 246, 0.95), rgba(255, 247, 234, 0.88)),
        radial-gradient(circle at top right, rgba(43, 117, 108, 0.12), transparent 40%);
}

.login-card h1,
.loading-card h1 {
    font-size: clamp(1.8rem, 4.6vw, 2.55rem);
    margin-bottom: 0.75rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1.15rem;
}

.user-switcher {
    display: flex;
    gap: 0.55rem;
}

.switch-pill.active {
    background: var(--teal-soft);
    color: var(--teal);
    border-color: rgba(43, 117, 108, 0.18);
}

@media (max-width: 1180px) {
    .app-shell,
    .app-shell.left-collapsed,
    .app-shell.right-collapsed,
    .app-shell.left-collapsed.right-collapsed {
        grid-template-columns: 1fr;
    }

    .panel {
        max-height: none;
    }

    .left-panel,
    .center-panel,
    .right-panel {
        overflow: visible;
    }

    .task-list,
    .timeline-list,
    .info-stack {
        overflow: visible;
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .panel,
    .login-card,
    .loading-card {
        border-radius: 18px;
    }

    .task-row,
    .composer-actions,
    .card-actions,
    .panel-header,
    .post-topline,
    .comment-form,
    .timeline-toolbar,
    .timeline-day-toggle {
        flex-direction: column;
        align-items: stretch;
    }

    .user-switcher {
        flex-direction: column;
    }

    .panel-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

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

    .timeline-day-meta {
        white-space: normal;
    }
}
