:root {
    --teal: #28AA9E;
    --teal-deep: #1E8579;
    --headline: #0F4943;
    --primary: #155D54;
    --mint: #E8FEFB;
    --white: #FFFFFF;
    --grey: #6B7C79;
    --line: #D4EEEA;
    --red: #C0392B;
    --amber: #B9770E;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--mint);
    color: var(--headline);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wrap { width: min(1100px, 94%); margin: 32px auto; flex: 1; }

/* Top bar */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 3%;
    flex-wrap: wrap;
    gap: 10px;
}
.brand {
    font-weight: 700;
    font-size: 20px;
    color: var(--headline);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.brand em { color: var(--teal); font-style: italic; font-weight: 400; }
.brand-logo { height: 34px; display: block; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 999px;
}
.topbar nav a:hover { background: var(--mint); }
.topbar nav a.active { background: var(--teal); color: var(--white); }
.topbar nav a.muted { color: var(--grey); }

/* Trending ticker */
.ticker {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--headline);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 22px;
}
.ticker-label {
    flex-shrink: 0;
    background: var(--teal);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 10px 18px;
    border-radius: 999px;
    white-space: nowrap;
}
.ticker-track { overflow: hidden; flex: 1; }
.ticker-move {
    display: inline-flex;
    gap: 34px;
    padding-left: 22px;
    white-space: nowrap;
    animation: ticker-scroll 45s linear infinite;
}
.ticker:hover .ticker-move { animation-play-state: paused; }
.ticker-item {
    color: var(--mint);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.ticker-item:hover { color: var(--white); text-decoration: underline; }
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Cards & general */
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}
h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.sub { color: var(--grey); font-size: 14px; margin-bottom: 20px; }
a { color: var(--teal-deep); }

/* Buttons */
.btn {
    display: inline-block;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    background: var(--teal);
    color: var(--white);
}
.btn:hover { background: var(--teal-deep); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--teal); }
.btn-outline:hover { background: var(--mint); }
.btn-danger { background: var(--red); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local],
input[type=url], textarea, select {
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    padding: 10px 12px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: var(--white);
    color: var(--headline);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--teal); }

/* Flash */
.flash {
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
    background: #DDF6F2;
    color: var(--primary);
    border: 1px solid var(--teal);
}
.flash-err { background: #FBEAE7; color: var(--red); border-color: var(--red); }

/* Badges */
.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 11px;
    border-radius: 999px;
    white-space: nowrap;
}
.badge-draft    { background: #EEF1F0; color: var(--grey); }
.badge-review   { background: #FDF3E0; color: var(--amber); }
.badge-changes  { background: #FBEAE7; color: var(--red); }
.badge-approved { background: #DDF6F2; color: var(--teal-deep); }
.badge-posted   { background: var(--teal); color: var(--white); }
.badge-failed   { background: var(--red); color: var(--white); }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.cal-dow { font-size: 12px; font-weight: 600; color: var(--grey); text-align: center; padding: 4px 0; }
.cal-cell {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    min-height: 92px;
    min-width: 0; /* let grid columns shrink below content width */
    padding: 6px;
    font-size: 12px;
    overflow: hidden;
}
.cal-cell.other { background: transparent; border-style: dashed; opacity: 0.5; }
.cal-cell.today { border-color: var(--teal); border-width: 2px; }
.cal-day { font-weight: 600; color: var(--grey); margin-bottom: 4px; }
.cal-post {
    display: block;
    background: var(--mint);
    border-left: 3px solid var(--teal);
    border-radius: 6px;
    padding: 4px 6px;
    margin-bottom: 4px;
    color: var(--headline);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-post:hover { filter: brightness(0.96); }

/* Design-stage colour coding */
.cal-post.design-copy      { background: #F0F2F1; border-left-color: #9AA8A5; }
.cal-post.design-requested { background: #FDF3E0; border-left-color: var(--amber); }
.cal-post.design-aw        { background: #E3ECFA; border-left-color: #3E6FB0; }
.cal-post.design-designed  { background: #DDF6F2; border-left-color: var(--teal); }

.legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--grey);
}
.legend-title { font-weight: 600; color: var(--headline); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend .swatch {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 4px;
    border-left: 3px solid transparent;
}
.legend .swatch.design-copy      { background: #F0F2F1; border-left-color: #9AA8A5; }
.legend .swatch.design-requested { background: #FDF3E0; border-left-color: var(--amber); }
.legend .swatch.design-aw        { background: #E3ECFA; border-left-color: #3E6FB0; }
.legend .swatch.design-designed  { background: #DDF6F2; border-left-color: var(--teal); }
.badge-design-copy      { background: #F0F2F1; color: var(--grey); }
.badge-design-requested { background: #FDF3E0; color: var(--amber); }
.badge-design-aw        { background: #E3ECFA; color: #3E6FB0; }
.badge-design-designed  { background: #DDF6F2; color: var(--teal-deep); }
.cal-post .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot-draft { background: var(--grey); }
.dot-review { background: var(--amber); }
.dot-changes { background: var(--red); }
.dot-approved { background: var(--teal); }
.dot-posted { background: var(--headline); }
.dot-failed { background: var(--red); }

.cal-key {
    display: block;
    font-size: 11px;
    font-weight: 600;
    background: var(--headline);
    color: var(--white);
    border-radius: 6px;
    padding: 3px 6px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-key-launch { background: var(--teal-deep); }
.cal-key-event, .cal-key-other { background: var(--primary); }

/* Post grid (library, unscheduled) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.tile {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: var(--headline);
    display: block;
}
.tile img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; background: var(--mint); }
.tile .tile-body { padding: 10px 12px; }
.tile .tile-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.tile .tile-meta { font-size: 11px; color: var(--grey); }

/* Slide viewer */
.slides { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.slides img {
    height: 380px;
    aspect-ratio: 4/5;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.slide-item { position: relative; flex-shrink: 0; }
.slide-item form { position: absolute; top: 8px; right: 8px; }

/* Comments */
.comment { border-top: 1px solid var(--line); padding: 12px 0; }
.comment .who { font-size: 13px; font-weight: 600; }
.comment .when { font-size: 11px; color: var(--grey); margin-left: 8px; font-weight: 400; }
.comment p { font-size: 14px; margin-top: 4px; white-space: pre-wrap; }

/* Caption box */
.caption-box { background: var(--mint); border-radius: 12px; padding: 16px; font-size: 14px; white-space: pre-wrap; }
.hashtags { color: var(--teal-deep); font-size: 13px; margin-top: 10px; word-break: break-word; }

/* Login */
.login-card { max-width: 400px; margin: 8vh auto; }
.login-card .brand { display: block; text-align: center; font-size: 26px; margin-bottom: 6px; }
.login-card .sub { text-align: center; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--grey); }

.footer { text-align: center; font-size: 12px; color: var(--grey); padding: 24px 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.mt { margin-top: 16px; }

@media (max-width: 700px) {
    .cal-grid { gap: 3px; }
    .cal-cell { min-height: 64px; font-size: 10px; padding: 4px; }
    .slides img { height: 260px; }
}
