:root {
    --ink: #071c21;
    --ink-soft: #12343b;
    --brand: #f3af16;
    --brand-deep: #d89500;
    --paper: #f6f5ef;
    --white: #fff;
    --line: #dfe4df;
    --muted: #637276;
    --linkedin: #0a66c2;
    --instagram: #d83a75;
    --idea: #8b73e6;
    --draft: #ed8a3e;
    --ready: #22a889;
    --posted: #3678df;
    --danger: #c44343;
    --shadow: 0 18px 50px rgba(7, 28, 33, .08);
    --radius: 20px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
    margin: 0;
    background:
        radial-gradient(circle at 6% 2%, rgba(243, 175, 22, .12), transparent 24rem),
        var(--paper);
    color: var(--ink);
    font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 76px;
    padding: 12px clamp(20px, 4vw, 64px);
    background: rgba(7, 28, 33, .97);
    color: #fff;
    box-shadow: 0 8px 30px rgba(7, 28, 33, .16);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; }
.brand-mark {
    width: 42px;
    height: 42px;
    padding: 4px;
    border-radius: 11px;
    background: #fff;
    object-fit: contain;
}
.brand strong { display: block; font-size: 18px; letter-spacing: .01em; }
.brand small { display: block; color: #b9c6c8; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.main-nav { display: flex; gap: 5px; padding: 5px; border-radius: 14px; background: rgba(255,255,255,.07); }
.main-nav a { padding: 9px 15px; border-radius: 10px; color: #c8d2d4; font-weight: 700; }
.main-nav a:hover, .main-nav a.active { background: rgba(255,255,255,.11); color: #fff; }
.main-nav a.active { box-shadow: inset 0 -2px var(--brand); }
.user-menu { justify-self: end; display: flex; align-items: center; gap: 10px; color: #d6ddde; }
.user-menu > a { margin-left: 5px; color: var(--brand); font-weight: 700; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(243,175,22,.5); border-radius: 50%; background: rgba(243,175,22,.12); color: var(--brand); font-weight: 900; }

.page-shell { width: min(1500px, calc(100% - 44px)); min-height: calc(100vh - 140px); margin: 0 auto; padding: 38px 0 70px; }
.site-footer { padding: 23px; background: var(--ink); color: #91a2a6; text-align: center; font-size: 13px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(32px, 4vw, 50px); line-height: 1.04; letter-spacing: -.045em; }
h2 { line-height: 1.2; letter-spacing: -.025em; }
.eyebrow { margin-bottom: 7px; color: var(--brand-deep); font-size: 12px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.hero-row { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 28px; }
.hero-row p { margin-bottom: 0; color: var(--muted); font-size: 16px; }
.hero-actions { display: flex; gap: 10px; }
.compact-hero { align-items: center; }
.compact-hero h1 { font-size: clamp(32px, 3.4vw, 44px); }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 19px;
    border: 1px solid transparent;
    border-radius: 13px;
    font-weight: 800;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--brand); color: var(--ink); box-shadow: 0 10px 24px rgba(243,175,22,.22); }
.button-primary:hover { background: #ffc02c; box-shadow: 0 12px 28px rgba(243,175,22,.28); }
.button-light { border-color: var(--line); background: #fff; color: var(--ink); }
.button-block { width: 100%; }

.flash { margin: 0 0 20px; padding: 13px 16px; border: 1px solid; border-radius: 12px; font-weight: 650; }
.flash-success { border-color: #9cdcc9; background: #e7f8f2; color: #11644f; }
.flash-error { border-color: #efb4b4; background: #fff0f0; color: #922d2d; }
.flash-info { border-color: #a9c8e8; background: #edf6ff; color: #285a8c; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 18px; }
.stats-grid article { position: relative; overflow: hidden; padding: 19px 21px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.83); box-shadow: 0 8px 30px rgba(7,28,33,.035); }
.stats-grid article::after { content: ''; position: absolute; right: -12px; bottom: -22px; width: 70px; height: 70px; border-radius: 50%; background: rgba(243,175,22,.13); }
.stats-grid span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.stats-grid strong { display: block; margin-top: 6px; font-size: 28px; line-height: 1; }
.split-stat strong { display: flex; align-items: center; gap: 7px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.linkedin-dot { background: var(--linkedin); }
.instagram-dot { background: var(--instagram); }

.calendar-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.calendar-toolbar { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 18px 20px 4px; }
.calendar-toolbar h2 { min-width: 170px; margin: 0; text-align: center; font-size: 20px; }
.month-arrow { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf8; font-size: 28px; line-height: 1; }
.month-arrow:hover { border-color: var(--brand); background: #fff8e8; }
.calendar-legend { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 15px; padding: 8px 20px 17px; color: var(--muted); font-size: 12px; }
.calendar-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-status { padding: 3px 8px; border-radius: 20px; font-weight: 800; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday-row { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f7f8f4; }
.weekday-row div { padding: 10px; color: #758286; text-align: center; font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.month-grid { background: var(--line); gap: 1px; }
.day-cell { position: relative; min-height: 155px; padding: 12px 10px; background: #fff; transition: background .15s ease; }
.day-cell:hover { z-index: 1; background: #fffdf5; box-shadow: inset 0 0 0 2px var(--brand); }
.day-empty { background: #fafaf7; }
.day-empty:hover { box-shadow: none; background: #fafaf7; }
.day-number { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; color: #526166; font-size: 12px; font-weight: 900; }
.is-today .day-number { background: var(--ink); color: var(--brand); }
.day-posts { display: grid; gap: 6px; margin-top: 7px; }
.mini-post { display: grid; grid-template-columns: 1fr auto; gap: 1px 6px; min-width: 0; padding: 7px 8px; border-left: 4px solid; border-radius: 8px; background: #f7f9f9; }
.mini-post.platform-linkedin { border-left-color: var(--linkedin); background: #f0f7ff; }
.mini-post.platform-instagram { border-left-color: var(--instagram); background: #fff2f7; }
.mini-post b { min-width: 0; overflow: hidden; font-size: 10px; letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.mini-post em { grid-column: 1 / -1; min-width: 0; overflow: hidden; color: #47575b; font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.mini-post i { grid-column: 2; grid-row: 1; padding: 1px 5px; border-radius: 8px; font-size: 8px; font-style: normal; font-weight: 900; }
.more-posts { padding-left: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.mobile-post-count { display: none; }

.status-idea { background: #efeaff; color: #6047bb; }
.status-draft { background: #fff0df; color: #a64f12; }
.status-ready { background: #def6ee; color: #13765f; }
.status-posted { background: #e6f0ff; color: #255ea9; }
.platform-linkedin { color: var(--linkedin); }
.platform-instagram { color: var(--instagram); }

.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 23px; color: #718084; font-size: 13px; }
.breadcrumbs a { color: var(--ink); font-weight: 750; }
.breadcrumbs a:hover { color: var(--brand-deep); }
.empty-state { padding: 80px 25px; border: 1px dashed #c9d0cd; border-radius: var(--radius); background: rgba(255,255,255,.6); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 18px; background: #fff5d8; color: var(--brand-deep); font-size: 28px; }
.empty-state h2 { margin-bottom: 8px; font-size: 25px; }
.empty-state p { color: var(--muted); }

.post-list { display: grid; gap: 13px; }
.post-list-card { display: grid; grid-template-columns: 8px 1fr auto; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 7px 24px rgba(7,28,33,.035); transition: transform .15s ease, box-shadow .15s ease; }
.post-list-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.post-accent.platform-linkedin { background: var(--linkedin); }
.post-accent.platform-instagram { background: linear-gradient(180deg, #7c48c5, var(--instagram), #f08a31); }
.post-list-main { padding: 20px 21px; }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.platform-badge, .status-badge, .muted-tag { display: inline-flex; padding: 4px 9px; border-radius: 20px; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.platform-badge.platform-linkedin { background: #e6f2ff; }
.platform-badge.platform-instagram { background: #ffe8f1; }
.muted-tag { background: #eef0ed; color: #667579; }
.post-list-main h2 { margin: 11px 0 5px; font-size: 22px; }
.post-list-main > p { margin-bottom: 14px; color: #5e6e72; }
.card-meta { display: flex; flex-wrap: wrap; gap: 9px 20px; color: #758286; font-size: 11px; font-weight: 700; }
.card-arrow { display: grid; place-items: center; padding: 0 25px; color: #8e9a9d; font-size: 35px; }

.form-heading { margin-bottom: 18px; }
.post-form { display: grid; gap: 16px; }
.form-section { display: grid; grid-template-columns: 52px 190px 1fr; gap: 17px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 10px 35px rgba(7,28,33,.035); }
.section-number { display: grid; place-items: center; align-self: start; width: 42px; height: 42px; border-radius: 13px; background: var(--ink); color: var(--brand); font-size: 12px; font-weight: 900; }
.section-heading h2 { margin: 3px 0 4px; font-size: 19px; }
.section-heading p { color: var(--muted); font-size: 12px; }
.form-grid { display: grid; gap: 17px; }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-1 { grid-template-columns: 1fr; }
.field-wide { grid-column: 1 / -1; }
.form-grid label, .stacked-form label { display: grid; gap: 7px; color: #34484d; font-size: 12px; font-weight: 850; }
.form-grid input, .form-grid select, .form-grid textarea, .stacked-form input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cfd8d5;
    border-radius: 11px;
    outline: none;
    background: #fbfcfa;
    color: var(--ink);
    font-weight: 500;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.form-grid textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.form-grid .large-textarea { min-height: 190px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .stacked-form input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(243,175,22,.15); }
.existing-files { grid-column: 3; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 13px; }
.existing-files a { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #f9faf7; }
.existing-files a > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.existing-files small { display: block; color: var(--muted); }
.upload-zone { grid-column: 3; display: grid; place-items: center; min-height: 180px; padding: 22px; border: 2px dashed #bdc9c5; border-radius: 15px; background: #fafbf8; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.upload-zone:hover { border-color: var(--brand); background: #fffaf0; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone > span { color: var(--muted); font-size: 12px; }
.upload-zone .upload-icon { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: 8px; border-radius: 13px; background: var(--ink); color: var(--brand); font-size: 24px; }
.upload-zone strong { font-size: 15px; }
.upload-zone em { margin-top: 10px; color: var(--brand-deep); font-size: 11px; font-style: normal; font-weight: 850; }
.sticky-form-actions { position: sticky; bottom: 15px; z-index: 15; display: flex; justify-content: flex-end; gap: 10px; padding: 13px; border: 1px solid rgba(207,216,213,.9); border-radius: 16px; background: rgba(255,255,255,.9); box-shadow: 0 16px 40px rgba(7,28,33,.13); backdrop-filter: blur(10px); }

.post-detail-hero { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 26px; padding: 29px; border-radius: var(--radius); background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.post-detail-hero h1 { max-width: 980px; margin: 17px 0 8px; font-size: clamp(30px, 4vw, 48px); }
.detail-subtitle { margin: 0; color: #aebdc0; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.detail-main, .detail-sidebar { display: grid; gap: 18px; }
.detail-sidebar { position: sticky; top: 96px; }
.detail-card { padding: 23px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 8px 28px rgba(7,28,33,.035); }
.detail-card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: #627176; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.copy-button { padding: 6px 10px; border: 1px solid #d7dfdc; border-radius: 8px; background: #f7f8f5; color: var(--ink); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.copy-button:hover { border-color: var(--brand); }
.copy-content { color: #263a3f; line-height: 1.7; white-space: normal; overflow-wrap: anywhere; }
.hashtag-content { color: #255f9a; }
.empty-copy { color: #8a9699; font-style: italic; }
.planning-card h2 { margin-bottom: 18px; font-size: 18px; }
.planning-card dl { display: grid; gap: 15px; margin: 0; }
.planning-card dl div { padding-bottom: 13px; border-bottom: 1px solid #edf0ee; }
.planning-card dl div:last-child { padding-bottom: 0; border: 0; }
.planning-card dt { margin-bottom: 4px; color: #7a888b; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.planning-card dd { margin: 0; color: #2c4146; font-size: 13px; }
.audit-card { display: grid; gap: 3px; background: #f9faf7; }
.audit-card span { font-size: 12px; font-weight: 800; }
.audit-card small { margin-bottom: 10px; color: var(--muted); }
.file-list { display: grid; gap: 8px; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf8; }
.file-row > a { display: flex; align-items: center; gap: 11px; min-width: 0; }
.file-row > a > span:last-child { min-width: 0; }
.file-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row small { display: block; color: var(--muted); font-size: 10px; }
.file-icon { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #eaf2f0; color: #287064; font-weight: 900; }
.file-row form { flex: 0 0 auto; }
.text-danger { border: 0; background: transparent; color: var(--danger); font-size: 11px; font-weight: 850; }

.auth-wrap { display: grid; place-items: center; min-height: calc(100vh - 220px); }
.auth-card { position: relative; overflow: hidden; width: min(450px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 25px; background: #fff; box-shadow: 0 25px 70px rgba(7,28,33,.12); }
.auth-card h1 { font-size: 39px; }
.auth-card > p { color: var(--muted); }
.stacked-form { display: grid; gap: 17px; margin-top: 24px; }
.stacked-form label span { display: flex; justify-content: space-between; }
.stacked-form label small { color: var(--muted); font-weight: 600; }
.login-logo { display: block; width: min(260px, 82%); height: auto; margin-bottom: 28px; }
.install-card { width: min(520px, 100%); }
.help-text { margin: 18px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 1100px) {
    .site-header { grid-template-columns: 1fr auto; }
    .main-nav { grid-row: 2; grid-column: 1 / -1; justify-self: center; margin-top: 9px; }
    .form-section { grid-template-columns: 48px 1fr; }
    .section-heading { grid-column: 2; }
    .form-grid, .existing-files, .upload-zone { grid-column: 2; }
    .form-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .day-cell { min-height: 130px; }
    .mini-post em { display: none; }
}

@media (max-width: 760px) {
    .site-header { position: static; display: flex; flex-wrap: wrap; justify-content: space-between; padding: 12px 17px; }
    .brand small, .user-name { display: none; }
    .main-nav { order: 3; width: 100%; justify-content: center; }
    .main-nav a { flex: 1; text-align: center; }
    .page-shell { width: min(100% - 26px, 1500px); padding-top: 25px; }
    .hero-row, .post-detail-hero { align-items: stretch; flex-direction: column; }
    .hero-actions, .hero-actions .button { flex: 1; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .calendar-card { overflow: visible; border: 0; background: transparent; box-shadow: none; }
    .calendar-toolbar { padding-top: 9px; }
    .calendar-legend { padding-bottom: 12px; }
    .weekday-row { display: none; }
    .month-grid { grid-template-columns: 1fr; gap: 8px; background: transparent; }
    .day-empty { display: none; }
    .day-cell { display: grid; grid-template-columns: 43px 1fr; align-items: center; min-height: 65px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 5px 18px rgba(7,28,33,.03); }
    .day-cell:hover { box-shadow: inset 0 0 0 2px var(--brand); }
    .day-posts { display: flex; justify-content: flex-end; margin: 0; }
    .mini-post { display: block; width: 8px; height: 34px; padding: 0; border: 0; border-radius: 8px; }
    .mini-post.platform-linkedin { background: var(--linkedin); }
    .mini-post.platform-instagram { background: var(--instagram); }
    .mini-post > * { display: none; }
    .more-posts { align-self: center; }
    .mobile-post-count { display: block; grid-column: 2; grid-row: 1; color: var(--muted); font-size: 12px; }
    .day-posts { grid-column: 3; grid-row: 1; }
    .form-section { grid-template-columns: 40px 1fr; padding: 19px 16px; }
    .section-number { width: 36px; height: 36px; }
    .form-grid-4, .form-grid-2 { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-sidebar { position: static; }
    .post-detail-hero { padding: 23px; }
    .post-detail-hero .button { width: 100%; }
    .post-list-card { grid-template-columns: 7px 1fr; }
    .card-arrow { display: none; }
    .card-meta { display: grid; grid-template-columns: 1fr 1fr; }
    .sticky-form-actions { bottom: 7px; }
    .sticky-form-actions .button { flex: 1; }
    .auth-card { padding: 28px 23px; }
}

@media (max-width: 440px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stats-grid article { padding: 15px; }
    .stats-grid strong { font-size: 24px; }
    h1 { font-size: 34px; }
    .calendar-legend .legend-status { display: none; }
    .file-row { align-items: flex-start; }
}
