/* PinPanel — Pinterest-like red / neutral theme. Mobile-first, one shared stylesheet. */
:root {
  --ink: #111111;
  --ink-2: #333333;
  --primary: #E60023;
  --primary-dark: #AD081B;
  --primary-soft: #FCE8EC;
  --accent-deep: #AD081B;
  --accent-bright: #AD081B;
  --amber: #d97706;
  --amber-soft: #fff7e0;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #efefed;
  --text: #111111;
  --muted: #767676;
  --border: #e3e3e0;
  --dark: #111111;
  --danger: #d64545;
  --danger-soft: #fef2f2;
  --success: #1f9d63;
  --success-soft: #f0fdf4;
  --info-soft: #f6f6f4;
  --info-text: #333333;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .05), 0 8px 24px rgba(17, 17, 17, .06);
  --shadow-lg: 0 2px 4px rgba(17, 17, 17, .06), 0 18px 44px rgba(17, 17, 17, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video, iframe { max-width: 100%; height: auto; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: .1em 0 .4em; letter-spacing: -.02em; color: var(--ink); overflow-wrap: break-word; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 1.5em 0 .45em; letter-spacing: -.01em; color: var(--ink); overflow-wrap: break-word; }
h3 { font-size: 1.08rem; margin: 1em 0 .3em; color: var(--ink); overflow-wrap: break-word; }
.lead { font-size: 1.08rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.nowrap { white-space: nowrap; }
.icon { flex: 0 0 auto; vertical-align: middle; }

/* Flex/grid children must be allowed to shrink, or long content forces overflow. */
.shell > *, .main, .main-inner, .grid > *, .stat-grid > *, .account-grid > *,
.pin-grid > *, .hero > *, .form-grid > *, .page-head > *, .topbar-inner > *,
.dash-topbar > *, .step > div, .acct-top h3, .activity-list span, .preview-row > *,
.usage-top > *, .kv dd, .card, .table-wrap, .filters > div, .tool-card,
.nav-item span, .activity-list li { min-width: 0; }

/* ---------- Public top navigation ---------- */
.topbar {
  background: rgba(246, 246, 244, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--primary), var(--accent-bright));
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(230, 0, 35, .35);
}
.nav-links { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--ink-2); padding: 8px 13px; border-radius: 8px; font-size: .95rem; font-weight: 500; }
.nav-links a:hover { background: var(--surface-2); text-decoration: none; }
.nav-links a.active { background: var(--primary-soft); color: var(--accent-deep); }
.nav-links a.nav-cta { background: var(--primary); color: #fff; font-weight: 700; margin-left: 6px; }
.nav-links a.nav-cta:hover { background: var(--primary-dark); }
.menu-btn { display: none; background: var(--surface); border: 1px solid var(--border); color: var(--ink); border-radius: 8px; padding: 8px 12px; font-size: 1rem; cursor: pointer; }

/* ---------- Layout ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 56px; }
.wrap-narrow { max-width: 720px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 16px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin-bottom: 2px; }
.page-head p { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

/* ---------- Hero / homepage ---------- */
.hero {
  display: grid; gap: 28px; align-items: center;
  background: linear-gradient(140deg, #111111 0%, #1c1c1c 55%, #2b2b2b 100%);
  color: #ffffff; border-radius: 20px; padding: 36px 26px;
  box-shadow: var(--shadow-lg); overflow: hidden; position: relative;
}
.hero::after {
  content: ""; position: absolute; right: -90px; top: -90px; width: 300px; height: 300px;
  border-radius: 50%; background: rgba(230, 0, 35, .12); pointer-events: none;
}
.hero h1 { color: #ffffff; font-size: 2.1rem; font-family: "Playfair Display", Georgia, "Times New Roman", serif; font-weight: 800; letter-spacing: 0; }
.hero .lead { color: #d9d9d9; }
.hero-eyebrow {
  display: inline-block; background: rgba(230, 0, 35, .15);
  border: 1px solid rgba(255, 77, 106, .45); color: #ff8fa3;
  padding: 5px 13px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  margin-bottom: 14px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.hero-note { color: #b5b5b5; font-size: .9rem; margin-top: 14px; }
.hero-preview {
  background: var(--surface); color: var(--text); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35); padding: 18px; position: relative; z-index: 1;
}
.hero-preview h3 { margin-top: 0; font-size: 1rem; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hero-preview h3 span { font-size: .78rem; font-weight: 600; color: var(--success); background: var(--success-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.preview-bar { height: 10px; border-radius: 999px; background: #efefed; margin: 9px 0; overflow: hidden; }
.preview-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent-bright)); }
.preview-row { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; color: var(--muted); padding: 7px 0; border-bottom: 1px solid var(--border); overflow-wrap: break-word; }
.preview-row:last-child { border-bottom: none; }
.preview-row b { color: var(--text); font-weight: 600; }

.feature-card h3 { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.feature-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
  background: var(--primary-soft); color: var(--accent-deep);
  display: grid; place-items: center;
}
.feature-card p { color: var(--muted); margin-bottom: 0; }
.steps { display: grid; gap: 0; }
.step { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--border); }
.step:last-child { border-bottom: none; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  background: var(--ink); color: #ffffff; display: grid; place-items: center; font-weight: 800;
}
.step p { margin: 2px 0 0; color: var(--muted); }
.cta-band {
  background: var(--ink); color: #ffffff; border-radius: 20px; padding: 32px 26px;
  text-align: center; box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #ffffff; margin-top: 0; }
.cta-band p { color: #b5b5b5; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; color: var(--ink); overflow-wrap: break-word; }
.faq p { color: var(--muted); margin-bottom: 0; }

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-block; background: var(--primary); color: #fff !important;
  text-decoration: none; border: none; padding: 11px 22px; border-radius: 10px;
  font-size: 1rem; font-weight: 700; cursor: pointer; line-height: 1.4;
  box-shadow: 0 4px 14px rgba(230, 0, 35, .30); transition: background .15s ease, transform .1s ease;
  max-width: 100%; white-space: normal; overflow-wrap: break-word;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; }
.btn-secondary { background: var(--ink); color: #ffffff !important; box-shadow: 0 4px 14px rgba(17, 17, 17, .25); }
.btn-secondary:hover { background: var(--ink-2); }
.btn-ghost { background: var(--surface); color: var(--ink) !important; border: 1px solid var(--border); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff !important; box-shadow: 0 4px 14px rgba(185, 28, 28, .25); }
.btn-danger:hover { background: #991b1b; }
.btn-white { background: #fff; color: var(--ink) !important; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.btn-white:hover { background: #f6f6f4; }
.btn-sm { padding: 7px 14px; font-size: .9rem; border-radius: 8px; box-shadow: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
label { display: block; font-weight: 600; margin: 14px 0 5px; font-size: .95rem; }
label.check-row { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; line-height: 1.45; }
label.check-row input[type="checkbox"] { width: auto; margin-top: 3px; flex: none; }
label .hint { font-weight: 400; color: var(--muted); font-size: .88rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], input[type="datetime-local"], input[type="file"], select, textarea {
  width: 100%; max-width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 1rem; background: #fff; color: var(--text); font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-deep); outline-offset: 1px; border-color: var(--accent-deep); }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent-deep); vertical-align: middle; }
textarea { min-height: 110px; resize: vertical; }
.form-narrow { max-width: 460px; margin: 0 auto; }
.form-grid { display: grid; gap: 0 16px; }
.inline-form { display: inline; }
.inline-form select { width: auto; max-width: 100%; display: inline-block; padding: 8px 10px; font-size: .92rem; }
.field-note { color: var(--muted); font-size: .88rem; margin-top: 5px; }
.alert { padding: 13px 17px; border-radius: 10px; margin: 14px 0; border: 1px solid; font-size: .96rem; overflow-wrap: break-word; }
.alert .icon { margin-right: 2px; vertical-align: -3px; }
.alert-info { background: var(--info-soft); border-color: var(--border); color: var(--info-text); }
.alert-warning { background: var(--amber-soft); border-color: #f5d67a; color: #92400e; }
.alert-error { background: var(--danger-soft); border-color: #fecaca; color: #7f1d1d; }
.alert-success { background: var(--success-soft); border-color: #bbf7d0; color: #14532d; }
.alert ul { margin: 0; padding-left: 20px; }
code { background: var(--primary-soft); color: var(--accent-deep); padding: 2px 7px; border-radius: 6px; font-size: .9em; overflow-wrap: anywhere; }
pre { background: var(--ink); color: #e5e5e5; padding: 15px; border-radius: 10px; overflow-x: auto; font-size: .85rem; }

/* ---------- Plans ---------- */
.plan-card { display: flex; flex-direction: column; }
.plan-card h2 { margin-top: 0; }
.plan-price { font-size: 1.65rem; font-weight: 800; color: var(--ink); margin: 2px 0 8px; letter-spacing: -.02em; }
.plan-period { font-size: .9rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan-limits { list-style: none; padding: 0; margin: 10px 0; }
.plan-limits li { padding: 7px 0 7px 28px; position: relative; border-bottom: 1px solid var(--surface-2); overflow-wrap: break-word; }
.plan-limits li:last-child { border-bottom: none; }
.plan-limits li::before {
  content: ""; position: absolute; left: 2px; top: 9px; width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E60023' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") no-repeat center / contain;
}
.plan-card .btn-row { margin-top: auto; padding-top: 14px; }
.plan-tag { display: inline-block; background: var(--amber-soft); color: var(--amber); border: 1px solid #f5d67a; font-size: .8rem; font-weight: 700; padding: 3px 11px; border-radius: 999px; }

/* ---------- Dashboard shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; max-width: 85vw; flex: 0 0 auto; background: var(--ink); color: #ffffff; padding: 20px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #555555 transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #555555; border-radius: 3px; }
.sidebar .brand { color: #ffffff; padding: 2px 10px 14px; }
.sidebar a.nav-item { display: flex; align-items: center; gap: 10px; color: #d9d9d9; text-decoration: none; padding: 10px 12px; border-radius: 9px; margin-bottom: 3px; font-size: .96rem; font-weight: 500; border-left: 3px solid transparent; }
.sidebar a.nav-item:hover { background: #262626; color: #ffffff; text-decoration: none; }
.sidebar a.nav-item.active { background: #262626; color: #ffffff; border-left-color: var(--primary); }
.sidebar a.nav-item .icon { opacity: .9; }
.sidebar .side-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: #9e9e9e; margin: 20px 12px 7px; font-weight: 700; }
.sidebar .side-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid #333333; font-size: .85rem; color: #9e9e9e; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-inner { width: 100%; max-width: 1060px; margin: 0 auto; padding: 22px 20px 48px; flex: 1; }
.dash-topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 40;
}
.dash-topbar .crumb { font-weight: 700; color: var(--ink); font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-user { display: flex; align-items: center; gap: 10px; font-size: .92rem; flex-shrink: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--primary), var(--accent-bright)); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .95rem;
}
.sidebar-toggle { display: none; }
.impersonate-banner {
  background: #111111; color: #ffffff; padding: 10px 20px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  font-size: .92rem;
}
.impersonate-banner .btn { background: var(--primary); color: #fff !important; box-shadow: none; }
.impersonate-banner .btn:hover { background: var(--primary-dark); }
.dash-foot { border-top: 1px solid var(--border); padding: 16px 20px; color: var(--muted); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; }

/* ---------- Stat cards / account cards / tool cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.15; overflow-wrap: break-word; }
.stat-card .label { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.stat-card .sub { font-size: .83rem; color: var(--muted); }
.tool-grid { margin-bottom: 20px; }
.tool-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; color: var(--text); box-shadow: var(--shadow);
}
.tool-card:hover { text-decoration: none; border-color: var(--primary); }
.tool-card .icon { color: var(--accent-deep); }
.tool-title { font-weight: 800; color: var(--ink); }
.tool-desc { font-size: .88rem; color: var(--muted); }
.plan-strip { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.plan-strip h2 { margin: 0 0 2px; }
.plan-strip p { margin: 0; }
.account-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.account-card { display: flex; flex-direction: column; gap: 8px; }
.account-card .acct-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.account-card h3 { margin: 0; }
.account-card .meta { color: var(--muted); font-size: .9rem; overflow-wrap: break-word; }
.account-card .numbers { display: flex; gap: 18px; margin: 6px 0; }
.account-card .numbers b { display: block; font-size: 1.25rem; color: var(--ink); }
.account-card .numbers span { font-size: .83rem; color: var(--muted); }
.account-card .btn-row { margin-top: auto; padding-top: 8px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; max-width: 100%; margin: 0 -6px; padding: 0 6px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: var(--surface-2); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; white-space: nowrap; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
.cell-main { font-weight: 600; color: var(--ink); overflow-wrap: break-word; }
.cell-sub { color: var(--muted); font-size: .87rem; overflow-wrap: anywhere; }
.badge-status { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.st-queued, .st-unknown, .st-inactive, .st-draft { background: #efefed; color: #333333; }
.st-posting, .st-pending { background: var(--amber-soft); color: #92400e; }
.st-posted, .st-connected, .st-active, .st-working { background: var(--success-soft); color: var(--success); }
.st-failed, .st-disconnected, .st-error, .st-blocked, .st-dead { background: var(--danger-soft); color: var(--danger); }
.st-archived { background: #efefed; color: #767676; }

/* ---------- Trending pins ---------- */
.pin-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.pin-card { overflow: hidden; padding: 0; }
.pin-thumb { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: .9rem; overflow: hidden; }
.pin-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin-body { padding: 16px; }
.pin-body h3 { margin: 0 0 6px; font-size: 1rem; }
.pin-stats { display: flex; gap: 16px; color: var(--muted); font-size: .88rem; margin: 8px 0; flex-wrap: wrap; }
.pin-stats b { color: var(--ink); }
.pin-link { word-break: break-all; font-size: .88rem; }

/* ---------- Filters / tabs / pagination / empty states ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters label { margin: 0 0 4px; }
.filters select, .filters input { width: auto; min-width: 170px; max-width: 100%; }
.filters .btn { margin-bottom: 1px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a {
  padding: 8px 16px; border-radius: 999px; font-size: .92rem; font-weight: 600;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--border);
}
.tabs a:hover { text-decoration: none; border-color: var(--accent-deep); color: var(--accent-deep); }
.tabs a.active { background: var(--ink); border-color: var(--ink); color: #ffffff; }
.pagination { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pagination .page-info { color: var(--muted); font-size: .9rem; margin-right: 6px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { margin: 0 0 16px; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.activity-list li:last-child { border-bottom: none; }
.activity-list time { color: var(--muted); font-size: .86rem; white-space: nowrap; flex-shrink: 0; }
.activity-list span { overflow-wrap: break-word; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: .96rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: break-word; }
.meter { height: 9px; border-radius: 999px; background: #e3e3e0; overflow: hidden; margin: 6px 0 4px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent-bright)); border-radius: 999px; }
.usage-row { margin-bottom: 18px; }
.usage-row:last-child { margin-bottom: 0; }
.usage-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-weight: 600; color: var(--ink); }
.totals-row td { font-weight: 700; background: var(--surface-2); color: var(--ink); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 26px 20px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.footer a { color: var(--muted); }

/* ---------- Larger screens ---------- */
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .account-grid { grid-template-columns: repeat(2, 1fr); }
  .pin-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .hero { grid-template-columns: 1.05fr .95fr; padding: 48px 40px; }
  .hero h1 { font-size: 2.5rem; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 2.1rem; }
}
@media (min-width: 1020px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .account-grid { grid-template-columns: repeat(3, 1fr); }
  .pin-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Narrow phones ---------- */
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; }
  .main-inner { padding: 18px 14px 40px; }
  .wrap { padding: 22px 14px 48px; }
  .dash-topbar { padding: 10px 14px; }
  .topbar-inner { padding: 10px 14px; }
  h1 { font-size: 1.7rem; }
  .hero { padding: 28px 18px; }
  .filters select, .filters input { width: 100%; min-width: 0; }
  .filters > div { flex: 1 1 100%; }
  .filters .btn { width: 100%; }
}

@media (max-width: 760px) {
  .menu-btn { display: inline-block; }
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-top: 8px; }
  .nav-links.open { display: flex; }
  .nav-links a.nav-cta { margin-left: 0; text-align: center; }
  .topbar-inner { flex-wrap: wrap; }
  .sidebar { position: fixed; left: -260px; top: 0; bottom: 0; z-index: 60; transition: left .2s ease; width: 248px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .sidebar-toggle { display: inline-block; }
  .dash-user .user-name { display: none; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { margin-top: 8px; }
}

/* ---------- AI Images / Keywords / Link Update ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.chip:hover { text-decoration: none; border-color: var(--accent-deep); color: var(--accent-deep); }
.check-grid { display: grid; gap: 4px 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .check-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .check-grid { grid-template-columns: 1fr 1fr 1fr; } }
.gallery-card .pin-thumb { aspect-ratio: 2 / 3; }
.assign-thumb { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; display: block; }
.gallery-actions { margin-top: 12px; }

/* ---------- Image detail view ---------- */
.detail-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .detail-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } }
.detail-img { padding: 0; overflow: hidden; }
.detail-img img { display: block; width: 100%; height: auto; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0; min-width: 0; }
fieldset legend { padding: 0 6px; font-weight: 700; font-size: .92rem; }

/* --- v6: calendar, banners, deleted badge --- */
.st-deleted, .st-inactive, .st-unknown, .st-draft { background: #efefed; color: #767676; }
.st-queued, .st-posting, .st-pending, .st-ready { background: var(--primary-soft); color: var(--primary-dark); }
.banner-announce { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.banner-announce > span { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-dow { font-weight: 800; font-size: .82rem; color: var(--muted); text-align: center; padding: 6px 2px; }
.calendar-day { display: block; min-height: 74px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: inherit; background: var(--surface); }
.calendar-day:hover { border-color: var(--primary); }
.calendar-blank { border-style: dashed; background: transparent; }
.calendar-today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.calendar-selected { background: var(--primary-soft); }
.calendar-num { display: block; font-weight: 800; }
.calendar-counts { display: block; font-size: .82rem; font-weight: 700; margin-top: 4px; }
.calendar-breakdown { display: block; font-size: .75rem; color: var(--muted); }
@media (max-width: 700px) { .calendar-day { min-height: 56px; padding: 6px; } .calendar-breakdown { display: none; } }
