/* Creative Network — web MVP UI. System fonts only. */
:root {
  --ink:#0b0b0c; --paper:#f6f6f2; --paper2:#efefe9; --line:#c9c9c1; --mid:#5a5a54;
  --accent:#a6401f; --accent2:#e3a07f; --accent-bg:#fbf1ea;
  --ok:#2f6b3a; --ok-bg:#e4efe6; --warn:#8a5a00; --warn-bg:#f3ecd8; --bad:#a6401f; --bad-bg:#f3e3da;
  --res-fg:#5b3a00; --res-bg:#efe7d0; --ai-fg:#174a7c; --ai-bg:#e3edf6;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --radius: 10px; --maxw: 720px; --focus: #1f5c99;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:#f1f1ec; --paper:#111110; --paper2:#1b1b19; --line:#3c3c38; --mid:#a6a69c;
    --accent:#e3a07f; --accent2:#a6401f; --accent-bg:#2a1f19;
    --ok:#7fbf8e; --ok-bg:#122016; --warn:#e0b355; --warn-bg:#241d10; --bad:#e3a07f; --bad-bg:#2a1a16;
    --res-fg:#e6c98a; --res-bg:#2a2211; --ai-fg:#9cc3ec; --ai-bg:#101d2a; --focus:#8fc3ff;
  }
}
:root[data-theme="dark"] {
  --ink:#f1f1ec; --paper:#111110; --paper2:#1b1b19; --line:#3c3c38; --mid:#a6a69c;
  --accent:#e3a07f; --accent2:#a6401f; --accent-bg:#2a1f19;
  --ok:#7fbf8e; --ok-bg:#122016; --warn:#e0b355; --warn-bg:#241d10; --bad:#e3a07f; --bad-bg:#2a1a16;
  --res-fg:#e6c98a; --res-bg:#2a2211; --ai-fg:#9cc3ec; --ai-bg:#101d2a; --focus:#8fc3ff;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); line-height: 1.45; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--font); font-weight: 700; line-height: 1.15; margin: 0 0 10px; }
h1 { font-size: 28px; } h2 { font-size: 20px; margin-top: 26px; } h3 { font-size: 16px; margin-top: 18px; }
p { margin: 0 0 12px; } a { color: inherit; }
.lead { font-size: 17px; color: var(--mid); }
.muted { color: var(--mid); } .small { font-size: 13px; } .tiny { font-size: 11.5px; }
.mono { font-family: var(--mono); }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--mid); margin-bottom: 6px; }
.lab { font-family: var(--mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--mid); margin: 18px 0 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.center { text-align: center; }
button, input, select, textarea { font: inherit; color: inherit; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---------- app shell ---------- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 2px solid var(--ink); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 800; font-size: 16px; text-decoration: none; white-space: nowrap; }
.rail { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; text-decoration: none; font-size: 17px; }
.iconbtn:hover, .rail-i:hover { background: var(--paper2); }
.dot { position: absolute; top: 0; right: 0; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; line-height: 15px; text-align: center; font-family: var(--mono); }
.me-chip { display: inline-flex; background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
#main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 14px 14px 90px; }
.page { animation: page-in .15s ease-out; }
@keyframes page-in { from { transform: translateY(6px); } to { transform: none; } }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; border-top: 2px solid var(--ink); background: var(--paper); z-index: 10; }
.tab-i { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 9px; text-decoration: none; font-size: 11px; color: var(--mid); }
.tab-i.on { color: var(--ink); font-weight: 700; } .tab-ic { font-size: 19px; }

@media (min-width: 900px) {
  :root { --maxw: 880px; }
  .tabbar { display: none; }
  .rail { display: flex; gap: 4px; }
  .rail-i { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 20px; text-decoration: none; font-size: 14px; color: var(--mid); }
  .rail-i.on { background: var(--ink); color: var(--paper); }
  #main { padding-bottom: 40px; }
}

/* ---------- spinner / loading ---------- */
.spinner { display: flex; justify-content: center; padding: 32px 0; }
.spinner::after { content: ''; width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons / chips / badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--ink); color: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 11px 18px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 44px; text-decoration: none; }
.btn:hover { opacity: .88; } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sec { background: transparent; color: var(--ink); }
.btn.ghost { background: transparent; border-color: transparent; padding: 8px 10px; min-height: 36px; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 13px; min-height: 36px; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; margin-top: 6px; }
.row.center { justify-content: center; }
.row.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid var(--ink); border-radius: 999px; padding: 6px 13px; font-size: 13px; background: transparent; cursor: pointer; text-decoration: none; color: inherit; min-height: 34px; }
.chip.on { background: var(--ink); color: var(--paper); }
.chip.ac { border-color: var(--accent); color: var(--accent); }
.chip.dash { border-style: dashed; color: var(--mid); }
.chip.static { cursor: default; }
.badge { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border: 1.5px solid var(--ink); border-radius: 5px; background: transparent; }
.badge.res { background: var(--res-bg); border-color: var(--res-fg); color: var(--res-fg); }
.badge.ai { background: var(--ai-bg); border-color: var(--ai-fg); color: var(--ai-fg); }
.badge.pend { border-style: dashed; color: var(--mid); }
.badge.late { background: var(--paper2); color: var(--mid); }
.badge.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.badge.bad { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.card { border: 2px solid var(--ink); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.card.link { display: block; text-decoration: none; color: inherit; }
.note { border-left: 4px solid var(--accent); background: var(--accent-bg); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 14px 0; font-size: 14px; }
.note.bad { border-color: var(--bad); background: var(--bad-bg); }
.seg { display: flex; border-bottom: 2px solid var(--ink); margin: 10px 0 16px; gap: 4px; }
.seg-i { padding: 9px 4px; text-decoration: none; color: var(--mid); font-weight: 600; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.seg-i.on { color: var(--ink); border-color: var(--accent); }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.field { width: 100%; border: 2px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 10px 12px; font-size: 15px; }
.field:focus { border-color: var(--ink); }
.field.short { max-width: 160px; display: inline-block; width: auto; }
textarea.field { resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; font-size: 14px; margin: 10px 0; }
.declare { border: 2px solid var(--accent); background: var(--accent-bg); border-radius: var(--radius); padding: 13px 15px; margin: 16px 0; }
.declare.on { border-color: var(--ok); background: var(--ok-bg); }
.declare-label { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; cursor: pointer; }
.declare-label input { width: 20px; height: 20px; margin-top: 1px; flex: none; }
.declare .req { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.declare.on .req { color: var(--ok); }
.declare small { display: block; color: var(--mid); font-weight: 400; margin-top: 2px; }
.check.big input { width: 20px; height: 20px; margin-top: 2px; }
.check.inline { display: inline-flex; margin: 0; }
.field-msg { color: var(--bad); font-size: 13px; min-height: 1em; }
.plain { list-style: disc; padding-left: 22px; margin: 0 0 12px; } .plain li { margin: 6px 0; }
.radios { border: 0; padding: 0; margin: 10px 0; } .radio { display: flex; gap: 8px; padding: 6px 0; font-size: 14px; }
.form h1 { margin-top: 8px; }

/* pickers */
.picker { margin: 8px 0 4px; }
.picker.small { max-width: 200px; }
.picker-empty { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px 12px; text-align: center; }
.picker-mode { display: flex; gap: 8px; margin-bottom: 8px; }
.picker-model-prev { border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px; display: flex; align-items: center; gap: 12px; background: var(--paper2); margin-bottom: 8px; }
.model-view { margin: 10px 0; }
.model-fallback { border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px 16px; text-align: center; }
.model-fallback p { margin: 6px 0; }
.picker-prev img { width: 100%; border-radius: var(--radius); display: block; margin-bottom: 8px; border: 2px solid var(--ink); }
.sketches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0; }
.voice { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.voice audio { max-width: 220px; }

/* term picker sheet */
.termlist { max-height: 42vh; overflow: auto; border: 2px solid var(--line); border-radius: var(--radius); margin: 8px 0; }
.termopt { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 14px; cursor: pointer; font-size: 14px; }
.termopt:last-child { border-bottom: 0; }
.termopt.on { background: var(--accent-bg); font-weight: 700; }
.termopt:disabled { opacity: .4; cursor: not-allowed; }
.termopt small { color: var(--mid); font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; }
.sticky-foot { position: sticky; bottom: -1px; background: var(--paper); padding-top: 8px; }

/* providers (sign-in) */
.providers { display: flex; flex-direction: column; gap: 10px; }
.provider { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; border: 2px solid var(--ink); border-radius: var(--radius); background: transparent; padding: 13px 16px; cursor: pointer; text-align: left; }
.provider:disabled { opacity: .4; cursor: not-allowed; }
.provider small { color: var(--mid); font-weight: 400; }

/* ---------- sheets / toasts ---------- */
.veil { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
@media (min-width: 640px) { .veil { align-items: center; } }
.sheet { background: var(--paper); color: var(--ink); width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; border: 2px solid var(--ink); border-bottom: 0; }
@media (min-width: 640px) { .sheet { border-radius: 14px; border-bottom: 2px solid var(--ink); } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 2px solid var(--ink); position: sticky; top: 0; background: var(--paper); }
.sheet-head h2 { margin: 0; font-size: 17px; }
.sheet-body { padding: 14px 16px 22px; }
#toasts { position: fixed; left: 0; right: 0; bottom: 76px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; }
@media (min-width: 900px) { #toasts { bottom: 24px; } }
.toast { background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; font-size: 13.5px; max-width: 90vw; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.toast.error { background: var(--bad); }
.toast.out { opacity: 0; transition: opacity .3s; }
#crash { position: fixed; left: 0; right: 0; top: 0; background: #a6401f; color: #fff; padding: 8px 14px; font-size: 12.5px; z-index: 100; font-family: var(--mono); }

/* ---------- feeds / grids / tiles ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 14px; }
.catsel select { min-width: 150px; }
.day-h { display: flex; align-items: baseline; gap: 4px; margin-top: 22px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; border: 2px solid var(--ink); text-decoration: none; background: var(--paper2); }
.tile-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.model-thumb { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--paper2); color: var(--mid); }
.model-thumb-ic { font-size: 34px; line-height: 1; }
.model-thumb-fmt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.tile-label { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.tile-flags { position: absolute; right: 5px; top: 5px; display: flex; gap: 4px; }
.tile-flags .badge { font-size: 9px; padding: 2px 5px; background: var(--paper); }
.endcap { text-align: center; margin: 26px 0; }
.empty { text-align: center; padding: 40px 14px; color: var(--mid); }
.empty h3 { color: var(--ink); }
.cell { display: flex; flex-direction: column; gap: 4px; }
.tasklist { display: flex; flex-direction: column; gap: 10px; }
.taskrow { display: grid; grid-template-columns: 66px 1fr; gap: 12px; text-decoration: none; color: inherit; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px; }
.taskrow img { width: 66px; height: 66px; object-fit: cover; border-radius: 6px; }

/* ---------- task / item detail ---------- */
.task { border: 2px solid var(--ink); border-radius: 14px; padding: 16px; margin: 12px 0 24px; }
.task-fig { margin: 0 0 12px; } .task-fig img { width: 100%; border-radius: 8px; display: block; }
.task-h { font-size: 26px; margin-bottom: 2px; } .task-sub { color: var(--mid); margin-top: 0; }
.steps { padding-left: 22px; } .steps li { margin: 10px 0; }
.steps li.diverge { background: var(--accent-bg); border: 1.5px solid var(--accent); border-radius: 8px; padding: 10px 12px 10px 8px; margin-left: -8px; list-style-position: inside; }
.cta { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero { width: 100%; border-radius: 12px; border: 2px solid var(--ink); display: block; margin: 10px 0; }
.author { display: flex; align-items: center; gap: 9px; }
.author .who { font-weight: 700; text-decoration: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 800; flex: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.statement { font-size: 18px; font-style: italic; }
.item .comments { margin-top: 26px; border-top: 2px solid var(--line); padding-top: 16px; }
.composer { margin: 10px 0 20px; }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment.nested { margin-left: 30px; padding-left: 12px; border-left: 2px solid var(--line); }
.ctext { white-space: pre-wrap; margin: 6px 0 0; }
.thumb .tile { width: 90px; height: 90px; }

/* ---------- profile / portfolio ---------- */
.phead { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.psec { margin-top: 22px; }
.heat-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; margin: 8px 0; }
@media (min-width: 560px) { .heat-row { grid-template-columns: 190px 1fr; } }
.heat-l { font-size: 12.5px; }
.heat { display: flex; flex-wrap: wrap; gap: 3px; }
.radar { max-width: 620px; margin: 10px auto; }
.alt summary { cursor: pointer; font-size: 13px; color: var(--mid); margin: 10px 0; }
.table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.table th { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--mid); }

/* settings */
.meter { height: 8px; background: var(--paper2); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; margin: 6px 0 12px; }
.meter i { display: block; height: 100%; background: var(--accent); }

/* alerts */
.alert { display: block; padding: 12px 8px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.alert.unread { background: var(--accent-bg); }
.alert .who { font-weight: 700; }

/* menu sheet */
.menu { display: flex; flex-direction: column; }
.menuitem { text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 13px 4px; font-size: 15px; cursor: pointer; color: inherit; text-decoration: none; }
.menuitem.danger { color: var(--bad); font-weight: 700; }
.menulab { padding: 10px 0; font-weight: 400; }

/* moderation / editorial */
.report { margin: 10px 0; }
