/* AkashiMedia dashboard — dark, calm and content-first. */
:root {
  --bg: #111111;
  --surface: #1b1c1c;
  --surface-raised: #242525;
  --surface-soft: #2c2d2d;
  --line: #343636;
  --line-strong: #454747;
  --text: #f2f2ef;
  --muted: #a5a7a6;
  --subtle: #737676;
  --green: #91c87d;
  --green-strong: #a4d78f;
  --green-ink: #152114;
  --blue: #2d78c4;
  --blue-soft: #123754;
  --instagram: #e74487;
  --linkedin: #4d9ed5;
  --danger: #e67c73;
  --ok: #91c87d;
  --radius: 14px;
  --radius-sm: 9px;
  --space-1: 6px;
  --space-2: 12px;
  --space-3: 20px;
  --space-4: 30px;
  --ring: 0 0 0 3px rgb(145 200 125 / 32%);
  --ease: 160ms ease;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
a { color: inherit; }

/* ---------- Global notice and app structure ---------- */
.notice-bar { min-height: 48px; padding: 10px 26px; background: #103653; border-bottom: 1px solid #1d4e70; color: #e9f1f6; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: 14px; }
.notice-bar strong { color: #fff; }
.notice-bar a { border: 1px solid rgb(255 255 255 / 22%); border-radius: 7px; padding: 4px 10px; text-decoration: none; white-space: nowrap; }
.notice-bar a:hover { background: rgb(255 255 255 / 10%); }
.dashboard-shell { min-height: calc(100vh - 48px); display: grid; grid-template-columns: 286px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: calc(100vh - 48px); padding: 24px 16px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #151515; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 21px; font-weight: 750; letter-spacing: -0.04em; text-decoration: none; padding: 0 10px; }
.brand__mark { display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid currentColor; border-radius: 8px 4px 8px 4px; font-size: 13px; letter-spacing: 0; }
.new-post { display: flex; justify-content: center; align-items: center; gap: 6px; width: 100%; margin: 28px 0 16px; padding: 12px 16px; border: 0; border-radius: 999px; background: var(--green); color: var(--green-ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: filter var(--ease), transform var(--ease); }
.new-post:hover { filter: brightness(1.08); transform: translateY(-1px); }
.side-nav { display: grid; gap: 3px; }
.side-nav__item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 9px 12px; border-radius: 8px; color: #d2d4d2; text-decoration: none; font-weight: 600; }
.side-nav__button { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.side-nav__item:hover { background: var(--surface-raised); }
.side-nav__item--active { background: #2b2c2c; color: #fff; }
.side-nav__item--future { color: var(--subtle); cursor: default; }
.side-nav__item small { margin-left: auto; color: #79956b; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.nav-icon { width: 20px; color: var(--muted); text-align: center; font-size: 18px; line-height: 1; }
.side-nav__item--active .nav-icon { color: var(--green); }
.channels { margin: 28px 8px 0; padding-top: 2px; }
.channels > p { margin: 0 0 10px; color: var(--subtle); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.channel-row { display: flex; align-items: center; gap: 10px; min-height: 40px; color: #d2d4d2; font-size: 14px; font-weight: 600; }
.channel-row i { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: var(--green); }
.channel-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: white; font-size: 15px; font-weight: 800; font-style: normal; line-height: 1; }
.channel-icon--instagram { background: var(--instagram); }
.channel-icon--linkedin { background: var(--linkedin); font-size: 13px; }
.sidebar__account { display: flex; align-items: center; gap: 10px; margin: auto -4px 0; padding: 15px 10px 0; border-top: 1px solid var(--line); }
.sidebar__account > span:nth-child(2) { min-width: 0; display: grid; line-height: 1.2; }
.sidebar__account strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sidebar__account small { margin-top: 3px; color: var(--subtle); font-size: 11px; }
.account-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 31px; height: 31px; border-radius: 9px; background: #7776c7; color: #f8f7ff; font-size: 13px; font-weight: 800; }
.sidebar__account form { margin-left: auto; }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover { background: var(--surface-raised); color: var(--text); }
.dashboard-main { width: min(1500px, 100%); padding: 36px 44px 60px; }

/* ---------- Homepage ---------- */
.welcome-panel { padding: 0 0 28px; }
.welcome-panel__eyebrow, .eyebrow { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.welcome-sun { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: 9px; border-radius: 10px; background: #25313c; color: #f4c858; font-size: 20px; vertical-align: middle; }
.welcome-panel h1 { margin: 14px 0 3px; font-size: clamp(28px, 3.1vw, 42px); letter-spacing: -0.045em; line-height: 1.08; }
.welcome-panel p { margin: 0; color: var(--muted); }
.metric-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.metric { display: flex; align-items: center; gap: 15px; min-height: 100px; padding: 18px 22px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric__value { display: grid; place-items: center; width: 54px; height: 54px; flex: 0 0 auto; border: 3px solid var(--line-strong); border-radius: 50%; color: var(--muted); font-size: 24px; font-weight: 700; }
.metric strong, .metric small { display: block; }
.metric strong { font-size: 15px; }
.metric small { margin-top: 3px; color: var(--subtle); font-size: 12px; }
.setup-section { margin-top: 42px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-2); margin-bottom: 15px; }
.section-heading .eyebrow { margin: 0 0 3px; }
.section-heading h2, .editor-card h2, .empty-card h2 { margin: 0; font-size: 20px; letter-spacing: -0.025em; }
.section-heading a, .text-action { color: #cce7c4; font-size: 14px; font-weight: 700; text-decoration: none; }
.section-heading a:hover, .text-action:hover { text-decoration: underline; }
.text-action--button { padding: 0; border: 0; background: transparent; font: inherit; cursor: pointer; }
.setup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.setup-card, .empty-card, .editor-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.setup-card { min-height: 218px; padding: 22px; display: flex; flex-direction: column; }
.setup-card__number { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.setup-card h3 { margin: 13px 0 8px; font-size: 18px; letter-spacing: -0.02em; }
.setup-card p { margin: 0; color: var(--muted); font-size: 14px; }
.card-state, .text-action { margin-top: auto; padding-top: 16px; }
.card-state { color: var(--green-strong); font-size: 13px; font-weight: 700; }
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.empty-card { min-height: 226px; overflow: hidden; }
.empty-card__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.empty-card__head h2 { font-size: 16px; }
.future-label { color: #79956b; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.empty-card__body { min-height: 158px; display: grid; place-content: center; justify-items: center; text-align: center; padding: 20px; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 23px; }
.empty-card__body p { margin: 13px 0 2px; font-weight: 650; }
.empty-card__body small { color: var(--subtle); max-width: 300px; }
.ideas-panel { margin-top: 28px; }
.ideas-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ideas-empty { grid-column: 1 / -1; margin: 0; padding: 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.idea-card { min-height: 145px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.idea-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #b8dcae; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.idea-card h3 { margin: 12px 0 6px; font-size: 16px; letter-spacing: -.02em; }
.idea-card p { margin: 0; color: var(--muted); font-size: 13px; white-space: pre-line; }

/* ---------- Editor ---------- */
.editor-card { margin-top: 34px; scroll-margin-top: 20px; overflow: hidden; }
.editor-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 22px 24px; border-bottom: 1px solid var(--line); }
.editor-card__head .eyebrow { margin: 0 0 4px; }
.platform-summary { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 650; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); }
.editor-pane { min-width: 0; padding: 24px; }
.editor-pane + .editor-pane { border-left: 1px solid var(--line); }
.editor-pane--linkedin { background: #1a1d20; }
.editor-pane__head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.editor-pane__head h3 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.editor-pane__badge { display: inline-flex; padding: 4px 7px; border: 1px solid rgb(231 68 135 / 55%); border-radius: 6px; color: #ff9cc3; font-size: 11px; font-weight: 800; }
.editor-pane__badge--linkedin { border-color: rgb(77 158 213 / 55%); color: #9fd7ff; }
.editor-pane__intro { max-width: 440px; margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.composer-form { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; }
.field__label { color: var(--muted); font-size: 13px; font-weight: 650; }
.field__input, .field__textarea, .field__file { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #202121; color: var(--text); padding: 11px 12px; }
.field__textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.field__textarea::placeholder { color: var(--subtle); }
.media-field__head { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.media-field__head > div { display: grid; gap: 3px; }
.media-field__head small { color: var(--subtle); font-size: 11px; }
.media-clear { padding: 5px 9px; border: 0; border-radius: 999px; background: transparent; color: #ffaaa3; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.media-clear:hover { background: rgb(220 38 38 / 14%); }
.media-clear:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.media-picker { display: flex; align-items: stretch; gap: 10px; min-width: 0; }
.dropzone { position: relative; display: grid; flex: 0 0 170px; place-items: center; min-height: 150px; padding: 20px 14px; border: 1px dashed #737876; border-radius: 12px; background: #1d1e1e; color: var(--muted); text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--green); background: #263326; transform: translateY(-1px); }
.dropzone .field__file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone__icon { position: relative; display: block; color: var(--text); font-size: 30px; line-height: 1; }
.dropzone__icon b { position: absolute; right: -9px; bottom: -5px; color: var(--green); font-size: 19px; }
.dropzone__copy { margin-top: 9px; font-size: 13px; line-height: 1.4; }
.dropzone__copy em { color: var(--green); font-style: normal; font-weight: 700; }
.dropzone__hint { display: block; margin-top: 8px; color: var(--subtle); font-size: 10px; line-height: 1.35; }
.dropzone__previews { display: grid; flex: 1 1 auto; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; min-width: 0; }
.media-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: #1d1e1e; }
.media-card__image { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.media-card__footer { display: grid; gap: 2px; padding: 8px; }
.media-card__footer strong { overflow: hidden; color: var(--text); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.media-card__footer small { color: var(--subtle); font-size: 10px; }
.media-card__remove { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid rgb(255 255 255 / 28%); border-radius: 999px; background: rgb(0 0 0 / 75%); color: white; font-size: 17px; line-height: 1; cursor: pointer; }
.media-card__remove:hover { background: var(--danger, #dc2626); }
.media-card__remove:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.field__input:focus, .field__textarea:focus, .field__file:focus-visible { outline: none; border-color: var(--green); box-shadow: var(--ring); }
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 10px 15px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-soft); color: var(--text); font-weight: 750; cursor: pointer; transition: transform var(--ease), filter var(--ease), background var(--ease); }
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:focus-visible, .new-post:focus-visible, a:focus-visible, .icon-button:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn.htmx-request { opacity: .58; cursor: progress; transform: none; }
.btn--instagram { border-color: transparent; background: var(--instagram); color: white; }
.btn--linkedin, .btn--primary { border-color: transparent; background: var(--linkedin); color: #071c2c; }
.btn--accent { background: var(--instagram); border-color: transparent; color: white; }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }
.adapted, .result { margin-top: 18px; }
.adapted { display: grid; gap: 12px; }
.adapted__hint { margin: 0; padding: 15px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--subtle); font-size: 14px; }
.result { min-height: 20px; font-size: 14px; }
.alert { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; }
.alert--error { border-color: rgb(230 124 115 / 48%); color: #ffc0ba; background: rgb(230 124 115 / 10%); }
.alert--ok { border-color: rgb(145 200 125 / 48%); color: #d3efc9; background: rgb(145 200 125 / 10%); }

/* ---------- New-item menu and modal editor ---------- */
.new-menu { position: fixed; z-index: 10; top: 144px; left: 24px; width: min(390px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--line-strong); border-radius: 16px; background: #242626; box-shadow: 0 22px 55px rgb(0 0 0 / 48%); }
.new-menu[hidden] { display: none; }
.new-menu button { display: flex; width: 100%; align-items: center; gap: 14px; padding: 13px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.new-menu button:hover { background: #303232; }
.new-menu strong, .new-menu small { display: block; }
.new-menu strong { font-size: 17px; }
.new-menu small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.new-menu__icon { display: grid; place-items: center; flex: 0 0 auto; width: 45px; height: 45px; border-radius: 11px; font-size: 24px; }
.new-menu__icon--post { background: #123c5d; color: #c5e8ff; }
.new-menu__icon--idea { background: #40553b; color: #b9e49f; }
.app-dialog { width: min(620px, calc(100vw - 30px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 18px; background: #242626; color: var(--text); }
.app-dialog::backdrop { background: rgb(0 0 0 / 68%); }
.dialog-form { display: grid; gap: 18px; padding: 24px; }
.dialog-head, .dialog-actions, .post-dialog__head, .post-dialog__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head .eyebrow, .post-dialog__head .eyebrow { margin: 0 0 4px; }
.dialog-head h2, .post-dialog__head h2 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.dialog-description { margin: -5px 0 0; color: var(--muted); font-size: 14px; }
.dialog-close { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 27px; line-height: 1; cursor: pointer; }
.dialog-close:hover { background: var(--surface-soft); color: var(--text); }
.dialog-actions { justify-content: flex-end; margin-top: 3px; }
.btn--green { border-color: transparent; background: var(--green); color: var(--green-ink); }
.field__textarea--idea { min-height: 120px; }
.app-dialog--post { width: min(1450px, calc(100vw - 32px)); max-height: calc(100vh - 28px); overflow: auto; }
.post-dialog__head { min-height: 88px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.post-dialog__actions { color: var(--muted); font-size: 13px; font-weight: 700; }
.theme-switch { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-soft); color: var(--text); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.theme-switch:hover, .theme-toggle:hover { border-color: var(--green); }
.theme-switch:focus-visible, .theme-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.theme-toggle { flex: 0 0 auto; border: 1px solid transparent; }
.platform-tabs { display: flex; gap: 10px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.platform-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-weight: 750; cursor: pointer; }
.platform-tab.is-active { border-color: var(--green); background: #273328; color: var(--text); }
.post-workspace { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(340px, .85fr); min-height: 560px; }
.post-editor { padding: 24px; border-right: 1px solid var(--line); }
.post-editor .composer-form { min-height: 480px; }
.field__textarea--post { min-height: 245px; background: #2b2d2d; font-size: 16px; }
.post-action { margin-top: auto; }
.post-action--linkedin { padding: 16px; border: 1px solid rgb(77 158 213 / 33%); border-radius: var(--radius-sm); background: rgb(77 158 213 / 7%); }
.post-action--linkedin > p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.post-preview { padding: 24px; background: #1d1e1e; }
.post-side-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: -8px -8px 24px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: #171818; }
.post-side-tab { min-height: 38px; padding: 7px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.post-side-tab:hover { color: var(--text); }
.post-side-tab.is-active { background: var(--text); color: #161717; }
.post-side-tab:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.post-ai-panel__intro { margin-bottom: 20px; }
.post-ai-panel__intro .eyebrow { margin: 0 0 5px; color: var(--green-strong); }
.post-ai-panel__intro h3 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.post-ai-panel__intro > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.post-ai-form { display: grid; gap: 15px; }
.post-ai-brief { min-height: 190px; font-size: 14px; }
.post-ai-panel .adapted { margin-top: 0; }
.post-ai-panel .adapted .field__textarea { min-height: 220px; font-size: 13px; }
.post-preview__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.post-preview__head h3 { margin: 0; font-size: 17px; }
.post-preview__head span { color: var(--muted); font-size: 13px; font-weight: 700; }
.network-preview { max-width: 390px; margin: 0 auto; }
.network-preview__label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--muted); font-size: 14px; font-weight: 650; }
.linkedin-mark { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 3px; background: #4d9ed5; color: #071c2c; font-size: 10px; font-weight: 900; }
.instagram-preview, .linkedin-preview { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: #272929; }
.instagram-preview__profile, .linkedin-preview__profile { display: flex; align-items: center; gap: 10px; padding: 12px; }
.instagram-preview__profile > span:last-child { margin-left: auto; color: var(--muted); letter-spacing: 2px; }
.instagram-preview__avatar, .linkedin-preview__avatar { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #6b78c6; color: white; font-size: 13px; font-weight: 800; }
.instagram-preview__profile strong, .linkedin-preview__profile strong { color: var(--text); font-size: 13px; }
.instagram-preview__media { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; overflow: hidden; background: #353737; color: var(--subtle); font-size: 12px; }
.instagram-preview__media img, .linkedin-preview__document img { width: 100%; height: 100%; object-fit: cover; }
.linkedin-preview__document img { object-fit: contain; }
.instagram-preview__actions { display: flex; align-items: center; gap: 15px; padding: 11px 13px 7px; color: var(--text); font-size: 25px; line-height: 1; }
.instagram-preview__save { margin-left: auto; }
.instagram-preview__caption { padding: 4px 13px 15px; color: var(--text); font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.instagram-preview__caption strong { margin-right: 4px; }
.linkedin-preview__profile { padding: 18px 20px 12px; }
.linkedin-preview__avatar { width: 58px; height: 58px; border-radius: 0; background: #111; font-size: 21px; }
.linkedin-preview__profile > span:nth-child(2) { display: grid; line-height: 1.25; }
.linkedin-preview__profile strong { font-size: 18px; }
.linkedin-preview__profile small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.linkedin-preview__copy { min-height: 44px; margin: 0 20px; padding: 5px 0 14px; border-bottom: 1px solid var(--line-strong); color: var(--text); font-size: 15px; line-height: 1.45; white-space: pre-wrap; }
.linkedin-preview__document { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; border-top: 1px solid var(--line); background: #202121; color: var(--subtle); font-size: 12px; }
.linkedin-preview__actions { display: grid; grid-template-columns: 48px repeat(4, 1fr); align-items: center; gap: 2px; padding: 14px 14px 17px; }
.linkedin-preview__actions > span { display: grid; justify-items: center; gap: 4px; color: var(--text); font-size: 23px; }
.linkedin-preview__actions small { color: var(--text); font-size: 11px; font-weight: 700; }
.linkedin-preview__mini-avatar { place-self: center; width: 32px; height: 32px; border-radius: 50%; background: #111; color: white; font-size: 12px !important; font-weight: 800; }
.instagram-preview__media .preview-card__count, .linkedin-preview__document .preview-card__count { position: absolute; right: 9px; top: 9px; padding: 4px 7px; border-radius: 999px; background: rgb(0 0 0 / 72%); color: white; font-size: 10px; font-weight: 800; }
.preview-card { max-width: 350px; margin: 40px auto 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 13px; background: #272929; }
.preview-card__profile { display: flex; align-items: center; gap: 10px; padding: 13px; }
.preview-card__profile span:last-child { display: grid; line-height: 1.25; }
.preview-card__profile strong { font-size: 13px; }
.preview-card__profile small { color: var(--muted); font-size: 11px; }
.preview-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #6b78c6; font-size: 12px; font-weight: 800; }
.preview-card__copy { min-height: 85px; padding: 0 13px 13px; color: #dbdddc; font-size: 13px; white-space: pre-wrap; }
.preview-card__media { position: relative; display: grid; place-items: center; height: 210px; overflow: hidden; background: #353737; color: var(--subtle); font-size: 12px; }
.preview-card__media img { width: 100%; height: 100%; object-fit: cover; }
.preview-card__count { position: absolute; right: 9px; top: 9px; padding: 4px 7px; border-radius: 999px; background: rgb(0 0 0 / 72%); color: white; font-size: 10px; font-weight: 800; }
.preview-card__meta { padding: 11px 13px; color: var(--muted); }
.preview-hint { margin: 18px auto 0; color: var(--subtle); font-size: 12px; text-align: center; }

/* Platform previews keep their native proportions in both app themes. */
.post-preview { overflow-y: auto; }
.post-preview__head h3 { font-size: 22px; letter-spacing: -.03em; }
.network-preview { max-width: 440px; }
.network-preview__label { margin-bottom: 12px; font-size: 17px; font-weight: 500; }
.instagram-preview, .linkedin-preview { border-radius: 12px; }
.instagram-preview__profile { min-height: 64px; padding: 12px 18px; }
.instagram-preview__profile strong { font-size: 16px; }
.instagram-preview__avatar { width: 42px; height: 42px; border: 1px solid var(--line-strong); background: #111; color: #fff; }
.instagram-preview__media { aspect-ratio: 4 / 5; }
.instagram-preview__actions { padding: 14px 18px 7px; font-size: 31px; }
.instagram-preview__caption { padding: 8px 18px 20px; font-size: 15px; }
.linkedin-preview__profile { padding: 20px 22px 12px; }
.linkedin-preview__avatar { width: 64px; height: 64px; background: #111; color: #fff; }
.linkedin-preview__profile strong { font-size: 20px; }
.linkedin-preview__profile small { font-size: 13px; }
.linkedin-preview__copy { margin: 0; padding: 8px 22px 18px; border-bottom: 0; font-size: 16px; }
.linkedin-preview__document { aspect-ratio: 4 / 5; border-top: 0; }
.linkedin-preview__document img { object-fit: cover; }
.linkedin-preview__actions { grid-template-columns: 54px repeat(4, 1fr); margin: 0 22px; padding: 15px 0 19px; border-top: 1px solid var(--line-strong); }
.linkedin-preview__actions > span { font-size: 26px; }
.linkedin-preview__actions small { font-size: 12px; }
.linkedin-preview__mini-avatar { background: #111; color: #fff; }

/* Light theme is explicit and user-selectable; dark remains the default. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-raised: #eeece8;
  --surface-soft: #e7e5e0;
  --line: #dcd9d3;
  --line-strong: #c8c4bc;
  --text: #171717;
  --muted: #5f605e;
  --subtle: #777873;
  --green: #8fd878;
  --green-strong: #397a2e;
  --green-ink: #10230d;
  --danger: #c43a31;
  --ring: 0 0 0 3px rgb(69 132 54 / 24%);
}
:root[data-theme="light"] .notice-bar { background: #e9f3e6; border-bottom-color: #c9ddc3; color: #21351d; }
:root[data-theme="light"] .notice-bar strong { color: #142411; }
:root[data-theme="light"] .notice-bar a { border-color: #aac4a3; }
:root[data-theme="light"] .notice-bar a:hover { background: #dcebd8; }
:root[data-theme="light"] .sidebar { background: #fff; }
:root[data-theme="light"] .side-nav__item { color: #3f403d; }
:root[data-theme="light"] .side-nav__item--active { background: #eceae6; color: #111; }
:root[data-theme="light"] .channel-row { color: #3f403d; }
:root[data-theme="light"] .welcome-sun { background: #fff1c9; }
:root[data-theme="light"] .section-heading a,
:root[data-theme="light"] .text-action { color: #356c2b; }
:root[data-theme="light"] .idea-card__meta { color: #467a3b; }
:root[data-theme="light"] .editor-pane--linkedin { background: #f2f5f7; }
:root[data-theme="light"] .field__input,
:root[data-theme="light"] .field__textarea,
:root[data-theme="light"] .field__file { background: #fff; color: var(--text); }
:root[data-theme="light"] .field__textarea--post { background: #f7f6f3; }
:root[data-theme="light"] .dropzone,
:root[data-theme="light"] .media-card { background: #f7f6f3; }
:root[data-theme="light"] .dropzone:hover,
:root[data-theme="light"] .dropzone.is-dragging { background: #edf6ea; }
:root[data-theme="light"] .new-menu,
:root[data-theme="light"] .app-dialog { background: #fff; }
:root[data-theme="light"] .new-menu { box-shadow: 0 22px 55px rgb(0 0 0 / 16%); }
:root[data-theme="light"] .new-menu button:hover { background: #f1efeb; }
:root[data-theme="light"] .new-menu__icon--post { background: #dbeefe; color: #164e74; }
:root[data-theme="light"] .new-menu__icon--idea { background: #e3f2de; color: #315d29; }
:root[data-theme="light"] .platform-tab.is-active { background: #e5f2e1; color: #172414; }
:root[data-theme="light"] .post-preview { background: #f6f5f2; color: #252525; }
:root[data-theme="light"] .post-side-tabs { border-color: #dedcd7; background: #eceae6; }
:root[data-theme="light"] .post-side-tab { color: #61615f; }
:root[data-theme="light"] .post-side-tab:hover { color: #111; }
:root[data-theme="light"] .post-side-tab.is-active { background: #111; color: #fff; }
:root[data-theme="light"] .post-preview__head h3 { color: #252525; }
:root[data-theme="light"] .post-preview__head span,
:root[data-theme="light"] .network-preview__label { color: #626260; }
:root[data-theme="light"] .instagram-preview,
:root[data-theme="light"] .linkedin-preview { border-color: #dedcd7; background: #fff; color: #252525; }
:root[data-theme="light"] .instagram-preview__profile strong,
:root[data-theme="light"] .linkedin-preview__profile strong,
:root[data-theme="light"] .linkedin-preview__copy,
:root[data-theme="light"] .instagram-preview__caption,
:root[data-theme="light"] .instagram-preview__actions,
:root[data-theme="light"] .linkedin-preview__actions > span,
:root[data-theme="light"] .linkedin-preview__actions small { color: #252525; }
:root[data-theme="light"] .instagram-preview__profile > span:last-child { color: #555; }
:root[data-theme="light"] .linkedin-preview__profile small { color: #686866; }
:root[data-theme="light"] .instagram-preview__media,
:root[data-theme="light"] .linkedin-preview__document { background: #efeeeb; color: #858582; }
:root[data-theme="light"] .linkedin-preview__actions { border-top-color: #d7d5d0; }
:root[data-theme="light"] .preview-hint { color: #777; }
:root[data-theme="light"] .post-ai-panel { color: #242424; }
:root[data-theme="light"] .post-ai-panel__intro .eyebrow { color: #16803e; }
:root[data-theme="light"] .post-ai-panel__intro h3 { color: #111; }
:root[data-theme="light"] .post-ai-panel__intro > p:last-child { color: #666; }
:root[data-theme="light"] .post-ai-panel .field__label { color: #555; }
:root[data-theme="light"] .post-ai-panel .field__input,
:root[data-theme="light"] .post-ai-panel .field__textarea { border-color: #d6d4cf; background: #fff; color: #111; }
:root[data-theme="light"] .digest-table a { color: #165f99; }
:root[data-theme="light"] .status--published,
:root[data-theme="light"] .status--baseline { color: #356c2b; }
:root[data-theme="light"] .status--failed { color: #a92e25; }

/* ---------- Digest ---------- */
.digest-page { padding-top: 40px; }
.digest-page__intro { max-width: 620px; margin-bottom: 28px; }
.digest-page__intro .eyebrow { margin: 0 0 7px; color: var(--green-strong); }
.digest-page__intro h1 { margin: 0 0 7px; font-size: clamp(31px, 3.2vw, 44px); letter-spacing: -0.045em; line-height: 1.08; }
.digest-page__intro p { margin: 0; color: var(--muted); }
.digest-stats { display: grid; grid-template-columns: .85fr .85fr 1.3fr; gap: 14px; }
.digest-stat, .digest-history { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.digest-stat { display: grid; gap: 5px; min-height: 132px; padding: 20px; }
.digest-stat > span, .digest-stat small, .digest-history__head span { color: var(--muted); font-size: 13px; }
.digest-stat strong { font-size: 22px; letter-spacing: -0.03em; }
.digest-history { margin-top: 16px; overflow: hidden; }
.digest-history__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); padding: 19px 20px; border-bottom: 1px solid var(--line); }
.digest-history__head h2 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.digest-table-wrap { overflow-x: auto; }
.digest-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; text-align: left; }
.digest-table th, .digest-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.digest-table tr:last-child td { border: 0; }
.digest-table th { color: var(--muted); font-weight: 650; }
.digest-table a { color: #b5dcff; text-decoration: none; }
.digest-table a:hover { text-decoration: underline; }
.status { display: inline-block; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 8px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.status--published { border-color: rgb(145 200 125 / 50%); color: #ccebc2; }
.status--baseline { border-color: rgb(145 200 125 / 32%); color: #b9d7ae; }
.status--failed { border-color: rgb(230 124 115 / 48%); color: #ffc0ba; }
.digest-empty { margin: 0; padding: 22px; color: var(--muted); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--space-3); background: var(--bg); }
.auth__panel { width: min(410px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.auth .brand { padding: 0; }
.auth__title { margin: 25px 0 6px; font-size: 28px; line-height: 1.1; letter-spacing: -0.04em; }
.auth__subtitle { margin: 0; color: var(--muted); }
.auth__form { display: grid; gap: 15px; margin-top: 26px; }

@media (max-width: 1120px) {
  .dashboard-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .dashboard-main { padding: 30px; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-pane + .editor-pane { border-top: 1px solid var(--line); border-left: 0; }
  .post-workspace { grid-template-columns: 1fr; }
  .post-editor { border-right: 0; border-bottom: 1px solid var(--line); }
  .post-preview { min-height: 390px; }
}
@media (max-width: 820px) {
  .notice-bar { padding: 9px 14px; }
  .dashboard-shell { display: block; }
  .sidebar { position: relative; top: auto; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { font-size: 18px; }
  .new-post { margin: 15px 0 12px; }
  .side-nav { display: flex; overflow-x: auto; padding-bottom: 2px; }
  .side-nav__item { flex: 0 0 auto; }
  .channels, .sidebar__account { display: none; }
  .dashboard-main { padding: 26px 16px 44px; }
  .metric-strip, .setup-grid, .overview-grid, .ideas-list, .digest-stats { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
  .setup-card { min-height: 190px; }
  .editor-card__head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  .notice-bar { font-size: 12px; }
  .notice-bar a { padding: 3px 7px; }
  .welcome-panel h1 { font-size: 30px; }
  .editor-pane, .editor-card__head { padding: 18px; }
  .platform-summary { font-size: 11px; }
  .app-dialog--post { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .post-dialog__head, .platform-tabs, .post-editor, .post-preview { padding: 16px; }
  .platform-tabs { overflow-x: auto; }
  .post-editor .composer-form { min-height: 0; }
  .field__textarea--post { min-height: 190px; }
  .media-picker { flex-direction: column; }
  .dropzone { flex-basis: auto; min-height: 132px; }
  .dropzone__previews { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
