:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #efefed;
  --surface-3: #e7e7e3;
  --text: #171817;
  --muted: #73766f;
  --line: rgba(22, 24, 23, 0.11);
  --button-outline: rgba(22, 24, 23, 0.18);
  --primary: #ff5100;
  --primary-dark: #d83f00;
  --danger: #d83a3a;
  --shadow: 0 18px 44px rgba(20, 24, 21, 0.10);
  --shadow-soft: 0 10px 28px rgba(20, 24, 21, 0.08);
  --nav-bg: rgba(255, 255, 255, 0.78);
  --card-bg: rgba(255, 255, 255, 0.82);
  --glass-bg: rgba(255, 255, 255, 0.70);
  --focus-ring: rgba(255, 81, 0, 0.34);
  --icon-ink: #ffffff;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07080a;
  --surface: #0d0f10;
  --surface-2: #141617;
  --surface-3: #1a1d1f;
  --text: #f4f4f6;
  --muted: #a2a4a6;
  --line: rgba(255, 255, 255, 0.10);
  --button-outline: rgba(255, 255, 255, 0.18);
  --primary: #ff5100;
  --primary-dark: #ff7a3a;
  --danger: #ff6b6b;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 10px 34px rgba(0, 0, 0, 0.26);
  --nav-bg: rgba(10, 11, 12, 0.76);
  --card-bg: rgba(16, 17, 18, 0.82);
  --glass-bg: rgba(20, 22, 23, 0.70);
  --focus-ring: rgba(255, 81, 0, 0.42);
  --icon-ink: #ffffff;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent 320px),
    linear-gradient(90deg, color-mix(in srgb, #57c1ff 5%, transparent), transparent 38%, color-mix(in srgb, #59d499 5%, transparent)),
    var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-feature-settings: "calt", "kern", "liga", "ss03";
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.18);
}

.nav-inner {
  width: min(1240px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.nav-button,
.theme-button,
.login-button,
.segment,
.primary-button,
.secondary-button,
.preview-button,
.link-button,
.admin-button,
.preview-actions button,
.close-login {
  border: 0;
  background: transparent;
  color: inherit;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 88%, #ffffff), var(--primary-dark)),
    var(--primary);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(255, 81, 0, 0.28), inset 0 1px 0 rgba(255,255,255,0.28);
}

.brand-title {
  font-size: 18px;
  letter-spacing: 0;
}

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

.shortcut-help-button {
  width: 40px;
  padding: 0;
  font-size: 16px;
  font-weight: 950;
}

.update-bubble-button {
  position: relative;
  width: 40px;
  height: 40px;
  display: none;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--glass-bg);
  color: var(--primary);
  box-shadow: var(--shadow-soft);
}

.update-bubble-button[hidden] {
  display: none;
}

.update-bubble-icon {
  position: relative;
  width: 17px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 6px;
}

.update-bubble-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  bottom: -5px;
  width: 6px;
  height: 6px;
  border-left: 2px solid currentColor;
  transform: skewY(-35deg);
}

.update-bubble-button small {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--nav-bg);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.mobile-nav-wrap {
  display: none;
  position: relative;
}

.mobile-menu-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass-bg);
  box-shadow: var(--shadow-soft);
}

.mobile-menu-button span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.mobile-nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: 168px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.2);
}

.mobile-nav-menu button {
  position: relative;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text);
  text-align: left;
  font-weight: 800;
}

.nav-button[data-badge],
.mobile-nav-menu button[data-badge] {
  position: relative;
  padding-right: 34px;
}

.nav-button[data-badge]::after,
.mobile-nav-menu button[data-badge]::after {
  content: attr(data-badge);
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
  line-height: 18px;
}

.mobile-nav-menu button:hover,
.mobile-nav-menu button.active {
  background: var(--primary);
  color: #ffffff;
}

.nav-button,
.theme-button,
.login-button,
.secondary-button,
.segment {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 780;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.nav-button:hover,
.theme-button:hover,
.secondary-button:hover,
.segment:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-button.active,
.segment.active {
  background: var(--text);
  color: var(--bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 20px rgba(0, 0, 0, 0.08);
}

.login-button,
.primary-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 88%, #ffffff), var(--primary)),
    var(--primary);
  color: #ffffff;
  font-weight: 850;
  transition: background 0.18s ease, transform 0.18s ease;
  box-shadow: 0 14px 30px rgba(255, 81, 0, 0.24), inset 0 1px 0 rgba(255,255,255,0.22);
}

.login-button:hover,
.primary-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.main-area {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head,
.runner-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: color-mix(in srgb, var(--primary) 70%, var(--muted));
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 0.98;
  letter-spacing: 0;
  text-wrap: balance;
}

.section-summary {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.system-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 12px;
}

.system-stats div {
  padding: 15px 16px;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.12);
}

.system-stats span {
  display: block;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.system-stats small {
  color: var(--muted);
}

.control-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  margin-bottom: 22px;
}

.favorite-shelf,
.quick-shelf {
  margin: -6px 0 20px;
}

.quick-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quick-shelf-head button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.section-filter-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: -8px 0 20px;
  padding: 0 2px 8px;
  scrollbar-width: thin;
}

.section-filter-bar button {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-bg);
  color: var(--muted);
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}

.section-filter-bar button.active {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  background: #15130f;
  color: #fff8ed;
}

.section-filter-bar small {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.section-filter-bar button.active small {
  background: rgba(255, 255, 255, 0.16);
  color: #fff8ed;
}

.result-summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -10px 0 18px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--glass-bg) 72%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.result-summary button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-size: 12px;
  font-weight: 950;
}

.result-summary button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  color: var(--muted);
  opacity: 0.54;
}

.favorite-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.favorite-list button {
  min-width: 220px;
  min-height: 56px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass-bg);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.recent-shelf .favorite-list button {
  min-width: 190px;
  min-height: 52px;
}

.favorite-list strong,
.favorite-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-box {
  min-height: 54px;
  display: flex;
  align-items: center;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--line);
  padding: 0 20px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.12);
}

.search-box input,
.deploy-panel input,
.deploy-panel textarea,
.login-panel input {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.search-box button {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.search-box button:hover {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
}

.search-box input::placeholder,
.deploy-panel input::placeholder,
.deploy-panel textarea::placeholder,
.login-panel input::placeholder {
  color: var(--muted);
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.12);
}

.random-open-button {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--line));
  border-radius: 999px;
  background:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,0.46), transparent 26%),
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 90%, #fff), var(--primary));
  color: #fff8ed;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(255, 81, 0, 0.24);
}

.random-open-button:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.5;
}

.favorite-filter-button {
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-bg);
  color: var(--text);
  font-weight: 950;
  box-shadow: var(--shadow-soft);
}

.favorite-filter-button.active {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
}

.favorite-filter-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-preview {
  height: 172px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, transparent), transparent),
    var(--surface-2);
}

.product-glyph {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 32px;
  background: var(--surface);
  color: var(--primary);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px var(--line);
}

.card-body {
  padding: 18px;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.card-meta,
.card-link {
  color: var(--muted);
  font-size: 13px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.status-pill {
  color: var(--primary-dark);
  font-weight: 800;
}

.project-card h2 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.25;
}

.project-card p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.card-link {
  margin-top: auto;
  padding: 10px 0 14px;
  word-break: break-all;
}

.card-footer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}

.like-count {
  font-weight: 800;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-button,
.link-button,
.admin-button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
}

.preview-button:hover,
.link-button:hover {
  background: var(--text);
  color: var(--surface);
}

.admin-button {
  color: var(--danger);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border-radius: 18px;
  background: var(--glass-bg);
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.empty-state button {
  margin: 0 4px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font: inherit;
  cursor: pointer;
}

.deploy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.deploy-panel,
.hint-panel,
.login-panel {
  background: var(--glass-bg);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.15);
}

.deploy-panel {
  width: 100%;
  min-width: 0;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.deploy-panel h2,
.hint-title,
.login-panel h2 {
  margin: 0;
}

.deploy-panel .deploy-panel-head,
.deploy-panel .tag-fieldset,
.deploy-panel .url-field,
.deploy-panel .package-upload-field,
.deploy-panel .code-field {
  grid-column: 1 / -1;
}

.package-upload-field {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px dashed color-mix(in srgb, var(--primary) 34%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.package-upload-head,
.package-upload-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.package-upload-head {
  justify-content: space-between;
}

.package-upload-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.package-upload-head strong {
  color: var(--text);
  font-size: 14px;
}

.package-upload-head small,
.package-eligibility,
.package-selection,
.source-download-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.package-eligibility.is-eligible {
  color: color-mix(in srgb, #0a9b68 78%, var(--text));
}

.package-selection {
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.package-file-input {
  position: absolute;
  width: 1px !important;
  height: 1px;
  padding: 0 !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.file-select-button,
.clear-package-button {
  min-height: 36px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text) !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  white-space: nowrap;
  cursor: pointer;
}

.file-select-button:hover,
.clear-package-button:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
}

.package-upload-field.is-locked .file-select-button {
  pointer-events: none;
  opacity: 0.42;
}

.html-file-field {
  display: grid;
  gap: 10px;
}

.code-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.html-file-field.is-locked .file-select-button {
  pointer-events: none;
  opacity: 0.42;
}

.package-upload-field .inline-check {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
}

.package-upload-field .inline-check input,
.source-download-panel .inline-check input {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.remove-package-check {
  color: var(--danger) !important;
}

.upload-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.upload-progress progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  accent-color: var(--primary);
}

.upload-progress span {
  max-width: min(48vw, 420px);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.deploy-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.deploy-panel-head .primary-button {
  min-width: 150px;
}

.deploy-panel label:nth-of-type(4),
.deploy-panel label:nth-of-type(5) {
  grid-column: span 2;
}

.deploy-panel label,
.login-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.deploy-panel label.is-locked,
.edit-panel label.is-locked {
  opacity: 0.62;
}

.deploy-panel input:disabled,
.deploy-panel textarea:disabled,
.edit-panel input:disabled,
.edit-panel textarea:disabled {
  cursor: not-allowed;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  color: var(--muted);
}

.deploy-panel input,
.deploy-panel textarea,
.deploy-panel select,
.login-panel input,
.login-panel textarea,
.edit-panel select {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
  color: var(--text);
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.deploy-panel input:focus,
.deploy-panel textarea:focus,
.deploy-panel select:focus,
.login-panel input:focus,
.login-panel textarea:focus,
.edit-panel select:focus {
  border-color: color-mix(in srgb, var(--primary) 48%, var(--line));
  box-shadow: 0 0 0 4px var(--focus-ring);
  background: var(--surface);
}

.code-input {
  font-family: "Cascadia Mono", Consolas, monospace;
}

.hint-panel {
  padding: 24px;
}

.hint-panel[hidden] {
  display: none;
}

.hint-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.user-table {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  max-height: 234px;
  overflow-y: auto;
  padding-right: 6px;
}

.admin-search-input {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.user-row strong {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-row span {
  color: var(--muted);
  font-size: 13px;
}

.user-actions {
  display: flex;
  gap: 8px;
}

.user-actions button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.user-actions button:last-child {
  color: var(--danger);
}

.alias-button {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--button-outline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.alias-button:hover {
  border-color: color-mix(in srgb, var(--primary) 52%, var(--button-outline));
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.user-admin-section {
  scroll-margin-top: 92px;
}

.tag-fieldset {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.tag-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 800;
}

.tag-picker,
.tag-admin-list,
.admin-panel {
  display: grid;
  gap: 12px;
}

.access-log-list {
  display: flex;
  align-items: stretch;
  gap: 12px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: 8px 2px 14px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.admin-section-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.source-download-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.source-download-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(220px, 1.2fr) minmax(280px, 2fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
}

.source-download-row span,
.source-download-row small {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .source-download-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.tag-group,
.tag-admin-group,
.log-group,
.log-row {
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.log-group {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  flex: 0 0 clamp(300px, 30vw, 390px);
  width: clamp(300px, 30vw, 390px);
  height: clamp(420px, 56vh, 560px);
  min-width: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  scroll-snap-align: start;
}

.log-group-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
  padding: 0 2px 2px;
}

.log-group-title > div > strong,
.log-group-title > span {
  display: block;
}

.log-group-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.log-group-title > div {
  min-width: 0;
}

.log-group-title small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.log-group-title > small,
.log-group-title > .group-signals {
  grid-column: 1 / -1;
  margin-top: -4px;
}

.visitor-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.visitor-signal-row.compact {
  margin-top: 2px;
}

.visitor-signal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.visitor-signal.device {
  background: color-mix(in srgb, var(--text) 6%, var(--surface));
}

.visitor-signal b {
  color: var(--primary);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.log-group-title > span {
  flex: 0 0 auto;
  max-width: 48%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
}

.log-group-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 2px 8px 2px 0;
  scrollbar-width: thin;
}

.log-group .log-row {
  flex: 0 0 auto;
  display: grid;
  gap: 5px;
  min-height: 0;
  padding: 12px 14px;
  background: var(--surface);
  overflow: visible;
  overflow-wrap: anywhere;
  line-height: 1.38;
}

.log-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.log-row-head > span {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.dwell-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.dwell-badge span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.dwell-badge strong {
  color: var(--primary);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.log-group .log-row strong,
.log-group .log-row span,
.log-group .log-row small {
  min-width: 0;
  white-space: normal;
}

.log-group .log-row small {
  color: var(--muted);
}

.tag-picker .tag-group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.tag-picker .tag-group strong {
  flex: 0 0 auto;
  min-width: 72px;
  color: var(--muted);
  font-size: 13px;
}

.tag-options,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--tag-color, var(--primary)) 18%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--tag-color, var(--primary)) 12%, var(--surface));
  color: color-mix(in srgb, var(--tag-color, var(--primary)) 72%, var(--text));
  font-size: 12px;
  font-weight: 850;
}

.tag-list span::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--tag-color, var(--primary));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-color, var(--primary)) 14%, transparent);
}

.tag-list [data-filter-section],
.tag-list [data-filter-tag] {
  cursor: pointer;
}

.tag-list [data-filter-section]:hover,
.tag-list [data-filter-tag]:hover,
.tag-list [data-filter-section]:focus-visible,
.tag-list [data-filter-tag]:focus-visible {
  border-color: var(--tag-color, var(--primary));
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tag-color, var(--primary)) 16%, transparent);
}

.tag-options label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.tag-options label span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.tag-options input[type="checkbox"] {
  position: absolute;
  width: 1px;
  min-width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.tag-options label:has(input:checked) span {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(255, 81, 0, 0.20);
}

.tag-list button,
.tag-admin-title button {
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.tag-options label span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--tag-color, var(--primary));
}

.tag-options label:has(input:checked) span::before {
  background: #ffffff;
}

.tag-admin-list .tag-list span i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.tag-list .tag-admin-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 8px;
}

.tag-list .tag-admin-item::before {
  display: none;
}

.tag-admin-item b {
  font: inherit;
}

.color-menu {
  position: relative;
}

.color-menu summary {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--swatch);
  color: transparent;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.45);
}

.color-menu summary::-webkit-details-marker {
  display: none;
}

.color-menu summary::before {
  display: none;
}

.color-menu-options {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: 180px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.color-menu-options .color-preset {
  width: 26px;
  height: 26px;
}

.admin-panel {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.invite-admin-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.invite-code-list {
  max-height: 234px;
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 6px;
}

.invite-code-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.invite-code-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.invite-code-card strong,
.invite-code-card span {
  display: block;
}

.invite-code-card span,
.invite-code-card p {
  color: var(--muted);
  font-size: 12px;
}

.invite-code-card p {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.admin-panel h2 {
  margin: 0;
  font-size: 17px;
}

.admin-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-section-title .secondary-button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--button-outline);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 850;
}

.admin-title-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-view.active {
  display: block;
}

.visitor-logs-view.active {
  display: block;
}

.visitor-logs-view .section-head {
  align-items: flex-end;
}

.visitor-logs-view .section-head p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.visitor-log-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.visitor-log-panel {
  display: grid;
  gap: 14px;
}

.visitor-log-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.visitor-range-filter {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.visitor-range-filter button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.visitor-range-filter button:hover {
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.visitor-range-filter button:active {
  transform: translateY(1px);
}

.visitor-range-filter button.active {
  background: var(--primary);
  color: #ffffff;
}

.visitor-alias-button {
  margin: 6px 0 0;
}

.dashboard-stats.visitor-log-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.visitor-log-list {
  padding-top: 2px;
}

@media (max-width: 760px) {
  .visitor-logs-view .section-head {
    align-items: stretch;
  }

  .visitor-log-actions {
    justify-content: stretch;
  }

  .visitor-log-actions button {
    flex: 1 1 0;
  }

  .dashboard-stats.visitor-log-stats {
    grid-template-columns: 1fr;
  }

  .visitor-log-filters {
    grid-template-columns: 1fr;
  }

  .visitor-log-filters .admin-search-input {
    grid-column: 1 / -1;
  }

  .visitor-range-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .visitor-range-filter button {
    min-width: 0;
    padding: 0 6px;
  }

  .visitor-log-list .log-group {
    flex-basis: min(88vw, 360px);
    width: min(88vw, 360px);
  }

  .visitor-log-list .log-group-title {
    flex-direction: column;
    gap: 4px;
  }

  .visitor-log-list .log-group-title span {
    max-width: 100%;
    text-align: left;
  }
}

.admin-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.admin-dashboard > * {
  min-width: 0;
}

.admin-anchor-nav {
  position: sticky;
  top: 70px;
  z-index: 18;
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
  padding: 7px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  scrollbar-width: thin;
}

.admin-anchor-nav button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 12px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.admin-anchor-nav button:hover,
.admin-anchor-nav button:focus-visible {
  outline: none;
  background: var(--surface-2);
  color: var(--primary);
}

.admin-anchor-target,
#userAdminSection,
#inviteAdminSection {
  scroll-margin-top: 126px;
}

.dashboard-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--glass-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.15);
}

.dashboard-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.dashboard-stats div {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 82%, var(--primary) 7%), var(--surface-2)),
    var(--surface-2);
}

.dashboard-stats [data-admin-open] {
  cursor: pointer;
}

.dashboard-stats [data-admin-open]:hover {
  outline: 3px solid var(--focus-ring);
  transform: translateY(-1px);
}

.dashboard-stats strong {
  color: var(--primary);
  font-size: 28px;
  line-height: 1;
}

.dashboard-stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.visit-chart,
.audit-list {
  display: grid;
  gap: 10px;
}

.live-visitors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.live-visitors div {
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.live-visitors strong,
.live-visitors span,
.live-visitors small {
  display: block;
}

.live-visitors span,
.live-visitors small {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-visitors small {
  color: var(--primary);
  font-weight: 850;
}

.visit-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(90px, 1fr) 36px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.visit-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visit-row i {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.visit-row i::before {
  content: "";
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.visit-row b {
  color: var(--text);
  text-align: right;
}

.audit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.audit-item strong,
.audit-item span {
  display: block;
}

.audit-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.audit-item p {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.audit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.audit-actions button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
}

.audit-actions button:first-child {
  background: var(--primary);
  color: #ffffff;
}

.community-admin-panel {
  grid-column: 1 / -1;
}

.admin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.admin-form input,
.admin-form select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
}

.admin-form input[type="color"],
.tag-list input[type="color"] {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 2px;
}

.section-create-form {
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.inline-check input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--primary);
}

.section-admin-list,
.section-assign-list {
  display: grid;
  gap: 8px;
}

.section-assign-list {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.section-assign-search {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.section-admin-item,
.section-assign-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

.section-assign-item {
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: start;
  padding: 10px;
}

.section-assign-thumb {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--section-app-accent), color-mix(in srgb, var(--section-app-accent) 48%, #181818));
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.section-assign-copy {
  min-width: 0;
  align-self: center;
}

.section-assign-copy strong,
.section-assign-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-assign-item select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  grid-column: 1 / -1;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

@media (max-width: 760px) {
  .section-create-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

.section-admin-item strong,
.section-assign-item strong {
  display: block;
}

.section-admin-item span,
.section-assign-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.section-admin-item button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--danger);
  font-weight: 900;
}

.color-field {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.color-field input[type="color"] {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.color-field input[type="color"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.color-field .color-presets {
  position: static;
  width: auto;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.tag-create-form .color-presets,
.color-menu-options .color-presets {
  position: static;
  width: auto;
  max-width: none;
  display: flex;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.color-preset {
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--swatch) 62%, #000);
  border-radius: 999px;
  background: var(--swatch, #ff5100) !important;
  background-color: var(--swatch, #ff5100) !important;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.12);
}

.color-preset.active {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.tag-create-form {
  grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1fr) 38px;
}

.tag-create-form .color-presets {
  grid-column: 1 / -1;
  max-width: 100%;
  flex-wrap: wrap;
}

.tag-create-form button {
  grid-column: 2 / -1;
  justify-self: end;
  min-width: 108px;
}

.tag-create-form .color-preset {
  grid-column: auto;
  justify-self: auto;
  min-width: 28px;
}

.tag-admin-title {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.tag-admin-title strong {
  margin-right: auto;
}

.log-row strong {
  display: block;
  font-size: 16px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.log-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.log-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.preview-dialog,
.login-dialog {
  width: min(1120px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.preview-dialog::backdrop,
.login-dialog::backdrop {
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(6px);
}

.preview-frame {
  height: min(820px, calc(100vh - 34px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
}

.preview-head {
  min-height: 76px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.preview-head h2 {
  margin: 0;
}

.preview-actions {
  display: flex;
  gap: 8px;
}

.preview-actions button,
.close-login {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 800;
}

#previewIframe,
.runner-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.runner-frame-wrap {
  position: relative;
  min-height: 520px;
}

.runner-frame-wrap .runner-iframe {
  display: block;
}

.guest-interaction-guard {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.guest-interaction-guard span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.project-runner-view.is-guest-locked .guest-interaction-guard {
  display: block;
}

.guest-interaction-guard:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -6px;
}

.project-runner-view.active {
  display: grid;
  min-height: calc(100vh - 128px);
  grid-template-rows: auto auto minmax(520px, 1fr) auto auto;
  gap: 12px;
}

.runner-head {
  align-items: center;
}

.runner-head h1 {
  font-size: clamp(26px, 4vw, 42px);
}

.login-dialog {
  width: min(440px, calc(100vw - 28px));
}

.source-download-dialog {
  width: min(560px, calc(100vw - 28px));
}

.load-diagnostics-dialog {
  width: min(720px, calc(100vw - 28px));
}

.load-diagnostics-panel .eyebrow {
  margin: 0 0 -8px;
}

.load-diagnostics-meta,
.load-diagnostics-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.load-diagnostics-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.load-diagnostics-stats div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.load-diagnostics-stats strong,
.load-diagnostics-stats span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.load-diagnostics-stats strong {
  color: var(--primary);
  font-size: 17px;
}

.load-diagnostics-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.slow-resource-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.slow-resource-list {
  display: grid;
  gap: 6px;
}

.slow-resource-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.slow-resource-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slow-resource-item span {
  color: var(--primary);
  font-weight: 850;
}

.slow-resource-item small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.empty-resource-state {
  margin: 0;
  padding: 16px 0;
  color: var(--muted);
}

.source-download-panel .eyebrow {
  margin: 0 0 -8px;
}

.source-download-panel {
  min-width: 0;
  overflow: hidden;
}

.source-download-panel > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.source-download-panel .inline-check {
  min-width: 0;
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
  white-space: normal;
}

.source-download-panel .inline-check span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.login-panel {
  position: relative;
  padding: 28px;
  display: grid;
  gap: 16px;
}

.close-login {
  position: absolute;
  right: 14px;
  top: 14px;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.browser-hint {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.auth-message {
  display: none;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  color: var(--text);
  font-weight: 800;
}

.auth-message.show {
  display: block;
}

.auth-message[data-type="error"] {
  background: color-mix(in srgb, var(--danger) 18%, var(--surface));
  color: var(--danger);
}

.auth-message[data-type="warn"] {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface));
}

.shortcut-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.shortcut-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft);
}

.shortcut-list dt {
  min-width: 64px;
  font-weight: 900;
  color: var(--primary);
}

.shortcut-list dd {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.user-watermark {
  position: fixed;
  inset: 0;
  z-index: 92;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: 140px;
  gap: 0;
  overflow: hidden;
  opacity: 0.04;
  color: var(--text);
  mix-blend-mode: multiply;
}

html[data-theme="dark"] .user-watermark {
  color: #ffffff;
  mix-blend-mode: screen;
}

.user-watermark span {
  align-self: center;
  justify-self: center;
  transform: translateX(var(--wm-shift, 0)) rotate(-24deg);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.toast {
  position: fixed;
  left: 50%;
  top: 18px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 36px));
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(255, 81, 0, 0.28);
  transform: translate(-50%, -24px);
  opacity: 0;
  transition: 0.22s ease;
  font-weight: 900;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 860px) {
  .user-watermark {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    grid-auto-rows: 44px;
  }

  .user-watermark span {
    transform: translateX(calc(var(--wm-shift, 0) * 0.45)) rotate(-24deg);
    font-size: 9px;
  }

  .nav-inner,
  .main-area {
    width: min(100% - 24px, 1240px);
  }

  .section-head,
  .runner-head {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-inner {
    min-height: 56px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px;
  }

  .control-strip,
  .deploy-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .deploy-panel,
  .edit-panel {
    grid-template-columns: 1fr;
  }

  .deploy-panel label:nth-of-type(4),
  .deploy-panel label:nth-of-type(5) {
    grid-column: 1;
  }

  .admin-dashboard,
  .dashboard-stats {
    grid-template-columns: 1fr;
  }

  .mobile-nav-wrap {
    display: block;
    margin-left: auto;
  }

  .nav-actions .nav-button,
  .nav-actions .theme-button {
    display: none;
  }

  .login-button {
    width: auto;
    min-width: 0;
    padding: 0 14px;
    font-size: 13px;
  }

  .system-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: min(100%, 280px);
  }

}

@media (max-width: 520px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
  }

  .card-footer {
    grid-template-columns: 1fr;
  }

  .card-actions {
    justify-content: stretch;
  }

  .card-actions button {
    flex: 1;
  }

  .tag-picker .tag-group,
  .audit-item,
  .visit-row {
    grid-template-columns: 1fr;
  }

  .tag-picker .tag-group {
    display: grid;
  }

  .deploy-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .audit-actions {
    justify-content: stretch;
  }

  .audit-actions button {
    flex: 1;
  }
}

/* App-store community layout */
.project-grid {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  align-items: stretch;
  grid-auto-rows: auto;
}

.project-card.app-tile {
  position: relative;
  height: auto;
  min-height: 142px;
  display: grid;
  grid-template-rows: minmax(76px, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 92%, var(--app-accent, var(--primary)) 8%), var(--card-bg)),
    var(--surface);
  box-shadow: var(--shadow-soft);
  transform: none;
  backdrop-filter: blur(18px) saturate(1.12);
}

.project-card.app-tile:hover {
  border-color: color-mix(in srgb, var(--app-accent, var(--primary)) 38%, var(--line));
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(20, 24, 21, 0.12);
}

.project-card.app-tile.is-locked {
  border-style: dashed;
}

.project-card.app-tile.is-locked .app-icon {
  filter: saturate(0.72);
  opacity: 0.78;
}

.app-launch {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  touch-action: manipulation;
}

.app-launch:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 6px;
}

.app-icon {
  position: relative;
  width: 62px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--app-accent, var(--primary)) 92%, #ffffff), color-mix(in srgb, var(--app-accent, var(--primary)) 64%, #111111)),
    var(--app-accent, var(--primary));
  color: var(--icon-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -18px 28px rgba(0, 0, 0, 0.16),
    0 12px 26px color-mix(in srgb, var(--app-accent, var(--primary)) 24%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.app-icon::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  pointer-events: none;
}

.app-icon i,
.app-icon em {
  position: absolute;
  display: block;
  font-style: normal;
}

.app-icon small {
  position: absolute;
  right: 7px;
  bottom: 6px;
  max-width: 42px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.94);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  text-align: right;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.28);
}

.app-icon-tool i {
  width: 28px;
  height: 22px;
  left: 13px;
  top: 13px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 8px;
  transform: rotate(-18deg);
}

.app-icon-tool em {
  width: 22px;
  height: 3px;
  left: 14px;
  top: 31px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 11px -13px 0 rgba(255, 255, 255, 0.52);
}

.app-icon-visual i {
  width: 31px;
  height: 31px;
  left: 12px;
  top: 12px;
  border: 4px solid rgba(255, 255, 255, 0.90);
  border-radius: 50%;
}

.app-icon-visual em {
  width: 14px;
  height: 14px;
  left: 33px;
  top: 13px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.78);
  transform: rotate(16deg);
}

.app-icon-play i {
  left: 20px;
  top: 15px;
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 23px solid rgba(255, 255, 255, 0.92);
}

.app-icon-play em {
  width: 7px;
  height: 7px;
  left: 12px;
  top: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 34px 28px 0 rgba(255, 255, 255, 0.42);
}

.app-icon-orbit i {
  width: 34px;
  height: 20px;
  left: 12px;
  top: 18px;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  transform: rotate(-24deg);
}

.app-icon-orbit em {
  width: 12px;
  height: 12px;
  left: 27px;
  top: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}

.app-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.app-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 44px;
}

.app-title-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.like-count-display {
  position: absolute;
  top: 14px;
  right: 14px;
  margin-left: 0;
  padding: 2px 0;
  border-radius: 999px;
  color: color-mix(in srgb, #ff3d2e 84%, var(--text));
  font-weight: 900;
  white-space: nowrap;
  user-select: none;
}

.heat-count-display {
  flex: 0 0 auto;
  max-width: 78px;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-author,
.app-desc,
.app-access-note {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.app-author[data-filter-author] {
  cursor: pointer;
}

.app-author[data-filter-author]:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-desc {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.app-access-note {
  color: color-mix(in srgb, var(--app-accent, var(--primary)) 70%, var(--muted));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-chip.is-pending {
  color: var(--muted);
}

.app-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  margin: 0 0 0 76px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.app-meta-row .tag-list {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  margin-top: 0;
  white-space: nowrap;
}

.app-meta-row .tag-list span {
  flex: 0 0 auto;
}

.tag-list .tag-more {
  min-width: 30px;
  justify-content: center;
  background: var(--surface-2);
  color: var(--muted);
}

.comment-count-display {
  flex: 0 0 auto;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.share-button,
.report-button,
.favorite-card-button,
.app-meta-row .admin-button {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--app-accent, var(--primary)) 30%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--app-accent, var(--primary)) 8%, var(--surface));
  color: var(--app-accent, var(--primary));
  font-weight: 900;
}

.report-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.favorite-card-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.favorite-card-button.active {
  border-color: color-mix(in srgb, var(--app-accent, var(--primary)) 34%, var(--line));
  background: color-mix(in srgb, var(--app-accent, var(--primary)) 12%, var(--surface));
  color: var(--app-accent, var(--primary));
}

.app-meta-row .admin-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--danger);
}

.share-button:hover,
.report-button:hover,
.favorite-card-button:hover,
.app-meta-row .admin-button:hover {
  background: var(--app-accent, var(--primary));
  color: #ffffff;
}

.card-preview,
.card-link {
  display: none;
}

.app-browser-head {
  align-items: center;
  margin-bottom: 12px;
}

.runner-copy {
  min-width: 0;
  flex: 1;
}

.runner-copy h1 {
  overflow: hidden;
  margin-bottom: 0;
  font-size: clamp(22px, 4vw, 34px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runner-dwell-report {
  min-height: 38px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  color: var(--muted);
  font-size: 12px;
}

.runner-dwell-report[hidden] {
  display: none;
}

.runner-dwell-report-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: dwell-report-barrage 22s linear infinite;
}

.runner-dwell-report-copy {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 48px 0 14px;
  white-space: nowrap;
}

.runner-dwell-report:hover .runner-dwell-report-track {
  animation-play-state: paused;
}

.runner-dwell-report-copy span {
  color: var(--primary);
  font-weight: 850;
}

.runner-dwell-report-copy strong,
.runner-dwell-report-copy b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

@keyframes dwell-report-barrage {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .runner-dwell-report-track {
    animation: none;
  }

  .runner-dwell-report-copy[aria-hidden="true"] {
    display: none;
  }
}

.project-runner-view.is-page-fullscreen .runner-dwell-report {
  display: none;
}

.runner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.runner-actions .secondary-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--button-outline);
  border-radius: 12px;
  background: var(--glass-bg);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.runner-actions .secondary-button:hover {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--line));
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  color: var(--primary);
}

.runner-actions .secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app-tab-strip {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 5px 0 12px;
  scrollbar-width: thin;
}

.app-tab {
  min-width: 132px;
  max-width: 240px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass-bg);
  color: var(--muted);
  font-weight: 850;
}

.app-tab.active {
  border-color: color-mix(in srgb, var(--primary) 56%, var(--line));
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--text);
}

.app-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tab i {
  width: 22px;
  height: 22px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  font-style: normal;
}

.app-tab i:hover {
  background: var(--surface-2);
  color: var(--text);
}

.app-tab-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.project-runner-view.active {
  min-height: calc(100vh - 118px);
  grid-template-rows: auto auto minmax(520px, 1fr) auto auto;
}

.runner-page-fullscreen {
  overflow: hidden;
}

.runner-page-fullscreen .top-nav {
  display: none;
}

.project-runner-view.is-page-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: 1fr;
  min-height: 100vh;
  padding: 0;
  background: #000000;
}

.project-runner-view.is-page-fullscreen .runner-head,
.project-runner-view.is-page-fullscreen .app-tab-strip,
.project-runner-view.is-page-fullscreen .comment-panel {
  display: none;
}

.project-runner-view.is-page-fullscreen .runner-frame-wrap,
.project-runner-view.is-page-fullscreen .runner-iframe {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
}

.project-runner-view.is-page-fullscreen .runner-iframe {
  border: 0;
  border-radius: 0;
}

.page-fullscreen-exit {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 95;
  width: 48px;
  height: 72px;
  display: none;
  place-items: center;
  border: 1px solid rgba(220, 220, 220, 0.54);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  background: rgba(228, 228, 228, 0.36);
  color: rgba(36, 36, 36, 0.78);
  font-size: 22px;
  line-height: 1;
  opacity: 0.64;
  transform: translate(34px, -50%);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.project-runner-view.is-page-fullscreen .page-fullscreen-exit {
  display: grid;
}

.page-fullscreen-exit:hover,
.page-fullscreen-exit:focus-visible {
  opacity: 1;
  background: rgba(242, 242, 242, 0.68);
  transform: translate(0, -50%);
}

.comment-barrage {
  position: fixed;
  top: 0;
  left: 0;
  right: 56px;
  z-index: 90;
  height: 126px;
  display: none;
  pointer-events: none;
  overflow: hidden;
}

.project-runner-view.is-page-fullscreen .comment-barrage {
  display: block;
}

.comment-barrage span {
  position: absolute;
  top: var(--top, 10px);
  right: 12px;
  width: max-content;
  max-width: min(640px, calc(100vw - 92px));
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(12, 12, 12, 0.62);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  opacity: 0;
  animation: barrage-slide 16s linear infinite;
  animation-delay: var(--delay, 0s);
  animation-fill-mode: both;
}

@keyframes barrage-slide {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  5% {
    opacity: 1;
    transform: translateX(0);
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(calc(-100vw - 100%));
  }
}

.runner-iframe {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #000000;
  box-shadow: var(--shadow);
}

.comment-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--glass-bg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.12);
}

.comment-panel[hidden] {
  display: none;
}

.comment-panel-head,
.comment-form,
.comment-item footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-panel-head {
  justify-content: space-between;
}

.comment-panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-panel-tools button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 850;
}

.comment-panel-tools button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.comment-panel h2 {
  margin: 0;
  font-size: 18px;
}

.comment-panel-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.comment-form input {
  min-height: 42px;
  flex: 1;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
  color: var(--text);
}

.comment-form.is-guest-locked input {
  cursor: pointer;
}

.comment-limit-text {
  min-width: 44px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.comment-limit-text.is-warning {
  color: var(--primary);
}

.comment-form button {
  min-width: 88px;
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 72%, var(--surface-2));
}

.comment-item.is-focused {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 81, 0, 0.14);
}

.comment-item div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.comment-item span {
  color: var(--muted);
  font-size: 12px;
}

.comment-item p {
  margin: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.comment-item footer button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 850;
}

.related-app-list {
  display: grid;
  gap: 10px;
}

.related-app-head {
  padding-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.related-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.related-app-grid button {
  min-height: 58px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 76%, var(--surface-2));
  color: var(--text);
  text-align: left;
}

.related-app-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hardware-dialog {
  width: min(620px, calc(100vw - 28px));
}

.share-dialog {
  width: min(500px, calc(100vw - 28px));
}

.edit-dialog {
  width: min(920px, calc(100vw - 28px));
}

.share-panel {
  text-align: center;
}

.edit-panel {
  max-height: min(860px, calc(100vh - 28px));
  overflow: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.edit-panel h2,
.edit-panel .tag-fieldset,
.edit-panel .url-field,
.edit-panel .package-upload-field,
.edit-panel .code-field,
.edit-panel > .primary-button {
  grid-column: 1 / -1;
}

.edit-panel > .primary-button {
  justify-self: end;
  width: min(220px, 100%);
}

.edit-panel textarea {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  outline: none;
  resize: vertical;
}

.edit-panel .code-input {
  min-height: 320px;
}

.code-field .code-input {
  min-height: 260px;
  resize: vertical;
}

.share-link-text {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.qr-box {
  width: min(300px, 80vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 4px auto 2px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.qr-box img {
  width: 100%;
  height: 100%;
  display: block;
}

.share-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.share-actions .secondary-button {
  min-height: 44px;
  padding: 0 14px;
  min-width: 150px;
}

.hardware-panel {
  max-height: min(760px, calc(100vh - 28px));
}

.hardware-content {
  max-height: min(480px, 56vh);
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  font: 12px/1.55 "Cascadia Mono", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 860px) {
  .project-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    grid-auto-rows: auto;
  }

  .project-card.app-tile {
    min-height: 146px;
    padding: 12px;
  }

  .app-launch {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
  }

  .app-icon {
    width: 56px;
    border-radius: 16px;
    font-size: 15px;
  }

  .app-icon.glyph-1 {
    font-size: 21px;
  }

  .app-meta-row {
    margin-left: 68px;
    gap: 6px;
  }

  .share-button,
  .report-button,
  .favorite-card-button,
  .app-meta-row .admin-button {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
  }

  .app-browser-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .runner-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .runner-actions .secondary-button {
    min-width: 0;
    padding: 0 10px;
  }

  .project-runner-view.active {
    min-height: max(520px, calc(100vh - 104px));
  }
}

.mobile-filter-button {
  display: none;
}

@media (max-width: 560px) {
  .main-area {
    padding-top: 22px;
  }

  .nav-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-button {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  h1 {
    font-size: clamp(38px, 14vw, 50px);
  }

  .system-stats {
    width: 100%;
  }

  .system-stats div {
    padding: 12px;
  }

  .control-strip {
    gap: 10px;
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    grid-auto-rows: auto;
  }

  .project-card.app-tile {
    min-height: 138px;
    padding: 14px;
  }

  .app-launch {
    grid-template-columns: 62px minmax(0, 1fr);
    min-height: 74px;
    gap: 14px;
  }

  .app-icon {
    width: 62px;
    font-size: 14px;
  }

  .app-icon.glyph-1 {
    font-size: 20px;
  }

  .app-title-row strong {
    font-size: 16px;
  }

  .like-count-display,
  .app-author,
  .app-desc {
    font-size: 12px;
  }

  .app-meta-row {
    margin-left: 76px;
    display: flex;
    align-items: center;
  }

  .share-actions {
    grid-template-columns: 1fr;
  }

  .tag-options label,
  .tag-list span {
    min-height: 28px;
    padding: 0 9px;
    font-size: 12px;
  }

  .app-meta-row .tag-list span {
    min-height: 24px;
    padding: 0 7px;
    font-size: 11px;
  }

  .app-meta-row .tag-list {
    display: flex;
    gap: 4px;
  }

  .share-button,
  .report-button,
  .favorite-card-button,
  .app-meta-row .admin-button {
    min-width: 40px;
    padding: 0 7px;
  }

  .runner-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .load-diagnostics-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-tab {
    min-width: 116px;
    max-width: 168px;
  }

  .runner-iframe {
    border-radius: 12px;
  }
}

/* frontend-design refresh: orange instrument-panel UI, CSS-only so app logic stays untouched. */
:root {
  --bg: #f2f0ea;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-2: #ebe8df;
  --surface-3: #ded9cd;
  --text: #17130f;
  --muted: #706a60;
  --line: rgba(34, 28, 22, 0.13);
  --button-outline: rgba(34, 28, 22, 0.18);
  --nav-bg: rgba(248, 246, 239, 0.78);
  --card-bg: rgba(255, 255, 255, 0.9);
  --glass-bg: rgba(255, 255, 255, 0.68);
  --shadow: 0 24px 70px rgba(28, 22, 16, 0.14);
  --shadow-soft: 0 16px 38px rgba(28, 22, 16, 0.09);
}

html[data-theme="dark"] {
  --bg: #080806;
  --surface: rgba(18, 18, 15, 0.9);
  --surface-2: #171713;
  --surface-3: #222119;
  --text: #f7f1e6;
  --muted: #aaa397;
  --line: rgba(255, 241, 220, 0.12);
  --button-outline: rgba(255, 241, 220, 0.2);
  --nav-bg: rgba(9, 9, 7, 0.78);
  --card-bg: rgba(19, 19, 16, 0.9);
  --glass-bg: rgba(22, 22, 18, 0.72);
  --shadow: 0 28px 76px rgba(0, 0, 0, 0.48);
  --shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.32);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(20, 185, 129, 0.12), transparent 24rem),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 46%, transparent), transparent 30rem),
    var(--bg);
  font-family: "Alibaba PuHuiTi", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.42), transparent 72%);
}

.top-nav {
  box-shadow: 0 1px 0 var(--line), 0 18px 42px rgba(20, 16, 12, 0.08);
}

.brand {
  gap: 12px;
}

.brand::before {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background:
    linear-gradient(135deg, #ffffff 0 20%, transparent 21%),
    linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 12px 28px rgba(255, 81, 0, 0.28), inset 0 0 0 1px rgba(255,255,255,0.35);
}

.brand-title {
  font-size: 19px;
  font-weight: 950;
}

.nav-button,
.theme-button,
.segment,
.secondary-button {
  border: 1px solid transparent;
}

.nav-button.active,
.segment.active {
  background: #15130f;
  color: #fff8ed;
  box-shadow: 0 10px 24px rgba(20, 16, 12, 0.18);
}

html[data-theme="dark"] .nav-button.active,
html[data-theme="dark"] .segment.active {
  background: #fff3e7;
  color: #15110d;
}

.login-button,
.primary-button {
  border-radius: 999px;
  box-shadow: 0 16px 34px rgba(255, 81, 0, 0.28), inset 0 1px 0 rgba(255,255,255,0.28);
}

.main-area {
  width: min(1320px, calc(100% - 42px));
}

.section-head {
  position: relative;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass-bg) 82%, var(--primary) 8%), var(--glass-bg)),
    var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(1.12);
}

.section-head::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: 18px;
  width: min(38vw, 420px);
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.36;
}

.update-message-bar {
  display: grid;
  gap: 10px;
}

.update-message-bar[hidden] {
  display: none;
}

.update-message-bar article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
  box-shadow: var(--shadow-soft);
}

.update-message-bar article.is-restore {
  min-height: 40px;
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-2));
}

.update-message-bar strong {
  color: var(--primary);
  font-size: 13px;
  font-weight: 950;
}

.update-message-bar span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-message-bar button {
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--button-outline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 950;
}

@media (max-width: 1319px) {
  .update-bubble-button:not([hidden]) {
    display: grid;
  }

  .shortcut-help-button {
    display: none;
  }

  .update-message-bar:not([hidden]) {
    position: fixed;
    top: 80px;
    right: 18px;
    z-index: 70;
    width: min(430px, calc(100% - 36px));
    max-height: min(68vh, 560px);
    padding: 10px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(1.15);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .update-message-bar.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .update-message-bar article {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .update-message-bar span {
    line-height: 1.45;
    white-space: normal;
  }
}

@media (max-width: 860px) {
  .update-message-bar:not([hidden]) {
    top: 66px;
    right: 12px;
    width: min(410px, calc(100% - 24px));
    max-height: calc(100vh - 82px);
  }
}

.eyebrow {
  color: var(--primary);
  letter-spacing: 0.08em;
}

h1 {
  font-size: clamp(40px, 6.4vw, 76px);
  font-weight: 950;
}

.system-stats div,
.search-box,
.segmented,
.dashboard-panel,
.deploy-panel,
.login-panel,
.comment-panel,
.preview-frame,
.hardware-content {
  border-color: var(--line);
  background: var(--glass-bg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px) saturate(1.15);
}

.system-stats div {
  min-width: 112px;
  border-radius: 22px;
}

.system-stats span {
  color: var(--primary);
}

.search-box {
  min-height: 58px;
  border-radius: 999px;
}

.project-grid {
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.project-card.app-tile {
  min-height: 166px;
  padding: 16px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card-bg) 94%, var(--primary) 3%), var(--card-bg)),
    var(--surface);
  box-shadow: 0 18px 44px rgba(28, 22, 16, 0.08);
}

.project-card.app-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--app-accent, var(--primary)) 62%, #fff), transparent);
  opacity: 0.86;
}

.project-card.app-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 58px rgba(28, 22, 16, 0.15);
}

.app-icon {
  border-radius: 20px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,0.55), transparent 28%),
    linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--app-accent, var(--primary)) 38%, #14110e));
}

.app-icon small {
  right: auto;
  bottom: auto;
  max-width: 46px;
  font-size: 13px;
  line-height: 1.05;
  text-align: center;
}

.app-title-row strong {
  font-size: 17px;
}

.app-access-note {
  padding-top: 2px;
  font-weight: 800;
}

.tag-list span,
.share-button,
.report-button,
.favorite-card-button,
.app-meta-row .admin-button {
  border-radius: 999px;
}

.section-admin-item,
.section-assign-item,
.user-row,
.invite-code-card,
.tag-admin-group,
.log-group {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 76%, var(--surface-2));
}

.section-admin-item,
.section-assign-item {
  border-radius: 18px;
}

.runner-iframe {
  border-radius: 26px;
}

@media (max-width: 860px) {
  .section-head {
    padding: 20px;
    border-radius: 24px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .main-area {
    width: min(100% - 18px, 1320px);
  }

  .section-head {
    padding: 18px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card.app-tile {
    min-height: 150px;
    border-radius: 22px;
  }

  .app-meta-row {
    margin-left: 76px;
  }
}

/* interaction refresh: local view mode switch plus launcher-style browsing. */
.control-strip {
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  align-items: center;
}

.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 58px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass-bg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px) saturate(1.15);
}

.view-switch button {
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.view-switch button::before {
  content: "";
  width: 14px;
  height: 14px;
  display: inline-block;
  margin-right: 7px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-radius: 5px;
  box-shadow: 8px 0 0 -5px currentColor, 0 8px 0 -5px currentColor, 8px 8px 0 -5px currentColor;
  opacity: 0.72;
}

.view-switch [data-feed-mode="launcher"]::before {
  width: 17px;
  height: 14px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 3px 3px, currentColor 0 2.6px, transparent 3px),
    radial-gradient(circle at 14px 3px, currentColor 0 2.6px, transparent 3px),
    radial-gradient(circle at 3px 11px, currentColor 0 2.6px, transparent 3px),
    radial-gradient(circle at 14px 11px, currentColor 0 2.6px, transparent 3px);
  box-shadow: none;
}

.view-switch button.active {
  background: #15130f;
  color: #fff8ed;
  box-shadow: 0 10px 24px rgba(20, 16, 12, 0.16);
}

html[data-theme="dark"] .view-switch button.active {
  background: #fff3e7;
  color: #15110d;
}

html[data-theme="dark"] .section-filter-bar button.active {
  background: #fff3e7;
  color: #15110d;
}

html[data-theme="dark"] .section-filter-bar button.active small {
  background: rgba(0, 0, 0, 0.12);
  color: #15110d;
}

.project-card.app-tile:hover .app-icon {
  transform: translateY(-2px) scale(1.04);
}

[data-feed-mode="launcher"] .project-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

[data-feed-mode="launcher"] .project-card.app-tile {
  min-height: 190px;
  grid-template-rows: 1fr auto;
  padding: 14px;
  border-radius: 24px;
}

[data-feed-mode="launcher"] .app-launch {
  min-height: 132px;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 10px;
  text-align: center;
}

[data-feed-mode="launcher"] .app-icon {
  width: 68px;
  border-radius: 22px;
}

[data-feed-mode="launcher"] .app-info {
  width: 100%;
  justify-items: center;
}

[data-feed-mode="launcher"] .app-title-row {
  justify-content: center;
  width: 100%;
  padding-right: 0;
}

[data-feed-mode="launcher"] .app-title-row strong {
  max-width: 126px;
  text-align: center;
}

[data-feed-mode="launcher"] .app-author,
[data-feed-mode="launcher"] .app-desc,
[data-feed-mode="launcher"] .app-access-note {
  display: none;
}

[data-feed-mode="launcher"] .like-count-display {
  top: 12px;
  right: 13px;
  font-size: 12px;
}

[data-feed-mode="launcher"] .heat-count-display {
  display: none;
}

[data-feed-mode="launcher"] .app-meta-row {
  justify-content: center;
  margin-left: 0;
}

[data-feed-mode="launcher"] .app-meta-row .tag-list {
  display: none;
}

[data-feed-mode="launcher"] .report-button,
[data-feed-mode="launcher"] .share-button,
[data-feed-mode="launcher"] .favorite-card-button,
[data-feed-mode="launcher"] .app-meta-row .admin-button {
  min-width: 44px;
  padding: 0 9px;
}

@media (max-width: 860px) {
  .control-strip {
    grid-template-columns: 1fr;
  }

  .view-switch,
  .segmented,
  .random-open-button {
    width: 100%;
    justify-content: center;
  }

  [data-feed-mode="launcher"] .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .view-switch {
    min-height: 52px;
  }

  .view-switch button {
    flex: 1 1 0;
    min-height: 38px;
    padding: 0 10px;
  }

  .result-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  [data-feed-mode="launcher"] .project-grid {
    grid-template-columns: 1fr;
  }

  [data-feed-mode="launcher"] .project-card.app-tile {
    min-height: 128px;
  }

  [data-feed-mode="launcher"] .app-launch {
    min-height: 74px;
    grid-template-columns: 74px minmax(0, 1fr);
    place-items: start;
    align-items: center;
    text-align: left;
  }

  [data-feed-mode="launcher"] .app-info {
    align-content: center;
    justify-items: start;
  }

  [data-feed-mode="launcher"] .app-title-row {
    justify-content: flex-start;
  }

  [data-feed-mode="launcher"] .app-title-row strong {
    max-width: none;
    text-align: left;
  }
}

/* distinct generated app icons: project-stable colors and pattern language. */
.app-icon {
  border-radius: 20px;
  background:
    radial-gradient(circle at 24% 18%, color-mix(in srgb, var(--icon-fg, #fff) 52%, transparent), transparent 21%),
    radial-gradient(circle at 82% 78%, color-mix(in srgb, var(--icon-bg, #ff5100) 72%, #fff), transparent 26%),
    linear-gradient(145deg, var(--icon-bg, var(--app-accent, var(--primary))), var(--icon-bg2, #21130d));
  color: var(--icon-fg, #fff);
  transform: rotate(var(--icon-tilt, 0deg));
}

.project-card.app-tile:hover .app-icon {
  transform: rotate(var(--icon-tilt, 0deg)) translateY(-2px) scale(1.04);
}

.app-icon::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.54;
}

.app-icon i,
.app-icon em,
.app-icon small {
  z-index: 2;
}

.app-icon small {
  color: var(--icon-fg, #fff);
}

.icon-style-0 {
  border-radius: 22px 14px 24px 16px;
}

.icon-style-0::after {
  inset: 10px;
  border: 3px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
}

.icon-style-1 {
  border-radius: 50%;
}

.icon-style-1::after {
  width: 44px;
  height: 4px;
  left: 9px;
  top: 28px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 -12px 0 color-mix(in srgb, currentColor 58%, transparent), 0 12px 0 color-mix(in srgb, currentColor 42%, transparent);
  transform: rotate(28deg);
}

.icon-style-2 {
  border-radius: 15px 26px 15px 26px;
}

.icon-style-2::after {
  inset: 9px;
  background:
    linear-gradient(90deg, currentColor 2px, transparent 2px),
    linear-gradient(0deg, currentColor 2px, transparent 2px);
  background-size: 12px 12px;
  opacity: 0.34;
}

.icon-style-3 {
  border-radius: 14px;
}

.icon-style-3::after {
  width: 40px;
  height: 40px;
  left: 11px;
  top: 11px;
  border: 3px solid currentColor;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.icon-style-4 {
  border-radius: 28px 12px 28px 12px;
}

.icon-style-4::after {
  width: 44px;
  height: 44px;
  left: -8px;
  top: -8px;
  border-right: 6px solid currentColor;
  border-bottom: 6px solid currentColor;
  border-radius: 50%;
}

.icon-style-5 {
  border-radius: 18px 18px 30px 12px;
}

.icon-style-5::after {
  inset: 9px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 20%, currentColor 0 3px, transparent 4px),
    radial-gradient(circle at 80% 28%, currentColor 0 3px, transparent 4px),
    radial-gradient(circle at 34% 78%, currentColor 0 3px, transparent 4px),
    radial-gradient(circle at 76% 74%, currentColor 0 3px, transparent 4px);
}

.icon-style-6 {
  border-radius: 12px 28px 18px 20px;
}

.icon-style-6::after {
  width: 36px;
  height: 36px;
  left: 13px;
  top: 13px;
  border-radius: 9px;
  background: currentColor;
  clip-path: polygon(0 0, 70% 0, 100% 34%, 100% 100%, 30% 100%, 0 66%);
}

.icon-style-7 {
  border-radius: 24px 24px 12px 12px;
}

.icon-style-7::after {
  width: 48px;
  height: 48px;
  left: 7px;
  top: 7px;
  border-radius: 50%;
  background: conic-gradient(from 45deg, currentColor 0 18%, transparent 18% 32%, currentColor 32% 52%, transparent 52% 100%);
}

/* richer app glyphs: stable per project, distinct enough for scanning. */
.app-icon {
  isolation: isolate;
  border: 1px solid color-mix(in srgb, var(--icon-fg, #fff) 28%, transparent);
  background:
    radial-gradient(circle at 24% 18%, color-mix(in srgb, var(--icon-fg, #fff) 46%, transparent), transparent 20%),
    radial-gradient(circle at 82% 82%, color-mix(in srgb, var(--icon-bg, #ff5100) 74%, #fff), transparent 25%),
    linear-gradient(145deg, var(--icon-bg, var(--app-accent, var(--primary))), var(--icon-bg2, #21130d));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--icon-fg, #fff) 28%, transparent),
    inset 0 -18px 28px rgba(0, 0, 0, 0.18),
    0 12px 24px color-mix(in srgb, var(--icon-bg, var(--primary)) 20%, transparent);
}

.app-icon::before {
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--icon-fg, #fff) 24%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--icon-fg, #fff) 20%, transparent), transparent 36%),
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--icon-fg, #fff) 14%, transparent) 0 1px, transparent 1px 9px);
  opacity: 0.44;
}

.app-icon[class*="icon-symbol-"]::after {
  background: none;
  border: 0;
  box-shadow: none;
  clip-path: none;
  opacity: 0.68;
}

.app-icon[class*="icon-symbol-"] i,
.app-icon[class*="icon-symbol-"] em {
  width: auto;
  height: auto;
  inset: auto;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  transform: none;
  clip-path: none;
  color: currentColor;
}

.app-icon small {
  right: 7px;
  bottom: 6px;
  max-width: 44px;
  padding: 2px 4px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--icon-bg2, #111) 48%, transparent);
  color: var(--icon-fg, #fff);
  font-size: 10px;
  line-height: 1.05;
  text-align: center;
  text-shadow: none;
}

.app-icon.icon-symbol-0 i {
  width: 34px;
  height: 27px;
  left: 13px;
  top: 13px;
  border: 3px solid currentColor;
  border-radius: 10px;
}

.app-icon.icon-symbol-0 em {
  width: 18px;
  height: 3px;
  left: 21px;
  top: 22px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 8px 0 color-mix(in srgb, currentColor 55%, transparent);
}

.app-icon.icon-symbol-1 i {
  width: 34px;
  height: 34px;
  left: 14px;
  top: 12px;
  background: currentColor;
  clip-path: polygon(50% 0, 62% 34%, 100% 50%, 62% 66%, 50% 100%, 38% 66%, 0 50%, 38% 34%);
}

.app-icon.icon-symbol-1 em {
  width: 7px;
  height: 7px;
  right: 13px;
  top: 13px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: -28px 27px 0 color-mix(in srgb, currentColor 48%, transparent);
}

.app-icon.icon-symbol-2 i {
  left: 21px;
  top: 15px;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 24px solid currentColor;
}

.app-icon.icon-symbol-2 em {
  width: 8px;
  height: 8px;
  left: 12px;
  top: 14px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 35px 29px 0 color-mix(in srgb, currentColor 48%, transparent);
}

.app-icon.icon-symbol-3 i {
  width: 36px;
  height: 24px;
  left: 13px;
  top: 17px;
  border-radius: 999px;
  border: 3px solid currentColor;
  border-left-color: transparent;
  transform: rotate(-18deg);
}

.app-icon.icon-symbol-3 em {
  width: 28px;
  height: 5px;
  left: 17px;
  top: 33px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-18deg);
}

.app-icon.icon-symbol-4 i {
  width: 32px;
  height: 32px;
  left: 15px;
  top: 13px;
  border: 3px solid currentColor;
  border-radius: 9px;
  background:
    linear-gradient(90deg, transparent 44%, currentColor 45% 55%, transparent 56%),
    linear-gradient(0deg, transparent 44%, currentColor 45% 55%, transparent 56%);
}

.app-icon.icon-symbol-4 em {
  width: 4px;
  height: 4px;
  left: 10px;
  top: 18px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 42px 0 0 currentColor, 0 18px 0 currentColor, 42px 18px 0 currentColor;
}

.app-icon.icon-symbol-5 i {
  width: 34px;
  height: 4px;
  left: 14px;
  top: 18px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 11px 0 color-mix(in srgb, currentColor 72%, transparent), 0 22px 0 color-mix(in srgb, currentColor 52%, transparent);
}

.app-icon.icon-symbol-5 em {
  width: 9px;
  height: 9px;
  left: 21px;
  top: 15px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 16px 11px 0 currentColor, -5px 22px 0 currentColor;
}

.app-icon.icon-symbol-6 i {
  width: 41px;
  height: 24px;
  left: 10px;
  top: 18px;
  border: 3px solid currentColor;
  border-radius: 50%;
  transform: rotate(-22deg);
}

.app-icon.icon-symbol-6 em {
  width: 13px;
  height: 13px;
  left: 25px;
  top: 23px;
  border-radius: 50%;
  background: currentColor;
}

.app-icon.icon-symbol-7 i {
  width: 34px;
  height: 12px;
  left: 14px;
  top: 16px;
  border-radius: 8px;
  background: currentColor;
  box-shadow: 0 12px 0 color-mix(in srgb, currentColor 70%, transparent), 0 24px 0 color-mix(in srgb, currentColor 46%, transparent);
}

.app-icon.icon-symbol-7 em {
  width: 9px;
  height: 36px;
  left: 27px;
  top: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 36%, transparent);
}

.app-icon.icon-symbol-8 i {
  width: 25px;
  height: 17px;
  left: 13px;
  top: 20px;
  border: 3px solid currentColor;
  border-radius: 999px;
  transform: rotate(-26deg);
}

.app-icon.icon-symbol-8 em {
  width: 25px;
  height: 17px;
  left: 24px;
  top: 20px;
  border: 3px solid currentColor;
  border-radius: 999px;
  transform: rotate(-26deg);
}

.app-icon.icon-symbol-9 i {
  width: 36px;
  height: 30px;
  left: 13px;
  top: 14px;
  border: 3px solid currentColor;
  border-radius: 9px;
}

.app-icon.icon-symbol-9 em {
  width: 22px;
  height: 12px;
  left: 19px;
  top: 28px;
  background: currentColor;
  clip-path: polygon(0 100%, 42% 28%, 62% 58%, 78% 32%, 100% 100%);
}

.app-icon.icon-symbol-10 i {
  width: 34px;
  height: 34px;
  left: 14px;
  top: 13px;
  background: currentColor;
  clip-path: polygon(50% 0, 92% 24%, 92% 76%, 50% 100%, 8% 76%, 8% 24%);
}

.app-icon.icon-symbol-10 em {
  width: 2px;
  height: 32px;
  left: 31px;
  top: 15px;
  background: color-mix(in srgb, var(--icon-bg2, #111) 56%, transparent);
  box-shadow: -12px 8px 0 color-mix(in srgb, var(--icon-bg2, #111) 46%, transparent), 12px 8px 0 color-mix(in srgb, var(--icon-bg2, #111) 46%, transparent);
  transform: rotate(30deg);
}

.app-icon.icon-symbol-11 i {
  width: 36px;
  height: 28px;
  left: 13px;
  top: 14px;
  border-radius: 9px;
  border: 3px solid currentColor;
}

.app-icon.icon-symbol-11 em {
  width: 16px;
  height: 4px;
  left: 26px;
  top: 31px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: -10px -8px 0 currentColor;
}

/* Icon refresh: stable project identity with varied silhouettes and symbols. */
.app-icon {
  border-color: color-mix(in srgb, var(--icon-ring, var(--icon-bg)) 42%, transparent);
  background:
    radial-gradient(circle at 21% 17%, color-mix(in srgb, var(--icon-mark, #fff) 72%, transparent), transparent 20%),
    radial-gradient(circle at 80% 83%, color-mix(in srgb, var(--icon-bg, #ff5100) 68%, #fff), transparent 28%),
    linear-gradient(145deg, color-mix(in srgb, var(--icon-bg, #ff5100) 94%, #fff), var(--icon-bg2, #1d120c));
  color: var(--icon-fg, #fff);
}

.app-icon::before {
  border-color: color-mix(in srgb, var(--icon-mark, #fff) 24%, transparent);
  opacity: 0.5;
}

.app-icon::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.app-icon i,
.app-icon em,
.app-icon small {
  z-index: 2;
}

.app-icon small {
  right: 6px;
  bottom: 6px;
  max-width: 36px;
  padding: 2px 4px;
  border: 1px solid color-mix(in srgb, var(--icon-mark, #fff) 22%, transparent);
  background: color-mix(in srgb, var(--icon-bg2, #111) 58%, transparent);
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 950;
  line-height: 1.05;
}

.icon-shape-0 { border-radius: 19px; }
.icon-shape-1 { border-radius: 50%; }
.icon-shape-2 { border-radius: 26px 12px 26px 12px; }
.icon-shape-3 { border-radius: 12px 26px 12px 26px; }
.icon-shape-4 { border-radius: 28px 18px 12px 18px; }
.icon-shape-5 { border-radius: 28px 28px 14px 14px; }
.icon-shape-6 { border-radius: 14px 26px 26px 14px; }
.icon-shape-7 { border-radius: 13px; }
.icon-shape-8 { border-radius: 30px 14px; }

.icon-tone-0::before {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--icon-mark, #fff) 22%, transparent), transparent 42%),
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--icon-mark, #fff) 16%, transparent) 0 1px, transparent 1px 8px);
}

.icon-tone-1::before {
  background:
    radial-gradient(circle at 24% 30%, color-mix(in srgb, var(--icon-mark, #fff) 22%, transparent) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 68%, color-mix(in srgb, var(--icon-mark, #fff) 18%, transparent) 0 4px, transparent 5px);
}

.icon-tone-2::before {
  background:
    linear-gradient(90deg, transparent 44%, color-mix(in srgb, var(--icon-mark, #fff) 16%, transparent) 45% 55%, transparent 56%),
    linear-gradient(0deg, transparent 44%, color-mix(in srgb, var(--icon-mark, #fff) 16%, transparent) 45% 55%, transparent 56%);
}

.icon-tone-3::before {
  background:
    conic-gradient(from 45deg at 50% 50%, transparent 0 16%, color-mix(in srgb, var(--icon-mark, #fff) 18%, transparent) 16% 28%, transparent 28% 100%);
}

.icon-tone-4::before {
  background:
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--icon-mark, #fff) 13%, transparent) 0 2px, transparent 2px 9px);
}

.icon-tone-5::before {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 25%, color-mix(in srgb, var(--icon-mark, #fff) 18%, transparent) 26% 29%, transparent 30% 100%),
    linear-gradient(135deg, color-mix(in srgb, var(--icon-mark, #fff) 12%, transparent), transparent 48%);
}

.app-icon.icon-symbol-12 i {
  width: 34px;
  height: 27px;
  left: 13px;
  top: 14px;
  border: 3px solid currentColor;
  border-radius: 8px;
}

.app-icon.icon-symbol-12 em {
  width: 18px;
  height: 4px;
  left: 22px;
  top: 30px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: -8px -8px 0 color-mix(in srgb, currentColor 70%, transparent);
}

.app-icon.icon-symbol-13 i {
  width: 30px;
  height: 40px;
  left: 18px;
  top: 10px;
  background: currentColor;
  clip-path: polygon(48% 0, 95% 0, 62% 38%, 92% 38%, 38% 100%, 48% 57%, 12% 57%);
}

.app-icon.icon-symbol-13 em {
  width: 8px;
  height: 8px;
  right: 12px;
  bottom: 13px;
  border-radius: 50%;
  background: currentColor;
}

.app-icon.icon-symbol-14 i {
  width: 34px;
  height: 38px;
  left: 16px;
  top: 12px;
  background: currentColor;
  clip-path: polygon(8% 0, 82% 48%, 51% 56%, 65% 100%, 47% 100%, 34% 62%, 8% 82%);
}

.app-icon.icon-symbol-14 em {
  width: 16px;
  height: 4px;
  left: 33px;
  top: 37px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 58%, transparent);
  transform: rotate(32deg);
}

.app-icon.icon-symbol-15 i {
  width: 10px;
  height: 38px;
  left: 28px;
  top: 9px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(34deg);
}

.app-icon.icon-symbol-15 em {
  width: 27px;
  height: 16px;
  left: 14px;
  top: 31px;
  border-radius: 5px 5px 16px 16px;
  background: currentColor;
  transform: rotate(34deg);
}

.app-icon.icon-symbol-16 i {
  width: 34px;
  height: 9px;
  left: 14px;
  top: 17px;
  border-radius: 5px;
  background: currentColor;
  box-shadow:
    0 11px 0 color-mix(in srgb, currentColor 72%, transparent),
    0 22px 0 color-mix(in srgb, currentColor 48%, transparent);
}

.app-icon.icon-symbol-16 em {
  width: 4px;
  height: 34px;
  left: 28px;
  top: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--icon-bg2, #111) 52%, transparent);
  transform: rotate(90deg);
}

.app-icon.icon-symbol-17 i {
  width: 40px;
  height: 18px;
  left: 11px;
  top: 20px;
  border-top: 4px solid currentColor;
  border-radius: 50%;
}

.app-icon.icon-symbol-17 em {
  width: 40px;
  height: 18px;
  left: 11px;
  top: 28px;
  border-bottom: 4px solid currentColor;
  border-radius: 50%;
}

.app-icon.icon-symbol-18 i {
  width: 34px;
  height: 34px;
  left: 14px;
  top: 13px;
  border: 3px solid currentColor;
  border-radius: 10px;
  background:
    radial-gradient(circle at 28% 30%, currentColor 0 3px, transparent 4px),
    radial-gradient(circle at 72% 70%, currentColor 0 3px, transparent 4px);
}

.app-icon.icon-symbol-18 em {
  width: 24px;
  height: 3px;
  left: 19px;
  top: 30px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(36deg);
}

.app-icon.icon-symbol-19 i {
  width: 30px;
  height: 30px;
  left: 16px;
  top: 10px;
  border: 3px solid currentColor;
  border-radius: 50% 50% 50% 8px;
  transform: rotate(-45deg);
}

.app-icon.icon-symbol-19 em {
  width: 10px;
  height: 10px;
  left: 26px;
  top: 20px;
  border-radius: 50%;
  background: currentColor;
}

.app-icon.icon-symbol-20 i {
  width: 36px;
  height: 30px;
  left: 13px;
  top: 14px;
  border: 3px solid currentColor;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 50%, color-mix(in srgb, currentColor 36%, transparent) 51%),
    linear-gradient(0deg, transparent 47%, color-mix(in srgb, currentColor 36%, transparent) 48% 56%, transparent 57%);
}

.app-icon.icon-symbol-20 em {
  width: 6px;
  height: 6px;
  left: 20px;
  top: 21px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 16px 13px 0 currentColor;
}

.app-icon.icon-symbol-21 i {
  width: 36px;
  height: 5px;
  left: 14px;
  top: 31px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-28deg);
}

.app-icon.icon-symbol-21 em {
  width: 8px;
  height: 8px;
  left: 14px;
  top: 13px;
  background: currentColor;
  clip-path: polygon(50% 0, 63% 35%, 100% 50%, 63% 65%, 50% 100%, 37% 65%, 0 50%, 37% 35%);
  box-shadow: 32px 25px 0 currentColor;
}

.app-icon.icon-symbol-22 i {
  width: 35px;
  height: 5px;
  left: 14px;
  top: 18px;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    0 11px 0 color-mix(in srgb, currentColor 74%, transparent),
    0 22px 0 color-mix(in srgb, currentColor 50%, transparent);
}

.app-icon.icon-symbol-22 em {
  width: 3px;
  height: 36px;
  left: 31px;
  top: 12px;
  border-radius: 999px;
  background: currentColor;
}

.app-icon.icon-symbol-23 i {
  width: 34px;
  height: 34px;
  left: 14px;
  top: 13px;
  border: 3px solid currentColor;
  border-radius: 50%;
}

.app-icon.icon-symbol-23 em {
  width: 3px;
  height: 34px;
  left: 31px;
  top: 13px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: -11px 15px 0 -1px color-mix(in srgb, currentColor 65%, transparent), 11px 15px 0 -1px color-mix(in srgb, currentColor 65%, transparent);
}

.back-top-button {
  position: fixed;
  right: max(18px, calc((100vw - 1320px) / 2 + 18px));
  bottom: 24px;
  z-index: 34;
  width: 46px;
  height: 46px;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, var(--primary) 10%);
  color: var(--primary);
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(20, 16, 12, 0.16);
  backdrop-filter: blur(18px) saturate(1.12);
}

.back-top-button:hover,
.back-top-button:focus-visible {
  background: var(--primary);
  color: #fff8ed;
}

.runner-page-fullscreen .back-top-button {
  display: none;
}

.side-dock-controls {
  display: none;
}

.desktop-panel-dock,
.panel-dock-body,
.dock-panel-page {
  display: contents;
}

.panel-dock-tabs {
  display: none;
}

@media (min-width: 1320px) {
  .main-area {
    width: min(1320px, calc(100% - 600px));
  }

  .desktop-panel-dock {
    position: fixed;
    z-index: 22;
    top: 96px;
    bottom: 24px;
    width: clamp(250px, 14vw, 290px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(24px) saturate(1.12);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .left-panel-dock {
    left: 18px;
  }

  .right-panel-dock {
    right: 18px;
  }

  .panel-dock-tabs {
    min-height: 46px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 6px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  }

  .panel-dock-tabs button {
    min-width: 0;
    min-height: 34px;
    padding: 0 6px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
  }

  .panel-dock-tabs button:hover,
  .panel-dock-tabs button:focus-visible {
    background: color-mix(in srgb, var(--surface-2) 82%, transparent);
    color: var(--text);
  }

  .panel-dock-tabs button.active {
    background: var(--surface-2);
    color: var(--text);
    box-shadow: inset 0 -2px var(--primary);
  }

  .panel-dock-body {
    min-height: 0;
    display: block;
    overflow: hidden;
  }

  .dock-panel-page {
    height: 100%;
    min-height: 0;
    display: none;
    align-content: start;
    gap: 12px;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
  }

  .dock-panel-page::-webkit-scrollbar {
    display: none;
  }

  .dock-panel-page.active {
    display: grid;
  }

  .side-dock-controls {
    display: block;
  }

  .side-dock-controls button {
    position: fixed;
    top: 74px;
    z-index: 35;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px) saturate(1.12);
  }

  .side-dock-controls [data-toggle-side="left"] {
    left: 18px;
  }

  .side-dock-controls [data-toggle-side="right"] {
    right: 18px;
  }

  body[data-left-dock="collapsed"] .left-panel-dock {
    pointer-events: none;
    opacity: 0;
    transform: translateX(calc(-100% - 28px));
  }

  body[data-right-dock="collapsed"] .right-panel-dock {
    pointer-events: none;
    opacity: 0;
    transform: translateX(calc(100% + 28px));
  }

  .desktop-panel-dock .control-strip,
  .desktop-panel-dock .section-filter-bar,
  .desktop-panel-dock .result-summary,
  .desktop-panel-dock .update-message-bar,
  .desktop-panel-dock .favorite-shelf,
  .desktop-panel-dock .quick-shelf {
    position: static;
    width: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    opacity: 1;
    transform: none;
  }

  .control-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .control-strip .search-box,
  .control-strip .view-switch,
  .control-strip .segmented,
  .control-strip .random-open-button,
  .control-strip .favorite-filter-button {
    width: 100%;
  }

  .control-strip .search-box {
    min-height: 48px;
    padding: 0 14px;
  }

  .control-strip .view-switch,
  .control-strip .segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-strip .segment,
  .control-strip .view-switch button {
    min-width: 0;
    padding: 0 8px;
  }

  .section-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .section-filter-bar button {
    width: 100%;
    justify-content: space-between;
  }

  .result-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  }

  .result-summary span {
    grid-column: 1 / -1;
  }

  .result-summary button {
    width: 100%;
  }

  .update-message-bar {
    display: grid;
    gap: 8px;
  }

  .update-message-bar article {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    padding: 12px;
  }

  .update-message-bar strong {
    grid-column: 1;
  }

  .update-message-bar span {
    grid-column: 1 / -1;
    margin-top: 2px;
    line-height: 1.45;
    white-space: normal;
  }

  .update-message-bar button {
    grid-column: 2;
    grid-row: 1;
  }

  .favorite-shelf .favorite-list,
  .quick-shelf .favorite-list {
    display: grid;
    grid-auto-columns: unset;
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    max-height: none;
    overflow: visible;
    padding: 0 2px 2px 0;
  }

  .favorite-shelf .favorite-list button,
  .quick-shelf .favorite-list button,
  .recent-shelf .favorite-list button {
    width: 100%;
    min-width: 0;
  }

  .app-launch::after {
    display: none;
  }
}

@media (max-width: 560px) {
  #feedView .section-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 13px;
    border-radius: 20px;
  }

  #feedView .section-head::after,
  #feedView .eyebrow {
    display: none;
  }

  #feedView h1 {
    font-size: 28px;
    line-height: 1.05;
    white-space: nowrap;
  }

  #feedView .system-stats {
    width: auto;
    min-width: 0;
    display: flex;
    gap: 4px;
  }

  #feedView .system-stats div {
    min-width: 46px;
    padding: 6px 7px;
    border-radius: 12px;
    box-shadow: none;
  }

  #feedView .system-stats span {
    font-size: 18px;
  }

  #feedView .system-stats small {
    display: block;
    margin-top: 3px;
    font-size: 9px;
    white-space: nowrap;
  }

  #feedView .control-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }

  #feedView .mobile-filter-button {
    grid-column: 1;
    grid-row: 2;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--glass-bg);
    color: var(--text);
    font-weight: 900;
  }

  #feedView .mobile-filter-button.active {
    border-color: color-mix(in srgb, var(--primary) 44%, var(--line));
    background: #15130f;
    color: #fff8ed;
  }

  #feedView .mobile-filter-button small {
    min-width: 20px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    line-height: 1.35;
  }

  #feedView .mobile-filter-icon {
    width: 15px;
    height: 14px;
    display: inline-block;
    background: currentColor;
    clip-path: polygon(0 0, 100% 0, 62% 46%, 62% 100%, 38% 100%, 38% 46%);
  }

  #feedView .search-box,
  #feedView .segmented {
    grid-column: 1 / -1;
  }

  #feedView .search-box {
    grid-row: 1;
  }

  #feedView .search-box {
    min-height: 46px;
    padding: 0 15px;
  }

  #feedView .view-switch,
  #feedView .random-open-button,
  #feedView .favorite-filter-button {
    min-height: 44px;
    box-shadow: none;
  }

  #feedView .view-switch {
    grid-column: 1 / -1;
    grid-row: 3;
    padding: 4px;
  }

  #feedView .view-switch button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  #feedView .random-open-button {
    grid-column: 2;
    grid-row: 2;
    padding: 0 12px;
  }

  #feedView .favorite-filter-button:disabled {
    display: none;
  }

  #feedView:not(.mobile-filters-open) .view-switch,
  #feedView:not(.mobile-filters-open) .favorite-filter-button,
  #feedView:not(.mobile-filters-open) .section-filter-bar {
    display: none;
  }

  .control-strip .segmented {
    display: flex;
    justify-content: flex-start;
    gap: 4px;
    padding: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .control-strip .segmented::-webkit-scrollbar {
    display: none;
  }

  .control-strip .segment {
    flex: 0 0 auto;
    min-width: 64px;
    padding: 0 14px;
    white-space: nowrap;
  }

  #feedView .section-filter-bar {
    margin: 0 0 12px;
    padding: 0 1px 4px;
    scrollbar-width: none;
  }

  #feedView .section-filter-bar::-webkit-scrollbar {
    display: none;
  }

  #feedView .section-filter-bar button {
    min-height: 34px;
    padding: 0 11px;
  }

  #feedView .result-summary:has(#clearFiltersButton:disabled) {
    display: none;
  }

  #feedView .result-summary {
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 14px;
  }

  #feedView .search-history-shelf,
  #feedView .recent-shelf,
  #feedView .community-recent-shelf,
  #feedView .comment-shelf {
    display: none !important;
  }

  #feedView .project-grid {
    margin-top: 0;
  }

  .package-upload-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .package-upload-actions {
    width: 100%;
  }

  .file-select-button,
  .clear-package-button {
    flex: 1;
  }

  .upload-progress {
    grid-template-columns: 1fr;
  }

  .upload-progress span {
    max-width: none;
    text-align: left;
  }

  .project-runner-view,
  .runner-head,
  .runner-copy,
  .runner-actions,
  .app-tab-strip,
  .runner-frame-wrap,
  .runner-dwell-report,
  .comment-panel {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .project-runner-view.active,
  .comment-panel {
    width: 100%;
  }

  .comment-panel {
    padding: 14px;
  }

  .comment-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .comment-panel-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .comment-form {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .comment-form input {
    width: 100%;
    min-width: 0;
    grid-column: 1 / -1;
    box-sizing: border-box;
  }

  .comment-list,
  .related-app-list,
  .related-app-grid {
    min-width: 0;
  }

  .related-app-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 2026-07 tool-library workspace: app-first layout across desktop, tablet and phone. */
:root {
  --workspace-bg: #f3f4f2;
  --workspace-panel: rgba(255, 255, 255, 0.94);
  --workspace-elevated: #ffffff;
  --workspace-line: rgba(24, 27, 25, 0.12);
  --workspace-grid: rgba(24, 27, 25, 0.045);
}

html[data-theme="dark"] {
  --workspace-bg: #090b0a;
  --workspace-panel: rgba(17, 19, 18, 0.94);
  --workspace-elevated: #141716;
  --workspace-line: rgba(255, 255, 255, 0.12);
  --workspace-grid: rgba(255, 255, 255, 0.045);
}

body {
  overflow-x: hidden;
  background-color: var(--workspace-bg);
  background-image:
    linear-gradient(var(--workspace-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--workspace-grid) 1px, transparent 1px);
  background-size: 36px 36px;
}

body::before {
  display: none;
}

.top-nav {
  z-index: 80;
  background: color-mix(in srgb, var(--workspace-panel) 90%, transparent);
  box-shadow: 0 1px 0 var(--workspace-line);
}

.nav-inner {
  width: min(1240px, calc(100% - 32px));
  min-height: 64px;
}

.brand::before {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

.brand-title {
  font-size: 17px;
}

.nav-button,
.theme-button,
.login-button {
  min-height: 38px;
}

.main-area {
  width: min(1240px, calc(100% - 32px));
  padding: 24px 0 56px;
}

#feedView .section-head {
  min-height: 106px;
  align-items: center;
  margin-bottom: 16px;
  padding: 20px 22px;
  border: 1px solid var(--workspace-line);
  border-radius: 16px;
  background: var(--workspace-panel);
  box-shadow: 0 12px 32px rgba(18, 20, 19, 0.07);
}

#feedView .section-head::after {
  display: none;
}

#feedView .eyebrow {
  margin-bottom: 5px;
  font-size: 10px;
}

#feedView h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
}

#feedView .system-stats {
  display: flex;
  gap: 8px;
}

#feedView .system-stats div {
  min-width: 88px;
  padding: 12px 14px;
  border: 1px solid var(--workspace-line);
  border-radius: 12px;
  background: var(--workspace-elevated);
  box-shadow: none;
}

#feedView .system-stats span {
  font-size: 24px;
}

#feedView .system-stats small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
}

#feedView .project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#feedView .project-card.app-tile {
  min-height: 148px;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--workspace-line);
  border-radius: 14px;
  background: var(--workspace-panel);
  box-shadow: 0 8px 22px rgba(18, 20, 19, 0.055);
  backdrop-filter: blur(16px) saturate(1.06);
}

#feedView .project-card.app-tile::before {
  height: 2px;
  background: var(--app-accent, var(--primary));
  opacity: 0.72;
}

#feedView .project-card.app-tile:hover {
  border-color: color-mix(in srgb, var(--app-accent, var(--primary)) 34%, var(--workspace-line));
  box-shadow: 0 14px 30px rgba(18, 20, 19, 0.11);
  transform: translateY(-2px);
}

#feedView .app-launch {
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 72px;
  gap: 12px;
}

#feedView .app-icon {
  width: 58px;
  border-radius: 15px;
}

#feedView .app-icon::before {
  border-radius: 14px;
}

#feedView .app-title-row {
  gap: 7px;
  padding-right: 38px;
}

#feedView .app-title-row strong {
  font-size: 15px;
}

#feedView .app-info {
  gap: 3px;
}

#feedView .app-author,
#feedView .app-desc,
#feedView .app-access-note {
  font-size: 11px;
}

#feedView .like-count-display {
  top: 12px;
  right: 12px;
  font-size: 12px;
}

#feedView .heat-count-display {
  max-width: 66px;
  font-size: 10px;
}

#feedView .app-meta-row {
  gap: 5px;
  margin-left: 70px;
}

#feedView .app-meta-row .tag-list {
  display: flex;
  gap: 4px;
}

#feedView .app-meta-row .tag-list span,
#feedView .comment-count-display,
#feedView .share-button,
#feedView .report-button,
#feedView .favorite-card-button,
#feedView .app-meta-row .admin-button {
  min-height: 24px;
  padding: 0 8px;
  font-size: 10px;
}

#feedView .share-button,
#feedView .report-button,
#feedView .favorite-card-button,
#feedView .app-meta-row .admin-button {
  border-color: var(--workspace-line);
  background: transparent;
}

#feedView .empty-state {
  grid-column: 1 / -1;
}

@media (min-width: 1320px) {
  .main-area {
    width: min(1240px, calc(100% - 176px));
  }

  .desktop-panel-dock {
    top: 76px;
    bottom: 16px;
    width: 292px;
    border-radius: 16px;
    background: var(--workspace-panel);
    box-shadow: 0 18px 48px rgba(15, 18, 16, 0.18);
  }

  .left-panel-dock {
    left: 12px;
  }

  .right-panel-dock {
    right: 12px;
  }

  .panel-dock-tabs {
    min-height: 44px;
    padding: 5px;
  }

  .panel-dock-tabs button {
    min-height: 32px;
    border-radius: 7px;
    font-size: 11px;
  }

  .dock-panel-page {
    gap: 10px;
    padding: 12px;
  }

  .side-dock-controls button {
    top: 78px;
    min-height: 36px;
    padding: 0 13px;
    border-radius: 10px;
    background: var(--workspace-panel);
    color: var(--text);
  }

  .side-dock-controls [data-toggle-side="left"] {
    left: 12px;
  }

  .side-dock-controls [data-toggle-side="right"] {
    right: 12px;
  }

  body[data-left-dock="open"] .side-dock-controls [data-toggle-side="left"] {
    left: 316px;
  }

  body[data-right-dock="open"] .side-dock-controls [data-toggle-side="right"] {
    right: 316px;
  }

  .desktop-panel-dock .control-strip .search-box {
    min-height: 44px;
  }

  [data-feed-mode="launcher"] #feedView .project-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 1319px) {
  .main-area {
    width: min(1120px, calc(100% - 28px));
  }

  #feedView > .left-panel-dock,
  #feedView > .left-panel-dock .panel-dock-body,
  #feedView > .left-panel-dock .dock-panel-page {
    display: contents;
  }

  #feedView > .left-panel-dock .panel-dock-tabs {
    display: none;
  }

  #feedView .control-strip {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    margin-bottom: 12px;
  }

  #feedView .search-box {
    min-height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    box-shadow: none;
  }

  #feedView .mobile-filter-button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border: 1px solid var(--workspace-line);
    border-radius: 12px;
    background: var(--workspace-panel);
    color: var(--text);
    font-weight: 900;
  }

  #feedView .mobile-filter-icon {
    width: 14px;
    height: 13px;
    display: inline-block;
    background: currentColor;
    clip-path: polygon(0 0, 100% 0, 62% 46%, 62% 100%, 38% 100%, 38% 46%);
  }

  #feedView .random-open-button {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 12px;
    box-shadow: none;
  }

  #feedView:not(.mobile-filters-open) .view-switch,
  #feedView:not(.mobile-filters-open) .favorite-filter-button,
  #feedView:not(.mobile-filters-open) .section-filter-bar {
    display: none;
  }

  #feedView.mobile-filters-open .view-switch,
  #feedView.mobile-filters-open .segmented {
    grid-column: 1 / -1;
  }

  #feedView.mobile-filters-open .favorite-filter-button {
    min-height: 40px;
  }

  #feedView .section-filter-bar {
    margin: 0 0 10px;
  }

  #feedView .result-summary {
    margin: 0 0 12px;
  }

  #feedView > .right-panel-dock {
    position: fixed;
    z-index: 62;
    top: 76px;
    right: 12px;
    bottom: 12px;
    width: min(350px, calc(100% - 24px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--workspace-line);
    border-radius: 18px;
    background: var(--workspace-panel);
    box-shadow: 0 20px 54px rgba(12, 15, 13, 0.24);
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  #feedView > .right-panel-dock .panel-dock-tabs {
    min-height: 46px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 3px;
    padding: 5px;
    border-bottom: 1px solid var(--workspace-line);
  }

  #feedView > .right-panel-dock .panel-dock-tabs button {
    min-width: 0;
    min-height: 34px;
    padding: 0 5px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
  }

  #feedView > .right-panel-dock .panel-dock-tabs button.active {
    background: var(--surface-2);
    color: var(--text);
    box-shadow: inset 0 -2px var(--primary);
  }

  #feedView > .right-panel-dock .panel-dock-body {
    min-height: 0;
    display: block;
    overflow: hidden;
  }

  #feedView > .right-panel-dock .dock-panel-page {
    height: 100%;
    min-height: 0;
    display: none;
    padding: 12px;
    overflow-y: auto;
    scrollbar-width: none;
  }

  #feedView > .right-panel-dock .dock-panel-page.active {
    display: grid;
    align-content: start;
    gap: 10px;
  }

  #feedView > .right-panel-dock .dock-panel-page::-webkit-scrollbar {
    display: none;
  }

  #feedView > .right-panel-dock .favorite-shelf,
  #feedView > .right-panel-dock .quick-shelf,
  #feedView > .right-panel-dock .favorite-list {
    position: static;
    width: auto;
    margin: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  #feedView > .right-panel-dock .favorite-list {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #feedView > .right-panel-dock .favorite-list button {
    width: 100%;
    min-width: 0;
  }

  body[data-right-dock="collapsed"] #feedView > .right-panel-dock {
    pointer-events: none;
    opacity: 0;
    transform: translateX(calc(100% + 24px));
  }

  .side-dock-controls {
    display: block;
  }

  .side-dock-controls [data-toggle-side="left"] {
    display: none;
  }

  .side-dock-controls [data-toggle-side="right"] {
    position: fixed;
    right: 14px;
    bottom: 18px;
    z-index: 70;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--workspace-line);
    border-radius: 12px;
    background: var(--workspace-elevated);
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(14, 17, 15, 0.16);
  }

  #feedView .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  [data-feed-mode="launcher"] #feedView .project-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav-inner {
    width: calc(100% - 20px);
    min-height: 56px;
    gap: 8px;
  }

  .brand-title {
    font-size: 16px;
  }

  .mobile-nav-wrap {
    display: block;
    margin-left: auto;
  }

  .mobile-menu-button,
  .update-bubble-button,
  .login-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 11px;
  }

  .login-button {
    width: auto;
    padding: 0 13px;
  }

  .nav-actions {
    gap: 6px;
  }

  .nav-actions .nav-button,
  .nav-actions .theme-button {
    display: none;
  }

  .nav-actions .update-bubble-button:not([hidden]) {
    display: grid;
  }

  .main-area {
    width: calc(100% - 16px);
    padding: 12px 0 40px;
  }

  #feedView .section-head {
    min-height: 76px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 14px;
  }

  #feedView .eyebrow {
    display: none;
  }

  #feedView h1 {
    font-size: clamp(23px, 7vw, 30px);
    white-space: nowrap;
  }

  #feedView .system-stats {
    gap: 2px;
  }

  #feedView .system-stats div {
    min-width: 42px;
    padding: 5px 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
  }

  #feedView .system-stats span {
    font-size: 17px;
    text-align: center;
  }

  #feedView .system-stats small {
    margin-top: 2px;
    font-size: 8px;
    text-align: center;
    white-space: nowrap;
  }

  #feedView .control-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 10px;
  }

  #feedView .search-box {
    grid-column: 1 / -1;
    min-height: 44px;
  }

  #feedView .mobile-filter-button,
  #feedView .random-open-button {
    min-height: 42px;
  }

  #feedView.mobile-filters-open .view-switch,
  #feedView.mobile-filters-open .segmented {
    grid-column: 1 / -1;
  }

  #feedView .view-switch {
    min-height: 42px;
  }

  #feedView .view-switch button {
    min-height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  #feedView .segmented {
    min-height: 42px;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  #feedView .segmented::-webkit-scrollbar,
  #feedView .section-filter-bar::-webkit-scrollbar {
    display: none;
  }

  #feedView .section-filter-bar {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  #feedView .section-filter-bar button {
    flex: 0 0 auto;
    width: auto;
  }

  #feedView .result-summary {
    grid-template-columns: 1fr auto;
    padding: 8px 10px;
    border-radius: 10px;
  }

  #feedView .result-summary span {
    grid-column: 1 / -1;
  }

  #feedView .project-grid,
  [data-feed-mode="launcher"] #feedView .project-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  #feedView .project-card.app-tile,
  [data-feed-mode="launcher"] #feedView .project-card.app-tile {
    min-height: 120px;
    padding: 10px;
    border-radius: 13px;
  }

  #feedView .app-launch,
  [data-feed-mode="launcher"] #feedView .app-launch {
    min-height: 58px;
    grid-template-columns: 46px minmax(0, 1fr);
    place-items: start;
    align-items: start;
    gap: 10px;
    text-align: left;
  }

  #feedView .app-icon,
  [data-feed-mode="launcher"] #feedView .app-icon {
    width: 46px;
    border-radius: 12px;
  }

  #feedView .app-icon::before,
  [data-feed-mode="launcher"] #feedView .app-icon::before {
    border-radius: 11px;
  }

  #feedView .app-info,
  [data-feed-mode="launcher"] #feedView .app-info {
    justify-items: start;
  }

  [data-feed-mode="launcher"] #feedView .app-author,
  [data-feed-mode="launcher"] #feedView .app-desc,
  [data-feed-mode="launcher"] #feedView .app-access-note {
    display: block;
  }

  #feedView .app-title-row,
  [data-feed-mode="launcher"] #feedView .app-title-row {
    justify-content: flex-start;
    padding-right: 34px;
  }

  #feedView .app-title-row strong,
  [data-feed-mode="launcher"] #feedView .app-title-row strong {
    max-width: none;
    font-size: 14px;
    text-align: left;
  }

  #feedView .app-meta-row,
  [data-feed-mode="launcher"] #feedView .app-meta-row {
    gap: 4px;
    justify-content: flex-end;
    margin-left: 0;
  }

  #feedView .app-meta-row .tag-list,
  [data-feed-mode="launcher"] #feedView .app-meta-row .tag-list {
    display: flex;
    flex: 1 1 86px;
    max-width: none;
  }

  #feedView .comment-count-display,
  #feedView .share-button,
  #feedView .report-button,
  #feedView .favorite-card-button,
  #feedView .app-meta-row .admin-button {
    min-width: 36px;
    min-height: 23px;
    padding: 0 6px;
    font-size: 9px;
  }

  #feedView > .right-panel-dock {
    top: 64px;
    right: 8px;
    bottom: 8px;
    width: calc(100% - 16px);
    border-radius: 16px;
  }

  .side-dock-controls [data-toggle-side="right"] {
    right: 10px;
    bottom: 12px;
    min-height: 38px;
  }

  body[data-right-dock="collapsed"] .side-dock-controls [data-toggle-side="right"] {
    display: none;
  }

  .back-top-button {
    right: 10px;
    bottom: 58px;
    width: 40px;
    height: 40px;
  }

  .project-runner-view .runner-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 8px;
  }

  .project-runner-view #backToFeedButton {
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--workspace-line);
    border-radius: 10px;
  }

  .project-runner-view .runner-copy {
    min-width: 0;
  }

  .project-runner-view .runner-copy .eyebrow {
    margin-bottom: 2px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .project-runner-view .runner-copy h1 {
    margin: 0;
    overflow: hidden;
    font-size: 19px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .project-runner-view .runner-actions {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    padding: 2px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .project-runner-view .runner-actions::-webkit-scrollbar,
  .project-runner-view .app-tab-strip::-webkit-scrollbar {
    display: none;
  }

  .project-runner-view .runner-actions button {
    flex: 0 0 auto;
    width: auto;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid var(--workspace-line);
    border-radius: 9px;
    font-size: 11px;
  }

  .project-runner-view .app-tab-strip {
    margin-bottom: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .project-runner-view .runner-frame-wrap {
    border-radius: 14px;
  }
}

/* 2026-07 compact tool-library workspace. */
:root {
  --tool-bg: #f7f7f6;
  --tool-panel: #ffffff;
  --tool-panel-soft: #f2f3f2;
  --tool-line: #e2e4e2;
  --tool-text: #171918;
  --tool-muted: #777d79;
  --tool-orange: #ff5100;
  --tool-sidebar: #fafafa;
  --tool-shadow: 0 10px 28px rgba(18, 23, 20, 0.07);
}

html[data-theme="dark"] {
  --tool-bg: #111312;
  --tool-panel: #191c1a;
  --tool-panel-soft: #222624;
  --tool-line: #303532;
  --tool-text: #f3f5f3;
  --tool-muted: #9aa09c;
  --tool-sidebar: #161917;
  --tool-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

body {
  background: var(--tool-bg);
  color: var(--tool-text);
}

button svg,
a svg,
label svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  min-height: 62px;
  background: color-mix(in srgb, var(--tool-panel) 96%, transparent);
  border-bottom: 1px solid var(--tool-line);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.nav-inner {
  width: min(1580px, calc(100% - 28px));
  min-height: 62px;
  gap: 18px;
}

.brand {
  min-width: 132px;
  justify-content: flex-start;
  gap: 9px;
}

.brand::before {
  display: none;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--tool-orange);
  color: #ffffff;
}

.brand-mark svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.brand-title {
  color: var(--tool-text);
  font-size: 17px;
  font-weight: 900;
}

.nav-actions {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.nav-button,
.theme-button,
.update-bubble-button,
.login-button,
.nav-random-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--tool-muted);
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

.nav-button.active {
  border-color: var(--tool-line);
  background: var(--tool-panel-soft);
  color: var(--tool-text);
}

.nav-search-box {
  min-width: 180px;
  max-width: 420px;
  height: 38px;
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--tool-line);
  border-radius: 10px;
  background: var(--tool-panel-soft);
  color: var(--tool-muted);
}

.nav-search-box:focus-within {
  border-color: color-mix(in srgb, var(--tool-orange) 52%, var(--tool-line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tool-orange) 10%, transparent);
}

.nav-search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--tool-text);
  font-size: 12px;
}

.nav-search-box button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--tool-muted);
}

.nav-random-button,
.login-button {
  padding: 0 15px;
  background: var(--tool-orange);
  color: #ffffff;
}

.theme-button,
.update-bubble-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  border-color: var(--tool-line);
  background: var(--tool-panel);
  color: var(--tool-text);
}

.theme-button span {
  display: none;
}

.main-area {
  width: 100%;
  max-width: none;
  padding: 14px 0 54px;
}

.main-area > .view:not(#feedView) {
  width: min(1240px, calc(100% - 32px));
  margin-inline: auto;
}

#feedView.workspace-feed.active {
  width: min(1580px, calc(100% - 24px));
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 244px;
  gap: 12px;
  align-items: start;
  margin-inline: auto;
}

#feedView .workspace-sidebar,
#feedView .activity-rail {
  position: sticky;
  top: 76px;
  right: auto;
  bottom: auto;
  left: auto;
  width: auto;
  min-width: 0;
  height: calc(100vh - 90px);
  display: grid;
  overflow: visible;
  border: 1px solid var(--tool-line);
  border-radius: 12px;
  background: var(--tool-sidebar);
  box-shadow: none;
  opacity: 1;
  transform: none;
}

#feedView .workspace-sidebar {
  grid-template-rows: 1fr;
  z-index: 48;
  pointer-events: auto;
  display: contents;
}

#feedView .workspace-nav {
  display: none;
  min-height: 0;
  flex-direction: column;
  gap: 5px;
  padding: 10px 8px;
}

#feedView .workspace-nav button {
  position: relative;
  width: 100%;
  min-height: 43px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--tool-muted);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

#feedView .workspace-nav button:hover:not(:disabled),
#feedView .workspace-nav button:focus-visible,
#feedView .workspace-nav button.active {
  background: color-mix(in srgb, var(--tool-orange) 12%, var(--tool-panel));
  color: var(--tool-orange);
}

#feedView .workspace-nav button.active {
  border-color: color-mix(in srgb, var(--tool-orange) 34%, transparent);
}

#feedView .workspace-nav button[data-count]::after {
  content: attr(data-count);
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--tool-panel-soft);
  color: var(--tool-muted);
  font-size: 9px;
}

#feedView .workspace-nav button small {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--tool-orange);
  color: #ffffff;
  font-size: 9px;
}

#feedView .workspace-filter-sheet {
  position: fixed;
  z-index: 72;
  top: 76px;
  left: max(126px, calc((100vw - min(1580px, calc(100vw - 24px))) / 2 + 124px));
  width: 330px;
  max-height: calc(100vh - 92px);
  display: none;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--tool-line);
  border-radius: 12px;
  background: var(--tool-panel);
  box-shadow: 0 22px 56px rgba(10, 14, 12, 0.22);
}

#feedView.mobile-filters-open .workspace-filter-sheet {
  display: grid;
}

#feedView .workspace-filter-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--tool-line);
}

#feedView .workspace-filter-head strong {
  font-size: 14px;
}

#feedView .workspace-filter-head button,
#feedView .activity-rail-head button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--tool-muted);
}

#feedView .workspace-filter-sheet > .panel-dock-tabs {
  min-height: 42px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 5px;
  border-bottom: 1px solid var(--tool-line);
}

#feedView .workspace-filter-sheet > .panel-dock-tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--tool-muted);
  font-size: 11px;
  font-weight: 800;
}

#feedView .workspace-filter-sheet > .panel-dock-tabs button.active {
  background: var(--tool-panel-soft);
  color: var(--tool-text);
}

#feedView .workspace-filter-sheet .dock-panel-page {
  min-height: 0;
  display: none;
  align-content: start;
  gap: 12px;
  padding: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
}

#feedView .workspace-filter-sheet .dock-panel-page.active {
  display: grid;
}

#feedView .workspace-filter-sheet .view-switch {
  min-height: 42px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--tool-line);
  border-radius: 9px;
  background: var(--tool-panel-soft);
}

#feedView .workspace-filter-sheet .view-switch button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--tool-muted);
  font-size: 11px;
  font-weight: 800;
}

#feedView .workspace-filter-sheet .view-switch button.active {
  background: var(--tool-panel);
  color: var(--tool-text);
  box-shadow: 0 2px 8px rgba(20, 24, 22, 0.08);
}

#feedView .filter-sheet-note {
  margin: 0;
  color: var(--tool-muted);
  font-size: 11px;
  line-height: 1.5;
}

#feedView .feed-workspace {
  min-width: 0;
}

#feedView .workspace-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  padding: 8px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#feedView .workspace-head::after {
  display: none;
}

#feedView .workspace-head .eyebrow {
  display: none;
}

#feedView .workspace-head h1 {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0;
  color: var(--tool-text);
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}

#feedView .workspace-head h1 span {
  color: var(--tool-muted);
  font-size: 12px;
  font-weight: 700;
}

#feedView .system-stats {
  display: flex;
  gap: 6px;
}

#feedView .system-stats div {
  min-width: auto;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid var(--tool-line);
  border-radius: 8px;
  background: var(--tool-panel);
  box-shadow: none;
}

#feedView .system-stats span {
  color: var(--tool-orange);
  font-size: 13px;
  font-weight: 900;
}

#feedView .system-stats small {
  margin: 0;
  color: var(--tool-muted);
  font-size: 9px;
}

#feedView .workspace-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

#feedView .section-filter-strip,
#feedView .section-filter-bar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

#feedView .section-filter-strip::-webkit-scrollbar,
#feedView .section-filter-bar::-webkit-scrollbar {
  display: none;
}

#feedView .section-filter-strip button,
#feedView .section-filter-bar button {
  min-height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--tool-line);
  border-radius: 8px;
  background: var(--tool-panel);
  color: var(--tool-muted);
  font-size: 10px;
  font-weight: 800;
}

#feedView .section-filter-strip button.active,
#feedView .section-filter-bar button.active {
  border-color: color-mix(in srgb, var(--tool-orange) 38%, var(--tool-line));
  background: color-mix(in srgb, var(--tool-orange) 10%, var(--tool-panel));
  color: var(--tool-orange);
}

#feedView .section-filter-strip small,
#feedView .section-filter-bar small {
  color: inherit;
  font-size: 9px;
}

#feedView .segmented {
  min-height: 36px;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--tool-line);
  border-radius: 9px;
  background: var(--tool-panel);
}

#feedView .segmented .segment {
  min-width: 48px;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--tool-muted);
  font-size: 10px;
  font-weight: 800;
}

#feedView .segmented .segment.active {
  background: var(--tool-panel-soft);
  color: var(--tool-text);
}

#feedView .mobile-filter-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--tool-line);
  border-radius: 9px;
  background: var(--tool-panel);
  color: var(--tool-text);
  font-size: 10px;
  font-weight: 800;
}

#feedView .mobile-filter-button.active {
  border-color: color-mix(in srgb, var(--tool-orange) 42%, var(--tool-line));
  color: var(--tool-orange);
}

#feedView .result-summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 9px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#feedView .result-summary span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--tool-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#feedView .result-summary button {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--tool-line);
  border-radius: 8px;
  background: var(--tool-panel);
  color: var(--tool-muted);
  font-size: 9px;
  font-weight: 800;
}

#feedView .project-grid,
[data-feed-mode="launcher"] #feedView .project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#feedView .project-card.app-tile,
[data-feed-mode="launcher"] #feedView .project-card.app-tile {
  min-height: 154px;
  grid-template-rows: minmax(82px, 1fr) auto;
  gap: 8px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--tool-line);
  border-radius: 11px;
  background: var(--tool-panel);
  box-shadow: none;
  backdrop-filter: none;
}

#feedView .project-card.app-tile::before {
  height: 2px;
  background: var(--app-accent, var(--tool-orange));
  opacity: 0.78;
}

#feedView .project-card.app-tile:hover {
  border-color: color-mix(in srgb, var(--app-accent, var(--tool-orange)) 34%, var(--tool-line));
  box-shadow: var(--tool-shadow);
  transform: translateY(-2px);
}

#feedView .app-launch,
[data-feed-mode="launcher"] #feedView .app-launch {
  min-height: 82px;
  grid-template-columns: 52px minmax(0, 1fr);
  place-items: start;
  align-items: start;
  gap: 11px;
  text-align: left;
}

#feedView .app-icon,
[data-feed-mode="launcher"] #feedView .app-icon {
  width: 52px;
  border-radius: 13px;
}

#feedView .app-icon::before {
  border-radius: 12px;
}

#feedView .app-info,
[data-feed-mode="launcher"] #feedView .app-info {
  min-width: 0;
  justify-items: start;
  gap: 2px;
}

#feedView .app-title-row,
[data-feed-mode="launcher"] #feedView .app-title-row {
  width: 100%;
  justify-content: flex-start;
  gap: 5px;
  padding-right: 30px;
}

#feedView .app-title-row strong,
[data-feed-mode="launcher"] #feedView .app-title-row strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--tool-text);
  font-size: 13px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#feedView .app-author,
#feedView .app-desc,
#feedView .app-access-note,
[data-feed-mode="launcher"] #feedView .app-author,
[data-feed-mode="launcher"] #feedView .app-desc,
[data-feed-mode="launcher"] #feedView .app-access-note {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#feedView .app-author,
#feedView .app-desc {
  color: var(--tool-muted);
}

#feedView .result-summary button span {
  min-width: auto;
  flex: 0 0 auto;
  overflow: visible;
  color: inherit;
  text-overflow: clip;
  white-space: nowrap;
}

#feedView .app-access-note {
  color: color-mix(in srgb, var(--app-accent, var(--tool-orange)) 76%, var(--tool-text));
  font-weight: 800;
}

#feedView .like-count-display {
  top: 12px;
  right: 12px;
  color: var(--tool-muted);
  font-size: 10px;
}

#feedView .heat-count-display {
  min-height: 18px;
  max-width: 58px;
  padding: 0 5px;
  border: 1px solid color-mix(in srgb, var(--tool-orange) 34%, var(--tool-line));
  border-radius: 6px;
  color: var(--tool-orange);
  font-size: 8px;
}

#feedView .app-meta-row,
[data-feed-mode="launcher"] #feedView .app-meta-row {
  min-width: 0;
  min-height: 27px;
  justify-content: flex-end;
  gap: 4px;
  margin-left: 63px;
}

#feedView .app-meta-row .tag-list {
  min-width: 0;
  flex: 1 1 80px;
  display: flex;
  gap: 3px;
  overflow: hidden;
}

#feedView .app-meta-row .tag-list span,
#feedView .comment-count-display {
  min-height: 22px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 8px;
}

#feedView .open-card-button,
#feedView .favorite-card-button,
#feedView .report-button,
#feedView .share-button,
#feedView .app-meta-row .admin-button {
  width: 27px;
  min-width: 27px;
  height: 27px;
  min-height: 27px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--tool-line);
  border-radius: 8px;
  background: transparent;
  color: var(--tool-muted);
}

#feedView .open-card-button span,
#feedView .favorite-card-button span,
#feedView .report-button span,
#feedView .share-button span,
#feedView .app-meta-row .admin-button span {
  display: none;
}

#feedView .open-card-button:hover,
#feedView .favorite-card-button:hover,
#feedView .report-button:hover,
#feedView .share-button:hover,
#feedView .app-meta-row .admin-button:hover,
#feedView .favorite-card-button.active {
  border-color: color-mix(in srgb, var(--app-accent, var(--tool-orange)) 42%, var(--tool-line));
  background: color-mix(in srgb, var(--app-accent, var(--tool-orange)) 10%, transparent);
  color: var(--app-accent, var(--tool-orange));
}

#feedView .open-card-button svg,
#feedView .favorite-card-button svg,
#feedView .report-button svg,
#feedView .share-button svg,
#feedView .app-meta-row .admin-button svg {
  width: 13px;
  height: 13px;
}

#feedView .activity-rail {
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

#feedView .activity-rail-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--tool-line);
}

#feedView .activity-rail-head strong {
  font-size: 13px;
}

#feedView .activity-rail > .panel-dock-tabs {
  min-height: 40px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 4px;
  border-bottom: 1px solid var(--tool-line);
}

#feedView .activity-rail > .panel-dock-tabs button {
  min-width: 0;
  min-height: 30px;
  padding: 0 3px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--tool-muted);
  font-size: 9px;
  font-weight: 800;
}

#feedView .activity-rail > .panel-dock-tabs button.active {
  background: var(--tool-panel-soft);
  color: var(--tool-orange);
}

#feedView .activity-rail > .panel-dock-body {
  min-height: 0;
  overflow: hidden;
}

#feedView .activity-rail .dock-panel-page {
  height: 100%;
  min-height: 0;
  display: none;
  align-content: start;
  gap: 8px;
  padding: 9px;
  overflow-y: auto;
  scrollbar-width: none;
}

#feedView .activity-rail .dock-panel-page.active {
  display: grid;
}

#feedView .activity-rail .dock-panel-page::-webkit-scrollbar {
  display: none;
}

#feedView .activity-rail .favorite-shelf,
#feedView .activity-rail .quick-shelf,
#feedView .activity-rail .favorite-list {
  position: static;
  width: auto;
  display: grid;
  gap: 7px;
  margin: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#feedView .activity-rail .quick-shelf-head,
#feedView .activity-rail .hint-title {
  margin: 0;
}

#feedView .activity-rail .favorite-list button {
  width: 100%;
  min-width: 0;
  min-height: 66px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--tool-line);
  border-radius: 9px;
  background: var(--tool-panel);
  color: var(--tool-text);
  text-align: left;
}

#feedView .activity-rail .favorite-list strong,
#feedView .activity-rail .favorite-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#feedView .activity-rail .favorite-list strong {
  font-size: 11px;
}

#feedView .activity-rail .favorite-list small {
  color: var(--tool-muted);
  font-size: 9px;
}

#feedView .side-dock-controls,
#feedView .mobile-tool-nav {
  display: none;
}

body[data-right-dock="collapsed"] #feedView .activity-rail {
  pointer-events: auto;
  opacity: 1;
  transform: none;
}

@media (max-width: 1199px) {
  .nav-inner {
    width: calc(100% - 24px);
  }

  .nav-search-box {
    max-width: 300px;
  }

  .nav-button span,
  .nav-random-button span {
    display: none;
  }

  .nav-button,
  .nav-random-button {
    width: 38px;
    min-width: 38px;
    padding: 0;
  }

  #feedView.workspace-feed.active {
    width: min(1120px, calc(100% - 20px));
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  #feedView > .workspace-sidebar {
    position: sticky;
    top: 74px;
    width: auto;
    height: calc(100vh - 86px);
    display: contents;
    overflow: visible;
  }

  #feedView .workspace-nav {
    padding: 8px 6px;
  }

  #feedView .workspace-nav button {
    min-height: 42px;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 0;
  }

  #feedView .workspace-nav button span,
  #feedView .workspace-nav button::after,
  #feedView .workspace-nav button small {
    display: none;
  }

  #feedView .workspace-filter-sheet {
    top: 64px;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(340px, calc(100% - 24px));
    max-height: none;
    border-radius: 14px 0 0 14px;
  }

  #feedView > .workspace-sidebar .workspace-filter-sheet {
    display: none;
  }

  #feedView.mobile-filters-open > .workspace-sidebar .workspace-filter-sheet {
    display: grid;
  }

  #feedView > .activity-rail {
    position: fixed;
    z-index: 74;
    top: 64px;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(340px, calc(100% - 24px));
    height: auto;
    border-radius: 14px 0 0 14px;
    box-shadow: 0 24px 60px rgba(8, 12, 10, 0.28);
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  body[data-right-dock="collapsed"] #feedView > .activity-rail {
    pointer-events: none;
    opacity: 0;
    transform: translateX(100%);
  }

  #feedView .project-grid,
  [data-feed-mode="launcher"] #feedView .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #feedView .section-filter-strip {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .top-nav,
  .nav-inner {
    min-height: 56px;
  }

  .nav-inner {
    width: calc(100% - 16px);
    gap: 7px;
  }

  .brand {
    min-width: 0;
    gap: 7px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }

  .brand-title {
    font-size: 15px;
  }

  .nav-search-box,
  .nav-actions .nav-button,
  .nav-actions .nav-random-button,
  .nav-actions .theme-button,
  .nav-actions .shortcut-help-button {
    display: none;
  }

  .mobile-nav-wrap {
    display: block;
    margin-left: auto;
  }

  .nav-actions {
    width: auto;
    gap: 5px;
  }

  .update-bubble-button,
  .login-button,
  .mobile-menu-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 9px;
  }

  .login-button {
    width: auto;
    max-width: 96px;
    padding: 0 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-area {
    padding: 8px 0 64px;
  }

  #feedView.mobile-filters-open::before,
  body[data-right-dock="open"] #feedView::before {
    content: "";
    position: fixed;
    z-index: 67;
    inset: 56px 0 0;
    background: rgba(8, 10, 9, 0.42);
    backdrop-filter: blur(2px);
  }

  .main-area > .view:not(#feedView) {
    width: calc(100% - 16px);
  }

  #feedView.workspace-feed.active {
    width: calc(100% - 12px);
    display: block;
  }

  #feedView > .workspace-sidebar {
    position: static;
    width: auto;
    height: auto;
    display: contents;
    border: 0;
  }

  #feedView .workspace-nav {
    display: none;
  }

  #feedView .workspace-filter-sheet {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(72dvh, 620px);
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }

  #feedView > .workspace-sidebar .workspace-filter-sheet {
    display: none;
  }

  #feedView.mobile-filters-open > .workspace-sidebar .workspace-filter-sheet {
    display: grid;
  }

  #feedView .workspace-head {
    min-height: 48px;
    margin-bottom: 6px;
    padding: 5px 4px;
  }

  #feedView .workspace-head h1 {
    font-size: 18px;
  }

  #feedView .system-stats {
    display: none;
  }

  #feedView .workspace-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    margin-bottom: 7px;
  }

  #feedView .section-filter-strip {
    display: none;
  }

  #feedView .segmented {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  #feedView .segmented::-webkit-scrollbar {
    display: none;
  }

  #feedView .segmented .segment {
    min-width: 48px;
    flex: 1 0 48px;
  }

  #feedView .mobile-filter-button {
    min-width: 72px;
    justify-content: center;
  }

  #feedView .result-summary {
    display: none;
  }

  #feedView .project-grid,
  [data-feed-mode="launcher"] #feedView .project-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  #feedView .project-card.app-tile,
  [data-feed-mode="launcher"] #feedView .project-card.app-tile {
    min-height: 118px;
    grid-template-rows: minmax(66px, 1fr) auto;
    gap: 5px;
    padding: 9px;
    border-radius: 10px;
  }

  #feedView .app-launch,
  [data-feed-mode="launcher"] #feedView .app-launch {
    min-height: 66px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 9px;
  }

  #feedView .app-icon,
  [data-feed-mode="launcher"] #feedView .app-icon {
    width: 42px;
    border-radius: 11px;
  }

  #feedView .app-icon::before {
    border-radius: 10px;
  }

  #feedView .app-title-row strong,
  [data-feed-mode="launcher"] #feedView .app-title-row strong {
    font-size: 13px;
  }

  #feedView .app-desc,
  #feedView .app-access-note,
  [data-feed-mode="launcher"] #feedView .app-desc,
  [data-feed-mode="launcher"] #feedView .app-access-note {
    font-size: 9px;
  }

  #feedView .app-meta-row,
  [data-feed-mode="launcher"] #feedView .app-meta-row {
    min-height: 24px;
    gap: 3px;
    margin-left: 51px;
  }

  #feedView .app-meta-row .tag-list span,
  #feedView .comment-count-display {
    min-height: 20px;
    padding: 0 6px;
    font-size: 8px;
  }

  #feedView .open-card-button,
  #feedView .favorite-card-button,
  #feedView .report-button,
  #feedView .share-button,
  #feedView .app-meta-row .admin-button {
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    border-radius: 7px;
  }

  #feedView .open-card-button {
    display: none;
  }

  #feedView > .activity-rail {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    max-height: min(72dvh, 620px);
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }

  #feedView .activity-rail .quick-shelf:not([hidden]),
  #feedView .activity-rail .favorite-shelf:not([hidden]) {
    display: grid !important;
  }

  #feedView .mobile-tool-nav {
    position: fixed;
    z-index: 68;
    right: 0;
    bottom: 0;
    left: 0;
    height: 58px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 4px;
    border: 1px solid var(--tool-line);
    border-radius: 0;
    border-width: 1px 0 0;
    background: color-mix(in srgb, var(--tool-panel) 96%, transparent);
    box-shadow: 0 12px 30px rgba(10, 14, 12, 0.18);
    backdrop-filter: blur(18px);
    transition: opacity 0.16s ease, transform 0.16s ease;
  }

  #feedView .mobile-tool-nav [data-mobile-tool="updates"] {
    display: none;
  }

  #feedView.mobile-filters-open .mobile-tool-nav,
  body[data-right-dock="open"] #feedView .mobile-tool-nav {
    pointer-events: none;
    opacity: 0;
    transform: translateY(100%);
  }

  #feedView .mobile-tool-nav button {
    min-width: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--tool-muted);
    font-size: 8px;
    font-weight: 800;
  }

  #feedView .mobile-tool-nav button.active {
    background: color-mix(in srgb, var(--tool-orange) 12%, var(--tool-panel));
    color: var(--tool-orange);
  }

  #feedView .mobile-tool-nav svg {
    width: 17px;
    height: 17px;
  }
}

/* The runner must win over every late view-width constraint in page fullscreen. */
body.runner-page-fullscreen .main-area {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body.runner-page-fullscreen .main-area > #projectView.is-page-fullscreen {
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body.runner-page-fullscreen #projectView.is-page-fullscreen .runner-frame-wrap,
body.runner-page-fullscreen #projectView.is-page-fullscreen .runner-iframe {
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
}

body.runner-page-fullscreen #projectView.is-page-fullscreen .runner-iframe {
  display: block;
}

.page-fullscreen-theme {
  position: fixed;
  top: calc(50% + 72px);
  right: 0;
  z-index: 95;
  width: 48px;
  height: 52px;
  display: none;
  place-items: center;
  border: 1px solid rgba(220, 220, 220, 0.54);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  background: rgba(228, 228, 228, 0.42);
  color: rgba(28, 28, 28, 0.84);
  opacity: 0.7;
  transform: translate(16px, -50%);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.project-runner-view.is-page-fullscreen .page-fullscreen-theme {
  display: grid;
}

.page-fullscreen-theme:hover,
.page-fullscreen-theme:focus-visible {
  opacity: 1;
  background: rgba(242, 242, 242, 0.76);
  transform: translate(0, -50%);
}

.page-fullscreen-theme svg {
  width: 19px;
  height: 19px;
}

.privacy-dialog {
  width: min(520px, calc(100vw - 32px));
  max-width: 100%;
  overflow: visible;
}

.privacy-panel {
  width: 100%;
  min-width: 0;
  max-height: calc(100dvh - 32px);
  padding: 28px;
  gap: 20px;
  overflow: auto hidden;
  border-radius: 8px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.26);
}

.privacy-panel > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.privacy-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding-right: 44px;
}

.privacy-heading .eyebrow {
  margin: 0 0 3px;
  color: var(--primary);
  font-size: 10px;
  letter-spacing: 0;
}

.privacy-heading h2 {
  font-size: 24px;
  line-height: 1.2;
}

.privacy-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
}

.privacy-icon svg {
  width: 20px;
  height: 20px;
}

.privacy-panel .auth-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.privacy-panel .privacy-check {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  color: var(--text);
  line-height: 1.45;
  white-space: normal;
  cursor: pointer;
}

.privacy-panel .privacy-check input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  padding: 0;
}

.privacy-panel .privacy-check span {
  display: grid;
  gap: 3px;
}

.privacy-panel .privacy-check strong {
  color: var(--text);
  font-size: 13px;
}

.privacy-panel .privacy-check small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.privacy-panel .login-actions {
  display: flex;
  justify-content: flex-end;
}

.privacy-panel .primary-button {
  min-width: 148px;
  min-height: 44px;
  border-radius: 8px;
}

.privacy-panel .primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  box-shadow: none;
}

.privacy-panel .close-login {
  top: 16px;
  right: 16px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.privacy-panel .close-login svg {
  width: 17px;
  height: 17px;
}

body[data-right-dock="collapsed"] #feedView.workspace-feed.active {
  grid-template-columns: minmax(0, 1fr);
}

body[data-right-dock="collapsed"] #feedView .activity-rail {
  display: none;
}

@media (max-width: 720px) {
  .privacy-dialog {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .privacy-panel {
    max-height: calc(100dvh - 16px);
    padding: 22px 18px max(18px, env(safe-area-inset-bottom));
    gap: 16px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }

  .privacy-heading {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding-right: 40px;
  }

  .privacy-icon {
    width: 38px;
    height: 38px;
  }

  .privacy-heading h2 {
    font-size: 21px;
  }

  .privacy-panel .auth-note {
    font-size: 13px;
    line-height: 1.65;
  }

  .privacy-panel .login-actions,
  .privacy-panel .primary-button {
    width: 100%;
  }

  #feedView .mobile-filter-button {
    position: relative;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    justify-content: center;
  }

  #feedView .mobile-filter-button span {
    display: none;
  }

  #feedView .mobile-filter-button small {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--tool-orange);
    color: #fff;
    font-size: 9px;
    line-height: 17px;
  }

  #feedView .open-card-button,
  #feedView .favorite-card-button,
  #feedView .report-button,
  #feedView .share-button,
  #feedView .app-meta-row .admin-button {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
  }

  #feedView .app-meta-row button svg {
    width: 15px;
    height: 15px;
  }
}
