:root {
  --bg: #f4f7f7;
  --panel: #ffffff;
  --line: #dce4e7;
  --text: #1c2a2f;
  --muted: #64747a;
  --teal: #ee4d2d;
  --teal-soft: #fff1ec;
  --orange: #e95f2a;
  --orange-soft: #fff0e8;
  --green: #2d7d46;
  --green-soft: #eaf5ed;
  --amber: #a46a12;
  --amber-soft: #fff6df;
  --blue: #2f6f9f;
  --blue-soft: #e8f1f8;
  --shadow: 0 14px 32px rgba(28, 42, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", Arial, sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 236px 1fr;
}

.sidebar {
  min-height: 100vh;
  padding: 20px 14px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
}

.brand {
  font-size: 20px;
  font-weight: 900;
  margin: 0 8px 18px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.nav a.active {
  color: var(--teal);
  background: var(--teal-soft);
}

.main {
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.stat {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.row,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 12px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.name {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
}

.meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.wait { color: var(--amber); background: var(--amber-soft); }
.badge.done { color: var(--green); background: var(--green-soft); }
.badge.edit { color: var(--orange); background: var(--orange-soft); }
.badge.scan { color: var(--blue); background: var(--blue-soft); }

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
}

input,
select,
textarea {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

input[type="file"] {
  padding: 9px 12px;
}

.button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 13px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}

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

.button.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.button.approve { background: var(--green); }
.button.remake { background: var(--amber); }
.button.download { background: var(--orange); }
.button.danger { background: #c2410c; }

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

.task-row {
  cursor: pointer;
}

.task-row.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.task-detail {
  margin-top: 12px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.video-preview {
  height: 132px;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #edf3f3;
}

.video-preview svg {
  width: 100%;
  height: 100%;
  display: block;
}

.video-player {
  width: 100%;
  height: 100%;
  display: block;
  background: #111;
  object-fit: contain;
}

.title-line {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
}

.mobile-page {
  min-height: 100vh;
  background: #edf3f1;
}

.mobile-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 18px 14px 94px;
}

.mobile-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 74px;
  padding: 8px 2px 18px;
}

.mobile-kicker {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.mobile-header h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  white-space: nowrap;
  word-break: keep-all;
}

.mobile-credit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.member-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.member-summary span,
.member-summary strong {
  display: block;
  min-width: 0;
}

.member-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.member-summary strong {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.member-summary small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.member-summary .subscription-line {
  margin-top: 8px;
  color: var(--mobile-ink);
  font-size: 12px;
}

.member-summary .compact-logout {
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.credit-overview {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.credit-overview[hidden] {
  display: none;
}

.credit-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.credit-overview-header h2,
.credit-overview-header p {
  margin: 0;
}

.credit-overview-header h2 {
  font-size: 18px;
  line-height: 1.15;
}

.credit-overview-header p,
.credit-overview-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.credit-overview-header span {
  white-space: nowrap;
}

.credit-balance-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: #1c2a2f;
  color: #fff;
  box-shadow: var(--shadow);
}

.credit-balance-panel strong {
  display: block;
  margin-top: 8px;
  font-size: 44px;
  line-height: 0.95;
}

.credit-balance-panel p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 900;
}

.credit-label,
.credit-date {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.credit-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.credit-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.credit-metric strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.credit-metric span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.credit-list-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.credit-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.credit-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.credit-section-title h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
}

.credit-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.credit-detail-toggle {
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
  white-space: nowrap;
}

.credit-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 2px;
}

.credit-pagination .button {
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
}

.credit-pagination span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.credit-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.credit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.credit-row strong,
.credit-row span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.credit-row strong {
  font-size: 13px;
  font-weight: 900;
}

.credit-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.credit-row em {
  color: var(--orange);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.credit-empty {
  padding: 10px 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.install-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(193, 154, 88, 0.22);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 10px 24px rgba(22, 35, 38, 0.08);
  backdrop-filter: blur(10px);
}

.install-prompt strong,
.install-prompt span {
  display: block;
}

.install-prompt strong {
  font-size: 12px;
  font-weight: 900;
}

.install-prompt span,
.install-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.install-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.install-button {
  white-space: nowrap;
}

.install-prompt .button {
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  box-shadow: none;
}

.invite-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--bg);
}

.invite-gate[hidden] {
  display: none;
}

.invite-card {
  width: min(380px, 100%);
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.invite-logo {
  width: 92px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
}

.invite-card h2,
.invite-card p {
  margin: 0;
}

.invite-card input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
}

.mobile-screen {
  display: grid;
  gap: 12px;
}

.mobile-screen[hidden] {
  display: none;
}

.mobile-brand-art {
  width: min(100%, 188px);
  aspect-ratio: 1 / 1;
  justify-self: center;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: 0 14px 30px rgba(238, 77, 45, 0.22);
}

.mobile-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px;
}

.mobile-section-title.compact {
  margin-top: 6px;
}

.mobile-section-title h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.mobile-section-title span {
  color: #111111;
  font-size: 12px;
  font-weight: 900;
}

.mobile-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.mobile-form input,
.mobile-form select,
.mobile-form textarea {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
}

.mobile-form textarea {
  min-height: 112px;
}

.subtitle-color-field {
  display: grid;
  gap: 8px;
}

.product-name-field {
  display: grid;
  gap: 8px;
}

.product-name-gradient-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.product-name-gradient-option {
  min-width: 0;
  min-height: 76px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

.product-name-gradient-option:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: inset 0 0 0 1px rgba(238, 77, 45, 0.28);
}

.product-name-gradient-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.product-name-gradient-swatch {
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  color: transparent;
  background: linear-gradient(90deg, var(--product-name-gradient));
  background-clip: text;
  -webkit-background-clip: text;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.subtitle-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.subtitle-color-option {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.subtitle-color-option:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: inset 0 0 0 1px rgba(238, 77, 45, 0.28);
}

.subtitle-color-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.subtitle-swatch {
  flex: 0 0 30px;
  width: 30px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(238, 77, 45, 0.12) 25%, transparent 25% 50%, rgba(47, 111, 159, 0.12) 50% 75%, transparent 75%),
    #f6f9f9;
  background-size: 10px 10px;
  border: 1px solid rgba(28, 42, 47, 0.26);
}

.subtitle-swatch::before {
  content: "字";
  color: var(--subtitle-text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  text-shadow: -1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000;
}

.subtitle-swatch.white-outline::before {
  text-shadow: -1px 0 #fff, 0 1px #fff, 1px 0 #fff, 0 -1px #fff;
}

.mobile-page .list,
.mobile-page .video-list {
  display: grid;
  gap: 10px;
  padding: 0;
}

.mobile-page .row,
.mobile-page .card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.mobile-page .name {
  font-size: 16px;
}

.mobile-page .meta {
  font-size: 13px;
  line-height: 1.55;
}

.mobile-page .actions {
  display: grid;
  grid-template-columns: 1fr;
  justify-content: stretch;
}

.mobile-page .button {
  width: 100%;
  min-height: 50px;
  font-size: 15px;
}

.mobile-page .member-summary .compact-logout {
  width: auto;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.mobile-page .badge {
  min-height: 32px;
  width: fit-content;
}

.mobile-page .video-preview {
  height: auto;
  aspect-ratio: 9 / 16;
  max-height: 68vh;
}

.mobile-page .video-player {
  object-fit: contain;
}

.library-control,
.library-pick-row {
  gap: 14px;
}

.library-count-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
}

.library-hashtags {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 247, 237, 0.85);
}

.library-hashtags.compact {
  margin-top: 8px;
  padding: 8px 10px;
}

.hashtag-text {
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
  color: var(--ink);
}

.library-pick-main {
  min-width: 0;
}

.library-pick-actions {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 24px rgba(28, 42, 47, 0.12);
}

.mobile-nav button {
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
}

.mobile-nav button.active {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

/* Mobile product refresh */
.mobile-page {
  --mobile-ink: #2a201d;
  --mobile-deep: #ff5a2f;
  --mobile-deeper: #df3213;
  --mobile-soft: #fff6f1;
  --mobile-card: #fffdfb;
  --mobile-coral: #ee4d2d;
  --mobile-coral-deep: #d93616;
  --mobile-copper: #ff6a3d;
  --mobile-copper-deep: #d93a16;
  --mobile-gold: #ff9b45;
  --mobile-gold-soft: #fff0dc;
  --mobile-cream: #fff7ed;
  --mobile-line: rgba(238, 77, 45, 0.16);
  --mobile-shadow: 0 14px 32px rgba(238, 77, 45, 0.11);
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 168, 96, 0.88), transparent 28%),
    linear-gradient(135deg, #ff7043 0%, #ee4d2d 44%, #d93616 100%) 0 0 / 100% 172px no-repeat,
    linear-gradient(180deg, #fff6f1 0%, #fffdfb 100%);
  color: var(--mobile-ink);
}

.mobile-shell {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 16px 14px 104px;
}

.mobile-header {
  min-height: 64px;
  padding: 8px 2px 14px;
  color: #fff;
}

.mobile-kicker {
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  letter-spacing: 0;
}

.mobile-header h1 {
  color: #fff;
  font-size: 25px;
}

.mobile-screen {
  gap: 14px;
}

.brand-spotlight {
  min-height: 292px;
  display: grid;
  place-items: center;
  padding: 0 0 4px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-spotlight img {
  width: min(292px, 82vw);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 24px;
  clip-path: inset(6% round 24px);
  box-shadow: none;
}

.member-summary {
  grid-template-columns: minmax(0, 1fr);
  padding: 13px;
  border-color: var(--mobile-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 250, 247, 0.98));
  box-shadow: var(--mobile-shadow);
}

.member-summary span {
  color: #7d6e65;
}

.member-summary strong {
  color: var(--mobile-ink);
  font-size: 15px;
}

.member-summary .compact-logout {
  min-height: 38px;
  border-radius: 8px;
}

.member-summary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.recharge-button {
  background: linear-gradient(145deg, #ff6a3d, #ee4d2d);
}

.home-dashboard {
  display: grid;
  gap: 12px;
}

.radar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(238, 77, 45, 0.2);
  border-radius: 8px;
  background: linear-gradient(145deg, #ffe1d5, #ffcbbb);
  box-shadow: var(--mobile-shadow);
  color: #9f3d24;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.radar-link:focus-visible {
  outline: 3px solid rgba(238, 77, 45, 0.2);
  outline-offset: 2px;
}

.mobile-home-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 38px;
}

.radar-screen {
  gap: 14px;
}

.radar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px 2px;
}

.radar-toolbar div {
  min-width: 0;
}

.radar-toolbar span,
.radar-toolbar h2 {
  display: block;
  margin: 0;
}

.radar-toolbar span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.radar-toolbar h2 {
  margin-top: 2px;
  color: #fff;
  font-size: 24px;
}

.radar-back,
.radar-list-back {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.radar-search-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--mobile-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--mobile-shadow);
}

.radar-search-panel label {
  font-size: 13px;
  font-weight: 900;
}

.radar-search-panel input,
.radar-search-panel select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--mobile-line);
  border-radius: 8px;
  background: #fffaf4;
  color: var(--mobile-ink);
  font: inherit;
  font-size: 16px;
}

.radar-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 8px;
}

.radar-ranking {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.radar-ranking button,
.radar-pagination button,
.radar-empty button {
  min-height: 44px;
  border: 1px solid var(--mobile-line);
  border-radius: 8px;
  background: #fff;
  color: var(--mobile-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.radar-ranking button.active,
.radar-empty button {
  border-color: var(--mobile-coral);
  background: var(--mobile-coral);
  color: #fff;
}

.radar-status {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.radar-status div {
  display: grid;
  gap: 2px;
}

.radar-status strong,
.radar-status span {
  display: block;
}

.radar-status span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.radar-results {
  display: grid;
  gap: 10px;
}

.radar-keyword-card {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--mobile-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--mobile-ink);
  box-shadow: var(--mobile-shadow);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.radar-result-number {
  color: var(--mobile-coral);
  font-size: 18px;
  font-weight: 900;
}

.radar-result-copy {
  min-width: 0;
}

.radar-result-copy strong,
.radar-result-copy small {
  display: block;
}

.radar-result-copy strong {
  font-size: 16px;
}

.radar-result-copy small {
  margin-top: 4px;
  color: #75665f;
  font-size: 12px;
  line-height: 1.45;
}

.radar-result-action {
  color: var(--mobile-coral);
  font-size: 12px;
  font-weight: 900;
}

.radar-product-card,
.radar-empty {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--mobile-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--mobile-shadow);
}

.radar-product-card h3,
.radar-empty strong,
.radar-empty span {
  margin: 0;
}

.radar-product-card h3 {
  font-size: 16px;
  line-height: 1.45;
}

.radar-rank {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 8px;
  background: #fff0e8;
  color: var(--mobile-coral-deep);
  font-size: 11px;
  font-weight: 900;
}

.radar-product-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.radar-product-facts span {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #fff7ed;
}

.radar-product-facts small,
.radar-product-facts strong {
  display: block;
}

.radar-product-facts small {
  color: #7d6e65;
  font-size: 11px;
  font-weight: 900;
}

.radar-product-facts strong {
  margin-top: 4px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.radar-product-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--mobile-coral), var(--mobile-coral-deep));
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.radar-empty {
  text-align: center;
}

.radar-empty span {
  color: #75665f;
  font-size: 13px;
}

.radar-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding-bottom: 8px;
}

.radar-pagination span {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.radar-pagination button:disabled {
  opacity: 0.48;
  cursor: default;
}

@media (max-width: 380px) {
  .radar-filters {
    grid-template-columns: 1fr;
  }
}

/* The member radar is the original Selection Radar application, mounted unchanged. */
.mobile-page .radar-screen {
  position: fixed;
  inset: 0 0 78px;
  z-index: 18;
  display: block;
  padding: 0;
  background: #fff8f5;
}

.mobile-page .radar-screen[hidden] {
  display: none;
}

.radar-original-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff8f5;
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-metric {
  min-height: 108px;
  padding: 13px;
  border: 1px solid var(--mobile-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fffdf8, #faf7ef);
  box-shadow: var(--mobile-shadow);
}

.home-metric.primary {
  color: #fff;
  background: linear-gradient(145deg, #ff6a3d, #ee4d2d 52%, #d93616);
  border-color: transparent;
  box-shadow:
    0 18px 42px rgba(73, 34, 24, 0.18),
    inset 0 0 0 1px rgba(244, 212, 166, 0.18);
}

.home-metric span,
.home-metric em {
  display: block;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.home-metric span {
  color: #7d6e65;
}

.home-metric.primary span,
.home-metric.primary em {
  color: rgba(244, 212, 166, 0.82);
}

.home-metric strong {
  display: block;
  margin: 7px 0 5px;
  font-size: 30px;
  line-height: 1;
}

.home-metric em {
  color: #85766d;
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-action {
  min-height: 76px;
  display: block;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--mobile-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fffdf8, #faf7ef);
  color: var(--mobile-ink);
  box-shadow: var(--mobile-shadow);
}

.home-action.primary {
  background: linear-gradient(145deg, #d95a2b, #9f3d24);
  color: #fff;
  border-color: rgba(217, 90, 43, 0.36);
}

.home-action span,
.home-action strong {
  display: block;
}

.home-action span {
  color: #827168;
  font-size: 12px;
  font-weight: 900;
}

.home-action.primary span {
  color: rgba(255, 249, 236, 0.72);
}

.home-action strong {
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.25;
}

.home-latest {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--mobile-line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, #fffdf8, #fff8eb);
  box-shadow: var(--mobile-shadow);
}

.home-latest span,
.home-latest em {
  display: block;
  color: #827168;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.home-latest strong {
  display: block;
  margin: 5px 0;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.home-credit {
  padding: 14px;
  border: 1px solid var(--mobile-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fffdf8, #faf7ef);
  box-shadow: var(--mobile-shadow);
}

.credit-balance-panel {
  border-radius: 8px;
  background: linear-gradient(145deg, #ff6a3d, #ee4d2d 52%, #d93616);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.credit-balance-panel strong {
  font-size: 40px;
}

.credit-metric,
.credit-row,
.mobile-page .row,
.mobile-page .card,
.mobile-form {
  border-color: var(--mobile-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--mobile-shadow);
}

.mobile-section-title {
  padding: 6px 2px 0;
}

.mobile-section-title h2 {
  font-size: 22px;
}

.mobile-section-title span {
  color: #111111;
}

.mobile-form {
  gap: 12px;
  padding: 14px;
}

.mobile-form input,
.mobile-form select,
.mobile-form textarea,
.invite-card input {
  border-color: var(--mobile-line);
  border-radius: 8px;
  background: #fffaf4;
}

.mobile-form input:focus,
.mobile-form select:focus,
.mobile-form textarea:focus,
.invite-card input:focus {
  outline: 2px solid rgba(217, 90, 43, 0.18);
  border-color: var(--mobile-coral);
}

.button,
.mobile-page .button {
  border-radius: 8px;
  background: linear-gradient(145deg, var(--mobile-coral), var(--mobile-coral-deep));
  box-shadow: 0 10px 20px rgba(159, 77, 56, 0.16);
}

.button.secondary {
  background: #fff;
  color: var(--mobile-ink);
  border-color: var(--mobile-line);
  box-shadow: none;
}

.button.download { background: linear-gradient(145deg, var(--mobile-copper), var(--mobile-copper-deep)); }
.button.approve { background: linear-gradient(145deg, #3f8b61, #287a4f); }
.button.remake { background: linear-gradient(145deg, var(--mobile-gold), #956c30); }
.button.danger { background: linear-gradient(145deg, #c2573d, #9f3d2a); }

.subtitle-color-option {
  border-color: var(--mobile-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(73, 34, 24, 0.08);
}

.subtitle-color-option:has(input:checked) {
  border-color: var(--mobile-coral);
  background: #fff0e8;
  color: #9f3d24;
  box-shadow: inset 0 0 0 1px rgba(217, 90, 43, 0.18);
}

.product-name-gradient-option {
  border-color: var(--mobile-line);
  background: #fff;
  box-shadow: 0 8px 18px rgba(73, 34, 24, 0.08);
}

.product-name-gradient-option:has(input:checked) {
  border-color: var(--mobile-coral);
  background: #fff0e8;
  color: #9f3d24;
  box-shadow: inset 0 0 0 1px rgba(217, 90, 43, 0.18);
}

.badge {
  border-radius: 8px;
}

.invite-gate {
  background:
    radial-gradient(circle at 50% 0, rgba(255, 178, 115, 0.72), transparent 30%),
    linear-gradient(145deg, #ff7043 0%, #ee4d2d 46%, #d93616 100%) 0 0 / 100% 42% no-repeat,
    linear-gradient(180deg, #fff6f1, #fffdfb);
}

.invite-card {
  gap: 14px;
  border-color: rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  box-shadow: 0 22px 46px rgba(73, 34, 24, 0.2);
}

.invite-logo {
  border-radius: 8px;
}

.mobile-nav {
  left: 10px;
  right: 10px;
  bottom: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid rgba(83, 43, 33, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 30px rgba(73, 34, 24, 0.14);
}

.mobile-nav button {
  min-height: 50px;
  border-radius: 8px;
  font-size: 12px;
}

.mobile-nav button.active {
  background: linear-gradient(145deg, #ff6a3d, #ee4d2d 52%, #d93616);
  border-color: #ee4d2d;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

@media (max-width: 360px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-logo {
    width: 76px;
  }

  .home-metrics,
  .home-actions {
    grid-template-columns: 1fr;
  }

  .mobile-nav {
    gap: 4px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .mobile-nav button {
    font-size: 11px;
  }
}

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

  .sidebar {
    min-height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .main {
    padding: 16px;
  }

  .stats,
  .grid.two,
  .grid.three,
  .video-grid {
    grid-template-columns: 1fr;
  }
}
