[hidden] {
  display: none !important;
}
:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  display: flex;
}
aside {
  width: 240px;
  background: #12382f;
  color: #dae9e3;
  padding: 36px 24px;
  min-height: 100vh;
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.brand {
  font-size: 28px;
  font-weight: 750;
  color: #fff;
  letter-spacing: -1px;
}
.brand span {
  display: block;
  font-size: 9px;
  letter-spacing: 3px;
  color: #91bca8;
  margin: 12px 0 0 4px;
}
nav {
  display: grid;
  gap: 8px;
}
button {
  font: inherit;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
button:hover {
  filter: brightness(0.96);
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
nav button {
  border: 0;
  text-align: left;
  background: transparent;
  color: #afc8ba;
  padding: 15px;
}
nav button.active {
  background: #2a5547;
  color: #fff;
}
.aside-note {
  margin-top: auto;
  color: #8cb09d;
  line-height: 1.8;
  font-size: 12px;
}
main {
  margin-left: 240px;
  padding: 48px 48px 80px;
  width: calc(100% - 240px);
  max-width: 1700px;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 32px;
}
h1 {
  font-size: 38px;
  letter-spacing: -1.6px;
  margin: 12px 0;
}
h2 {
  letter-spacing: -0.6px;
}
p {
  color: var(--muted);
  line-height: 1.6;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 700;
}
.badge,
.pill {
  font-size: 11px;
  padding: 7px 11px;
  border-radius: 30px;
  background: #e8f2eb;
  color: #397452;
  display: inline-block;
}
.pill.draft {
  background: #f4eee2;
  color: #a08043;
}
.panel,
.card,
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.narrow {
  max-width: 420px;
  margin: 60px auto;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat small {
  color: var(--muted);
}
.stat strong {
  display: block;
  font-size: 30px;
  margin-top: 12px;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin: 24px 0;
}
.toolbar input {
  margin-right: auto;
  max-width: 360px;
}
.primary {
  background: #1c7252;
  color: white;
  border-color: #1c7252;
}
.danger {
  color: #a73737;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}
.card h3 {
  margin: 16px 0 5px;
  letter-spacing: -0.4px;
}
.card p {
  font-size: 12px;
  margin: 5px 0 16px;
}
.previews {
  height: 116px;
  background: var(--preview);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.previews img {
  width: 30%;
  height: 85px;
  object-fit: contain;
}
.card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card .meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.empty {
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed #cbd9d0;
  border-radius: 16px;
  color: #748b7c;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 16px 0;
  color: var(--text);
}
input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
input[type="checkbox"] {
  width: auto;
  display: inline-block;
  margin-right: 8px;
}
input[type="file"] {
  font-size: 12px;
}
textarea {
  min-height: 70px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.checks {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.checks label {
  display: flex;
  align-items: center;
}
.help {
  font-size: 12px;
  color: var(--muted);
}
dialog {
  width: min(860px, 94vw);
  max-height: 90vh;
  border: 0;
  border-radius: 20px;
  padding: 28px;
  color: var(--text);
  box-shadow: 0 30px 100px #102e3340;
}
dialog::backdrop {
  background: #102b2660;
  backdrop-filter: blur(4px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.stickers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.sticker {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.sticker img {
  width: 100%;
  height: 100px;
  object-fit: contain;
}
.sticker label {
  margin: 9px 0;
}
.sticker input {
  padding: 7px;
}
.sticker button {
  font-size: 11px;
  padding: 7px;
  margin-top: 7px;
}
#message,
#editor-message {
  padding: 13px 18px;
  background: #fff4dd;
  border: 1px solid #e8d6a3;
  border-radius: 10px;
  margin-bottom: 20px;
  color: #7f5723;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 12px;
}
td,
th {
  text-align: left;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
th {
  color: var(--muted);
  font-size: 11px;
}
td img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}
.actions {
  display: flex;
  gap: 8px;
}
.tray {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
@media (max-width: 900px) {
  aside {
    width: 185px;
    padding: 28px 15px;
  }
  main {
    margin-left: 185px;
    width: calc(100% - 185px);
    padding: 28px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .badge {
    display: none;
  }
}
@media (max-width: 600px) {
  body {
    display: block;
  }
  aside {
    position: static;
    min-height: 0;
    width: 100%;
    padding: 18px;
    gap: 16px;
  }
  nav {
    display: flex;
    gap: 3px;
  }
  .aside-note {
    display: none;
  }
  .brand span {
    display: none;
  }
  main {
    margin: 0;
    width: 100%;
    padding: 24px 16px;
  }
  h1 {
    font-size: 30px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .row {
    grid-template-columns: 1fr;
  }
  td,
  th {
    padding: 10px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
}

/* Login is independent of the authenticated workspace at every screen size. */
body.signed-out main {
  margin-left: 0;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
body.signed-out #login {
  margin: 0;
  width: 100%;
  max-width: 420px;
}
body.signed-out #message {
  width: 100%;
  max-width: 420px;
}
.login-brand {
  color: #12382f;
  margin-bottom: 28px;
}
.login-brand span {
  color: var(--muted);
  display: block;
}

.selected-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

/* Forest studio theme: shared tokens keep every workspace surface in sync. */
:root {
  color-scheme: light;
  --bg: #f3f6f3;
  --surface: #ffffff;
  --text: #18332e;
  --muted: #667d72;
  --border: #dce5df;
  --preview: #f0f5ef;
  --accent: #1c7252;
  --shadow: 0 8px 28px #143c2b08;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101e19;
  --surface: #192b23;
  --text: #e0eee6;
  --muted: #a0b8ab;
  --border: #32483c;
  --preview: #21382c;
  --accent: #8dd2aa;
  --shadow: 0 8px 28px #0002;
}
body { background: var(--bg); }
button, input, select, textarea { transition: border-color .18s, background .18s, box-shadow .18s; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 3px;
}
button:hover { filter: none; border-color: var(--accent); }
button.primary:hover { background: #245f49; }
aside { width: 248px; padding: 38px 22px; background: linear-gradient(165deg, #163e32, #102b25); border-right: 1px solid #ffffff10; }
nav button { display: flex; align-items: center; min-height: 50px; border-radius: 12px; }
nav button:hover { background: #ffffff0c; }
nav button.active { background: #3b73534d; box-shadow: inset 3px 0 #b8e5b0; }
#logout { background: #ffffff0c; color: #dcebe2; border-color: #ffffff20; }
main { margin-left: 248px; width: calc(100% - 248px); padding: 40px 44px 80px; }
header { margin-bottom: 30px; }
h1 { font-size: clamp(30px, 3vw, 42px); letter-spacing: -1.6px; }
header p { margin-bottom: 0; font-size: 14px; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.stats { gap: 16px; }
.stat { text-align: left; position: relative; overflow: hidden; box-shadow: var(--shadow); padding: 22px; }
.stat:hover { transform: translateY(-2px); }
.stat small { display: flex; justify-content: space-between; font-size: 12px; }
.stat small span { color: var(--accent); }
.stat strong { font-size: 34px; letter-spacing: -1px; margin: 12px 0 8px; color: var(--text); }
.stat-caption { font-size: 10px; color: var(--muted); font-weight: 400; }
.toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; margin-bottom: 14px; box-shadow: var(--shadow); }
.toolbar input { margin-top: 0; max-width: none; border-color: transparent; background: transparent; }
.toolbar .primary { flex-shrink: 0; }
.filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.segmented { display: flex; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 11px; gap: 3px; }
.segmented button { background: transparent; border: 0; padding: 9px 12px; color: var(--muted); font-size: 12px; }
.segmented button.active, .segmented button[aria-pressed="true"] { background: var(--preview); color: var(--accent); }
.filter-bar select { width: auto; margin: 0; padding: 11px 30px 11px 12px; font-size: 12px; }
.filter-bar .segmented:last-child { margin-left: auto; }
.results-heading { display: flex; justify-content: space-between; gap: 14px; margin: 24px 0 14px; font-size: 11px; color: var(--muted); }
#result-count { font-weight: 650; color: var(--text); }
.card { padding: 16px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px #12382f12; border-color: var(--accent); }
.previews { height: 152px; background-color: var(--preview); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 14px 14px; gap: 0; }
.previews img { height: 108px; transition: transform .2s; }
.card:hover .previews img:nth-child(2) { transform: translateY(-6px) rotate(-5deg); }
.card h3 { font-size: 17px; padding: 0 4px; }
.card p, .card .meta { padding: 0 4px; }
.card footer { padding: 14px 4px 0; border-top: 1px solid var(--border); }
.card footer small { color: var(--muted); font-size: 11px; }
.card footer button { background: var(--preview); border: 0; color: var(--accent); }
.list-layout { grid-template-columns: 1fr; }
.list-layout .card { display: grid; grid-template-columns: 150px 1fr auto; column-gap: 20px; align-items: center; }
.list-layout .previews { grid-row: 1 / 4; height: 110px; }
.list-layout .previews img { height: 65px; }
.list-layout h3 { margin: 0; }
.list-layout p { margin: 5px 0; }
.list-layout .meta { margin: 5px 0; }
.list-layout footer { grid-column: 3; grid-row: 1 / 4; border: 0; gap: 20px; flex-direction: column; padding: 0; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
table { min-width: 500px; }
th { background: var(--preview); text-transform: uppercase; letter-spacing: 1px; }
tbody tr:hover { background: var(--preview); }
tbody tr:last-child td { border-bottom: 0; }
.empty { background: var(--surface); padding: 55px 20px; }
.empty-icon { font-size: 44px; color: var(--accent); }
.empty h3 { color: var(--text); margin-bottom: 8px; }
.empty p { font-size: 13px; }
dialog { background: var(--surface); padding: 0 28px 28px; }
.dialog-heading { position: sticky; top: 0; background: var(--surface); z-index: 2; padding: 12px 0; margin-bottom: 20px; }
.dialog-heading h2 { font-size: 21px; }
.sticker { background: var(--preview); }
.sticker img { margin-bottom: 10px; }
summary { cursor: pointer; padding: 14px; border-radius: 10px; background: var(--preview); font-size: 13px; }
input[type="checkbox"] { accent-color: #1c7252; width: 16px; height: 16px; cursor: pointer; }
input[type="file"] { border: 1px dashed var(--accent); padding: 18px; background: var(--preview); }
.file-preview { width: 88px; background: var(--preview); border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.file-preview img { width: 70px; height: 70px; object-fit: contain; }
.file-preview small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 10; padding: 14px 24px; border-radius: 12px; background: #12382f; border: 1px solid #80b89b; color: #fff; box-shadow: 0 12px 35px #0003; font-size: 13px; }
body.signed-out { background: radial-gradient(ellipse at 20% 30%, #1c725218, transparent 60%), var(--bg); }
#login { padding: 36px; box-shadow: 0 24px 90px #12382f12; }
#login .primary { width: 100%; margin-top: 10px; padding: 14px; }
.login-brand { color: var(--accent); }
[data-theme="dark"] .pill, [data-theme="dark"] .badge { background: #2b4835; color: #b9e8c3; }
[data-theme="dark"] .pill.draft { background: #463c29; color: #e3cb97; }
@media (max-width: 1100px) {
  main { padding: 28px; }
  .header-actions { flex-direction: column; align-items: flex-end; }
  .filter-bar .segmented:last-child { margin-left: 0; }
}
@media (max-width: 900px) {
  aside { width: 190px; padding: 28px 14px; }
  main { margin-left: 190px; width: calc(100% - 190px); }
  .results-heading span:last-child { display: none; }
}
@media (max-width: 600px) {
  aside { width: 100%; padding: 18px; }
  nav { display: grid; grid-template-columns: repeat(3, 1fr); }
  nav button { font-size: 11px; padding: 10px; justify-content: center; }
  #logout { position: absolute; right: 18px; top: 15px; padding: 8px; }
  main { width: 100%; margin: 0; padding: 24px 16px; }
  header { align-items: flex-start; gap: 8px; }
  .header-actions button { padding: 8px; font-size: 11px; white-space: nowrap; }
  .toolbar input { width: 100%; flex-basis: 100%; }
  .filter-bar { gap: 8px; }
  .filter-bar .segmented:first-child { width: 100%; justify-content: space-between; }
  .segmented button { padding: 9px; }
  .filter-bar select { max-width: 160px; }
  .stat { padding: 16px; }
  .list-layout .card { grid-template-columns: 84px 1fr; column-gap: 12px; }
  .list-layout .previews { height: 95px; }
  .list-layout .previews img { width: 90%; }
  .list-layout .previews img:not(:first-child) { display: none; }
  .list-layout footer { grid-column: 1 / -1; grid-row: auto; flex-direction: row; padding-top: 12px; }
  dialog { padding: 0 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .card:hover, .stat:hover, .card:hover .previews img:nth-child(2) { transform: none; }
}

/* Compact catalogue rows and consistent rectangular action controls. */
.table-scroll th { padding: 12px 18px; }
.table-scroll td { padding: 8px 18px; vertical-align: middle; }
.table-scroll td img { display: block; width: 44px; height: 44px; object-fit: contain; }
.table-scroll .pill { padding: 5px 10px; }
.table-scroll .action-column { width: 108px; white-space: nowrap; text-align: right; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
button.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 32px; flex-shrink: 0; padding: 0;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--accent); vertical-align: middle;
}
button.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
button.icon-button:hover { border-color: var(--accent); background: var(--preview); }
button.icon-button.danger { color: #b74343; }
button.icon-button.danger:hover { border-color: #b74343; background: #b7434310; }
[data-theme="dark"] button.icon-button.danger { color: #f19898; }
.actions { align-items: center; }
.card footer button.icon-button { padding: 0; border: 1px solid var(--border); border-radius: 6px; }
.sticker button.icon-button { padding: 0; }
@media (max-width: 600px) {
  .table-scroll th { padding: 10px; }
  .table-scroll td { padding: 7px 10px; }
  button.icon-button { width: 36px; height: 36px; }
}

/* Sticker settings are edited in compact list rows. */
.stickers { display: flex; flex-direction: column; gap: 8px; }
.sticker {
  display: grid; grid-template-columns: 64px minmax(100px, 1fr) 100px minmax(110px, 1fr) auto;
  gap: 16px; align-items: center; padding: 12px 16px;
}
.sticker img { width: 56px; height: 56px; margin: 0; }
.sticker label { margin: 0; font-size: 11px; }
.sticker input { margin-top: 6px; padding: 8px 10px; }
.sticker .trending-toggle { display: flex; align-items: center; gap: 6px; }
.sticker .trending-toggle input { margin: 0; }
.sticker-actions { display: flex; align-items: center; gap: 6px; }
.sticker .sticker-actions button {
  height: 36px; min-height: 36px; margin: 0; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; border-radius: 6px; line-height: 1;
}
.sticker .sticker-actions button.icon-button { width: 36px; padding: 0; }
@media (max-width: 650px) {
  .sticker { grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 12px; }
  .sticker img { width: 44px; height: 44px; grid-row: 1 / 3; }
  .sticker label:has([name="sort_order"]) { grid-column: 2; grid-row: 1; }
  .sticker label:has([name="trending_order"]) { grid-column: 3; grid-row: 1; }
  .sticker .trending-toggle { grid-column: 2; grid-row: 2; }
  .sticker-actions { grid-column: 3; grid-row: 2; justify-content: flex-end; }
}

.sticker { grid-template-columns: 64px minmax(100px, 1fr) auto; }
.trending-edit-preview { display: block; width: 140px; height: 140px; object-fit: contain; margin: 16px auto; }
@media (max-width: 650px) {
  .sticker { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; }
  .sticker img { grid-row: auto; }
  .sticker label:has([name="sort_order"]) { grid-column: 2; grid-row: auto; }
  .sticker-actions { grid-column: 3; grid-row: auto; }
}

.premium-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.premium-toggle input { margin: 0; }
