:root {
  color-scheme: light;
  --bg: #fff7fa;
  --surface: #ffffff;
  --surface-tint: #fffafd;
  --surface-muted: #fff0f6;
  --ink: #261721;
  --muted: #755b68;
  --line: #f0cad8;
  --line-soft: #f4d8e3;
  --accent: #ec5b96;
  --accent-dark: #bd2e66;
  --accent-rgb: 236, 91, 150;
  --mint: #19a987;
  --mint-rgb: 25, 169, 135;
  --lime: #a8d85d;
  --gold: #f4b758;
  --aqua: #54c7d3;
  --violet: #8d6add;
  --danger: #cf3349;
  --ink-rgb: 38, 23, 33;
  --shadow: 0 18px 50px rgba(98, 32, 62, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 10% 8%, rgba(var(--accent-rgb), 0.16), transparent 24rem),
    radial-gradient(circle at 90% 18%, rgba(var(--mint-rgb), 0.12), transparent 22rem),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

body[data-mode="male"] {
  --bg: #f3f7fb;
  --surface-tint: #f8fbff;
  --surface-muted: #eaf2fb;
  --ink: #172033;
  --muted: #5e6d7d;
  --line: #d6e2ee;
  --line-soft: #dce8f2;
  --accent: #2f7dd3;
  --accent-dark: #1d5fa8;
  --accent-rgb: 47, 125, 211;
  --mint: #16a6b6;
  --mint-rgb: 22, 166, 182;
  --lime: #8bcf6a;
  --gold: #f0b44f;
  --ink-rgb: 23, 32, 51;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
}

body.modal-open {
  overflow: hidden;
}

body[data-mode="male"] .female-only {
  display: none !important;
}

body[data-mode="male"] .question-row {
  grid-template-columns: 1fr;
}

body[data-mode="male"] .action-card.watch {
  border-color: rgba(var(--accent-rgb), 0.25);
  background: rgba(var(--accent-rgb), 0.08);
}

body[data-mode="male"] .action-card.steady {
  border-color: rgba(var(--mint-rgb), 0.24);
  background: rgba(var(--mint-rgb), 0.08);
}

body[data-mode="male"] .download-banner {
  border-color: rgba(var(--accent-rgb), 0.24);
  background: rgba(var(--accent-rgb), 0.08);
}

body[data-mode="female"] .brand-mark {
  filter: drop-shadow(0 10px 20px rgba(var(--accent-rgb), 0.24));
}

body[data-mode="female"] .tabs {
  border-color: rgba(var(--accent-rgb), 0.2);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 34px rgba(98, 32, 62, 0.08);
}

body[data-mode="female"] .tab-button.active,
body[data-mode="female"] .download-primary,
body[data-mode="female"] .command.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #f06ca5 0%, #df4f8d 52%, #bd2e66 100%);
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.28);
  color: #fff;
}

body[data-mode="female"] .panel,
body[data-mode="female"] .community-compose-panel,
body[data-mode="female"] .community-feed-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 250, 253, 0.93));
}

body[data-mode="female"] .cycle-panel,
body[data-mode="female"] .cycle-calendar-panel,
body[data-mode="female"] .profile-plan-panel {
  border-color: rgba(var(--accent-rgb), 0.22);
}

body[data-mode="female"] .cycle-summary,
body[data-mode="female"] .download-banner {
  border-color: rgba(var(--accent-rgb), 0.26);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.13), rgba(var(--mint-rgb), 0.07)),
    rgba(255, 255, 255, 0.8);
}

body[data-mode="female"] .community-hero {
  position: relative;
  overflow: hidden;
  border-color: rgba(var(--accent-rgb), 0.2);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.15), rgba(var(--mint-rgb), 0.09)),
    rgba(255, 255, 255, 0.9);
}

body[data-mode="female"] .community-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--mint));
}

body[data-mode="female"] .topic-pill {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent-dark);
}

body[data-mode="female"] .score-ring {
  box-shadow:
    0 18px 46px rgba(var(--accent-rgb), 0.18),
    0 0 0 8px rgba(255, 255, 255, 0.7);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.svg-sprite {
  display: none;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-kicker,
.eyebrow {
  margin: 0 0 2px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.04;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.2;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-button,
.download-link {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.download-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent-dark);
  text-decoration: none;
  white-space: nowrap;
}

.date-chip,
.status-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0 13px;
  white-space: nowrap;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.icon-button svg,
.command svg,
.boost-button svg,
.timer-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.danger-ghost {
  color: var(--danger);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: min(560px, 100%);
  margin: 24px 0 26px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  max-width: 100%;
}

.download-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  padding: 16px 18px;
}

.download-banner strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.25;
}

.download-banner span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.4;
}

.trust-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(207, 51, 73, 0.26);
  border-radius: 10px;
  background: rgba(207, 51, 73, 0.06);
  color: #6f1c28;
  margin-bottom: 22px;
  padding: 12px 16px;
}

.trust-strip strong,
.trust-strip a {
  font-size: 13px;
  font-weight: 950;
}

.trust-strip span {
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.trust-strip a {
  color: #6f1c28;
  text-decoration: none;
}

.download-primary {
  min-height: 46px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  padding: 0 18px;
  text-decoration: none;
  white-space: nowrap;
}

.tab-button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.tab-button.active {
  background: var(--ink);
  color: #fff;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.heading-copy {
  max-width: 660px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.5;
}

.score-ring {
  --score: 0;
  width: 92px;
  height: 92px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--surface) 0 58%, transparent 59%),
    conic-gradient(var(--accent) calc(var(--score) * 1%), var(--line-soft) 0);
  box-shadow: var(--shadow);
}

.score-ring span {
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
}

.score-ring small {
  margin-top: -26px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.45fr);
  gap: 16px;
  align-items: stretch;
}

.workbench > *,
.panel {
  min-width: 0;
}

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

.session-panel,
.cycle-panel,
.cycle-calendar-panel,
.flare-panel,
.profile-plan-panel,
.action-panel,
.form-panel,
.manual-panel,
.chart-panel,
.insight-panel,
.report-panel,
.strategy-panel {
  padding: 18px;
}

.flare-panel {
  grid-column: 1 / -1;
}

.profile-plan-panel {
  grid-column: 1 / -1;
}

.reminder-panel {
  grid-column: 1 / -1;
}

.factory-panel {
  grid-column: 1 / -1;
  overflow: hidden;
}

.quick-log-panel {
  order: -3;
}

.session-panel,
.action-panel {
  order: -2;
}

.cycle-panel,
.cycle-calendar-panel,
.flare-panel,
.profile-plan-panel {
  order: 0;
}

.detail-log-panel {
  order: 1;
}

.reminder-panel {
  order: 1;
}

.relax-panel {
  order: 3;
}

.factory-panel .panel-title {
  padding: 18px 18px 0;
}

.factory-panel canvas {
  display: block;
  width: 100%;
  aspect-ratio: 2.1 / 1;
  min-height: 240px;
  background: var(--surface-muted);
}

.relax-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

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

.relax-summary strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.2;
}

.relax-summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.relax-summary > span:last-of-type {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.relax-summary::after {
  content: "展开";
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
  padding: 6px 10px;
}

.relax-panel[open] .relax-summary {
  border-bottom: 1px solid var(--line);
}

.relax-panel[open] .relax-summary::after {
  content: "收起";
}

.form-panel {
  grid-column: 1 / -1;
}

.quick-log-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  overflow: hidden;
}

.quick-log-panel h3 {
  margin-bottom: 6px;
}

.quick-log-panel p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.quick-log-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.quick-log-button {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-tint);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.quick-log-button strong {
  font-size: 17px;
  font-weight: 950;
  line-height: 1.1;
}

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

.quick-log-button:hover,
.quick-log-button:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.44);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.14);
  outline: 0;
}

.quick-log-button:active {
  transform: translateY(1px);
}

.quick-log-button.good {
  border-color: rgba(var(--mint-rgb), 0.28);
  background: linear-gradient(180deg, rgba(var(--mint-rgb), 0.1), var(--surface-tint));
}

.quick-log-button.warn,
.quick-log-button.period {
  border-color: rgba(var(--accent-rgb), 0.26);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.12), var(--surface-tint));
}

.quick-log-button.stuck {
  border-color: rgba(244, 183, 88, 0.34);
  background: linear-gradient(180deg, rgba(244, 183, 88, 0.16), var(--surface-tint));
}

.quick-log-button.rumble {
  border-color: rgba(84, 199, 211, 0.34);
  background: linear-gradient(180deg, rgba(84, 199, 211, 0.13), var(--surface-tint));
}

.detail-log-panel {
  padding: 0;
  overflow: hidden;
}

.detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

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

.detail-summary strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.2;
}

.detail-summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.detail-summary::after {
  content: "展开";
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
  padding: 6px 10px;
}

.detail-log-panel[open] .detail-summary::after {
  content: "收起";
}

.detail-log-body {
  display: grid;
  gap: 16px;
  padding: 0 18px 18px;
}

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

.settings-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.settings-grid input[type="time"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--ink);
  padding: 10px 12px;
}

.setting-check {
  min-height: 70px;
  align-content: center;
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-tint);
  padding: 12px;
}

.setting-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.settings-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.settings-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.trust-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  padding: 18px 0 0;
}

.trust-footer a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 950;
}

.legal-page {
  width: min(820px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.legal-page h1 {
  margin: 14px 0 8px;
  font-size: clamp(32px, 7vw, 56px);
}

.legal-page h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.legal-page section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  margin-top: 14px;
  padding: 18px;
}

.legal-page p {
  color: var(--muted);
  font-weight: 850;
  line-height: 1.7;
}

.legal-date {
  margin-bottom: 20px;
}

.legal-back {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 950;
  padding: 0 14px;
  text-decoration: none;
}

.community-compose-panel,
.community-feed-panel {
  margin-bottom: 16px;
  padding: 18px;
}

.community-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(160px, 0.8fr) minmax(280px, 2fr);
  gap: 12px;
}

.community-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.community-form input,
.community-form select,
.community-form textarea,
.comment-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  padding: 11px 12px;
}

.community-form textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

.community-textarea {
  grid-row: span 2;
}

.community-submit-row {
  grid-column: 1 / 3;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.community-submit-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.community-feed {
  display: grid;
  gap: 12px;
}

.community-post {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 14px;
}

.community-post-head,
.community-post-actions,
.community-comment {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.community-post-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.community-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-pill {
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
  padding: 5px 9px;
}

.community-post time,
.community-nick {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.community-post-body {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.community-post-actions {
  margin-bottom: 12px;
}

.community-action {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
}

.community-comments {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.community-comment {
  align-items: flex-start;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.community-comment strong {
  color: var(--ink);
  flex: 0 0 auto;
}

.comment-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.panel-title h3 {
  color: var(--ink);
}

.timer-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}

.timer-icon {
  width: 28px;
  height: 28px;
  color: var(--mint);
}

.timer {
  font-variant-numeric: tabular-nums;
  font-size: clamp(44px, 8vw, 72px);
  font-weight: 950;
  line-height: 1;
}

.cycle-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.08);
  padding: 14px;
}

.cycle-summary strong {
  font-size: 42px;
  line-height: 1;
}

.cycle-summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.cycle-settings {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 8px;
}

.cycle-calendar-panel {
  border-color: rgba(var(--accent-rgb), 0.2);
}

.cycle-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.cycle-day-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--muted);
  overflow: hidden;
}

.cycle-day-card span,
.cycle-day-card small {
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.cycle-day-card strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.cycle-day-card.period {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.12);
}

.cycle-day-card.ovulation {
  border-color: rgba(var(--mint-rgb), 0.3);
  background: rgba(var(--mint-rgb), 0.12);
}

.cycle-day-card.luteal {
  border-color: rgba(239, 176, 72, 0.34);
  background: rgba(239, 176, 72, 0.14);
}

.cycle-day-card.today {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.cycle-day-card.logged::after,
.cycle-day-card.flare::before {
  content: "";
  position: absolute;
  bottom: 7px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
}

.cycle-day-card.logged::after {
  left: calc(50% - 8px);
  background: var(--mint);
}

.cycle-day-card.flare::before {
  right: calc(50% - 8px);
  background: var(--danger);
}

.cycle-day-card.muted {
  color: #a1aaa3;
  background: #f3f5f1;
}

.cycle-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.cycle-status-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 10px;
}

.cycle-status-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.cycle-status-grid strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.1;
}

.cycle-coach {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.cycle-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.cycle-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}

.legend-dot.period {
  background: var(--accent);
}

.legend-dot.ovulation {
  background: var(--mint);
}

.legend-dot.luteal {
  background: var(--gold);
}

.legend-dot.flare {
  background: var(--danger);
}

.flare-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.flare-steps article {
  min-width: 0;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 14px;
}

.flare-steps strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.flare-steps span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.profile-plan-panel p {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.5;
}

.focus-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-panel {
  border-color: rgba(var(--ink-rgb), 0.16);
}

.action-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.action-card {
  min-width: 0;
  min-height: 124px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 14px;
}

.action-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.25;
}

.action-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.action-card.urgent {
  border-color: rgba(207, 51, 73, 0.25);
  background: rgba(207, 51, 73, 0.07);
}

.action-card.watch {
  border-color: rgba(var(--accent-rgb), 0.25);
  background: rgba(var(--accent-rgb), 0.07);
}

.action-card.steady {
  border-color: rgba(var(--mint-rgb), 0.24);
  background: rgba(var(--mint-rgb), 0.08);
}

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

.command {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.command.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.command:not(:disabled):active,
.boost-button:not(:disabled):active,
.tab-button:active,
.type-card:active {
  transform: translateY(1px);
}

.boost-board {
  display: grid;
  grid-template-columns: 62px 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  align-items: stretch;
}

.boost-board > div,
.boost-button {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.boost-button {
  display: grid;
  place-items: center;
  border-color: rgba(243, 184, 77, 0.6);
  background: var(--gold);
  color: var(--ink);
}

.boost-button svg {
  width: 26px;
  height: 26px;
}

.boost-board > div {
  display: grid;
  align-content: center;
  padding: 9px 11px;
}

.boost-board strong {
  font-size: 26px;
  line-height: 1;
}

.boost-board span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field-block {
  margin-bottom: 16px;
}

.field-block > label,
.note-field > span,
.manual-form span,
.cycle-settings span,
.counter-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(76px, 1fr));
  gap: 8px;
}

.type-card {
  min-height: 96px;
  display: grid;
  gap: 8px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.type-card[aria-selected="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb), 0.22);
}

.type-visual {
  position: relative;
  width: 46px;
  height: 38px;
  display: block;
}

.type-visual::before,
.type-visual::after {
  position: absolute;
  content: "";
  background: #8d5735;
}

.t1::before {
  width: 12px;
  height: 12px;
  left: 6px;
  top: 8px;
  border-radius: 50%;
  box-shadow: 18px 2px 0 #8d5735, 9px 18px 0 #8d5735;
}

.t2::before {
  width: 36px;
  height: 22px;
  left: 5px;
  top: 8px;
  border-radius: 16px 12px 14px 10px;
}

.t3::before {
  width: 40px;
  height: 17px;
  left: 3px;
  top: 11px;
  border-radius: 14px;
}

.t3::after {
  width: 2px;
  height: 18px;
  left: 22px;
  top: 10px;
  background: rgba(255, 255, 255, 0.7);
  transform: rotate(22deg);
}

.t4::before {
  width: 42px;
  height: 16px;
  left: 2px;
  top: 12px;
  border-radius: 999px;
  transform: rotate(-8deg);
}

.t5::before {
  width: 17px;
  height: 17px;
  left: 3px;
  top: 10px;
  border-radius: 50%;
  box-shadow: 14px 7px 0 #8d5735, 27px 1px 0 #8d5735;
}

.t6::before {
  width: 38px;
  height: 20px;
  left: 4px;
  top: 10px;
  border-radius: 44% 56% 42% 58%;
  filter: blur(0.6px);
}

.t7::before {
  width: 38px;
  height: 16px;
  left: 4px;
  top: 15px;
  border-radius: 50%;
  background: rgba(141, 87, 53, 0.62);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f4;
}

.segment {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segment.active {
  background: var(--mint);
  color: #fff;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

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

.counter-box {
  display: grid;
  gap: 12px;
  align-content: space-between;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 14px;
}

.counter-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

.counter-control {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
}

.counter-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

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

.habit {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  font-weight: 900;
}

.habit input {
  width: 18px;
  height: 18px;
  accent-color: var(--mint);
}

.red-flag-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.danger-check {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(207, 51, 73, 0.24);
  border-radius: 8px;
  background: rgba(207, 51, 73, 0.06);
  color: #7a1f2b;
  font-weight: 900;
}

.danger-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--danger);
}

.note-field textarea,
.cycle-settings input,
.counter-control input,
.manual-form input,
.manual-form select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--ink);
  padding: 10px 12px;
  resize: vertical;
}

.manual-panel {
  margin-bottom: 16px;
}

.manual-form {
  display: grid;
  grid-template-columns: 1fr 110px 110px 150px 120px;
  gap: 10px;
  align-items: end;
}

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

.log-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px;
}

.log-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.log-main strong {
  margin-right: 4px;
}

.tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  background: #edf4ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 0 9px;
}

.tag.good {
  background: rgba(var(--mint-rgb), 0.13);
  color: #11745d;
}

.tag.warn {
  background: rgba(243, 184, 77, 0.2);
  color: #8b5a0b;
}

.tag.cycle-tag {
  background: rgba(126, 106, 217, 0.14);
  color: #5a48a8;
}

.tag.danger-tag {
  background: rgba(207, 51, 73, 0.12);
  color: #7a1f2b;
}

.delete-log {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--danger);
}

.delete-log svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  padding: 28px;
  text-align: center;
  font-weight: 900;
}

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

.metric-tile {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.metric-tile span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.metric-tile strong {
  font-size: clamp(30px, 6vw, 50px);
  line-height: 1;
}

.chart-panel {
  margin-bottom: 16px;
}

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

.heat-cell {
  min-height: 74px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.heat-cell[data-level="1"] {
  background: rgba(92, 200, 215, 0.2);
}

.heat-cell[data-level="2"] {
  background: rgba(var(--mint-rgb), 0.22);
}

.heat-cell[data-level="3"] {
  background: rgba(183, 216, 60, 0.42);
}

.heat-count {
  color: var(--ink);
  font-size: 20px;
}

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

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 42px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.cycle-row {
  grid-template-columns: 72px 1fr 92px;
}

.trigger-row {
  grid-template-columns: 88px 1fr 42px;
}

.bar-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2ed;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
}

.bar-row:nth-child(2n) .bar-fill {
  background: var(--mint);
}

.bar-row:nth-child(3n) .bar-fill {
  background: var(--gold);
}

.strategy-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.55;
}

.insight-panel {
  margin-bottom: 16px;
  border-color: rgba(var(--accent-rgb), 0.34);
}

.insight-panel p {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.45;
}

.red-flag {
  border-left: 4px solid var(--danger);
  border-radius: 6px;
  background: rgba(207, 51, 73, 0.08);
  color: #7a1f2b;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.report-panel {
  margin-bottom: 16px;
}

.report-panel .panel-title {
  align-items: center;
}

.report-panel pre {
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--ink);
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family:
    ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100% - 40px));
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  font-weight: 900;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(23, 33, 29, 0.42);
  padding: 20px;
}

.onboarding-overlay[hidden] {
  display: none;
}

.onboarding-panel {
  width: min(760px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: 0 28px 90px rgba(23, 33, 29, 0.32);
}

.onboarding-panel form {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.onboarding-head {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.onboarding-head h2 {
  font-size: clamp(28px, 6vw, 44px);
}

.onboarding-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.5;
}

.question-card {
  min-width: 0;
  min-inline-size: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 14px;
}

.question-card legend,
.range-question > span {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
}

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

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

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

.option-grid label {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--ink);
  font-weight: 900;
  text-align: center;
  padding: 8px;
}

.option-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.option-grid input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.question-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.range-question {
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.range-question strong {
  font-size: 34px;
  line-height: 1;
}

.onboarding-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  position: sticky;
  bottom: -20px;
  background: linear-gradient(rgba(245, 247, 242, 0), var(--bg) 28%);
  padding-top: 18px;
}

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

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

  .cycle-settings,
  .flare-steps,
  .action-list,
  .quick-log-panel,
  .quick-log-grid,
  .settings-grid,
  .community-form,
  .manual-form,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-textarea,
  .community-submit-row {
    grid-column: 1 / -1;
  }

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

@media (max-width: 620px) {
  .app-shell {
    width: min(calc(100vw - 22px), 1180px);
    padding-top: 18px;
  }

  .topbar,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-title {
    justify-content: flex-start;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .download-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .download-primary {
    width: 100%;
  }

  .score-ring {
    width: 78px;
    height: 78px;
  }

  .type-grid,
  .quick-metrics,
  .habit-grid,
  .red-flag-grid,
  .segmented,
  .cycle-settings,
  .flare-steps,
  .action-list,
  .quick-log-panel,
  .quick-log-grid,
  .settings-grid,
  .community-form,
  .manual-form,
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quick-log-panel {
    align-items: stretch;
  }

  .quick-log-button {
    min-height: 86px;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .community-submit-row,
  .comment-form {
    grid-template-columns: 1fr;
  }

  .boost-board {
    grid-template-columns: 58px 1fr 1fr;
  }

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

  .heatmap {
    gap: 6px;
  }

  .heat-cell {
    min-height: 58px;
    padding: 6px;
  }

  .cycle-row {
    grid-template-columns: 64px 1fr 80px;
  }

  .trigger-row {
    grid-template-columns: 76px 1fr 38px;
  }

  .flare-steps {
    grid-template-columns: 1fr;
  }

  .onboarding-overlay {
    align-items: end;
    justify-items: start;
    padding: 0;
  }

  .onboarding-panel {
    width: min(100%, 390px);
    max-height: 94vh;
    border-radius: 8px 8px 0 0;
  }

  .onboarding-panel form {
    padding: 16px;
  }

  .option-grid,
  .option-grid.dense,
  .option-grid.compact {
    grid-template-columns: 1fr 1fr;
  }

  .question-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .type-grid,
  .quick-metrics,
  .habit-grid,
  .red-flag-grid,
  .cycle-settings,
  .flare-steps,
  .action-list,
  .quick-log-panel,
  .quick-log-grid,
  .settings-grid,
  .settings-actions,
  .trust-strip,
  .community-form,
  .manual-form,
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .relax-summary {
    grid-template-columns: 1fr;
  }

  .question-row,
  .option-grid,
  .option-grid.dense,
  .option-grid.compact,
  .onboarding-actions {
    grid-template-columns: 1fr;
  }
}

/* Community redesign: calm anonymous support room */
.tabs {
  width: min(680px, 100%);
  border-radius: 14px;
  padding: 6px;
}

.tab-button {
  min-height: 52px;
  border-radius: 10px;
  font-size: 15px;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.tab-button:focus-visible,
.download-primary:focus-visible,
.community-action:focus-visible,
.community-form input:focus-visible,
.community-form select:focus-visible,
.community-form textarea:focus-visible,
.comment-form input:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.34);
  outline-offset: 2px;
}

.community-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
  border: 1px solid rgba(var(--ink-rgb), 0.1);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.11), rgba(var(--mint-rgb), 0.08)),
    rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  padding: 22px;
}

.community-hero h2 {
  max-width: 720px;
  font-size: clamp(38px, 6vw, 72px);
}

.community-hero p:not(.eyebrow) {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.55;
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.28fr);
  gap: 16px;
  align-items: start;
}

.community-compose-panel,
.community-feed-panel {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  padding: 18px;
}

.community-compose-panel {
  position: sticky;
  top: 18px;
}

.community-form,
.community-row,
.community-textarea,
.community-submit-row {
  display: grid;
  gap: 12px;
}

.community-form {
  grid-template-columns: 1fr;
}

.community-row {
  grid-template-columns: 1fr 1fr;
}

.community-form label {
  min-width: 0;
}

.community-form label > span,
.community-textarea > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.community-form input,
.community-form select,
.community-form textarea,
.comment-form input {
  min-height: 46px;
  border-radius: 10px;
  background: var(--surface-tint);
  font-size: 14px;
}

.community-form textarea {
  min-height: 170px;
}

.community-submit-row {
  grid-column: auto;
  grid-template-columns: 1fr;
}

.community-submit-row .command {
  width: 100%;
}

.community-feed {
  gap: 14px;
}

.community-post {
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, var(--surface-tint));
  padding: 16px;
}

.community-post-head {
  align-items: flex-start;
}

.topic-pill {
  background: rgba(var(--accent-rgb), 0.11);
  font-size: 12px;
  padding: 6px 10px;
}

.community-nick,
.community-post time {
  font-size: 12px;
}

.community-post-body {
  margin: 6px 0 14px;
  font-size: 17px;
  line-height: 1.62;
}

.community-action {
  min-height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.community-action:hover {
  border-color: rgba(var(--accent-rgb), 0.34);
  color: var(--accent-dark);
}

.community-comments {
  border-top: 1px solid rgba(var(--ink-rgb), 0.1);
}

.community-comment {
  display: grid;
  grid-template-columns: auto 1fr;
}

.comment-form {
  grid-template-columns: 1fr auto;
}

body[data-mode="male"] .community-hero {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), rgba(var(--mint-rgb), 0.1)),
    rgba(255, 255, 255, 0.9);
}

body[data-mode="male"] .topic-pill {
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--accent-dark);
}

@media (max-width: 900px) {
  .community-hero,
  .community-layout {
    grid-template-columns: 1fr;
  }

  .community-compose-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tab-button {
    min-height: 46px;
    font-size: 14px;
  }

  .community-hero {
    padding: 18px;
  }

  .community-row,
  .comment-form,
  .community-comment {
    grid-template-columns: 1fr;
  }
}
