/* WILDR Social. Every colour and the typeface are tokens from /brand.css (the WILDR CI file).
   No colour is typed here: tests/test_copy.py fails the build if one is. Black, white and grey,
   with the one accent used sparingly: the active page, focus, the line being read, what needs attention. */

:root {
  --radius: 12px;
  --sidebar: 240px;
  --gap: 20px;
  --wash: color-mix(in srgb, var(--accent) 8%, transparent);
  --shade: color-mix(in srgb, var(--ground) 70%, transparent);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1 { font-size: 24px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; margin: 0; line-height: 1.2; }
h2 { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: 0.01em; }
h3 { font-size: 13px; font-weight: 700; margin: 0; }
p { margin: 0 0 8px; }
code { background: var(--raised); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--label); }
.muted { color: var(--label); }
.body-text { color: var(--body); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.spacer { flex: 1; }
.error-text { color: var(--accent); margin: 4px 0; }
.empty { color: var(--label); padding: 20px 0; }
.num { font-variant-numeric: tabular-nums; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; }

/* Layout */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 10;
  display: flex; flex-direction: column;
  padding: 0 16px 18px; border-right: 1px solid var(--hairline); background: var(--ground);
}
/* CI: clear space around the mark is the height of the W on every side. */
.logo { display: block; padding: 34px 29px; margin: 0 -16px; }
.logo img { display: block; width: 150px; height: auto; margin: 0 auto; }
.sidebar .create { margin-bottom: 18px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: var(--body); font-size: 14px;
}
.sidebar nav a:hover { background: var(--panel); color: var(--text); }
.sidebar nav a.on { background: var(--panel); color: var(--text); font-weight: 700; }
.sidebar nav a.on::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 12px 0; border-top: 1px solid var(--hairline); }
.me { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--raised); color: var(--text); font-size: 13px; font-weight: 700; text-transform: uppercase; flex: none; }
.mode-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--body); }
.mode-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--label); }
.mode-pill.live::before { background: var(--text); border-color: var(--text); }

.main { margin-left: var(--sidebar); padding: 30px 40px 60px; }
.page { max-width: 1240px; margin: 0 auto; }
body.bare .main { margin: 0; padding: 0; }
.tabbar, .phone-logo { display: none; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .titles { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-head .sub { color: var(--label); font-size: 14px; }
.head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: calc(16px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
  .phone-logo { display: block; padding: 24px 0; }
  .phone-logo img { display: block; width: 112px; height: auto; margin: 0 auto; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; align-items: flex-end;
    background: color-mix(in srgb, var(--ground) 94%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--hairline); padding: 0 6px env(safe-area-inset-bottom);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 0 8px; font-size: 11px; text-decoration: none; color: var(--label);
  }
  .tabbar a.on { color: var(--text); }
  .tabbar a.on .icon { color: var(--accent); }
  .tabbar a.make { margin-top: -18px; }
  .tabbar a.make span.plus {
    display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
    background: var(--text); color: var(--ground); border: 4px solid var(--ground);
  }
  .tabbar a.make .icon { width: 24px; height: 24px; }
  h1 { font-size: 20px; }
  .page-head { margin-bottom: 18px; }
}

/* Surfaces */
.card {
  background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 20px; min-width: 0;
}
.card + .card { margin-top: var(--gap); }
.grid > .card + .card, .acct-cards > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head .more { margin-left: auto; font-size: 13px; color: var(--body); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.card-head .more:hover { color: var(--text); }
.card-sub { color: var(--label); font-size: 13px; margin-top: -10px; margin-bottom: 16px; }
.grid { display: grid; gap: var(--gap); margin-bottom: var(--gap); }
.grid-2 { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-2, .grid-even, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.section { margin-bottom: var(--gap); }
.label { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--label); margin-bottom: 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.tag { flex: none; display: inline-flex; align-items: center; font-size: 11px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--hairline); color: var(--body); white-space: nowrap; }
.tag.sample { border-style: dashed; }

.notice {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; margin-bottom: var(--gap);
  border: 1px solid var(--hairline); border-left: 3px solid var(--label); border-radius: 10px; background: var(--panel); font-size: 14px;
}
.notice.warn { border-left-color: var(--accent); }
.notice .icon { color: var(--label); margin-top: 1px; }
.notice.warn .icon { color: var(--accent); }
.notice form { margin-left: auto; }
.flash { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; background: var(--panel); border: 1px solid var(--hairline); }
.flash-warn, .flash-error { border-left: 3px solid var(--accent); }

/* Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 9px; cursor: pointer;
  background: var(--raised); color: var(--text); border: 1px solid var(--raised);
  font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary { background: var(--text); color: var(--ground); border-color: var(--text); }
.btn-primary:hover { background: var(--paper); border-color: var(--accent); }
.btn-primary .icon { color: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--body); }
.btn-ghost:hover { background: var(--raised); color: var(--text); border-color: var(--raised); }
.btn-small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.danger { color: var(--accent); }
.link { background: none; border: 0; padding: 0; color: var(--body); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
form { margin: 0; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--body); }
input, textarea, select {
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--ground); border: 1px solid var(--hairline); border-radius: 9px; padding: 10px 12px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--body); }
textarea { width: 100%; resize: vertical; line-height: 1.55; }
.radio, .check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
.radio input, .check input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }

.seg { display: inline-flex; gap: 2px; background: var(--panel); border: 1px solid var(--hairline); border-radius: 10px; padding: 3px; overflow-x: auto; max-width: 100%; }
.seg a, .seg button {
  flex: none; padding: 7px 14px; border-radius: 7px; text-decoration: none; color: var(--body);
  font: inherit; font-size: 13px; background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.seg a:hover, .seg button:hover { color: var(--text); }
.seg a.on, .seg button.on { background: var(--raised); color: var(--text); font-weight: 700; }
.seg i { font-style: normal; color: var(--label); font-size: 12px; margin-left: 4px; font-weight: 400; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: var(--gap); }

/* Network marks: drawn in the text colour, never in the networks' own colours. */
.net {
  display: inline-block; width: 16px; height: 16px; flex: none; font-size: 0; vertical-align: -3px;
  background: currentColor; -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat;
}
.net-instagram { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Ccircle cx='17.3' cy='6.7' r='1' fill='black' stroke='none'/%3E%3C/svg%3E"); }
.net-linkedin { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm2.2 7.4V17h2.3v-6.6zm1.15-3.5a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6zM11.3 10.4V17h2.3v-3.4c0-1 .3-1.6 1.2-1.6s1.1.7 1.1 1.6V17h2.3v-3.9c0-2-1-2.9-2.6-2.9-1 0-1.7.5-2 1v-.8z'/%3E%3C/svg%3E"); }
.net-badge { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--raised); color: var(--text); flex: none; }
.net-badge .net { width: 18px; height: 18px; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--body); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--label); flex: none; }
.status-published::before { background: var(--text); border-color: var(--text); }
.status-simulated::before { border-style: dashed; border-color: var(--body); }
.status-scheduled { color: var(--text); }
.status-scheduled::before { border-color: var(--text); }
.status-draft::before { border-style: dotted; }
.status-partial, .status-failed { color: var(--accent); }
.status-partial::before, .status-failed::before { background: var(--accent); border-color: var(--accent); }
.status-removed { color: var(--label); }
.status-removed::before { border-color: var(--label); background: linear-gradient(135deg, transparent 45%, var(--label) 45%, var(--label) 55%, transparent 55%); }
.status-publishing::before { border-color: var(--text); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* Figures */
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: var(--gap); }
.tiles.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1380px) { .tiles.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 600px) { .tiles, .tiles.six { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .tile-stat .t-value { font-size: 24px; } .tile-stat { padding: 14px; } }
.tile-stat { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile-stat .t-label { font-size: 13px; color: var(--body); display: flex; align-items: center; gap: 8px; }
.tile-stat .t-value { font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; }
.tile-stat .t-delta { font-size: 12px; color: var(--label); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.delta { font-weight: 700; color: var(--text); white-space: nowrap; }
.delta.down { color: var(--body); }
.spark { width: 100%; height: 34px; display: block; margin-top: 4px; }
.spark path { fill: none; stroke: var(--label); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.spark-wrap { position: relative; }
.spark-end { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--panel); }

/* Charts: marks in SVG, text in HTML so it never scales with the plot. */
.chart { position: relative; height: 240px; margin: 4px 0 0 46px; }
.chart.short { height: 180px; }
.chart svg.plot { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--wash); stroke: none; }
.chart .gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--hairline); }
.chart .gridline span { position: absolute; right: calc(100% + 10px); top: -9px; font-size: 11px; color: var(--label); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart .xlabels { position: absolute; left: 0; right: 0; top: calc(100% + 8px); height: 16px; }
.chart .xlabels span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--label); white-space: nowrap; }
.chart .xlabels span:first-child { transform: none; }
.chart .xlabels span:last-child { transform: translateX(-100%); }
.chart .dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--panel); pointer-events: none; }
.chart .end-label { position: absolute; transform: translate(-100%, -150%); font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; pointer-events: none; }
.chart .cross { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--body); pointer-events: none; display: none; }
.chart .cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.chart .col { flex: 1; display: flex; align-items: flex-end; justify-content: center; height: 100%; min-width: 0; }
.chart .col i { display: block; width: 100%; max-width: 24px; background: var(--body); border-radius: 4px 4px 0 0; min-height: 1px; }
.chart .col.hot i, .chart .col:hover i { background: var(--accent); }
.chart .col.none i { background: none; }
.chart-wrap { padding-bottom: 26px; }
.tip {
  position: fixed; z-index: 50; pointer-events: none; display: none;
  background: var(--raised); border: 1px solid var(--faint); border-radius: 8px; padding: 8px 10px; font-size: 12px; min-width: 110px;
  box-shadow: 0 8px 24px var(--shade);
}
.tip b { display: block; font-size: 15px; color: var(--text); }
.tip span { color: var(--body); }
details.table-view { margin-top: 14px; font-size: 13px; }
details.table-view summary { cursor: pointer; color: var(--label); }
details.table-view .scroll { max-height: 260px; overflow: auto; margin-top: 8px; }

.data { width: 100%; border-collapse: collapse; font-size: 13px; }
.data th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); padding: 0 10px 10px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.data th.r, .data td.r { text-align: right; }
.data td { padding: 12px 10px; border-bottom: 1px solid var(--hairline); vertical-align: middle; font-variant-numeric: tabular-nums; }
.data tr:last-child td { border-bottom: 0; }
.data th button { all: unset; cursor: pointer; }
.data th button:hover, .data th.sorted button { color: var(--text); }
.data th.sorted button::after { content: " \2193"; color: var(--accent); }
.table-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.post-cell { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.post-cell .t { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--text); text-decoration: none; }
.post-cell .meta { display: flex; gap: 8px; align-items: center; color: var(--label); font-size: 12px; margin-top: 3px; }
.thumb { flex: none; width: 44px; height: 44px; border-radius: 8px; background: var(--raised); overflow: hidden; display: grid; place-items: center; color: var(--label); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .icon { width: 18px; height: 18px; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; gap: 12px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; border-radius: 0 4px 4px 0; position: relative; }
.bar-row .track i { position: absolute; inset: 0 auto 0 0; background: var(--body); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row:first-child .track i { background: var(--accent); }
.bar-row .v { font-weight: 700; font-variant-numeric: tabular-nums; }

.heat { display: grid; grid-template-columns: 36px repeat(8, minmax(0, 1fr)); gap: 3px; font-size: 11px; color: var(--label); }
.heat .h-col { text-align: center; padding-bottom: 4px; }
.heat .h-row { display: flex; align-items: center; }
.heat .cell { aspect-ratio: 1.6; border-radius: 4px; background: var(--ground); border: 1px solid var(--hairline); }
.heat .cell[data-step] { border: 0; background: color-mix(in srgb, var(--accent) var(--step), var(--panel)); cursor: default; }
.heat .cell[data-step]:hover { outline: 2px solid var(--text); outline-offset: 1px; }
.heat-key { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--label); margin-top: 12px; }
.heat-key i { width: 18px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--accent) var(--step), var(--panel)); }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.time-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--hairline); font-size: 13px; background: var(--ground); color: var(--text); }
.time-chip b { color: var(--text); }
.time-chip .r { color: var(--label); }
button.time-chip { cursor: pointer; font: inherit; font-size: 13px; }
button.time-chip:hover { border-color: var(--accent); }

/* Home */
.hello { font-size: 14px; color: var(--label); }
.acct-cards { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.acct-card { display: flex; flex-direction: column; gap: 14px; }
.acct-card .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acct-card .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-card .who span { display: block; color: var(--label); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-card .figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.acct-card .figs div { display: flex; flex-direction: column; gap: 2px; }
.acct-card .figs b { font-size: 18px; }
.acct-card .figs span { font-size: 11px; color: var(--label); }
.rows { display: flex; flex-direction: column; }
.row-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--hairline); text-decoration: none; min-width: 0; }
.row-item:first-child { border-top: 0; padding-top: 0; }
.row-item:last-child { padding-bottom: 0; }
.row-item:hover .t { text-decoration: underline; text-underline-offset: 3px; }
.row-item .main-col { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.row-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--label); font-size: 12px; }
.row-item .fig { text-align: right; flex: none; font-size: 13px; }
.row-item .fig b { display: block; font-size: 15px; }
.row-item .fig span { color: var(--label); font-size: 11px; }
.when-pill { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 10px; background: var(--raised); flex: none; line-height: 1.1; }
.when-pill b { font-size: 17px; }
.when-pill span { font-size: 10px; color: var(--body); text-transform: uppercase; letter-spacing: 0.1em; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--ground); }
.steps li .n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--faint); font-size: 12px; font-weight: 700; flex: none; }
.steps li.done .n { background: var(--text); color: var(--ground); border-color: var(--text); }
.steps li b { display: block; font-size: 14px; }
.steps li span { font-size: 12px; color: var(--label); }
.steps li a { font-size: 13px; }

/* Sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-box { width: min(400px, 100%); }
.auth-box.wide { width: min(680px, 100%); }
.auth-logo { display: block; padding: 0 0 40px; }
.auth-logo img { display: block; width: 200px; height: auto; margin: 0 auto; }
.auth-box h2 { margin-bottom: 6px; }

/* Composer */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; align-items: start; }
.composer .card + .card { margin-top: 16px; }
.col-edit > * + * { margin-top: 16px; }
.col-preview { position: sticky; top: 24px; }
@media (max-width: 1180px) {
  .composer { grid-template-columns: minmax(0, 1fr); }
  .col-preview { position: static; }
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px 8px 10px; border-radius: 99px;
  background: var(--ground); border: 1px solid var(--hairline); color: var(--label); cursor: pointer; font: inherit; font-size: 14px;
}
.chip:hover { color: var(--text); }
.chip.on { color: var(--text); border-color: var(--accent); background: var(--raised); }
.chip .tag { font-size: 10px; }
.counters { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--label); }
.counters .over { color: var(--accent); font-weight: 700; }

.media-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.tile { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--ground); border: 1px solid var(--hairline); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .tile-tools { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; background: linear-gradient(transparent, var(--shade)); padding: 14px 4px 3px; }
.tile .tile-tools button { background: none; border: 0; color: var(--text); font-size: 16px; line-height: 1; padding: 2px 5px; cursor: pointer; }
.tile .tile-n { position: absolute; top: 5px; left: 5px; background: var(--shade); border-radius: 5px; font-size: 11px; padding: 0 6px; }
.tile.add { display: grid; place-items: center; cursor: pointer; color: var(--label); font-size: 13px; text-align: center; border-style: dashed; }
.tile.add:hover { color: var(--text); border-color: var(--body); }

details.custom { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); }
details.custom + details.custom { margin-top: 10px; }
details.custom summary { padding: 14px 18px; cursor: pointer; display: flex; align-items: center; gap: 10px; list-style: none; font-size: 14px; }
details.custom summary::-webkit-details-marker { display: none; }
details.custom summary::after { content: "+"; margin-left: auto; color: var(--label); font-size: 18px; }
details.custom[open] summary::after { content: "\2212"; }
details.custom .custom-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.kind-row { display: flex; gap: 8px; align-items: center; font-size: 14px; }

.issues { display: flex; flex-direction: column; gap: 6px; }
.issues:empty { display: none; }
.issue { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 9px; font-size: 14px; background: var(--panel); border: 1px solid var(--hairline); }
.issue::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; border: 2px solid var(--label); }
.issue.error { border-left: 3px solid var(--accent); }
.issue.error::before { background: var(--accent); border-color: var(--accent); }
.issue.warn::before { border-color: var(--accent); }
.issue .who { color: var(--label); white-space: nowrap; }
.issue button { margin-left: auto; }

.when { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.when input[type="datetime-local"] { min-width: 230px; }
.suggest { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.actions.wrap { justify-content: flex-start; }
@media (max-width: 900px) {
  .composer .actions { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--ground); padding: 10px 0; z-index: 5; }
}

/* Previews: drawn on paper, like the apps themselves */
.pv { background: var(--paper); color: var(--ink); border-radius: 14px; overflow: hidden; border: 1px solid var(--hairline); font-size: 14px; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.pv-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.pv.li .pv-avatar { border-radius: 4px; width: 44px; height: 44px; font-size: 15px; }
.pv-name { font-weight: 700; font-size: 14px; }
.pv-sub { color: var(--grey); font-size: 12px; }
.pv-media { position: relative; background: var(--fill); display: grid; place-items: center; overflow: hidden; }
.pv-media img, .pv-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-count { position: absolute; top: 10px; right: 10px; background: var(--shade); color: var(--paper); border-radius: 99px; font-size: 12px; padding: 2px 8px; }
.pv-dots { display: flex; justify-content: center; gap: 4px; padding: 8px 0 0; }
.pv-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--rule); }
.pv-dots i:first-child { background: var(--ink); }
.pv-icons { display: flex; gap: 14px; padding: 10px 12px 4px; }
.pv-icons svg { width: 24px; height: 24px; }
.pv-caption { padding: 4px 12px 14px; white-space: pre-wrap; word-wrap: break-word; }
.pv-caption b { margin-right: 4px; }
.pv-more { color: var(--grey); }
.pv.li .pv-text { padding: 0 14px 12px; white-space: pre-wrap; word-wrap: break-word; }
.pv.li .pv-more { color: var(--grey); font-weight: 700; }
.pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--paper); }
.pv-grid > div { aspect-ratio: 1; overflow: hidden; position: relative; background: var(--fill); }
.pv-grid img, .pv-grid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-grid .plus { position: absolute; inset: 0; display: grid; place-items: center; background: var(--shade); color: var(--paper); font-size: 22px; font-weight: 700; }
.pv-bar { display: flex; justify-content: space-around; border-top: 1px solid var(--fill); padding: 10px 0; color: var(--grey); font-size: 13px; font-weight: 700; }
.pv.story { aspect-ratio: 9 / 16; position: relative; background: var(--ink); color: var(--paper); max-height: 640px; margin: 0 auto; }
.pv.story .pv-media { position: absolute; inset: 0; background: var(--ink); }
.pv.story .pv-head { position: absolute; top: 0; left: 0; right: 0; z-index: 1; background: linear-gradient(var(--shade), transparent); padding-top: 18px; }
.pv.story .pv-bars { position: absolute; top: 8px; left: 8px; right: 8px; height: 2px; background: color-mix(in srgb, var(--paper) 50%, transparent); z-index: 1; border-radius: 2px; }
.pv-empty { padding: 48px 16px; text-align: center; color: var(--label); background: var(--panel); border: 1px dashed var(--hairline); border-radius: 14px; }

/* Dialogs */
dialog.sheet {
  width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 48px); padding: 22px;
  background: var(--panel); color: var(--text); border: 1px solid var(--hairline); border-radius: 16px;
}
dialog.sheet.small { width: min(460px, calc(100vw - 24px)); }
dialog::backdrop { background: var(--shade); backdrop-filter: blur(3px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.upload { margin-bottom: 8px; }
.confirm-list { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.confirm-list li { display: flex; gap: 10px; align-items: center; }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; max-height: 50vh; overflow: auto; }
.lib-grid.big { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-height: none; gap: var(--gap); }
.lib-pick { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; padding: 0; background: var(--ground); }
.lib-pick.on { border-color: var(--accent); }
.lib-pick img, .lib-pick video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-pick .lib-badge, .lib-item .lib-badge { position: absolute; top: 6px; right: 6px; background: var(--shade); border-radius: 6px; padding: 3px; color: var(--text); display: grid; }
.lib-pick .lib-badge .icon, .lib-item .lib-badge .icon { width: 16px; height: 16px; }
.lib-item { position: relative; margin: 0; background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }
.lib-item img, .lib-item video { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--ground); }
.lib-item figcaption { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.lib-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { border: 1px dashed var(--faint); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--label); margin-bottom: var(--gap); }

/* Planner */
.month-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.month-head h2 { margin: 0 8px; min-width: 170px; text-align: center; font-size: 17px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-left: auto; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; background: var(--hairline); gap: 1px; }
.dow { background: var(--panel); padding: 10px 12px; font-size: 11px; font-weight: 700; color: var(--label); text-transform: uppercase; letter-spacing: 0.14em; }
.day { background: var(--ground); min-height: 128px; padding: 8px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.day.out { background: color-mix(in srgb, var(--ground) 60%, var(--panel)); }
.day.out .day-num { color: var(--faint); }
.day-num { font-size: 12px; color: var(--body); font-weight: 700; padding: 2px 4px; display: flex; justify-content: space-between; align-items: center; }
.day-num a { opacity: 0; text-decoration: none; color: var(--label); font-weight: 400; font-size: 16px; line-height: 1; }
.day:hover .day-num a { opacity: 1; }
.day.today .day-num b { color: var(--ground); background: var(--text); border-radius: 99px; min-width: 24px; text-align: center; padding: 1px 6px; box-shadow: 0 0 0 2px var(--accent); }
.cal-post { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 1px; padding: 5px 7px; border-radius: 7px; background: var(--panel); text-decoration: none; font-size: 12px; min-width: 0; border: 1px solid var(--hairline); line-height: 1.35; }
.cal-post.has-thumb { grid-template-columns: auto minmax(0, 1fr); column-gap: 7px; align-items: center; }
.cal-post.has-thumb .cal-thumb { grid-row: span 2; }
.cal-post[data-move] { cursor: grab; touch-action: none; }
.cal-post.dragging { opacity: 0.4; }
.day.drop { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-head { display: flex; align-items: center; gap: 5px; min-width: 0; }
.cal-post:hover { border-color: var(--body); }
.cal-post .cal-thumb { width: 30px; height: 30px; border-radius: 4px; overflow: hidden; flex: none; background: var(--raised); }
.cal-post .cal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-post.st-scheduled { border-color: var(--faint); }
.cal-post.st-failed, .cal-post.st-partial { border-color: var(--accent); }
.cal-post.st-draft { border-style: dashed; }
.cal-post.st-removed { opacity: 0.55; }
.cal-post .net { width: 12px; height: 12px; color: var(--body); }
.cal-time { color: var(--label); font-variant-numeric: tabular-nums; }
.cal-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--text); }
@media (max-width: 900px) { .hide-phone { display: none; } }
.agenda { display: none; }
.agenda-day { margin: 20px 0 8px; color: var(--label); text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; }
@media (max-width: 780px) {
  .calendar { display: none; }
  .agenda { display: block; }
  .legend { display: none; }
}

.list { display: flex; flex-direction: column; gap: 10px; }
.post-row { display: flex; gap: 14px; align-items: center; padding: 12px; background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); text-decoration: none; }
.post-row + .post-row { margin-top: 10px; }
.post-row:hover { border-color: var(--faint); }
.post-thumb { flex: none; width: 56px; height: 56px; border-radius: 9px; background: var(--raised); overflow: hidden; display: grid; place-items: center; color: var(--label); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.post-text { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--label); }

/* Post detail and accounts */
.post-detail { max-width: 820px; }
.post-body { white-space: pre-wrap; word-wrap: break-word; font-size: 16px; }
.detail-media { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.detail-media img, .detail-media video { max-width: 220px; max-height: 220px; border-radius: 10px; background: var(--ground); }
.targets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.targets li { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-top: 1px solid var(--hairline); }
.targets li:first-child { border-top: 0; padding-top: 0; }
.target-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.target-figs { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12px; color: var(--label); }
.target-figs b { display: block; font-size: 16px; color: var(--text); }
.net-card .net-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.acct-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; }
.acct-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--hairline); }
.acct-list li.off { opacity: 0.55; }
.acct-list .info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }

/* On your phone */
.side-link { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--body); text-decoration: none; }
.side-link .icon { width: 18px; height: 18px; }
.side-link:hover, .side-link.on { color: var(--text); }
.phone-card { display: flex; gap: 32px; align-items: center; flex-wrap: wrap; }
.qr-box { flex: none; width: 232px; border-radius: 12px; overflow: hidden; }
.qr { display: block; width: 100%; height: auto; }
.qr rect { fill: var(--paper); }
.qr path { fill: var(--ink); }
.num-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; flex: 1; min-width: 260px; }
.num-steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; column-gap: 12px; row-gap: 3px; }
.num-steps li::before { content: counter(step); grid-row: span 2; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--faint); font-size: 12px; font-weight: 700; }
.num-steps b { font-size: 15px; }
.num-steps span { font-size: 13px; color: var(--label); }
.addr { user-select: all; word-break: break-all; }
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; }
/* Setting up a network's developer app, on Accounts */
.app-setup { margin-top: 14px; border-top: 1px solid var(--hairline); padding-top: 14px; }
.app-setup summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.app-setup[open] summary { margin-bottom: 16px; }
.app-setup .num-steps { margin-bottom: 18px; }
.app-setup .num-steps li { max-width: 760px; }
.app-keys { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.app-keys label { flex: 1; min-width: 200px; }
/* Privacy policy */
.privacy h3 { font-size: 15px; margin: 22px 0 6px; }
.privacy p, .privacy li { color: var(--body); font-size: 14px; line-height: 1.6; }
.privacy ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }