/* PoFa — content plane.
   Deliberately a different visual language from the QA Lab control room:
   warm paper, chunky borders, hard shadows. Same backend, different job.
   Fonts are named with system fallbacks only — the CSP blocks remote font
   hosts, matching how styles.css handles IBM Plex. */

:root {
  color-scheme: light;
  --paper: #efe9dd;
  --surface: #f6f2ea;
  --card: #fffdf8;
  --ink: #241f1a;
  --muted: #7d7364;
  --faint: #8d8374;
  --line: #e6dece;
  --line-soft: #e3dbcb;
  --hard: #e0d8c8;
  --lime: #d7f25b;
  --lime-dark: #a8bf3b;
  --coral: #e0552f;
  --peach: #ffb1a0;
  --sky: #a9d8ff;
  --lilac: #d9c2ff;
  --mint: #b8f0d2;
  --amber: #ffd97a;
  --stone: #cdc3b2;
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  font-family: var(--body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--coral);
  text-decoration: none;
}

a:hover {
  color: var(--ink);
}

button,
input,
textarea,
select {
  font-family: inherit;
}

@keyframes pop {
  0% { transform: scale(0.9); opacity: 0; }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes rise {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #d6cdbb;
  border-radius: 8px;
  border: 3px solid var(--paper);
}

/* ---------- auth ---------- */

.auth {
  position: fixed;
  inset: 0;
  width: 100vw;
  min-height: 100vh;
  box-sizing: border-box;
  z-index: 40;
  display: grid;
  place-items: center;
  background: var(--paper);
  padding: 22px;
}

.auth[hidden] {
  display: none;
}

.shell[hidden],
.tabbar[hidden] {
  display: none !important;
}

.auth-box {
  width: min(400px, 100%);
  display: grid;
  gap: 12px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 0 var(--hard);
}

.auth-box h1 {
  margin: 0;
  font: 800 26px var(--display);
  letter-spacing: -0.03em;
}

.auth-box label {
  font: 500 10px var(--mono);
  letter-spacing: 0.12em;
  color: var(--faint);
  text-transform: uppercase;
}

.auth-box input {
  height: 44px;
  border: 1.5px solid var(--line-soft);
  border-radius: 13px;
  padding: 0 12px;
  font: 500 13px var(--body);
  background: #fdfbf6;
  color: var(--ink);
  outline: none;
}

.auth-box input:focus {
  border-color: var(--ink);
}

.auth-note {
  margin: 0;
  font: 400 11.5px/1.5 var(--body);
  color: var(--muted);
}

.auth-note.error {
  color: var(--coral);
  font-weight: 600;
}

/* ---------- shell ---------- */

/* Fixed-height shell so the screen header stays put and only the content
   region scrolls, as in the design. Mobile relaxes this. */
.shell {
  height: 100vh;
  overflow: hidden;
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  background: var(--surface);
}

.sidebar {
  width: 232px;
  flex: none;
  background: var(--ink);
  color: #fffdf8;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  gap: 22px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--lime);
  display: grid;
  place-items: center;
  font: 800 15px var(--display);
  color: var(--ink);
}

.brand-name {
  font: 700 17px var(--display);
  letter-spacing: -0.02em;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 11px;
  cursor: pointer;
  border: none;
  font: 600 13px var(--body);
  background: transparent;
  color: rgba(255, 253, 248, 0.62);
  text-align: left;
}

.nav-item:hover {
  color: #fffdf8;
}

.nav-item[aria-current="true"] {
  background: rgba(255, 253, 248, 0.13);
  color: #fffdf8;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex: none;
  opacity: 0.45;
}

.nav-item[aria-current="true"] .nav-dot {
  opacity: 1;
}

.nav-item span:nth-child(2) {
  flex: 1;
}

.nav-count {
  font: 500 10px var(--mono);
  color: var(--ink);
  border-radius: 6px;
  padding: 1px 5px;
}

.nav-count[hidden] {
  display: none;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.new-post {
  width: 100%;
  padding: 12px;
  border-radius: 13px;
  border: none;
  background: var(--lime);
  color: var(--ink);
  font: 700 14px var(--body);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--lime-dark);
}

.new-post:hover {
  transform: translateY(1px);
  box-shadow: 0 2px 0 var(--lime-dark);
}

.workspace-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.07);
  border: 1px solid rgba(255, 253, 248, 0.14);
  color: rgba(255, 253, 248, 0.86);
  font: 600 12px var(--body);
  cursor: pointer;
  text-align: left;
}

.workspace-switch:hover {
  background: rgba(255, 253, 248, 0.13);
  color: #fffdf8;
}

.workspace-switch small {
  display: block;
  font: 400 10px var(--mono);
  opacity: 0.6;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 8px;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.07);
}

.sidebar-user .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--peach);
  flex: none;
}

.sidebar-user strong {
  display: block;
  font: 600 12px var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user small {
  font: 400 10px var(--mono);
  opacity: 0.55;
}

/* ---------- main ---------- */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.screen-head {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1.5px solid var(--line);
}

.screen-head h1 {
  margin: 0;
  font: 800 29px var(--display);
  letter-spacing: -0.03em;
}

.screen-head p {
  margin: 3px 0 0;
  font: 400 12.5px var(--body);
  color: var(--muted);
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px 26px 40px;
}

/* ---------- primitives ---------- */

.btn {
  height: 36px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  font: 600 12px var(--body);
  cursor: pointer;
  color: var(--ink);
}

.btn:hover {
  background: var(--lime);
}

.btn.dark {
  background: var(--ink);
  color: #fffdf8;
  font-weight: 700;
  padding: 0 15px;
}

.btn.dark:hover {
  background: var(--coral);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 10px;
  cursor: pointer;
  font: 600 11.5px var(--body);
  border: 1.5px solid #ddd4c3;
  background: var(--card);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--lime);
}

.chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: none;
}

.card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  padding: 15px;
  box-shadow: 0 3px 0 var(--hard);
}

.step-label {
  font: 500 10px var(--mono);
  letter-spacing: 0.12em;
  color: var(--faint);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid var(--ink);
  font: 600 9.5px var(--mono);
  color: var(--ink);
}

.tile {
  position: relative;
  border-radius: 11px;
  overflow: hidden;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0 7px, rgba(255, 255, 255, 0) 7px 14px);
}

.empty {
  border: 1.5px dashed var(--stone);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  font: 400 12px var(--body);
  color: var(--faint);
}

.hint {
  font: 400 11px/1.6 var(--mono);
  color: var(--faint);
}

/* ---------- target / blocker badges ---------- */

.target {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 500 10px var(--mono);
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 1px 6px;
  background: var(--mint);
}

.target.blocked {
  background: var(--peach);
}

/* ---------- calendar ---------- */

.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 3px;
}

.week-nav button {
  width: 30px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  font: 600 15px system-ui;
}

.week-nav button:hover {
  background: var(--paper);
}

.week-nav span {
  padding: 0 9px;
  font: 600 12.5px var(--body);
  white-space: nowrap;
}

/* A week view is seven columns or it is not a week view. Only below the
   breakpoint does it reflow. */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
  align-items: start;
}

@media (max-width: 1100px) {
  .week-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

.day-col {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 11px 9px;
  min-height: 150px;
}

.day-col.today {
  background: #fdf6e3;
  border-color: var(--ink);
}

.day-col.drop-target {
  border-color: var(--coral);
  border-style: dashed;
}

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2px 8px;
}

.day-head .dow {
  font: 500 10px var(--mono);
  letter-spacing: 0.1em;
  color: var(--faint);
}

.day-head .num {
  font: 700 15px var(--display);
}

.day-col.today .day-head .num {
  background: var(--ink);
  color: #fffdf8;
  border-radius: 8px;
  padding: 1px 7px;
}

.day-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.post-card {
  border: 1.5px solid var(--ink);
  border-radius: 13px;
  padding: 8px;
  cursor: grab;
  box-shadow: 0 2px 0 var(--hard);
  text-align: left;
  width: 100%;
  font: inherit;
}

.post-card:active {
  cursor: grabbing;
}

.post-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.post-card-top .time {
  font: 500 10px var(--mono);
  color: #6f6557;
}

.status-dot {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  flex: none;
}

.post-thumb {
  height: 44px;
}

.overlay-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font: 500 8px var(--mono);
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 1px 4px;
}

.post-caption {
  font: 600 11.5px/1.35 var(--body);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-handle {
  display: block;
  font: 400 10px var(--mono);
  color: var(--faint);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-foot {
  display: block;
  margin-top: 5px;
}

.add-slot {
  height: 34px;
  border: 1.5px dashed var(--stone);
  border-radius: 11px;
  background: transparent;
  color: var(--faint);
  font: 600 11.5px var(--body);
  cursor: pointer;
}

.add-slot:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--card);
}

/* ---------- queue ---------- */

.queue-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 11px 13px;
  box-shadow: 0 2px 0 var(--hard);
}

.queue-row .thumb {
  width: 52px;
  height: 52px;
  flex: none;
  border: 1.5px solid var(--ink);
}

.queue-row .body {
  flex: 1;
  min-width: 170px;
}

.queue-row .meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.queue-row .meta strong {
  font: 600 12px var(--body);
}

.queue-row .caption {
  font: 400 12.5px/1.45 var(--body);
  color: #4b443b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.queue-row .when {
  text-align: right;
  min-width: 110px;
}

.queue-row .when strong {
  display: block;
  font: 600 12.5px var(--body);
}

.queue-row .when small {
  font: 400 10.5px var(--mono);
  color: var(--faint);
}

.status-tag {
  font: 600 10px var(--mono);
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 1px 6px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1.5px solid var(--line-soft);
  background: var(--card);
  cursor: pointer;
  color: var(--faint);
  font: 600 13px system-ui;
}

.icon-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
}

.mini-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  font: 600 11.5px var(--body);
  cursor: pointer;
}

.mini-btn:hover {
  background: var(--lime);
}

.mini-btn.go {
  background: var(--lime);
}

/* ---------- composer ---------- */

.composer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.composer-form {
  flex: 1 1 380px;
  min-width: 290px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-tabs {
  display: flex;
  background: #e7e0d2;
  border-radius: 13px;
  padding: 3px;
  width: fit-content;
}

.mode-tabs button {
  height: 32px;
  padding: 0 15px;
  border-radius: 11px;
  border: none;
  cursor: pointer;
  font: 600 12px var(--body);
  background: transparent;
}

.mode-tabs button[aria-pressed="true"] {
  background: var(--card);
  box-shadow: 0 1px 3px rgba(36, 31, 26, 0.14);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 7px;
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border-radius: 12px;
  cursor: pointer;
  border: 1.5px solid var(--line-soft);
  background: #fdfbf6;
  text-align: left;
}

.account-btn[aria-pressed="true"] {
  border-color: var(--ink);
}

.account-btn .handle {
  flex: 1;
  min-width: 0;
  font: 600 12px var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-btn .handle small {
  display: block;
  font: 400 9.5px var(--mono);
  color: var(--faint);
}

.account-btn .check {
  font: 700 12px system-ui;
  opacity: 0.15;
}

.account-btn[aria-pressed="true"] .check {
  opacity: 1;
}

.account-btn.blocked {
  opacity: 0.72;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 7px;
}

.media-btn {
  aspect-ratio: 1;
  padding: 0;
  cursor: pointer;
  border: 1.5px solid var(--line-soft);
}

.media-btn[aria-pressed="true"] {
  border: 2.5px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

.media-tag {
  position: absolute;
  left: 3px;
  bottom: 3px;
  font: 500 8px var(--mono);
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 0 3px;
}

textarea.field {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1.5px solid var(--line-soft);
  border-radius: 13px;
  padding: 11px;
  font: 400 13px/1.5 var(--body);
  background: #fdfbf6;
  color: var(--ink);
  outline: none;
}

textarea.field:focus,
input.field:focus {
  border-color: var(--ink);
}

textarea.field.mono {
  font: 400 12px/1.7 var(--mono);
  min-height: 132px;
}

input.field {
  height: 40px;
  border: 1.5px solid var(--line-soft);
  border-radius: 12px;
  padding: 0 11px;
  font: 500 12.5px var(--body);
  background: #fdfbf6;
  color: var(--ink);
  outline: none;
}

.caption-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  gap: 8px;
  flex-wrap: wrap;
}

body.preview-mobile {
  display: grid;
  place-items: start center;
  padding: 18px;
}

body.preview-mobile .shell {
  width: min(414px, 100%);
  min-height: calc(100vh - 36px);
  height: calc(100vh - 36px);
  border: 2px solid var(--ink);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(36, 31, 26, 0.18);
}

body.preview-mobile .sidebar {
  display: none;
}

body.preview-mobile .screen-head {
  padding: 14px 14px 12px;
}

body.preview-mobile .screen-head h1 {
  font-size: 23px;
}

body.preview-mobile .scroll {
  padding: 12px 14px 92px;
}

body.preview-mobile .tabbar {
  display: flex !important;
  position: fixed;
  width: min(410px, calc(100% - 40px));
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  border-radius: 0 0 22px 22px;
}

body.preview-mobile .head-actions #previewDeviceBtn {
  display: inline-flex;
}

.caption-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 9px;
}

.caption-mark {
  color: var(--coral);
  margin-left: 4px;
}

.char-count {
  font: 400 10.5px var(--mono);
  color: var(--faint);
}

.when-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.when-row input[type="date"] {
  flex: 1 1 150px;
}

.when-row input[type="time"] {
  flex: 1 1 110px;
}

.bulk-card {
  background: var(--ink);
  border-radius: 18px;
  padding: 15px;
  color: #fffdf8;
}

.bulk-card .step-label {
  color: rgba(255, 253, 248, 0.6);
}

.bulk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 253, 248, 0.07);
  border-radius: 12px;
  padding: 8px 10px;
}

.bulk-row .thumb {
  width: 34px;
  height: 34px;
  flex: none;
}

.bulk-row strong {
  flex: 1;
  min-width: 0;
  font: 600 12px var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bulk-row small {
  font: 400 11px var(--mono);
  opacity: 0.7;
}

.submit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 6px;
}

.submit-row .schedule {
  flex: 1 1 200px;
  height: 48px;
  border-radius: 15px;
  border: 1.5px solid var(--ink);
  background: var(--lime);
  color: var(--ink);
  font: 800 15px var(--display);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--ink);
}

.submit-row .schedule:hover:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
}

.submit-row .schedule:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: 0 4px 0 var(--hard);
}

.submit-row .draft {
  height: 48px;
  padding: 0 18px;
  border-radius: 15px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  font: 700 13px var(--body);
  cursor: pointer;
}

/* ---------- preview ---------- */

.preview-col {
  flex: 0 1 330px;
  min-width: 270px;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  padding: 12px;
  box-shadow: 0 4px 0 var(--hard);
}

.preview-id {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.preview-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
  border: 1.5px solid var(--ink);
}

.preview-id strong {
  display: block;
  font: 700 12.5px var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-id small {
  font: 400 10px var(--mono);
  color: var(--faint);
}

.preview-media {
  aspect-ratio: 4 / 5;
  border: 1.5px solid var(--ink);
}

.preview-frame {
  position: absolute;
  inset: 7px;
  border-radius: 7px;
  border-style: solid;
  border-width: 4px;
}

.preview-bar {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  border-top: 1px solid var(--ink);
  color: var(--ink);
  font: 600 10px var(--mono);
  padding: 6px;
  text-align: center;
}

.preview-kind {
  position: absolute;
  top: 8px;
  left: 8px;
  font: 500 9px var(--mono);
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: 5px;
  padding: 1px 5px;
}

.preview-caption {
  font: 400 12.5px/1.5 var(--body);
  margin-top: 10px;
  white-space: pre-wrap;
}

.preset-card {
  background: var(--lilac);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 12px 13px;
}

.preset-card strong {
  display: block;
  font: 700 12.5px var(--body);
  margin-bottom: 4px;
}

.preset-card p {
  margin: 0;
  font: 400 11.5px/1.5 var(--body);
  color: #3b3229;
}

.route-card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 12px 13px;
}

.route-card .step-label {
  margin-bottom: 8px;
}

.route-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 11.5px var(--body);
  padding: 4px 0;
}

.route-line small {
  margin-left: auto;
  font: 400 10.5px var(--mono);
  color: var(--faint);
}

.route-blockers {
  margin: 8px 0 0;
  padding-left: 16px;
  font: 400 11px/1.55 var(--body);
  color: var(--coral);
}

/* ---------- library ---------- */

.dropzone {
  border: 2px dashed var(--ink);
  border-radius: 20px;
  background: #fdf6e3;
  padding: 26px;
  text-align: center;
  cursor: pointer;
  width: 100%;
  font: inherit;
}

.dropzone:hover {
  background: #ffefc9;
}

.dropzone strong {
  display: block;
  font: 800 19px var(--display);
  margin-bottom: 5px;
}

.dropzone span {
  font: 400 12px var(--body);
  color: var(--muted);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 10px;
}

.library-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.library-item .art {
  aspect-ratio: 1;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  width: 100%;
  padding: 0;
}

.library-item .use {
  position: absolute;
  right: 5px;
  top: 5px;
  font: 600 9.5px var(--body);
  background: var(--ink);
  color: #fffdf8;
  border-radius: 6px;
  padding: 3px 6px;
  opacity: 0;
}

.library-item .art:hover .use {
  opacity: 1;
}

.library-item .name {
  font: 600 11.5px var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-item .meta {
  font: 400 10px var(--mono);
  color: var(--faint);
}

/* ---------- import ---------- */

.two-col {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.two-col > * {
  flex: 1 1 320px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.note {
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 12px 13px;
  font: 400 11.5px/1.6 var(--body);
  background: var(--mint);
}

.note.warn {
  background: var(--peach);
}

.extract-row {
  display: flex;
  gap: 11px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 11px;
  box-shadow: 0 2px 0 var(--hard);
  animation: rise 0.3s ease both;
}

.extract-row .thumb {
  width: 76px;
  height: 96px;
  flex: none;
  border: 1.5px solid var(--ink);
}

.extract-row .body {
  flex: 1;
  min-width: 0;
}

.extract-row .src {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.extract-row .src small {
  font: 400 10px var(--mono);
  color: var(--faint);
}

.extract-row p {
  margin: 0;
  font: 400 12px/1.45 var(--body);
  color: #4b443b;
}

.extract-row .acts {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 7px;
  font: 500 11.5px var(--body);
  cursor: pointer;
}

.checkline input {
  width: 16px;
  height: 16px;
  accent-color: var(--coral);
}

/* ---------- approvals ---------- */

.approval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 11px;
}

.approval-card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  padding: 13px;
  box-shadow: 0 3px 0 var(--hard);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.approval-card .top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.approval-card .top strong {
  font: 600 12px var(--body);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.approval-card .top small {
  font: 400 10px var(--mono);
  color: var(--faint);
}

.approval-card .art {
  height: 118px;
  border: 1.5px solid var(--ink);
}

.approval-card p {
  margin: 0;
  font: 400 12px/1.5 var(--body);
  color: #4b443b;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.approval-card .acts {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.approval-card .acts button {
  flex: 1;
  height: 34px;
  border-radius: 11px;
  border: 1.5px solid var(--ink);
  font: 700 12px var(--body);
  cursor: pointer;
}

.approval-card .approve {
  background: var(--lime);
}

.approval-card .changes {
  background: var(--peach);
  font-weight: 600;
}

.inbox-zero {
  grid-column: 1 / -1;
  border: 1.5px dashed var(--stone);
  border-radius: 18px;
  padding: 44px;
  text-align: center;
}

.inbox-zero strong {
  display: block;
  font: 800 22px var(--display);
  margin-bottom: 5px;
}

.inbox-zero span {
  font: 400 12.5px var(--body);
  color: var(--muted);
}

/* ---------- insights ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 3px 0 var(--ink);
}

.stat .label {
  font: 500 10px var(--mono);
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.stat .value {
  font: 800 30px var(--display);
  letter-spacing: -0.02em;
  margin: 6px 0 2px;
}

.stat .delta {
  font: 600 11.5px var(--body);
}

.bar-card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 3px 0 var(--hard);
  margin-bottom: 14px;
}

.bar-card h3 {
  margin: 0 0 2px;
  font: 700 14px var(--body);
}

.bar-card > p {
  margin: 0 0 16px;
  font: 400 11.5px var(--body);
  color: var(--muted);
}

.bar {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 11px;
}

.bar .name {
  width: 130px;
  flex: none;
  font: 600 12px var(--body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar .track {
  flex: 1;
  height: 26px;
  background: var(--paper);
  border-radius: 8px;
  overflow: hidden;
}

.bar .fill {
  display: block;
  height: 100%;
  border-right: 1.5px solid var(--ink);
}

.bar .val {
  width: 52px;
  text-align: right;
  font: 500 11.5px var(--mono);
}

.dark-card {
  background: var(--ink);
  color: #fffdf8;
  border-radius: 18px;
  padding: 16px;
}

.dark-card .step-label {
  color: rgba(255, 253, 248, 0.6);
}

.slot {
  border: 1px solid rgba(255, 253, 248, 0.3);
  border-radius: 10px;
  padding: 7px 11px;
  font: 500 11.5px var(--mono);
}

.slot.best {
  background: var(--lime);
  color: var(--ink);
}

/* ---------- settings ---------- */

.brand-card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 3px 0 var(--hard);
  margin-bottom: 11px;
}

.brand-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.library-search {
  margin-left: auto;
  min-width: min(240px, 100%);
}

.library-search .field {
  width: 100%;
}

/* ---------- creative studio ---------- */

.creative-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 16px;
  align-items: start;
}

.creative-workflow,
.creative-preview-column {
  display: grid;
  gap: 12px;
}

.step-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.step-heading > div {
  display: grid;
  gap: 3px;
}

.step-heading strong {
  font: 750 15px var(--display);
}

.step-heading small {
  color: var(--muted);
  font: 400 11.5px/1.45 var(--body);
}

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--lilac);
  font: 700 10px var(--mono);
}

.field-label {
  display: grid;
  gap: 6px;
  margin-top: 11px;
  color: var(--faint);
  font: 600 10px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-label .hint {
  text-transform: none;
  letter-spacing: 0;
}

select.field {
  height: 40px;
  width: 100%;
  border: 1.5px solid var(--line-soft);
  border-radius: 12px;
  padding: 0 34px 0 11px;
  background: #fdfbf6;
  color: var(--ink);
  font: 500 12.5px var(--body);
}

.creative-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.creative-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  margin-top: 11px;
  padding: 10px;
  border: 1.5px dashed var(--line-soft);
  border-radius: 11px;
  background: #fdfbf6;
  cursor: pointer;
}

.creative-upload:hover {
  border-color: var(--ink);
  background: #fff;
}

.creative-upload input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.creative-upload-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  background: var(--amber);
  font: 700 20px var(--display);
}

.creative-upload > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.creative-upload strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.creative-upload small {
  color: var(--muted);
  font-size: 10px;
}

.extraction-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.extraction-copy {
  display: grid;
  gap: 5px;
}

.extraction-copy strong {
  font-size: 13px;
}

.extraction-copy p,
.extraction-copy small {
  margin: 0;
  color: var(--muted);
  font: 400 11px/1.5 var(--body);
}

.reference-strip,
.recent-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}

.reference-thumb {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  padding: 0;
  overflow: hidden;
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
}

.reference-thumb[aria-pressed="true"] {
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

.reference-thumb img,
.creative-canvas img,
.recent-strip img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.creative-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.brand-direction {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: start;
  margin-top: 11px;
  padding: 10px;
  border-left: 4px solid var(--brand-accent);
  background: #f8f4eb;
}

.brand-direction .swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--ink);
}

.brand-direction p {
  margin: 3px 0 0;
  color: var(--muted);
  font: 400 11px/1.45 var(--body);
}

.creative-generate-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  background: var(--ink);
  color: #fffdf8;
}

.creative-generate-card p {
  margin: 5px 0 0;
  color: rgba(255, 253, 248, 0.62);
  font-size: 10.5px;
}

.provider-state {
  font: 650 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.provider-state.ready { color: var(--lime); }
.provider-state.blocked { color: var(--peach); }

.generate-btn {
  min-width: 148px;
  height: 44px;
  border: 1.5px solid #fffdf8;
  border-radius: 10px;
  background: var(--lime);
  color: var(--ink);
  font: 750 13px var(--display);
  cursor: pointer;
}

.generate-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.creative-preview-column {
  position: sticky;
  top: 0;
}

.creative-preview-card {
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 3px 0 var(--hard);
}

.creative-preview-card .preview-head {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.format-badge {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 4px 7px;
  color: var(--faint);
  font: 600 9px var(--mono);
  text-transform: uppercase;
}

.creative-canvas {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #e5ded0;
}

.creative-canvas.portrait { aspect-ratio: 4 / 5; }
.creative-canvas.square { aspect-ratio: 1; }
.creative-canvas.story { aspect-ratio: 9 / 16; max-height: 620px; }

.creative-canvas .source-ghost {
  opacity: 0.32;
  filter: saturate(0.75);
}

.creative-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 28px;
  text-align: center;
}

.creative-empty span:last-child {
  max-width: 240px;
  color: var(--muted);
  font-size: 11px;
}

.creative-empty-mark {
  width: 48px;
  height: 8px;
  margin-bottom: 4px;
}

.creative-save-form {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.creative-save-form .field-label:first-child {
  margin-top: 0;
}

.recent-generations {
  min-width: 0;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.recent-strip button {
  width: 92px;
  flex: 0 0 92px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  text-align: left;
}

.recent-strip img {
  height: 92px;
}

.recent-strip span {
  display: block;
  padding: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 9px var(--body);
}

@media (max-width: 1050px) {
  .creative-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 35%);
  }
}

@media (max-width: 760px) {
  .creative-layout {
    grid-template-columns: 1fr;
  }

  .creative-preview-column {
    position: static;
    grid-row: 1;
  }

  .creative-canvas {
    max-height: 62vh;
  }

  .creative-url-row,
  .creative-options {
    grid-template-columns: 1fr;
  }

  .creative-generate-card {
    align-items: stretch;
    flex-direction: column;
  }

  .generate-btn {
    width: 100%;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-connect {
  position: relative;
}

.page-connect summary {
  display: grid;
  place-items: center;
  list-style: none;
  white-space: nowrap;
}

.page-connect summary::-webkit-details-marker {
  display: none;
}

.page-connect form {
  position: absolute;
  z-index: 10;
  top: 40px;
  right: 0;
  width: min(340px, calc(100vw - 48px));
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(36, 31, 26, 0.2);
}

.page-connect label {
  display: grid;
  gap: 4px;
  font: 600 11px var(--body);
}

.page-connect select.field {
  width: 100%;
}

.request-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.request-tag {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font: 500 10px var(--mono);
}

.swatch {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1.5px solid var(--ink);
}

.brand-card-head .titles {
  flex: 1;
  min-width: 150px;
}

.brand-card-head strong {
  display: block;
  font: 700 14.5px var(--body);
}

.brand-card-head small {
  font: 400 10.5px var(--mono);
  color: var(--faint);
}

.brand-body {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  align-items: stretch;
}

.brand-preview {
  width: 104px;
  height: 104px;
  flex: none;
  border: 1.5px solid var(--ink);
}

.brand-preview .frame {
  position: absolute;
  inset: 5px;
  border-radius: 6px;
  border-style: solid;
  border-width: 3px;
  box-shadow: 0 0 0 1px rgba(36, 31, 26, 0.35);
}

.brand-preview .bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  background: rgba(36, 31, 26, 0.85);
  color: #fffdf8;
  font: 600 8px var(--mono);
  padding: 4px;
  text-align: center;
}

.brand-detail {
  flex: 1;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.account-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 11.5px var(--body);
  background: var(--surface);
  border-radius: 9px;
  padding: 4px 9px;
}

.account-tag small {
  font: 400 10px var(--mono);
  color: var(--faint);
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #fffdf8;
  border-radius: 15px;
  padding: 12px 17px;
  box-shadow: 0 8px 24px rgba(36, 31, 26, 0.28);
  animation: pop 0.28s ease both;
  font: 600 13px var(--body);
  max-width: min(560px, calc(100vw - 40px));
}

.toast[hidden] {
  display: none;
}

.toast .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  flex: none;
}

.toast.error .dot {
  background: var(--peach);
}

/* ---------- mobile ---------- */

.tabbar {
  display: none;
}

.mobile-more-menu {
  display: none;
}

@media (max-width: 880px) {
  .shell {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    width: 100%;
    padding: 12px 14px;
    gap: 12px;
  }

  .sidebar nav,
  .sidebar-user {
    display: none;
  }

  .sidebar-foot {
    margin-top: 0;
    margin-left: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .new-post {
    width: auto;
    padding: 10px 14px;
    white-space: nowrap;
  }

  .workspace-switch small {
    display: none;
  }

  .workspace-switch {
    padding: 10px 12px;
    white-space: nowrap;
  }

  .screen-head,
  .scroll {
    padding: 14px;
  }

  .screen-head h1 {
    font-size: 23px;
  }

  .main {
    padding-bottom: 68px;
  }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    gap: 2px;
    background: var(--ink);
    padding: 7px 6px 10px;
    justify-content: space-between;
  }

  .tabbar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 7px 2px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: transparent;
    color: rgba(255, 253, 248, 0.55);
    font: 600 9.5px var(--body);
  }

  .tabbar button[aria-current="true"] {
    background: rgba(255, 253, 248, 0.13);
    color: #fffdf8;
  }

  .tabbar .tab-dot {
    width: 16px;
    height: 16px;
    border-radius: 6px;
    opacity: 0.4;
  }

  .tabbar .mobile-more-dot {
    background: linear-gradient(90deg, var(--amber) 0 33%, var(--mint) 33% 66%, var(--lilac) 66%);
  }

  .tabbar button[aria-current="true"] .tab-dot {
    opacity: 1;
  }

  .mobile-more-menu {
    position: fixed;
    right: 8px;
    bottom: 70px;
    left: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    max-height: min(360px, calc(100vh - 100px));
    padding: 8px;
    overflow-y: auto;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 12px 36px rgba(36, 31, 26, 0.28);
  }

  .mobile-more-menu[hidden] {
    display: none !important;
  }

  .tabbar .mobile-more-item {
    min-height: 46px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    color: var(--ink);
    font-size: 11px;
    text-align: left;
  }

  .tabbar .mobile-more-item[aria-current="true"] {
    border-color: var(--ink);
    background: var(--lime);
    color: var(--ink);
  }

  .mobile-more-item .nav-dot {
    width: 10px;
    height: 10px;
    flex: none;
  }

  .brand-card-head .page-connect {
    width: 100%;
    flex-basis: 100%;
  }

  .page-connect summary {
    width: max-content;
  }

  .page-connect form {
    right: auto;
    left: 0;
    width: 100%;
  }

  .preview-col {
    position: static;
  }
}
