.reels-page {
  --bg: #0d0908;
  --panel: #17110e;
  --ink: #f8edd5;
  --muted: #b8aa91;
  --line: #4b3b2d;
  --accent: #d8ad4f;
  --accent-ink: #160f09;
  --danger: #e26150;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
  background:
    linear-gradient(rgba(11, 7, 6, 0.78), rgba(11, 7, 6, 0.95)),
    url('/assets/background-thumbs/golden-bokeh-reference.jpg') center top / cover fixed;
}

.reels-page .app-header {
  justify-content: center;
  min-height: 86px;
  border-bottom-color: rgba(216, 173, 79, 0.38);
  background: rgba(13, 9, 8, 0.9);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.reels-brand {
  position: relative;
  display: flex;
  width: min(100%, 980px);
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.reels-brand > div {
  min-width: 0;
  text-align: center;
}

.reels-brand-mark {
  position: absolute;
  left: 0;
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #d8ad4f;
  border-radius: 50%;
  background: #25170e;
  color: #f5ce70;
  box-shadow: 0 0 22px rgba(216, 173, 79, 0.25), inset 0 0 12px rgba(216, 173, 79, 0.13);
  font-size: 21px;
}

.reels-page .app-header h1 {
  color: #fff8e9;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 900;
  line-height: 1.18;
}

.reels-page .app-header h1 span + span {
  margin-left: 0.25em;
}

.reels-page .app-header .eyebrow {
  text-align: center;
}

.reels-page .eyebrow {
  color: #c8a45c;
}

.reels-page .page-switcher {
  position: relative;
  z-index: 1;
}

.reels-page .page-switch-link {
  border-color: #4b3b2d;
  background: rgba(20, 15, 12, 0.9);
  color: #f8edd5;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.reels-page .page-switch-link small {
  color: #9f927d;
}

.reels-page .page-switch-link[aria-current="page"] {
  border-color: #d8ad4f;
  background: #2a1c10;
  box-shadow: inset 3px 0 0 #e4bc62, 0 0 22px rgba(216, 173, 79, 0.13);
}

.reels-layout {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 14px 12px calc(32px + env(safe-area-inset-bottom));
}

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

.history-layout {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 14px 12px calc(32px + env(safe-area-inset-bottom));
}

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

.history-filter-actions,
.history-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.history-filter-actions {
  grid-column: 1 / -1;
}

.history-summary {
  margin: 18px 0 10px;
  color: var(--muted);
  font-weight: 800;
}

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

.history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 14, 11, 0.94);
}

.history-card h3 {
  margin: 5px 0;
  color: var(--ink);
  font-size: 18px;
  letter-spacing: 0;
}

.history-card-meta,
.history-card-submeta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.history-status {
  display: inline-flex;
  margin-right: 7px;
  color: #f2cc72;
  font-weight: 900;
}

.history-pagination {
  margin-top: 14px;
}

.history-dialog {
  width: min(calc(100% - 24px), 760px);
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid #6a5032;
  border-radius: 8px;
  background: #17110e;
  color: var(--ink);
}

.history-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.history-dialog-inner {
  padding: 20px;
  overflow: auto;
}

.history-dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.history-detail-list {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 18px 0;
}

.history-detail-list dt {
  color: var(--muted);
  font-weight: 800;
}

.history-detail-list dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.history-json {
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0e0a08;
  color: #e9dbc0;
  font-size: 12px;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-card { grid-template-columns: minmax(0, 1fr); }
  .history-card .secondary { width: 100%; }
  .history-detail-list { grid-template-columns: 1fr; }
  .history-detail-list dd { margin-bottom: 8px; }
}

@media (max-width: 520px) {
  .reels-page .page-switcher { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-filters { grid-template-columns: 1fr; }
  .history-filter-actions { flex-direction: column; }
  .history-filter-actions button { width: 100%; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.reel-generator-panel {
  position: relative;
  overflow: hidden;
  border-color: #5b432e;
  border-top: 4px solid #d8ad4f;
  background: rgba(20, 14, 11, 0.94);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.46);
}

.reel-generator-panel::before {
  position: absolute;
  top: -75px;
  right: -70px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(216, 173, 79, 0.19);
  border-radius: 50%;
  box-shadow: inset 0 0 42px rgba(216, 173, 79, 0.08);
  content: "";
  pointer-events: none;
}

.reel-heading {
  margin-bottom: 18px;
}

.reel-heading h2 {
  margin-top: 3px;
  color: #fff8e9;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: 22px;
  font-weight: 400;
}

.reel-size {
  border: 1px solid #5f492f;
  border-radius: 999px;
  background: #261b12;
  color: #e8c879;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.spirit-section {
  min-width: 0;
  border: 1px solid #4d3b2d;
  border-radius: 8px;
  background: rgba(8, 7, 6, 0.58);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 235, 183, 0.04);
}

.fps-quick-setting {
  border-left: 3px solid #d8ad4f;
  padding-left: 10px;
}

.fps-quick-setting > span {
  color: #f1d486;
  font-weight: 900;
}

.fps-quick-setting select {
  border-color: #84652f;
  background: #1d1712;
  color: #fff8e9;
}

.copy-fields {
  display: grid;
  gap: 12px;
}

.title-mode-picker {
  min-width: 0;
  border: 1px solid #5a452f;
  border-radius: 8px;
  padding: 12px;
  background: rgba(18, 13, 9, 0.7);
}

.title-mode-picker legend {
  padding: 0 6px;
  color: #f6d47e;
  font-size: 13px;
  font-weight: 850;
}

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

.title-mode-options label {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.title-mode-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.title-mode-options span {
  display: grid;
  min-height: 62px;
  align-content: center;
  gap: 3px;
  border: 1px solid #554636;
  border-radius: 7px;
  padding: 9px 10px;
  background: #17120e;
  color: #d6c9b8;
}

.title-mode-options strong,
.title-mode-options small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.title-mode-options small {
  color: #9f9384;
  font-size: 10px;
}

.title-mode-options input:checked + span {
  border-color: #d6aa50;
  background: #4b3514;
  color: #fff3ce;
  box-shadow: inset 0 0 0 1px rgba(255, 220, 135, 0.24);
}

.title-candidate-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  margin-top: 10px;
  border-left: 3px solid #d6aa50;
  padding: 9px 10px;
  background: rgba(8, 7, 6, 0.72);
}

.title-candidate-box small,
.title-candidate-box strong {
  display: block;
}

.title-candidate-box small {
  margin-bottom: 2px;
  color: #c7a862;
  font-size: 10px;
}

.title-candidate-box ol {
  grid-column: 1 / -1;
  margin: 0;
  padding-left: 24px;
  color: #fff8e9;
  font-family: "Yu Mincho", serif;
  line-height: 1.65;
}

.title-candidate-box .icon-button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-color: #715832;
  background: #21170f;
  color: #f4ce74;
}

@media (max-width: 430px) {
  .title-mode-options {
    grid-template-columns: 1fr;
  }
}

.spirit-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  color: #f6d47e;
}

.spirit-section-title > span {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #715832;
  border-radius: 50%;
  background: #24180f;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: 17px;
}

.spirit-section-title small,
.spirit-section-title strong {
  display: block;
}

.background-scene-picker {
  min-width: 0;
  border-top: 1px solid #4d3b2d;
  padding-top: 12px;
}

.background-scene-disabled {
  opacity: 0.42;
}

.background-scene-disabled legend::after {
  content: "（リアル背景のときに選択）";
  margin-left: 5px;
  color: #a99b86;
  font-size: 10px;
}

.background-scene-disabled .background-scene-option {
  cursor: not-allowed;
  filter: grayscale(0.72);
}

.background-scene-picker legend {
  margin-bottom: 9px;
  color: #d8c5a2;
  font-size: 13px;
  font-weight: 800;
}

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

.background-scene-option {
  position: relative;
  display: block;
  min-width: 0;
  height: 92px;
  overflow: hidden;
  border: 1px solid #5a4734;
  border-radius: 8px;
  background: #17100c var(--scene-image) center / cover;
  cursor: pointer;
}

.abstract-pattern-option {
  background-image: var(--pattern-bg);
  background-position: center;
  background-size: cover;
}

.custom-background-picker {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #846835;
  border-radius: 8px;
  background: rgba(15, 11, 8, 0.76);
}

.custom-background-picker.hidden { display: none; }

.custom-background-upload {
  display: grid;
  gap: 8px;
}

.custom-background-upload input {
  width: 100%;
  min-height: 48px;
}

.custom-background-upload small,
.custom-background-picker > small {
  color: #b8aa94;
  line-height: 1.5;
}

.custom-background-status {
  margin: 0;
  color: #f0cf82;
  font-weight: 800;
}

.background-scene-option::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 30%, rgba(5, 4, 3, 0.92));
  content: "";
}

.background-scene-option:has(input:checked) {
  border-color: #f1cd72;
  box-shadow: 0 0 0 2px rgba(241, 205, 114, 0.26), inset 0 0 20px rgba(241, 205, 114, 0.16);
}

.background-scene-option input {
  position: absolute;
  opacity: 0;
}

.background-scene-option span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  z-index: 1;
  color: #fff7e7;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.background-scene-auto::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(25, 13, 5, 0.48);
  content: "";
}

.spirit-section-title small {
  color: #9e8557;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.spirit-section-title strong {
  margin-top: 1px;
  color: #f8edd5;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: 17px;
  font-weight: 400;
}

.reels-page label {
  color: #cbbc9f;
}

.reels-page textarea,
.reels-page input,
.reels-page select {
  border-color: #594534;
  background: #0f0c0a;
  color: #fff7e7;
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.28);
}

.reels-page textarea:focus,
.reels-page input:focus,
.reels-page select:focus {
  border-color: #d8ad4f;
  box-shadow: 0 0 0 3px rgba(216, 173, 79, 0.16), inset 0 1px 6px rgba(0, 0, 0, 0.28);
}

.reels-page input::placeholder,
.reels-page textarea::placeholder {
  color: #746b5f;
}

#reelDailyFields,
.audio-upload {
  border: 1px solid #4d3b2d;
  border-radius: 8px;
  background: rgba(8, 7, 6, 0.58);
  padding: 14px;
}

.reel-items-input {
  min-height: 210px;
}

.reel-cta-fields textarea {
  min-height: 92px;
}

.instagram-publish-status {
  margin: 8px 0 16px;
  color: #d7c9b2;
  font-size: 13px;
  font-weight: 700;
}

.instagram-publish-status.is-ready {
  color: #8fdaa8;
}

/* Multi-account operations */
.account-layout {
  width: min(1500px, calc(100% - 32px));
  margin: 24px auto 80px;
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.account-sidebar {
  position: sticky;
  top: 16px;
}

.account-main {
  display: grid;
  gap: 18px;
}

.account-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.account-list-item {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(213, 173, 85, 0.22);
  border-radius: 6px;
  color: #f7f0df;
  background: rgba(8, 7, 6, 0.76);
  text-align: left;
}

.account-list-item.is-active {
  border-color: #d5ad55;
  box-shadow: inset 3px 0 #d5ad55;
  background: rgba(68, 44, 12, 0.72);
}

.account-list-item strong,
.account-list-item small {
  display: block;
}

.account-list-item small {
  margin-top: 4px;
  color: #bdb4a4;
  line-height: 1.45;
}

.account-color {
  width: 12px;
  height: 40px;
  background: var(--account-color);
  border-radius: 2px;
}

.account-create-reel {
  display: block;
  margin-top: 16px;
  text-align: center;
  text-decoration: none;
}

.account-active-badge {
  padding: 7px 10px;
  border: 1px solid rgba(213, 173, 85, 0.4);
  border-radius: 4px;
  color: #ead18e;
  background: rgba(30, 21, 10, 0.8);
  font-size: 0.82rem;
  font-weight: 800;
}

.account-form,
.account-form-section {
  display: grid;
  gap: 14px;
}

.account-form-section {
  padding: 18px 0;
  border-top: 1px solid rgba(213, 173, 85, 0.18);
}

.account-form-section:first-child {
  border-top: 0;
}

.account-form-section h3,
.post-result-form h3 {
  margin: 0;
  color: #ead18e;
  font-size: 1rem;
}

.topic-mix-grid,
.post-metric-inputs {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.topic-mix-grid label,
.post-metric-inputs label {
  display: grid;
  gap: 5px;
  color: #cfc5b3;
  font-size: 0.78rem;
  font-weight: 700;
}

.account-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.account-check input {
  width: 20px;
  height: 20px;
}

.account-form-actions {
  display: flex;
  gap: 10px;
}

.danger-button {
  color: #ffb8b8;
  border-color: rgba(229, 82, 82, 0.45);
}

.account-plan-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-plan-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(213, 173, 85, 0.24);
  border-radius: 6px;
  background: rgba(9, 7, 6, 0.72);
}

.account-plan-card > div {
  display: flex;
  justify-content: space-between;
  color: #d5ad55;
  font-weight: 900;
}

.account-plan-card h3 {
  margin: 10px 0 8px;
  font-size: 1.03rem;
}

.plan-hook {
  margin: 0 0 12px;
  padding: 10px;
  color: #fff6df;
  background: rgba(122, 82, 18, 0.28);
  border-left: 3px solid #d5ad55;
}

.account-plan-card dl {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 6px 10px;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.account-plan-card dt { color: #a99d8b; }
.account-plan-card dd { margin: 0; color: #e8e0d2; }

.account-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 22px;
}

.account-metric-grid > div {
  padding: 14px;
  border: 1px solid rgba(213, 173, 85, 0.22);
  background: rgba(9, 7, 6, 0.7);
}

.account-metric-grid small,
.account-metric-grid strong { display: block; }
.account-metric-grid small { color: #a99d8b; }
.account-metric-grid strong { margin-top: 5px; color: #f2d98f; font-size: 1.35rem; }

.post-result-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(213, 173, 85, 0.22);
  background: rgba(9, 7, 6, 0.54);
}

.account-table-wrap { overflow-x: auto; margin-top: 18px; }
.account-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.account-table th, .account-table td { padding: 10px; border-bottom: 1px solid rgba(213, 173, 85, 0.14); text-align: right; }
.account-table th:first-child, .account-table td:first-child { text-align: left; }

.account-learning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.account-learning-grid section {
  padding: 14px;
  border: 1px solid rgba(213, 173, 85, 0.22);
  background: rgba(9, 7, 6, 0.62);
}

.account-learning-grid h3 {
  margin: 0 0 10px;
  color: #ead18e;
  font-size: 0.9rem;
}

.learning-list {
  display: grid;
  gap: 7px;
  color: #d5ccbd;
  font-size: 0.78rem;
  line-height: 1.5;
}

.account-switch-panel {
  padding: 14px;
  border: 1px solid rgba(213, 173, 85, 0.3);
  background: rgba(29, 20, 10, 0.78);
}

.account-switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.account-switch-row a {
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  text-decoration: none;
}

.account-brand-summary {
  margin: 8px 0 0;
  color: #c9bea9;
  font-size: 0.82rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .account-layout { grid-template-columns: 1fr; }
  .account-sidebar { position: static; }
  .account-plan-grid { grid-template-columns: 1fr; }
  .account-learning-grid { grid-template-columns: 1fr; }
  .topic-mix-grid, .post-metric-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .account-layout { width: min(100% - 18px, 1500px); margin-top: 10px; }
  .account-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-switch-row { grid-template-columns: 1fr; }
}

.instagram-publish-button {
  grid-column: 1 / -1;
  border-color: #bd8e47;
  background: #261c13;
  color: #ffe4ac;
}

.fortune-cta-editor {
  display: grid;
  gap: 18px;
}

.fortune-cta-editor.hidden {
  display: none;
}

.fortune-cta-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid rgba(216, 173, 79, 0.32);
  padding-top: 14px;
}

.fortune-cta-group > strong {
  grid-column: 1 / -1;
  color: #f0cf82;
}

@media (max-width: 680px) {
  .fortune-cta-group {
    grid-template-columns: 1fr;
  }
}

.audio-upload input {
  min-height: 48px;
}

.reel-audio-fields {
  margin-top: 4px;
}

.ranking-format-picker {
  position: relative;
  overflow: hidden;
  margin: 4px 0 12px;
  padding: 18px;
  border: 1px solid #846835;
  border-radius: 8px;
  background:
    linear-gradient(rgba(10, 8, 7, 0.72), rgba(10, 8, 7, 0.92)),
    url('/assets/background-thumbs/golden-bokeh-reference.jpg') center 44% / cover;
  color: #fff;
}

.ranking-format-picker legend {
  padding: 0 8px;
  color: #f8dfa2;
  font-size: 13px;
  font-weight: 900;
}

.ranking-format-intro,
.ranking-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ranking-format-intro {
  margin-bottom: 14px;
}

.ranking-format-intro strong {
  display: block;
  margin-top: 3px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: 24px;
  font-weight: 400;
}

.ranking-format-picker .eyebrow {
  color: #d9bc79;
}

.ranking-shuffle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 1px solid rgba(248, 223, 162, 0.65);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.48);
  color: #f8dfa2;
  font-size: 24px;
}

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

.ranking-format-option {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-width: 0;
  min-height: 68px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(7, 7, 6, 0.72);
  cursor: pointer;
}

.ranking-format-option:has(input:checked) {
  border-color: #f2cf75;
  background: rgba(87, 60, 16, 0.82);
  box-shadow: inset 0 0 0 1px rgba(242, 207, 117, 0.45);
}

.ranking-format-option:active {
  transform: translateY(1px);
}

.ranking-format-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ranking-symbol {
  grid-row: 1 / 3;
  align-self: center;
  color: #f2cf75;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: 25px;
  text-align: center;
}

.ranking-format-option strong,
.ranking-format-option small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ranking-format-option strong {
  font-size: 13px;
  line-height: 1.25;
}

.ranking-format-option small {
  margin-top: 2px;
  color: #d8d2c5;
  font-size: 10px;
  line-height: 1.25;
}

.ranking-format-preview {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid #f2cf75;
  background: rgba(0, 0, 0, 0.68);
}

.ranking-preview-head {
  color: #f8dfa2;
  font-size: 11px;
  font-weight: 900;
}

.ranking-sample-list {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding-left: 28px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: 15px;
}

.ranking-format-pulse .ranking-format-preview {
  animation: ranking-preview-in 240ms ease-out;
}

@keyframes ranking-preview-in {
  from { opacity: 0.35; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.reel-results {
  margin-top: 24px;
  scroll-margin-top: 88px;
}

.reels-page .reel-results-toolbar {
  border-bottom: 1px solid #4d3b2d;
  padding: 0 2px 12px;
}

.reels-page .reel-results-toolbar h2 {
  color: #fff8e9;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: 22px;
  font-weight: 400;
}

.reel-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.reel-progress {
  min-height: 22px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.reels-page .reel-progress {
  color: #c8b99f;
}

.reel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.reel-card {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 14, 11, 0.96);
  padding: 12px;
  box-shadow: var(--shadow);
}

.reels-page .reel-card-title {
  color: #fff7e7;
}

.reels-page .reel-card-meta {
  color: #b8aa91;
}

.reels-page .reel-quality {
  color: #e4c46f;
}

.reels-page .reel-caption {
  border-color: #594534;
  background: #0f0c0a;
}

.reel-save-status {
  min-height: 20px;
  margin: 0;
  color: #d9bc79;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
}

.reels-page .save-ready {
  border-color: #ffe19a;
  background: #edc765;
  box-shadow: 0 0 0 3px rgba(237, 199, 101, 0.15), 0 0 24px rgba(237, 199, 101, 0.3);
  animation: save-ready-pulse 1.6s ease-in-out infinite;
}

@keyframes save-ready-pulse {
  50% { box-shadow: 0 0 0 5px rgba(237, 199, 101, 0.08), 0 0 30px rgba(237, 199, 101, 0.42); }
}

.reels-page .primary {
  border-color: #e0b956;
  background: #d8ad4f;
  color: #160f09;
  box-shadow: 0 8px 22px rgba(216, 173, 79, 0.18), inset 0 1px 0 rgba(255, 248, 219, 0.55);
}

.reels-page .secondary,
.reels-page .reel-card-actions button:not(.primary) {
  border-color: #675039;
  background: #241a13;
  color: #f5e8ce;
}

.reels-page .generate-button {
  min-height: 56px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-size: 18px;
  font-weight: 400;
}

.reels-page .generate-button::before {
  content: "✦ ";
}

.reels-page .app-footer {
  color: #8f8069;
}

.reel-preview {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  background: #1b0905;
}

.reel-card-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}

.reel-card-title {
  font-size: 16px;
  line-height: 1.35;
}

.reel-card-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reel-quality {
  color: #176b5d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
}

.reel-quality-warning {
  color: var(--danger);
}

.reel-caption {
  min-height: 156px;
  font-size: 13px;
}

.reel-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.reel-card-actions button {
  min-width: 0;
}

@media (max-width: 560px) {
  .app-header h1 {
    max-width: none;
    font-size: 20px;
  }

  .reels-page .app-header h1 span {
    display: block;
  }

  .reels-page .app-header h1 span + span {
    margin-left: 0;
  }

  .reels-page .app-header {
    min-height: 94px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .reels-brand {
    min-height: 58px;
    padding: 0 48px;
  }

  .reels-brand-mark {
    left: 0;
    width: 36px;
    min-width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .spirit-section {
    padding: 12px 10px;
  }

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

  .background-scene-option {
    height: 82px;
  }

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

  .reel-preview {
    width: min(100%, 330px);
    margin: 0 auto;
  }

  .reel-results-toolbar {
    align-items: flex-start;
  }

  .ranking-format-picker {
    padding: 14px 10px;
  }

  .ranking-format-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ranking-format-option {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 72px;
    padding: 8px 7px;
  }

  .ranking-format-intro strong {
    font-size: 20px;
  }

  .ranking-preview-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}
