:root {
  --bg: #07111f;
  --bg-soft: #0b1728;
  --panel: rgba(15, 29, 48, .88);
  --panel-solid: #0f1d30;
  --panel-raised: #14243a;
  --line: rgba(153, 176, 211, .15);
  --line-strong: rgba(153, 176, 211, .28);
  --text: #f5f8ff;
  --muted: #8fa2bd;
  --muted-2: #6d809b;
  --blue: #4e7cff;
  --blue-light: #72a0ff;
  --cyan: #20d7c7;
  --danger: #ff647c;
  --success: #45dda8;
  --shadow: 0 24px 70px rgba(0, 0, 0, .25);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: clip; background: var(--bg); }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow-x: clip; background: radial-gradient(circle at 80% -10%, rgba(45, 93, 185, .2), transparent 32%), var(--bg); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, label, input, textarea, select { -webkit-tap-highlight-color: transparent; }
svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
[hidden] { display: none !important; }

.ambient { position: fixed; z-index: 0; border-radius: 999px; pointer-events: none; filter: blur(2px); opacity: .8; }
.ambient-one { top: 15%; right: -220px; width: 430px; height: 430px; background: radial-gradient(circle, rgba(44, 91, 255, .11), transparent 70%); }
.ambient-two { bottom: -240px; left: 28%; width: 540px; height: 540px; background: radial-gradient(circle, rgba(32, 215, 199, .07), transparent 70%); }

.app-shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; width: 250px; padding: 28px 20px 22px; border-right: 1px solid var(--line); background: rgba(7, 17, 31, .78); box-shadow: 12px 0 50px rgba(0, 0, 0, .08); backdrop-filter: blur(22px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 30px; }
.brand-mark { display: grid; width: 40px; height: 40px; place-items: end center; overflow: hidden; border-radius: 12px; color: white; background: linear-gradient(145deg, #6e9aff, #315bea); box-shadow: 0 10px 28px rgba(68, 111, 242, .35); font-family: Arial, sans-serif; font-size: 34px; font-weight: 800; line-height: 37px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; letter-spacing: -.2px; }
.brand span { margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .7px; text-transform: uppercase; }

.main-nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid transparent; border-radius: 12px; color: var(--muted); background: transparent; cursor: pointer; font-size: 14px; font-weight: 650; text-align: left; transition: .18s ease; }
.nav-item svg { width: 19px; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.035); transform: translateX(2px); }
.nav-item.active { color: #fff; border-color: rgba(94, 135, 255, .25); background: linear-gradient(100deg, rgba(69, 110, 244, .28), rgba(59, 94, 186, .08)); box-shadow: inset 3px 0 var(--blue-light); }

.sidebar-status { margin-top: auto; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(20, 36, 58, .6); }
.status-row, .rate-copy { display: flex; align-items: center; }
.status-row { gap: 8px; color: #bdcce0; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(69, 221, 168, .1), 0 0 14px rgba(69, 221, 168, .45); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 100, 124, .1); }
.rate-copy { justify-content: space-between; margin-top: 18px; color: var(--muted); font-size: 11px; }
.rate-copy strong { color: #dce7f7; font-size: 12px; }
.rate-track, .progress-track { overflow: hidden; height: 5px; border-radius: 99px; background: rgba(120, 145, 180, .15); }
.rate-track { margin: 8px 0 7px; }
.rate-track span, .progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 16px rgba(32, 215, 199, .3); transition: width .35s ease; }
.text-button { padding: 0; border: 0; color: var(--blue-light); background: transparent; cursor: pointer; font-size: 11px; font-weight: 650; }
.text-button:hover { color: #a9c2ff; }
.text-button.muted { margin-left: 10px; color: var(--muted); }

.main-content { width: calc(100% - 250px); min-height: 100vh; margin-left: 250px; }
.topbar { display: flex; align-items: center; min-height: 92px; padding: 20px clamp(24px, 4vw, 64px); border-bottom: 1px solid var(--line); background: rgba(7, 17, 31, .35); backdrop-filter: blur(14px); }
.topbar h1 { margin: 3px 0 0; font-size: clamp(21px, 2vw, 27px); letter-spacing: -.7px; }
.eyebrow { margin: 0; color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: 1.9px; }
.top-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.top-actions form { margin: 0; }
.secure-pill { padding: 7px 11px; border: 1px solid rgba(69, 221, 168, .16); border-radius: 99px; color: #9fb4cb; background: rgba(69, 221, 168, .04); font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.secure-pill span { margin-right: 5px; color: var(--success); }
.avatar { width: 35px; height: 35px; border: 1px solid var(--line-strong); border-radius: 11px; color: #dce8f8; background: linear-gradient(145deg, #253b5c, #14243a); cursor: default; font-weight: 750; }
.menu-button { display: none; padding: 6px; border: 0; background: transparent; cursor: pointer; }

.view { display: none; padding: 30px clamp(24px, 4vw, 64px) 64px; animation: enter .25s ease both; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero-card { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 170px; padding: 30px clamp(26px, 4vw, 48px); overflow: hidden; border: 1px solid rgba(91, 132, 255, .22); border-radius: 24px; background: linear-gradient(110deg, rgba(32, 64, 121, .62), rgba(14, 32, 57, .82) 55%, rgba(16, 44, 69, .62)); box-shadow: var(--shadow); }
.hero-card::before { position: absolute; inset: 0; content: ""; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg, black, transparent 80%); }
.hero-card > div:first-child { position: relative; z-index: 1; max-width: 650px; }
.hero-kicker { color: #74e9db; font-size: 9px; font-weight: 800; letter-spacing: 2px; }
.hero-card h2 { max-width: 610px; margin: 10px 0 8px; font-size: clamp(24px, 3vw, 36px); line-height: 1.12; letter-spacing: -1.2px; }
.hero-card p { margin: 0; color: #9cafc7; font-size: 13px; }
.hero-orbit { position: relative; flex: 0 0 130px; height: 120px; margin-right: 2%; }
.hero-orbit::before, .hero-orbit::after { position: absolute; inset: 10px; border: 1px solid rgba(113, 159, 255, .25); border-radius: 50%; content: ""; }
.hero-orbit::after { inset: 27px; border-style: dashed; animation: rotate 18s linear infinite; }
.hero-orbit span { position: absolute; z-index: 2; inset: 42px; display: grid; place-items: center; border-radius: 50%; color: white; background: linear-gradient(145deg, #5d8dff, #315eea); box-shadow: 0 0 45px rgba(61, 105, 239, .48); font-family: Arial, sans-serif; font-size: 35px; font-weight: 800; }
.hero-orbit i, .hero-orbit b { position: absolute; z-index: 3; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.hero-orbit i { top: 12px; left: 63px; }
.hero-orbit b { right: 13px; bottom: 33px; width: 6px; height: 6px; background: var(--blue-light); box-shadow: 0 0 12px var(--blue-light); }
@keyframes rotate { to { transform: rotate(360deg); } }

.workspace-grid { display: grid; grid-template-columns: minmax(520px, 1.55fr) minmax(285px, .72fr); gap: 20px; margin-top: 20px; align-items: start; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(18, 34, 55, .94), rgba(12, 25, 43, .94)); box-shadow: 0 18px 50px rgba(0, 0, 0, .12); }
.pages-card, .composer-card, .settings-card, .logs-card, .progress-card { padding: 24px; }
.pages-card .card-head { gap: 8px; }
.pages-card .card-head > div { gap: 7px; }
.pages-card .card-head .button { padding-inline: 10px; }
.card-head, .card-head > div, .progress-heading, .settings-actions, .submit-row { display: flex; align-items: center; }
.card-head { min-height: 34px; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.card-head > div { gap: 10px; min-width: 0; }
.card-head h3 { margin: 0; overflow: hidden; font-size: 15px; letter-spacing: -.2px; text-overflow: ellipsis; white-space: nowrap; }
.step { display: grid; min-width: 30px; height: 25px; padding: 0 8px; place-items: center; border: 1px solid rgba(92, 139, 255, .23); border-radius: 8px; color: #83a8ff; background: rgba(78, 124, 255, .08); font-size: 9px; font-weight: 800; letter-spacing: .6px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-size: 12px; font-weight: 750; transition: .18s ease; }
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button.small { min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: 10px; }
.button.small svg { width: 14px; }
.button.ghost { border-color: var(--line-strong); color: #b6c8df; background: rgba(255,255,255,.025); }
.button.primary { color: white; background: linear-gradient(120deg, #4d7bff, #3b66e7); box-shadow: 0 10px 28px rgba(55, 99, 231, .25); }
.button.danger { border-color: rgba(255, 100, 124, .25); color: #ff9aac; background: rgba(255, 100, 124, .08); }
.button.loading { color: transparent; pointer-events: none; }

.active-token-picker { margin-bottom: 16px; padding: 12px; border: 1px solid rgba(78,124,255,.18); border-radius: 12px; background: rgba(78,124,255,.045); }
.active-token-picker > span:first-child { margin: 0 0 7px; color: #aebfda; }
.active-token-picker select { min-height: 38px; font-size: 10px; }
.active-token-picker small { margin-top: 7px; }
.selection-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 10px; }
.pages-list { display: grid; max-height: 455px; gap: 8px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a4162 transparent; }
.pages-list.empty { min-height: 290px; place-items: center; }
.empty-state { display: grid; justify-items: center; gap: 7px; padding: 28px 14px; color: var(--muted); text-align: center; }
.empty-state strong { color: #bdcbe0; font-size: 12px; }
.empty-state span { max-width: 220px; font-size: 10px; line-height: 1.5; }
.empty-icon { display: grid; width: 46px; height: 46px; margin-bottom: 4px; place-items: end center; border: 1px solid rgba(84, 129, 255, .18); border-radius: 14px; color: #779bfa; background: rgba(78,124,255,.08); font-family: Arial, sans-serif; font-size: 35px; font-weight: 800; line-height: 42px; }
.page-option { position: relative; display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid transparent; border-radius: 12px; background: rgba(255,255,255,.024); cursor: pointer; transition: .16s ease; }
.page-option:hover { border-color: var(--line); background: rgba(255,255,255,.04); }
.page-option.selected { border-color: rgba(81, 130, 255, .34); background: rgba(78,124,255,.1); }
.page-option input { position: absolute; opacity: 0; }
.page-avatar { display: grid; flex: 0 0 35px; width: 35px; height: 35px; place-items: center; border-radius: 10px; color: #dbe6ff; background: linear-gradient(145deg, #315eaf, #233b66); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.page-name { overflow: hidden; color: #dce5f2; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.manage-tokens { width: 100%; margin-top: 14px; text-align: center; }

.draft-pill, .config-badge { padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.02); font-size: 8px; font-weight: 750; letter-spacing: .5px; text-transform: uppercase; }
.config-badge.ok { border-color: rgba(69,221,168,.2); color: #77e8c0; background: rgba(69,221,168,.05); }
.post-types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: rgba(5, 15, 27, .38); }
.type-button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 8px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; transition: .16s ease; }
.type-button span { color: #7086a3; font-size: 12px; }
.type-button:hover { color: var(--text); }
.type-button.active { color: white; background: linear-gradient(130deg, rgba(78,124,255,.8), rgba(62,99,208,.72)); box-shadow: 0 7px 18px rgba(31, 61, 145, .25); }
.type-button.active span { color: white; }

label { display: block; }
label > span:first-child, .field-label { display: block; margin: 17px 0 8px; color: #9eb0c8; font-size: 10px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: #e8eef8; background: rgba(5, 15, 28, .46); transition: border-color .16s, box-shadow .16s; }
input:focus, textarea:focus, select:focus { border-color: rgba(89, 137, 255, .58); box-shadow: 0 0 0 3px rgba(78, 124, 255, .09); }
input, select { min-height: 42px; padding: 0 13px; }
textarea { min-height: 115px; padding: 13px; resize: vertical; line-height: 1.55; }
textarea.compact { min-height: 82px; }
input::placeholder, textarea::placeholder { color: #53657e; }
input:disabled { opacity: .5; }
select { cursor: pointer; }
label small { display: block; margin-top: 6px; color: var(--muted-2); font-size: 9px; line-height: 1.45; }
.textarea-wrap { position: relative; }
.textarea-wrap textarea { padding-bottom: 30px; }
.textarea-wrap > span { position: absolute; right: 12px; bottom: 10px; color: var(--muted-2); font-size: 8px; }
.media-panel { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(4, 14, 27, .28); }
.media-panel label > span:first-child { margin-top: 0; }
.field-grid { display: grid; grid-template-columns: 1fr 30px 1fr; align-items: center; gap: 10px; }
.or-divider { display: grid; align-self: stretch; place-items: center; color: var(--muted-2); font-size: 8px; text-transform: uppercase; }
.or-divider span { position: relative; z-index: 1; padding: 5px 0; background: #0d1a2c; }
.or-divider::before { position: absolute; width: 1px; height: 80px; content: ""; background: var(--line); }
.file-drop { position: relative; display: grid; min-height: 95px; padding: 13px; place-items: center; border: 1px dashed rgba(108, 139, 185, .3); border-radius: 11px; background: rgba(255,255,255,.018); cursor: pointer; text-align: center; transition: .16s ease; }
.file-drop:hover { border-color: rgba(89, 137, 255, .55); background: rgba(78, 124, 255, .05); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop strong { color: #becde1; font-size: 10px; }
.file-drop small { margin: 2px 0 0; }
.upload-icon { display: grid !important; width: 25px; height: 25px; margin: 0 0 3px !important; place-items: center; border-radius: 8px; color: #8dacff !important; background: rgba(78,124,255,.1); font-size: 15px !important; }
.file-name { display: none; max-width: 100%; overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.file-name:not(:empty) { display: inline-flex; margin-top: 8px; padding: 6px 9px; align-items: center; gap: 6px; border: 1px solid #efbda9; border-radius: 8px; color: #a63f20; background: #fff3ed; box-shadow: 0 4px 12px rgba(219, 88, 45, .1); font-size: 10.5px; font-weight: 800; line-height: 1.25; }
.file-name:not(:empty)::before { flex: 0 0 auto; color: #1b8a64; content: "✓"; font-size: 12px; font-weight: 900; }
.file-drop.horizontal { display: flex; min-height: 68px; gap: 12px; justify-content: flex-start; margin-top: 12px; text-align: left; }
.file-drop.horizontal .upload-icon { flex: 0 0 32px; width: 32px; height: 32px; margin: 0 !important; }
.file-drop.horizontal .file-name { max-width: 52%; margin: 0 0 0 auto; }

.schedule-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.018); }
.switch-line { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.switch-line input { position: absolute; opacity: 0; }
.switch { position: relative; flex: 0 0 34px; width: 34px; height: 19px; border-radius: 99px; background: #263953; transition: .18s; }
.switch::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #8fa2bb; content: ""; transition: .18s; }
.switch-line input:checked + .switch { background: var(--blue); }
.switch-line input:checked + .switch::after { left: 18px; background: white; }
.switch-line strong, .switch-line small { display: block; }
.switch-line strong { font-size: 10px; }
.switch-line small { margin-top: 2px; color: var(--muted-2); font-size: 8px; }
.schedule-row > input { width: 195px; min-height: 37px; font-size: 10px; }
.submit-row { justify-content: space-between; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.selected-summary { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.selected-summary > span:first-child { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: #a8bfff; background: rgba(78,124,255,.1); font-weight: 800; }
.submit-row .primary { min-width: 150px; }
.submit-row svg { width: 16px; }

.progress-card { margin-top: 20px; }
.progress-heading { justify-content: space-between; font-size: 11px; }
.progress-heading > div { display: flex; align-items: center; gap: 8px; }
.progress-heading > span { color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: pulse 1.4s ease infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.progress-track { height: 7px; margin: 14px 0; }
.job-log { display: grid; max-height: 180px; gap: 5px; margin-bottom: 12px; overflow-y: auto; color: #9eb0c7; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; line-height: 1.6; }

.section-intro { margin-bottom: 20px; color: var(--muted); font-size: 12px; }
.section-intro p { margin: 0; }
.settings-grid { display: grid; grid-template-columns: minmax(420px, 1.25fr) minmax(320px, .75fr); gap: 20px; align-items: start; }
.settings-card label { margin-top: 15px; }
.settings-card .card-head { margin-bottom: 8px; }
.token-vault-card { grid-column: 1 / -1; }
.token-create-grid { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(300px, 1.3fr) auto; gap: 12px; align-items: end; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.token-create-grid label { margin-top: 0; }
.token-create-grid label > span:first-child { margin-top: 0; }
.token-create-grid .button { margin-bottom: 1px; white-space: nowrap; }
.token-list { display: grid; gap: 9px; margin-top: 18px; }
.token-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(150px, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.token-row.active { border-color: rgba(69,221,168,.22); background: rgba(69,221,168,.035); }
.token-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.token-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #9cb8ff; background: rgba(78,124,255,.1); font-size: 15px; }
.token-copy { min-width: 0; }
.token-copy strong, .token-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token-copy strong { color: #d8e3f2; font-size: 11px; }
.token-copy small { margin-top: 3px; color: var(--muted-2); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }
.token-state { width: fit-content; padding: 5px 8px; border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 8px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.token-row.active .token-state { color: #72e5bd; background: rgba(69,221,168,.08); }
.token-actions { display: flex; gap: 7px; justify-content: flex-end; }
.compact-empty { padding-block: 16px; }
.compact-head { margin-top: 18px; }
.divider { height: 1px; margin: 24px 0 4px; background: var(--line); }
.settings-actions { justify-content: flex-end; gap: 9px; margin-top: 24px; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 45px; }
.input-suffix b { position: absolute; top: 14px; right: 13px; color: var(--muted); font-size: 9px; }
.security-note { display: flex; gap: 12px; margin-top: 24px; padding: 14px; border: 1px solid rgba(32,215,199,.13); border-radius: 13px; background: rgba(32,215,199,.035); }
.security-note > span { color: var(--cyan); font-size: 20px; }
.security-note strong { color: #c7d8e9; font-size: 10px; }
.security-note p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.logs-card { min-height: 520px; }
.head-actions { display: flex; gap: 8px; }
.logs-list { display: grid; gap: 8px; }
.log-entry { display: grid; grid-template-columns: 95px 78px minmax(120px, .5fr) 1.5fr; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.018); color: var(--muted); font-size: 9px; }
.log-entry .log-status { width: fit-content; padding: 4px 7px; border-radius: 6px; color: #71e6bc; background: rgba(69,221,168,.08); font-weight: 800; }
.log-entry.error .log-status { color: #ff93a5; background: rgba(255,100,124,.08); }
.log-entry strong { overflow: hidden; color: #c9d5e6; text-overflow: ellipsis; white-space: nowrap; }
.log-entry .log-message { overflow-wrap: anywhere; }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; width: min(360px, calc(100vw - 44px)); gap: 10px; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 13px; color: #cad7e8; background: rgba(17, 32, 52, .97); box-shadow: 0 18px 45px rgba(0,0,0,.3); animation: toast-in .25s ease both; font-size: 11px; line-height: 1.45; }
.toast::before { color: var(--success); content: "●"; }
.toast.error::before { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.loading-overlay { position: fixed; z-index: 200; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: #c9d7e9; background: rgba(4, 11, 20, .62); backdrop-filter: blur(5px); font-size: 11px; }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--blue-light); border-radius: 50%; animation: rotate .75s linear infinite; }

@media (max-width: 1050px) {
  .workspace-grid, .settings-grid { grid-template-columns: 1fr; }
  .pages-list.empty { min-height: 180px; }
  .pages-list { max-height: 300px; }
  .hero-orbit { display: none; }
}

@media (max-width: 760px) {
  .ambient { display: none; }
  .app-shell { z-index: auto; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open::after { position: fixed; z-index: 9; inset: 0; background: rgba(1,7,14,.68); content: ""; backdrop-filter: blur(3px); }
  .main-content { width: 100%; margin-left: 0; }
  .menu-button { display: inline-flex; margin-right: 12px; }
  .topbar { min-height: 78px; padding: 16px 18px; }
  .top-actions .secure-pill { display: none; }
  .view { padding: 20px 15px 45px; }
  .hero-card { min-height: 150px; padding: 25px 22px; }
  .hero-card h2 { font-size: 25px; }
  .hero-card p { font-size: 11px; line-height: 1.5; }
  .pages-card, .composer-card, .settings-card, .logs-card, .progress-card { padding: 18px; }
  .post-types { grid-template-columns: repeat(3, 1fr); }
  .field-grid { grid-template-columns: 1fr; }
  .token-create-grid, .token-row { grid-template-columns: 1fr; }
  .token-create-grid .button { width: 100%; }
  .token-state { margin-left: 45px; }
  .token-actions { justify-content: flex-start; margin-left: 45px; }
  .or-divider { min-height: 20px; }
  .or-divider::before { width: 100%; height: 1px; }
  .or-divider span { padding: 0 8px; }
  .schedule-row { align-items: flex-start; flex-direction: column; }
  .schedule-row > input { width: 100%; }
  .log-entry { grid-template-columns: 1fr 1fr; }
  .log-entry .log-message { grid-column: 1 / -1; }
}

@media (max-width: 430px) {
  .topbar h1 { font-size: 19px; }
  .hero-card h2 { font-size: 22px; }
  .post-types { grid-template-columns: repeat(2, 1fr); }
  .submit-row { align-items: stretch; flex-direction: column; gap: 14px; }
  .submit-row .primary { width: 100%; }
  .settings-actions { align-items: stretch; flex-direction: column-reverse; }
  .token-state, .token-actions { margin-left: 0; }
  .token-actions .button { flex: 1; }
  .head-actions { flex-direction: column; }
}

/* Temă modernă, luminoasă */
:root {
  --bg: #f5f7fa;
  --bg-soft: #eef2f7;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --panel-raised: #ffffff;
  --line: #e1e7ef;
  --line-strong: #cbd5e1;
  --text: #142033;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --blue: #e9693e;
  --blue-light: #d9582f;
  --cyan: #e9693e;
  --danger: #dc4c64;
  --success: #20a978;
  --shadow: 0 18px 50px rgba(31, 45, 61, .08);
  color: var(--text);
  background: var(--bg);
  color-scheme: light;
}

html, body { background: var(--bg); }
body { color: var(--text); background: radial-gradient(circle at 80% -10%, rgba(233,105,62,.08), transparent 28%), var(--bg); }
.ambient-one { background: radial-gradient(circle, rgba(233,105,62,.08), transparent 70%); }
.ambient-two { background: radial-gradient(circle, rgba(37,99,235,.05), transparent 70%); }
.sidebar { border-color: var(--line); background: rgba(255,255,255,.94); box-shadow: 10px 0 35px rgba(31,45,61,.045); backdrop-filter: blur(18px); }
.brand-mark { width: 42px; height: 42px; place-items: center; border-radius: 13px; background: linear-gradient(145deg, #ef7b50, #df5d33); box-shadow: 0 10px 25px rgba(233,105,62,.22); font-size: 12px; line-height: 1; letter-spacing: -.4px; }
.brand strong { color: #111d30; }
.brand span { color: #8492a6; }
.nav-item { color: #718096; }
.nav-item:hover { color: #17243a; background: #f7f8fb; }
.nav-item.active { color: #d9582f; border-color: #f3c5b4; background: linear-gradient(100deg, #fff2ed, #fff9f6); box-shadow: inset 3px 0 var(--blue); }
.sidebar-status { border-color: var(--line); background: #f8fafc; box-shadow: none; }
.status-row { color: #475569; }
.rate-copy { color: var(--muted); }
.rate-copy strong { color: #233148; }
.rate-track, .progress-track { background: #e8edf3; }
.rate-track span, .progress-track span { background: linear-gradient(90deg, #e9693e, #f29969); box-shadow: none; }
.text-button { color: #d9582f; }
.text-button:hover { color: #b84421; }
.main-content { background: rgba(247,249,252,.75); }
.topbar { min-height: 78px; padding-block: 16px; border-color: var(--line); background: rgba(255,255,255,.9); box-shadow: 0 3px 16px rgba(31,45,61,.035); backdrop-filter: blur(16px); }
.topbar h1 { color: #111d30; }
.eyebrow { color: #d9582f; }
.secure-pill { border-color: #ccebdc; color: #567166; background: #f3fbf7; }
.avatar { border-color: var(--line); color: #334155; background: #f8fafc; }
.view { padding: 22px clamp(22px, 3vw, 44px) 55px; }
.workspace-grid { grid-template-columns: minmax(600px, 1.65fr) minmax(300px, .72fr); margin-top: 0; }
.card { border-color: var(--line); background: #fff; box-shadow: var(--shadow); }
.pages-card, .composer-card, .settings-card, .logs-card, .progress-card { padding: 25px; }
.card-head h3 { color: #17243a; }
.step { border-color: #f2c7b7; color: #d9582f; background: #fff3ee; }
.button.ghost { border-color: #dce3ec; color: #46566d; background: #fff; }
.button.ghost:hover { border-color: #c8d1dd; background: #f8fafc; }
.button.primary { color: #fff; background: linear-gradient(120deg, #eb7044, #df5b32); box-shadow: 0 10px 24px rgba(224,91,50,.2); }
.button.danger { border-color: #f3c6ce; color: #ca3d56; background: #fff6f7; }
.draft-pill, .config-badge { border-color: var(--line); color: #74839a; background: #f8fafc; }
.config-badge.ok { border-color: #c6eadc; color: #17845f; background: #f1fbf6; }
.post-types { border-color: var(--line); background: #f7f9fc; }
.type-button { color: #718096; }
.type-button span { color: #94a3b8; }
.type-button:hover { color: #26364d; background: #fff; }
.type-button.active { color: #fff; background: linear-gradient(135deg, #ed754a, #df5c33); box-shadow: 0 7px 18px rgba(224,91,50,.18); }
label > span:first-child, .field-label { color: #4d5f76; }
input, textarea, select { border-color: #dbe3ed; color: #17243a; background: #fbfcfe; color-scheme: light; }
input:focus, textarea:focus, select:focus { border-color: #ed8d6b; box-shadow: 0 0 0 3px rgba(233,105,62,.1); background: #fff; }
input::placeholder, textarea::placeholder { color: #a4afbf; }
input:disabled { background: #f0f3f7; }
.composer-card textarea#caption { min-height: 185px; }
.media-panel { border-color: var(--line); background: #f9fafc; }
.or-divider span { background: #f9fafc; }
.file-drop { border-color: #cad4e1; background: #fff; }
.file-drop:hover { border-color: #e98967; background: #fff8f5; }
.file-drop.has-attachment { border-style: solid; border-color: #eca98f; background: #fffaf7; box-shadow: inset 0 0 0 2px rgba(233,105,62,.055); }
.file-drop.has-attachment .upload-icon { color: #16815e !important; background: #eaf8f1; }
.file-drop strong { color: #4b5d73; }
.upload-icon { color: #dc6036 !important; background: #fff0ea; }
.active-token-picker { border-color: #f0c8b9; background: #fff7f3; }
.active-token-picker > span:first-child { color: #5b6678; }
.page-option { border-color: #edf0f4; background: #fbfcfe; }
.page-option:hover { border-color: #d8e0ea; background: #fff; }
.page-option.selected { border-color: #efb9a5; background: #fff4ef; }
.page-option input { position: static; flex: 0 0 17px; width: 17px; height: 17px; min-height: 0; padding: 0; opacity: 1; accent-color: var(--blue); cursor: pointer; }
.page-avatar { color: #fff; background: linear-gradient(145deg, #ee7950, #dc5a31); }
.page-name { color: #2b3a50; }
.empty-state { color: var(--muted); }
.empty-state strong { color: #526176; }
.empty-icon { border-color: #f0c9bb; color: #dd6137; background: #fff3ee; }
.schedule-row { border-color: var(--line); background: #f9fafc; transition: border-color .18s, background .18s, box-shadow .18s; }
.schedule-row.active { border-color: #efb79f; background: #fff5f0; box-shadow: 0 0 0 3px rgba(233,105,62,.06); }
.switch { background: #cbd5e1; }
.switch::after { background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.2); }
.switch-line input:checked + .switch { background: var(--blue); }
.switch-line strong { color: #2e3d53; }
.schedule-row > input { cursor: pointer; background: #fff; }
.selected-summary { color: #697990; }
.selected-summary > span:first-child { color: #d9582f; background: #fff0ea; }
.progress-card { background: #fff; }
.job-log { color: #52637a; }
.live-dot { background: var(--success); box-shadow: 0 0 9px rgba(32,169,120,.35); }
.token-vault-card { border-top: 3px solid #eb7044; }
.token-create-grid { align-items: start; }
.token-create-grid .token-form-actions { display: flex; gap: 8px; align-items: center; min-height: 42px; margin-top: 25px; white-space: nowrap; }
.token-create-grid.editing { border-color: #efb9a5; }
.token-list { border-color: var(--line); }
.token-row { border-color: var(--line); background: #fbfcfe; }
.token-row.active { border-color: #bde4d4; background: #f3fbf7; }
.token-icon { color: #dc6036; background: #fff0ea; }
.token-copy strong { color: #27364c; }
.token-state { color: #697990; background: #eef2f6; }
.token-row.active .token-state { color: #17845f; background: #e7f7ef; }
.divider { background: var(--line); }
.input-suffix b { color: #78889d; }
.log-entry { border-color: var(--line); color: #66768b; background: #fbfcfe; }
.log-entry strong { color: #34445a; }
.log-entry .log-status { color: #16815e; background: #eaf8f1; }
.log-entry.error .log-status { color: #c13c54; background: #fff0f3; }
.toast { border-color: #d7dfe9; color: #334155; background: rgba(255,255,255,.98); box-shadow: 0 18px 45px rgba(31,45,61,.15); }
.loading-overlay { color: #334155; background: rgba(247,249,252,.72); }
.spinner { border-color: #e1e7ef; border-top-color: var(--blue); }

button.draft-pill { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit; }
button.draft-pill:hover { border-color: #efb9a5; color: #c84e28; background: #fff5f0; }
button.draft-pill span { display: grid; min-width: 18px; height: 18px; padding: 0 5px; place-items: center; border-radius: 99px; color: #fff; background: var(--blue); font-size: 8px; }
.drafts-dialog { width: min(620px, calc(100% - 28px)); max-height: min(760px, calc(100dvh - 40px)); padding: 0; overflow: hidden; border: 1px solid #dce3eb; border-radius: 19px; color: var(--text); background: #fff; box-shadow: 0 28px 80px rgba(30,41,59,.22); }
.drafts-dialog::backdrop { background: rgba(30,41,59,.32); backdrop-filter: blur(3px); }
.dialog-shell { padding: 25px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-head h2 { margin: 4px 0 0; color: #17243a; font-size: 22px; letter-spacing: -.5px; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: #66768b; background: #f8fafc; cursor: pointer; font-size: 22px; line-height: 1; }
.dialog-copy { margin: 13px 0 18px; color: #718096; font-size: 11px; line-height: 1.55; }
.draft-save-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.draft-save-form label > span:first-child { margin-top: 0; }
.draft-save-form .button { white-space: nowrap; }
.draft-list { display: grid; max-height: 330px; gap: 8px; margin-top: 16px; overflow-y: auto; }
.draft-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.draft-row.active { border-color: #efb9a5; background: #fff6f2; }
.draft-copy { display: grid; min-width: 0; gap: 4px; }
.draft-copy strong { overflow: hidden; color: #29384e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.draft-copy span { color: #7d8b9f; font-size: 9px; }
.draft-row-actions { display: flex; flex: 0 0 auto; gap: 7px; }

/* Compozitor compact, paginare locală și lizibilitate îmbunătățită */
.composer-head { align-items: flex-start; gap: 12px; }
.composer-head > div:first-child { flex: 0 0 auto; padding-top: 3px; }
.composer-tools { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: 7px; }
.schedule-toolbar { display: inline-flex; align-items: center; gap: 6px; }
.schedule-compact { display: inline-flex; min-height: 32px; padding: 0 10px; align-items: center; gap: 7px; border: 1px solid #dce3ec; border-radius: 9px; color: #56667b; background: #fff; cursor: pointer; font-size: 10px; font-weight: 750; white-space: nowrap; transition: .18s ease; }
.schedule-compact:hover, .schedule-toolbar.active .schedule-compact { border-color: #efb9a5; color: #bd4824; background: #fff5f0; }
.schedule-compact input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.schedule-compact .switch { flex-basis: 28px; width: 28px; height: 16px; }
.schedule-compact .switch::after { top: 3px; left: 3px; width: 10px; height: 10px; }
.schedule-compact input:checked + .switch { background: var(--blue); }
.schedule-compact input:checked + .switch::after { left: 15px; background: #fff; }
.schedule-date-compact { width: 185px; min-height: 32px; padding: 0 8px; border-radius: 9px; cursor: pointer; font-size: 9.5px; }
.compact-action, button.draft-pill { min-height: 32px; padding: 0 10px; border-radius: 9px; font-size: 10px; letter-spacing: 0; text-transform: none; white-space: nowrap; }
button.draft-pill span { min-width: 17px; height: 17px; font-size: 8px; }
.draft-insert-notice { max-width: 180px; padding: 7px 9px; overflow: hidden; border: 1px solid #c6eadc; border-radius: 9px; color: #167957; background: #f1fbf6; font-size: 9.5px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }

.composer-progress { display: flex; min-height: 150px; max-height: 240px; margin-top: 13px; padding: 13px 14px; flex: 1 1 150px; flex-direction: column; overflow: hidden; border: 1px solid #dfe6ef; border-radius: 13px; background: #f8fafc; }
.composer-progress .progress-heading { color: #2d3d53; font-size: 12px; }
.composer-progress .progress-track { margin: 10px 0; }
.composer-progress .job-log { flex: 1; min-height: 0; max-height: none; margin: 0; gap: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; color: #3f5067; font-family: inherit; font-size: 12px; font-weight: 550; line-height: 1.5; }
.composer-progress .job-log > div { padding: 7px 9px; border-left: 3px solid #e2a087; border-radius: 7px; background: #fff; }
.composer-progress .job-log > div.success { border-left-color: #4db38c; color: #245f4b; background: #f4fbf8; }
.composer-progress .job-log > div.error { border-left-color: #d76173; color: #8e3041; background: #fff6f7; }
.composer-progress .job-log > div.info { border-left-color: #e2a087; }
.submit-actions { display: flex; align-items: center; gap: 8px; }
.submit-actions .danger { min-height: 42px; }

.pages-list { gap: 4px; }
.page-option { min-height: 38px; padding: 3px 8px; }
.page-avatar { flex-basis: 28px; width: 28px; height: 28px; border-radius: 8px; }
.page-name { font-size: 11.5px; }
.pages-pagination { display: flex; min-height: 34px; margin-top: 9px; align-items: center; justify-content: center; gap: 10px; color: #65758b; font-size: 10.5px; font-weight: 700; }
.pagination-button { display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 1px solid #dce3ec; border-radius: 8px; color: #46566d; background: #fff; cursor: pointer; font-size: 18px; line-height: 1; }
.pagination-button:hover:not(:disabled) { border-color: #efb9a5; color: #c24c28; background: #fff6f2; }
.pagination-button:disabled { opacity: .38; cursor: default; }

label > span:first-child, .field-label { font-size: 11.5px; }
label small { font-size: 10px; }
.type-button { font-size: 11px; }
.file-drop strong { font-size: 11.5px; }
.empty-state strong { font-size: 13px; }
.empty-state span { font-size: 11px; }
.active-token-picker select { font-size: 11px; }
.active-token-picker small, .selection-actions { font-size: 10.5px; }
.selected-summary { font-size: 11px; }
.token-copy strong { font-size: 12px; }
.token-copy small { font-size: 10.5px; }
.token-state { font-size: 9px; }
.token-preview { border-color: #efb9a5; color: #9d3f21; background: #fff7f3; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700; }
.draft-copy strong { font-size: 12px; }
.draft-copy span, .dialog-copy { font-size: 11px; }
.log-entry { font-size: 11px; line-height: 1.45; }

@media (min-width: 1051px) {
  #view-compose.active { display: flex; min-height: calc(100dvh - 78px); padding-bottom: 22px; flex-direction: column; }
  #view-compose .workspace-grid { flex: 1; min-height: calc(100dvh - 122px); align-items: stretch; }
  .composer-card, .pages-card { display: flex; min-height: 100%; flex-direction: column; }
  .composer-card #post-form { display: flex; flex: 1; flex-direction: column; }
  .composer-card .submit-row { margin-top: auto; }
  .pages-card .pages-list { flex: 1; min-height: 0; max-height: none; grid-template-rows: repeat(10, minmax(0, 1fr)); align-content: stretch; overflow: hidden; }
  .pages-card .pages-list.empty { min-height: 0; grid-template-rows: minmax(0, 1fr); align-content: center; }
}

/* Login inspirat din macheta furnizată */
body.login-page { display: grid; min-width: 320px; min-height: 100vh; padding: 38px 18px; place-items: center; background: #f4f6fa; }
.login-shell { width: min(440px, 100%); }
.login-brand { display: flex; width: max-content; align-items: center; gap: 13px; margin: 0 auto 22px; }
.login-brand-mark { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, #ee7950, #df6037); box-shadow: 0 10px 24px rgba(225,95,54,.18); font-size: 13px; font-weight: 850; }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { color: #111d30; font-size: 16px; }
.login-brand span { margin-top: 3px; color: #75849a; font-size: 10px; letter-spacing: .2px; }
.login-card { padding: 40px 34px 31px; border: 1px solid #dce3eb; border-radius: 17px; background: #fff; box-shadow: 0 22px 45px rgba(38,50,66,.09); }
.login-eyebrow { margin: 0; color: #dd5d34; font-size: 10px; font-weight: 850; letter-spacing: 1.5px; }
.login-card h1 { margin: 13px 0 8px; color: #111d30; font-size: 28px; line-height: 1.15; letter-spacing: -.7px; }
.login-copy { margin: 0 0 23px; color: #718096; font-size: 12px; }
.login-card label { margin-top: 16px; }
.login-card label > span:first-child { margin: 0 0 7px; color: #334155; font-size: 11px; font-weight: 750; }
.login-card input { min-height: 46px; background: #fff; }
.login-error { margin: 12px 0 0; padding: 10px 12px; border: 1px solid #f3c6ce; border-radius: 9px; color: #bd3750; background: #fff5f7; font-size: 10px; line-height: 1.45; }
.login-submit { width: 100%; min-height: 43px; margin-top: 20px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(120deg, #ed7043, #e25f35); box-shadow: 0 10px 22px rgba(225,95,54,.22); cursor: pointer; font-size: 12px; font-weight: 800; }
.login-submit:hover { filter: brightness(1.03); transform: translateY(-1px); }
.login-submit:disabled { opacity: .65; cursor: wait; transform: none; }
.login-footnote, .login-limit-note { margin: 17px 0 0; color: #7d8a9d; text-align: center; font-size: 8px; }
.login-limit-note { margin-top: 7px; color: #9aa6b5; }

@media (max-width: 1050px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .composer-card, .pages-card { min-height: 0; }
  .pages-list { overflow-y: auto; }
}

@media (max-width: 760px) {
  body.menu-open::after { background: rgba(30,41,59,.25); backdrop-filter: blur(2px); }
  .topbar { min-height: 70px; }
  .view { padding-top: 16px; }
  .token-form-actions { width: 100%; margin-top: 0 !important; }
  .token-form-actions .button { flex: 1; }
  .token-actions { flex-wrap: wrap; }
  .draft-save-form { grid-template-columns: 1fr; }
  .draft-save-form .button { width: 100%; }
  .composer-head { align-items: stretch; flex-direction: column; }
  .composer-head > div:first-child { padding-top: 0; }
  .composer-tools { justify-content: flex-start; flex-wrap: wrap; }
  .submit-actions { width: 100%; }
  .submit-actions .primary { width: auto; flex: 1; }
}

@media (max-width: 480px) {
  body.login-page { padding: 24px 14px; }
  .login-card { padding: 32px 24px 26px; }
  .login-card h1 { font-size: 25px; }
  .top-actions .button { padding-inline: 10px; }
  .dialog-shell { padding: 20px; }
  .draft-row { align-items: stretch; flex-direction: column; }
  .draft-row-actions { width: 100%; }
  .draft-row-actions .button { flex: 1; }
  .schedule-toolbar { width: 100%; flex-wrap: wrap; }
  .schedule-compact { flex: 1; justify-content: center; }
  .schedule-date-compact { width: 100%; flex: 1 1 100%; }
  .composer-tools .compact-action, .composer-tools .draft-pill { flex: 1; }
  .draft-insert-notice { order: 10; width: 100%; max-width: none; text-align: center; }
  .file-drop.horizontal { flex-wrap: wrap; }
  .file-drop.horizontal .file-name { width: 100%; max-width: 100%; margin-left: 44px; }
}
