/* ---------- Plan / Form pages ---------- */

.side-label-desktop { display: inline; }
.side-label-mobile { display: none; }

@media (max-width: 900px) {
  .side-label-desktop { display: none; }
  .side-label-mobile { display: inline; }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1.4em;
}
.back-link:hover { color: var(--ink); }

.plan-hero { padding: 56px 32px 20px; }

.plan-hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }

.plan-hero p { color: var(--ink-soft); max-width: 60ch; }

.plan-hero--split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.plan-hero-photo {
  border-radius: 20px;
  overflow: hidden;
  height: 260px;
}

.plan-hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 900px) {
  .plan-hero--split { grid-template-columns: 1fr; }
  .plan-hero-photo { height: 200px; }
}

/* --- concept strip --- */
.plan-concept {
  text-align: center;
  padding: 36px 0 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.plan-concept-eyebrow {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 0.5em;
}

.plan-concept-eyebrow span { color: var(--gold-deep); }

.plan-concept-lead {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.9;
  margin: 0;
}

/* --- builder layout (form + live preview) --- */
.plan-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 36px;
  align-items: start;
  padding: 20px 0 90px;
}

.plan-form { padding: 20px 0 90px; }
.plan-builder .plan-form { padding: 0; }

@media (max-width: 900px) {
  .plan-builder { grid-template-columns: minmax(0, 1fr); padding: 12px 20px 70px; gap: 28px; }
}

.plan-form-footnote {
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.8;
  max-width: 52ch;
  margin: 28px 0 0;
}

/* --- category selector chips --- */
.category-toggle-note {
  display: inline-block;
  margin: 24px 0 0;
  padding: 10px 18px;
  background: var(--gold-deep);
  color: #2B2620;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 999px;
}

.category-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 8px;
}

.category-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #26374F;
  color: #F3F6FA;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.category-chip input { accent-color: var(--gold-deep); width: 16px; height: 16px; }

.category-chip.is-active {
  background: var(--sage-pale);
  border-color: var(--sage);
  color: var(--sage-deep);
}

/* --- mood / relationship choice cards --- */
.visually-hidden-field {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.choice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #35496A;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 18px 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  color: #F3F6FA;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.choice-card:hover { transform: translateY(-2px); }

.choice-card-icon { font-size: 1.6rem; line-height: 1; }

.choice-card.is-selected {
  background: var(--sage-pale);
  border-color: var(--sage-deep);
  color: var(--sage-deep);
}

/* --- addon tiles ("何を添えますか") --- */
.addon-section { margin-top: 28px; }

.addon-heading {
  font-size: 1.1rem;
  color: #F3F6FA;
  margin-bottom: 0.4em;
}

.addon-note {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.addon-tile {
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 16px;
}

.addon-tile input { position: absolute; opacity: 0; width: 0; height: 0; }

.addon-tile-icon { font-size: 1.5rem; line-height: 1; }

/* --- live plan preview --- */
.plan-preview {
  position: sticky;
  top: 24px;
  background: linear-gradient(160deg, #26374F 0%, #1B2740 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 26px 22px;
}

.plan-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1em;
}

.plan-preview-eyebrow {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--gold-deep);
  margin-bottom: 0;
}

.plan-preview-count {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--sage-pale);
  color: var(--sage-deep);
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}

.plan-preview-count-chevron { font-size: 0.7em; transition: transform 0.15s ease; }
.plan-preview-count.is-expanded .plan-preview-count-chevron { transform: rotate(180deg); }

@media (max-width: 900px) {
  .plan-preview-count { display: inline-flex; }
  #planPreview:not(.is-expanded) .plan-preview-body-detail { display: none; }

  .plan-preview {
    order: -1;
    position: sticky;
    top: 58px;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 18px;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
  }
  .plan-preview-head { margin-bottom: 0.5em; }
  .plan-preview-empty p { font-size: 0.82rem; line-height: 1.5; margin: 0 0 0.3em; }
  .plan-preview-empty-sub { font-size: 0.76rem; }
}

.plan-preview-empty p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.8;
}

.plan-preview-empty-sub { font-size: 0.82rem; opacity: 0.8; }

.plan-preview-mood-en {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  color: #F3F6FA;
  margin-bottom: 0.3em;
}

.plan-preview-mood-copy {
  color: #B9C6D9;
  font-size: 0.9rem;
  line-height: 1.7;
}

.plan-preview-with {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 14px;
  background: var(--sage-pale);
  color: var(--sage-deep);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.plan-preview-timeline {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.plan-preview-timeline li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.88rem;
  color: #F3F6FA;
}

.plan-preview-timeline li:last-child { border-bottom: none; }

.plan-preview-timeline-icon { font-size: 1.1rem; }

/* --- category panel --- */
.category-panel {
  background: #26374F;
  border-radius: 20px;
  padding: 28px 26px;
  margin-top: 18px;
}

.category-panel h3 {
  font-size: 1.1rem;
  margin-bottom: 1em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #F3F6FA;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.field-grid label,
.field-grid .field-label,
.notes-field label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.field-grid label, .field-grid .field-label { color: #B9C6D9; }
.notes-field label { color: var(--ink-soft); }

/* .field-grid label/.field-label set display:flex, which beats the [hidden] UA rule — force it explicitly */
.field-grid label[hidden], .field-grid .field-label[hidden] { display: none; }

select, .field-grid input[type="text"], .field-grid input[type="date"] {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #35496A;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: #F3F6FA;
}

.field-grid input[type="date"] { color-scheme: dark; }

.location-dropdown { position: relative; }

.location-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #35496A;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: #F3F6FA;
  cursor: pointer;
  text-align: left;
}

.location-dropdown-chevron { font-size: 0.7em; color: #B9C6D9; transition: transform 0.15s ease; flex-shrink: 0; }
.location-dropdown-toggle.is-open .location-dropdown-chevron { transform: rotate(180deg); }

.location-dropdown-panel {
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #2A3B54;
  max-height: 260px;
  overflow-y: auto;
}

/* .checkbox-row sets display:flex, which beats the [hidden] UA rule — force it explicitly */
.location-dropdown-panel[hidden] { display: none; }

.panel-subheading {
  margin: 20px 0 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #B9C6D9;
}

.field-grid input[type="text"]::placeholder,
.notes-field textarea::placeholder,
.panel-notes textarea::placeholder {
  color: #A9B9CE;
  opacity: 1;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-weight: 500;
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #35496A;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #F3F6FA;
  cursor: pointer;
}

.checkbox-row input { accent-color: var(--gold-deep); }

.notes-field {
  margin-top: 32px;
}

.notes-field textarea,
.panel-notes textarea {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #35496A;
  color: #F3F6FA;
  font-family: var(--font-body);
  font-size: 0.92rem;
  resize: vertical;
}

.panel-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #B9C6D9;
  margin-top: 18px;
}

.other-detail-input { margin-top: 8px; }

.plan-form .btn { margin-top: 32px; }

.empty-hint {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-top: 20px;
}

@media (max-width: 640px) {
  .category-toggle { flex-direction: column; align-items: stretch; }
  .plan-hero { padding: 40px 20px 16px; }

  #timeOfDayCards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #timeOfDayCards .choice-card { padding: 14px 6px; }
  #timeOfDayCards .choice-card-label { font-size: 0.8rem; }

  #relationshipCards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #relationshipCards .choice-card { padding: 12px 6px; }
  #relationshipCards .choice-card-icon { font-size: 1.3rem; }
  #relationshipCards .choice-card-label { font-size: 0.72rem; line-height: 1.3; }

  #cat-recipient .field-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  #moodCards { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #moodCards .choice-card { padding: 12px 6px; }
  #moodCards .choice-card-icon { font-size: 1.3rem; }
  #moodCards .choice-card-label { font-size: 0.72rem; line-height: 1.3; }

  .addon-section .category-toggle {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .addon-section .addon-tile { padding: 12px 6px; }
  .addon-section .addon-tile-icon { font-size: 1.3rem; }
  .addon-section .addon-tile span:last-child { font-size: 0.78rem; }

  #cat-self .field-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); gap: 10px; }
  #cat-self .field-grid label { min-width: 0; }
  #cat-self .field-grid select,
  #cat-self .field-grid input[type="text"] { width: 100%; box-sizing: border-box; min-width: 0; }
}

.confirm-content { margin: 20px 0; }
.confirm-category { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.confirm-category:last-child { border-bottom: none; }
.confirm-category-name { font-weight: 700; color: var(--gold-deep); margin-bottom: 8px; font-size: 0.95rem; }
.confirm-field-row { display: flex; justify-content: space-between; gap: 16px; font-size: 0.88rem; padding: 4px 0; }
.confirm-field-label { color: #B9C6D9; }
.confirm-field-value { color: #F3F6FA; text-align: right; }
.confirm-notes { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 0.88rem; }
.confirm-notes strong { display: block; margin-bottom: 6px; color: #B9C6D9; }
.confirm-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.issued-code {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--gold-deep);
  background: #35496A;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  margin: 16px 0;
}

.done-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  background: #06C755;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.btn-line:hover { background: #05B34C; }
.btn-line:disabled { opacity: 0.6; cursor: default; }

.done-actions-note { margin-top: 10px; color: #B9C6D9; font-size: 0.9rem; }
