/* BimmerTuner — early-2010s Google+ / "Kennedy" look: Arial 13px, flat greys, red + blue accents. */

:root {
  --page: 1100px;

  --red: #dd4b39;
  --red-button: #d14836;
  --red-hover: #c53727;
  --blue: #4d90fe;
  --blue-border: #3079ed;
  --blue-hover: #357ae8;
  --green: #3d9400;
  --green-border: #29691d;
  --navy: #1c3f94;
  --link: #36c;

  --text: #333;
  --text-strong: #222;
  --text-muted: #777;
  --text-faint: #999;

  --bar: #2d2d2d;
  --header: #f1f1f1;
  --page-bg: #ebebeb;
  --card: #fff;
  --soft: #f5f5f5;
  --line: #e5e5e5;
  --line-soft: #f0f0f0;
  --card-border: #d8d8d8;

  --mono: Consolas, "Courier New", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font: 13px/1.45 Arial, Helvetica, sans-serif;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

h1,
h2,
h3 {
  color: var(--text-strong);
}

.icon {
  flex: none;
  vertical-align: middle;
}

.muted {
  color: var(--text-faint);
}

.link-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--link);
  font: inherit;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

/* ---------- Black bar ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  height: 30px;
  padding: 0 8px;
  background: var(--bar);
  font-weight: bold;
}

.topbar-links,
.topbar-account {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.topbar-account {
  align-items: center;
}

.topbar-links a,
.topbar-button {
  display: flex;
  align-items: center;
  padding: 0 8px;
  border: 0;
  border-top: 2px solid transparent;
  background: none;
  color: #ccc;
  font: bold 13px Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.topbar-button {
  align-self: stretch;
}

.topbar-links a:hover,
.topbar-button:hover {
  background: #4c4c4c;
  color: #fff;
  text-decoration: none;
}

.topbar-links a.is-active {
  border-top-color: var(--red);
  color: #fff;
}

.topbar-links .topbar-you {
  color: #fff;
}

/* ---------- Header ---------- */

.header {
  background: var(--header);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--page);
  height: 64px;
  margin: 0 auto;
  padding: 0 16px;
}

.logo {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  width: 190px;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.logo-stripes {
  display: flex;
  gap: 2px;
  transform: skewX(-14deg);
}

.logo-stripes i {
  display: block;
  width: 5px;
  height: 24px;
}

.logo-stripes i:nth-child(1) {
  background: var(--blue);
}

.logo-stripes i:nth-child(2) {
  background: var(--navy);
}

.logo-stripes i:nth-child(3) {
  background: var(--red);
}

.logo-word {
  color: #666;
  font-size: 22px;
  letter-spacing: -0.5px;
}

.logo-word b {
  color: var(--red);
}

.search {
  display: flex;
  flex: 0 1 340px;
  min-width: 0;
}

.search input {
  flex: 1;
  min-width: 0;
}

.search-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 29px;
  border: 1px solid var(--blue-border);
  border-radius: 0 2px 2px 0;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}

.search-button:hover {
  background: var(--blue-hover);
  border-color: #2f5bb7;
}

.header-tabs {
  display: flex;
  align-self: stretch;
  margin-left: auto;
}

.header-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 72px;
  border-bottom: 3px solid transparent;
  color: var(--text-faint);
  font-size: 11px;
  text-decoration: none;
}

.header-tab:hover {
  background: #e7e7e7;
  color: #666;
  text-decoration: none;
}

.header-tab.is-active {
  border-bottom-color: var(--red);
  color: var(--red);
}

/* ---------- Page & columns ---------- */

.page {
  max-width: var(--page);
  min-height: 60vh;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.columns {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
}

.col-center,
.col-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 16px 16px 32px;
  border-top: 1px solid #ddd;
  color: var(--text-faint);
  font-size: 11px;
}

.footer a {
  color: var(--text-muted);
}

/* ---------- Left navigation ---------- */

.stream-nav {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  border-left: 3px solid transparent;
  color: var(--text);
  text-decoration: none;
}

.nav-item:hover {
  background: #e0e0e0;
  text-decoration: none;
}

.nav-item .icon {
  color: var(--text-faint);
}

.nav-item.is-active {
  border-left-color: var(--red);
  color: var(--red);
  font-weight: bold;
}

.nav-item.is-active .icon {
  color: var(--red);
}

.nav-count {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: normal;
}

.nav-heading {
  margin: 16px 0 4px 15px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

/* ---------- Cards & boxes ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.box {
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
}

.box-title {
  margin: 0 0 8px;
  font-size: 13px;
}

.box p {
  margin: 0 0 10px;
  color: #555;
}

.box-stat strong {
  color: var(--text-strong);
  font-size: 20px;
  font-weight: normal;
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0;
}

.facts dt {
  color: var(--text-faint);
}

.facts dd {
  margin: 0;
  color: var(--text-strong);
}

.stream-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: normal;
}

.stream-heading span {
  color: var(--text-faint);
  font-size: 13px;
}

.sharebox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-faint);
  text-decoration: none;
}

.sharebox:hover {
  text-decoration: none;
}

.sharebox-input {
  flex: 1;
  height: 29px;
  padding: 0 10px;
  border: 1px solid #d9d9d9;
  line-height: 27px;
}

.sharebox:hover .sharebox-input {
  border-color: #b9b9b9;
}

.empty {
  padding: 32px;
  text-align: center;
}

.empty h2,
.error-page h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: normal;
}

.empty p,
.error-page p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.error-page {
  max-width: 520px;
  margin: 40px auto;
  padding: 32px;
}

/* ---------- Avatars & badges ---------- */

.avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  letter-spacing: -0.5px;
}

.avatar-brand {
  background: var(--header);
  border: 1px solid var(--line);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: bold;
  line-height: 17px;
}

.badge-free {
  background: #e6f4d7;
  color: var(--green);
}

.badge-locked {
  background: #fbe5e1;
  color: #c23321;
}

.badge-unlocked {
  background: #e3edfe;
  color: #2a62c9;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 2px;
  background: #eee;
  color: #666;
  font: bold 10px/16px Arial, sans-serif;
  text-transform: uppercase;
}

.tag-warn {
  background: #f9edbe;
  color: #7a5c00;
}

/* ---------- Posts ---------- */

.post {
  padding: 16px 18px 0;
}

.post-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.post-meta {
  min-width: 0;
}

.post-author {
  color: var(--text-strong);
  font-weight: bold;
}

.post-arrow {
  margin: 0 6px;
  color: var(--text-faint);
  font-size: 10px;
}

.post-topic {
  color: var(--text-muted);
}

.post-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 12px;
}

.post-title {
  margin: 14px 0 6px;
  font-size: 16px;
  overflow-wrap: break-word;
}

.post-title a {
  color: var(--text-strong);
}

.post-full .post-title {
  font-size: 22px;
  font-weight: normal;
}

.post-excerpt {
  margin: 0 0 12px;
  overflow-wrap: break-word;
}

.post-full .post-excerpt {
  color: #555;
  font-size: 14px;
}

.post-body {
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.post-body p {
  margin: 0 0 12px;
}

.post-locked-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  color: #666;
  font-size: 12px;
}

.post-locked-strip:hover {
  border-color: #d0d0d0;
  text-decoration: none;
}

.post-locked-strip .icon {
  color: var(--text-faint);
}

.post-locked-cta {
  margin-left: auto;
  color: var(--red);
  font-weight: bold;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin: 0 -18px;
  padding: 10px 18px;
  border-top: 1px solid #ebebeb;
}

.action-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: 12px Arial, sans-serif;
  cursor: pointer;
}

.action-link:hover {
  text-decoration: underline;
}

.action-link .icon {
  color: var(--text-faint);
}

/* Paywall */

.paywall {
  margin: 4px 0 16px;
}

.paywall-ghost {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
  -webkit-mask-image: linear-gradient(#000, transparent);
  mask-image: linear-gradient(#000, transparent);
}

.paywall-ghost i {
  display: block;
  height: 10px;
  background: #e8e8e8;
}

.paywall-ghost i:nth-child(2) {
  width: 92%;
}

.paywall-ghost i:nth-child(3) {
  width: 97%;
}

.paywall-ghost i:nth-child(4) {
  width: 58%;
}

.paywall-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #fafafa;
  border: 1px solid var(--line);
}

.paywall-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #fbe5e1;
  color: var(--red);
}

/* Amount picker */

.amounts {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 6px;
}

.amount {
  min-width: 64px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #dcdcdc;
  border-radius: 2px;
  background: #fff;
  color: #444;
  font: bold 13px Arial, sans-serif;
  cursor: pointer;
}

.amount:hover {
  border-color: #c6c6c6;
  color: var(--text-strong);
}

.amount[aria-pressed="true"] {
  border-color: var(--red);
  background: #fbe5e1;
  color: #c23321;
}

.paywall-box input.amount-input {
  width: 96px;
  height: 32px;
}

.paywall-box .form-error {
  flex: 1 1 100%;
}

/* "Already paid?" */

.redeem {
  padding: 10px 16px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-top: 0;
}

.redeem summary {
  color: var(--link);
  cursor: pointer;
}

.redeem-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.redeem-form input {
  flex: 0 1 220px;
  min-width: 0;
  font-family: var(--mono);
  text-transform: uppercase;
}

.redeem .form-error {
  margin-top: 6px;
}

.redeem .form-error.is-ok {
  color: var(--green);
}

.paywall-text {
  display: flex;
  flex: 1 1 220px;
  flex-direction: column;
  gap: 2px;
}

.paywall-text strong {
  color: var(--text-strong);
}

.paywall-text span {
  color: var(--text-muted);
  font-size: 12px;
}

.paywall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Attachments */

.attachments {
  margin: 0 0 16px;
  padding: 0;
  border: 1px solid var(--line);
  list-style: none;
}

.paywall .attachments {
  border-top: 0;
}

.attachments li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid #ebebeb;
}

.attachments li:first-child {
  border-top: 0;
}

.attachments .icon-file {
  color: var(--blue);
}

.attachment-name {
  flex: 1;
  min-width: 0;
  color: var(--text-strong);
  font-weight: bold;
  overflow-wrap: break-word;
}

.attachment-size {
  color: var(--text-faint);
  font-size: 12px;
  white-space: nowrap;
}

.attachments.is-locked .icon {
  color: #bbb;
}

.attachments.is-locked .attachment-name {
  color: var(--text-muted);
  font-weight: normal;
}

/* ---------- Categories, files, versions ---------- */

.tiles-title {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-top: 3px solid var(--red);
  color: var(--text-muted);
  font-size: 11px;
}

.tile:hover {
  border-color: #c6c6c6;
  border-top-color: var(--red-hover);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tile strong {
  color: var(--text-strong);
  font-size: 14px;
}

.tile-files {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  border-top-color: var(--blue);
  color: var(--blue);
}

.tile-files:hover {
  border-top-color: var(--blue-hover);
}

.heading-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 12px;
}

.badge-version {
  background: #eee;
  color: #555;
}

.versions {
  margin: 0 0 16px;
  border: 1px solid var(--line);
}

.versions-title {
  margin: 0;
  padding: 10px 12px;
  background: #fafafa;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.versions-title span {
  color: var(--text-muted);
  font-weight: normal;
}

.versions-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.versions-list > li {
  padding: 10px 12px;
  border-top: 1px solid #ebebeb;
}

.versions-list > li:first-child {
  border-top: 0;
}

.version-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.version-head time {
  color: var(--text-faint);
  font-size: 12px;
}

.version-note {
  margin: 4px 0 0;
  color: #555;
}

.versions-list .attachments {
  margin: 8px 0 0;
}

.versions-list .muted {
  margin: 4px 0 0;
  font-size: 12px;
}

.file-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-filters input[type="search"] {
  width: 100%;
}

.chip[aria-pressed="true"] {
  border-color: var(--red);
  background: #fbe5e1;
  color: #c23321;
}

.file-chips .chip {
  font-family: Arial, sans-serif;
}

.file-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-group-title {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid #ebebeb;
  font-size: 13px;
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--line-soft);
}

.file-row:first-child {
  border-top: 0;
}

.file-row > .icon {
  color: var(--blue);
}

.file-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.file-name {
  color: var(--text-strong);
  font-weight: bold;
  overflow-wrap: anywhere;
}

.file-meta {
  color: var(--text-faint);
  font-size: 12px;
}

.file-meta a {
  color: var(--text-muted);
}

.btn-locked .icon {
  color: var(--red);
}

.notice {
  margin: 0;
  padding: 8px 12px;
  background: #f9edbe;
  border: 1px solid #f0c36d;
}

.tag-new {
  background: #e6f4d7;
  color: var(--green);
}

.composer-status {
  margin: 0;
  padding: 10px 12px;
  background: #fafafa;
  border: 1px solid var(--line);
  line-height: 1.6;
}

.field.is-required .field-label::after {
  content: " — required";
  color: var(--red);
  font-weight: normal;
}

.table-hint {
  margin: 0;
  padding: 10px 14px;
}

.cell-actions .btn-small {
  margin-right: 4px;
}

/* ---------- Buttons & inputs (Kennedy) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 54px;
  height: 29px;
  padding: 0 14px;
  border: 1px solid #dcdcdc;
  border-radius: 2px;
  background: var(--soft);
  color: #444;
  font: bold 11px Arial, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  border-color: #c6c6c6;
  background: #f8f8f8;
  color: var(--text-strong);
  text-decoration: none;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn:active {
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px #fff;
}

.btn-blue {
  border-color: var(--blue-border);
  background: var(--blue);
  color: #fff;
}

.btn-blue:hover {
  border-color: #2f5bb7;
  background: var(--blue-hover);
  color: #fff;
}

.btn-red {
  border-color: transparent;
  background: var(--red-button);
  color: #fff;
}

.btn-red:hover {
  border-color: #b0281a;
  background: var(--red-hover);
  color: #fff;
}

.btn-green {
  border-color: var(--green-border);
  background: var(--green);
  color: #fff;
}

.btn-green:hover {
  border-color: #2d6200;
  background: #368200;
  color: #fff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.btn-small {
  height: 25px;
  padding: 0 10px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.icon-button:hover {
  border-color: #dcdcdc;
  background: var(--soft);
  color: var(--text-strong);
}

.icon-button-danger:hover {
  color: var(--red);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
  height: 29px;
  padding: 0 8px;
  border: 1px solid #d9d9d9;
  border-top-color: #c0c0c0;
  border-radius: 1px;
  background: #fff;
  color: var(--text-strong);
  font: 13px Arial, sans-serif;
}

textarea {
  height: auto;
  padding: 6px 8px;
  line-height: 1.45;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #b9b9b9;
  border-top-color: #a0a0a0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

input[type="checkbox"] {
  accent-color: var(--blue);
}

/* ---------- Butterbar & dialogs ---------- */

.butterbar {
  position: fixed;
  top: 36px;
  left: 50%;
  z-index: 1000;
  max-width: calc(100vw - 32px);
  padding: 6px 16px;
  border: 1px solid #f0c36d;
  border-radius: 2px;
  background: #f9edbe;
  color: var(--text-strong);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px);
  transition: opacity 0.15s, transform 0.15s;
}

.butterbar.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.butterbar.is-error {
  border-color: var(--red-hover);
  background: var(--red);
  color: #fff;
}

.modal {
  width: min(440px, calc(100vw - 32px));
  padding: 28px 36px 24px;
  border: 1px solid rgba(0, 0, 0, 0.333);
  background: #fff;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal::backdrop {
  background: rgba(255, 255, 255, 0.75);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px;
  border: 0;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-strong);
}

.modal-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: normal;
}

.modal-body p {
  margin: 0 0 12px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.code-link {
  font-family: var(--mono);
  font-size: 12px;
}

/* ---------- Admin sign-in ---------- */

.signin-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 25px 25px;
  background: #fff;
  border: 1px solid var(--line);
}

.admin-signin {
  max-width: 360px;
  margin: 40px auto;
}

.admin-signin .logo {
  width: auto;
  margin-bottom: 16px;
}

.signin-card label {
  margin-top: 8px;
  color: var(--text-strong);
  font-weight: bold;
}

.signin-card h1 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: normal;
}

.signin-card input[type="email"],
.signin-card input[type="password"] {
  height: 32px;
  font-size: 15px;
}

.signin-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.form-error {
  margin: 0;
  color: var(--red);
}

.form-error:empty {
  display: none;
}

/* ---------- Help page ---------- */

.help {
  max-width: 680px;
  margin: 16px auto;
  padding: 28px 32px;
}

.help .logo {
  width: auto;
}

.help h1 {
  margin: 24px 0 16px;
  font-size: 24px;
  font-weight: normal;
}

.faq {
  margin: 0 0 24px;
}

.faq dt {
  margin-top: 16px;
  color: var(--text-strong);
  font-weight: bold;
}

.faq dd {
  margin: 4px 0 0;
  color: #555;
  font-size: 14px;
}

/* ---------- Admin ---------- */

.admin-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-head h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: normal;
}

.admin-head p {
  margin: 0;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat {
  min-width: 100px;
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
}

.stat strong {
  display: block;
  color: var(--text-strong);
  font-size: 20px;
  font-weight: normal;
}

.stat span {
  color: var(--text-muted);
  font-size: 11px;
}

.tabs {
  display: flex;
  margin-bottom: 16px;
  /* Drawn as an inset shadow so the active tab's underline can cover it without overflowing. */
  box-shadow: inset 0 -1px 0 var(--card-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab {
  padding: 10px 16px;
  border-bottom: 3px solid transparent;
  color: #666;
  font-weight: bold;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text-strong);
  text-decoration: none;
}

.tab.is-active {
  border-bottom-color: var(--red);
  color: var(--red);
}

.admin-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-foot {
  margin-top: 24px;
  font-size: 12px;
  text-align: right;
}

.section-title {
  margin: 0 0 10px;
  font-size: 13px;
}

.hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 10px 0 0;
  color: var(--text-faint);
  font-size: 11px;
}

.destination {
  padding: 16px 18px;
}

.key-input {
  display: flex;
  max-width: 600px;
}

.key-input span {
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: var(--soft);
  border: 1px solid #d9d9d9;
  border-right: 0;
  color: var(--text-muted);
  font: 12px var(--mono);
  white-space: nowrap;
}

.key-input input {
  flex: 1;
  min-width: 0;
  font: 12px var(--mono);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #dcdcdc;
  border-radius: 2px;
  background: var(--soft);
  color: #555;
  font: 12px var(--mono);
  cursor: pointer;
}

.chip:hover {
  border-color: #c6c6c6;
  color: var(--text-strong);
}

.chip .icon {
  color: var(--text-faint);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 16px;
  background: #fff;
  border: 2px dashed #d0d0d0;
  color: #bbb;
  text-align: center;
  transition: background 0.1s, border-color 0.1s;
}

.dropzone.is-over {
  background: #eef4ff;
  border-color: var(--blue);
  color: var(--blue);
}

.drop-title {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 24px;
}

.drop-or {
  margin: 0 0 8px;
  color: var(--text-muted);
}

.queue {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue:empty {
  display: none;
}

.upload-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.upload-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 180px 28px;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid #ebebeb;
}

.upload-row:first-child {
  border-top: 0;
}

.upload-row > .icon {
  color: var(--blue);
}

.upload-row[data-status="done"] > .icon {
  color: var(--green);
}

.upload-row[data-status="error"] > .icon,
.upload-row[data-status="cancelled"] > .icon {
  color: var(--red);
}

.upload-name {
  color: var(--text-strong);
  font-weight: bold;
  overflow-wrap: anywhere;
}

.upload-name span {
  margin-left: 6px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: normal;
}

.upload-key {
  margin: 2px 0 6px;
  color: var(--text-muted);
  font: 12px var(--mono);
  overflow-wrap: anywhere;
}

.progress {
  height: 6px;
  background: #ebebeb;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width 0.08s linear;
}

.upload-row[data-status="done"] .progress-bar {
  background: var(--green);
}

.upload-row[data-status="error"] .progress-bar,
.upload-row[data-status="cancelled"] .progress-bar {
  background: var(--red);
}

.upload-status {
  color: var(--text-muted);
  font-size: 12px;
}

.upload-row[data-status="done"] .upload-status {
  color: var(--green);
  font-weight: bold;
}

.upload-row[data-status="error"] .upload-status {
  color: var(--red);
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.queue-next {
  margin-left: auto;
  font-weight: bold;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #ebebeb;
}

.toolbar input {
  width: 240px;
  max-width: 100%;
}

.toolbar .btn {
  margin-left: auto;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 8px 14px;
  background: #f9f9f9;
  border-bottom: 1px solid #ebebeb;
  color: var(--text-muted);
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.table tr:hover td {
  background: #fafafa;
}

.cell-key {
  min-width: 200px;
  color: var(--text-strong);
  font: 12px var(--mono);
  overflow-wrap: anywhere;
}

.cell-key .icon {
  margin-right: 6px;
  color: var(--blue);
}

.cell-num,
.cell-actions {
  text-align: right;
  white-space: nowrap;
}

.table-empty {
  padding: 24px;
  color: var(--text-faint);
  text-align: center;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
  padding: 20px 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field .hint {
  margin: 0;
}

.field-label {
  padding: 0;
  color: var(--text-strong);
  font-weight: bold;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.attach-list {
  max-height: 240px;
  margin-top: 6px;
  border: 1px solid var(--line);
  overflow: auto;
}

.attach-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid var(--line-soft);
  cursor: pointer;
}

.attach-row:first-child {
  border-top: 0;
}

.attach-row:hover {
  background: #fafafa;
}

.attach-key {
  flex: 1;
  min-width: 0;
  font: 12px var(--mono);
  overflow-wrap: anywhere;
}

.form-actions {
  display: flex;
  gap: 8px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1060px) {
  .columns {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .col-right {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .topbar-links a:not(.topbar-you) {
    display: none;
  }

  .header-inner {
    flex-wrap: wrap;
    height: auto;
    gap: 10px;
    padding: 10px 16px 0;
  }

  .logo {
    width: auto;
  }

  .search {
    flex: 1 1 100%;
    order: 3;
  }

  .header-tabs {
    flex: 1 1 100%;
    order: 4;
    justify-content: space-around;
    margin-left: 0;
  }

  .header-tab {
    height: 52px;
  }

  .page {
    padding: 12px 16px 32px;
  }

  .columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .col-right {
    grid-column: auto;
  }

  .stream-nav {
    position: static;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hide-narrow {
    display: none;
  }

  .nav-heading,
  .nav-item .icon {
    display: none;
  }

  .nav-item {
    flex: none;
    padding: 4px 10px;
    border: 1px solid var(--card-border);
    border-radius: 2px;
    background: #fff;
    white-space: nowrap;
  }

  .nav-item.is-active {
    border-color: var(--red);
  }

  .post {
    padding: 14px 14px 0;
  }

  .post-actions {
    margin: 0 -14px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .post-full .post-title {
    font-size: 19px;
  }

  .help {
    padding: 20px;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal {
    padding: 24px 20px 20px;
  }

  .stat {
    flex: 1 1 40%;
  }

  .upload-row {
    grid-template-columns: 28px minmax(0, 1fr) 28px;
  }

  .upload-row > .icon {
    grid-row: 1 / span 2;
    align-self: start;
  }

  .upload-status {
    grid-column: 2;
    grid-row: 2;
  }

  .upload-action {
    grid-column: 3;
    grid-row: 1;
  }

  .toolbar input {
    width: 100%;
  }

  .file-row {
    flex-wrap: wrap;
  }

  .file-info {
    flex-basis: calc(100% - 40px);
  }

  .heading-link {
    margin-left: 0;
  }

  .toolbar .btn,
  .queue-next {
    margin-left: 0;
  }
}

/* ---------- Ads ---------- */

.ad {
  padding: 8px 10px 10px;
  background: var(--card);
  border: 1px solid var(--card-border);
}

.ad-label {
  margin-bottom: 6px;
  color: var(--text-faint);
  font-size: 10px;
  text-transform: uppercase;
}

.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 90px;
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 8px, #f2f2f2 8px, #f2f2f2 16px);
  border: 1px dashed #d0d0d0;
  color: var(--text-faint);
  font-size: 11px;
  text-align: center;
}

.ad-placeholder strong {
  color: var(--text-muted);
  font-size: 13px;
}

.ad-sidebar .ad-placeholder {
  min-height: 250px;
}

.ad-inFeed .ad-placeholder,
.ad-article .ad-placeholder {
  min-height: 120px;
}

.footer-button {
  color: var(--text-muted);
  font-size: 11px;
}

/* Server-rendered copy shown until the app starts (and to crawlers). */
.ssr {
  max-width: 760px;
  margin: 24px auto;
  padding: 0 16px;
}

/* AdSense marks units it couldn't fill (e.g. before approval): hide the empty box, label included. */
.ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  display: none;
}
