/* Studio: the site's palette (src/styles/global.css), one dense dark layout. */
:root {
  --bg: #141414; --bg-2: #1a1a1a; --card: #1f1f1f; --line: #333; --text: #f5f5f2; --muted: #adadad;
  --accent: #ff6900; --accent-2: #f59a23; --raise: #e0574f; --call: #3fa86b; --limp: #3f86c9; --allin: #9b4fd0;
  --radius: 10px; --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono, pre { font-family: var(--mono); font-size: 0.92em; }
pre { white-space: pre-wrap; word-break: break-word; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 15px; margin: 24px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
h3 { font-size: 14px; margin: 0 0 8px; }
h4 { font-size: 13px; margin: 12px 0 6px; color: var(--muted); }
main { max-width: 1120px; margin: 0 auto; padding: 20px 16px 60px; }
body.wide main { max-width: 1600px; }
footer { color: var(--muted); font-size: 13px; text-align: center; padding: 20px; border-top: 1px solid var(--line); }

.top { display: flex; align-items: center; gap: 18px; padding: 0 16px; height: 50px; border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; z-index: 5; }
.brand { color: var(--text); font-weight: 800; display: flex; align-items: center; gap: 8px; letter-spacing: 0.04em; }
.brand img { border-radius: 7px; }
.top nav { display: flex; gap: 2px; overflow-x: auto; }
.top nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.top nav a.on, .top nav a:hover { color: var(--text); background: var(--card); text-decoration: none; }
.who { margin-left: auto; display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.who form { display: inline; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.flash { max-width: 1120px; margin: 14px auto 0; padding: 10px 14px; border-radius: var(--radius); background: #1f3a2a; border: 1px solid var(--call); }
.flash.bad { background: #3a1f1f; border-color: var(--raise); }
body.wide .flash { max-width: 1600px; }

.bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.bar .spacer { flex: 1; }
.tabs { display: flex; gap: 2px; align-items: center; }
.tabs a, .tabs strong { padding: 5px 10px; border-radius: 8px; color: var(--muted); }
.tabs a.on, .tabs a:hover { background: var(--card); color: var(--text); text-decoration: none; }
.hint { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.ok { color: var(--call); }
.err { color: var(--raise); }
.warn { color: var(--accent-2); }
.empty { color: var(--muted); text-align: center; padding: 10px; }

.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.danger { color: var(--raise); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu > div { position: absolute; right: 0; top: 40px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-width: 190px; padding: 6px; z-index: 6; display: flex; flex-direction: column; }
.menu > div a { padding: 7px 10px; border-radius: 6px; color: var(--text); }
.menu > div a:hover { background: var(--bg-2); text-decoration: none; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); margin-right: 4px; vertical-align: middle; letter-spacing: 0.02em; }
.badge.t-blog { color: var(--accent-2); border-color: #5a4320; }
.badge.t-newsletter { color: var(--limp); border-color: #26405a; }
.badge.t-social { color: var(--allin); border-color: #432a5a; }
.badge.t-ideas { color: var(--muted); }
.badge.s-idea { color: var(--muted); }
.badge.s-draft { color: var(--accent-2); }
.badge.s-ready { color: var(--limp); }
.badge.s-scheduled { color: var(--allin); }
.badge.s-published { color: var(--call); }
.badge.p-instagram, .badge.p-x, .badge.p-discord, .badge.p-telegram { color: var(--text); }
.badge.done { color: var(--call); border-color: #2a4a35; }

/* board */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 300px; }
.col h2 { margin: 0 0 10px; display: flex; justify-content: space-between; font-size: 12px; }
.col .n { color: var(--text); background: var(--card); border-radius: 999px; padding: 0 8px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; color: var(--text); }
.card:hover { border-color: var(--muted); text-decoration: none; }
.card-top { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 6px; }
.card-title { font-weight: 600; line-height: 1.3; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .wd { color: var(--muted); font-size: 12px; text-align: center; padding: 4px; }
.day { min-width: 0; min-height: 110px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.day.off { opacity: 0.45; }
.day.today { border-color: var(--accent); }
.day .dn { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.chip { display: block; font-size: 12px; padding: 2px 6px; border-radius: 5px; margin-bottom: 3px; color: var(--text); background: var(--card); border-left: 3px solid var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.t-blog { border-left-color: var(--accent-2); }
.chip.t-newsletter { border-left-color: var(--limp); }
.chip.t-social { border-left-color: var(--allin); }
.chip.s-published { opacity: 0.6; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.bad td { color: var(--raise); }

/* forms */
.form .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.form label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.form small { color: var(--muted); font-size: 12px; }
.form input, .form select, .form textarea { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; width: 100%; }
.form textarea { font-family: var(--mono); font-size: 13px; line-height: 1.5; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .checks { display: flex; gap: 18px; margin-bottom: 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; text-transform: none !important; letter-spacing: 0 !important; font-size: 14px !important; color: var(--text) !important; margin-right: 12px; }
.check input { width: auto; }
.form.narrow { max-width: 560px; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.counts { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.counts .over { color: var(--raise); font-weight: 600; }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow-y: auto; }
.box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.box p { margin: 6px 0; font-size: 14px; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.inline { display: flex; gap: 6px; width: 100%; }
.inline input { flex: 1; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; }
.manual { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.cap pre { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 12px; max-height: 160px; overflow: auto; margin: 0 0 6px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumbs img { width: 100%; border-radius: 6px; border: 1px solid var(--line); display: block; aspect-ratio: 4 / 5; object-fit: cover; }
.log { list-style: none; padding: 0; margin: 0; font-size: 12px; }
.log li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; }

/* code editor */
.cm-editor { background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; min-height: 300px; max-height: 70vh; }
.cm-editor.cm-focused { outline: 2px solid var(--accent); }
.cm-scroller { font-family: var(--mono) !important; line-height: 1.5; }
.cm-gutters { background: var(--bg-2) !important; border-right: 1px solid var(--line) !important; color: var(--muted) !important; }
.cm-activeLine { background: rgba(255, 255, 255, 0.03) !important; }
.cm-activeLineGutter { background: transparent !important; }
.cm-content { caret-color: var(--accent); }
.cm-cursor { border-left-color: var(--accent) !important; }
.cm-selectionBackground, .cm-editor ::selection { background: rgba(255, 105, 0, 0.3) !important; }

.login { max-width: 380px; margin: 60px auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.login h1 { margin-bottom: 8px; }
.login p { color: var(--muted); }
.login .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.login label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.login input, .login select { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; width: 100%; }

@media (max-width: 960px) {
  .editor { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .kanban { grid-template-columns: repeat(5, 240px); }
  .form .row { grid-template-columns: 1fr; }
  .cal { gap: 2px; }
  .day { min-height: 70px; padding: 3px; }
  .chip { font-size: 10px; padding: 1px 3px; }
}
