/* Merphi product controls — date + strategy overlays (choice cards live in styles.css) */

.merphi-choice-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.merphi-choice-fieldset > legend {
  margin: 0 0 10px;
  color: var(--ink-primary);
  font-size: 14px;
  font-weight: 700;
}

.merphi-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.merphi-choice-card {
  min-width: 0;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  background: var(--surface);
  color: var(--ink-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    background var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}
.merphi-choice-card strong {
  font-size: 13px;
  line-height: 1.3;
}
.merphi-choice-card small {
  color: var(--ink-secondary);
  font-size: 11px;
  line-height: 1.4;
}
.merphi-choice-card:hover {
  border-color: color-mix(in srgb, var(--brand-orange) 48%, var(--border));
  background: color-mix(in srgb, var(--brand-orange-soft) 40%, var(--surface));
  transform: translateY(-1px);
}
.merphi-choice-card:focus-visible {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px var(--brand-orange-focus);
}
.merphi-choice-card[aria-checked="true"],
.merphi-choice-card.is-selected {
  border-color: var(--brand-orange);
  background: var(--brand-orange-soft);
  box-shadow: inset 0 0 0 1px var(--brand-orange);
}

html.ui-v2 .merphi-section-card > header {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
}
html.ui-v2 .merphi-section-card > header h3,
html.ui-v2 .merphi-section-card > header p {
  margin: 0;
}
html.ui-v2 .merphi-section-card > header p {
  max-width: 72ch;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.merphi-date-control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  gap: 6px;
  align-items: center;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(15, 23, 42, 0.045);
  transition: border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard);
}
.merphi-date-control:focus-within {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px var(--brand-orange-focus), 0 10px 26px rgba(15, 23, 42, 0.06);
}
.merphi-date-visible.control {
  min-height: 42px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}
.merphi-date-visible.control:focus { box-shadow: none; }
.merphi-date-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.merphi-date-open,
.merphi-date-clear {
  min-width: 44px;
  min-height: 44px;
}
.merphi-date-open {
  border-color: color-mix(in srgb, var(--brand-orange) 30%, var(--border));
  color: var(--brand-orange);
  background: var(--brand-orange-soft);
}
.merphi-date-clear { color: var(--ink-secondary); }
.merphi-calendar {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  width: min(328px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--brand-orange) 22%, var(--border));
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 22px 55px rgba(15, 23, 42, .18);
}
.merphi-calendar[hidden] { display: none; }
.merphi-calendar-head { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 8px; margin-bottom: 10px; }
.merphi-calendar-head strong { text-align: center; text-transform: capitalize; font-size: 14px; }
.merphi-calendar-head .icon-button { min-width: 38px; min-height: 38px; font-size: 22px; }
.merphi-calendar-weekdays, .merphi-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.merphi-calendar-weekdays { margin-bottom: 4px; }
.merphi-calendar-weekdays span { padding: 4px 0; color: var(--ink-secondary); font-size: 10px; font-weight: 700; text-align: center; text-transform: capitalize; }
.merphi-calendar-day { aspect-ratio: 1; min-width: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ink-primary); font: inherit; font-size: 12px; cursor: pointer; }
.merphi-calendar-day:hover { background: var(--brand-orange-soft); color: var(--brand-orange); }
.merphi-calendar-day.is-outside { color: color-mix(in srgb, var(--ink-secondary) 45%, transparent); }
.merphi-calendar-day.is-today { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-orange) 45%, transparent); }
.merphi-calendar-day.is-selected { background: var(--brand-orange); color: #fff; font-weight: 800; box-shadow: 0 5px 14px color-mix(in srgb, var(--brand-orange) 30%, transparent); }
.merphi-calendar-day:disabled { opacity: .25; cursor: not-allowed; }
.merphi-calendar-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.merphi-calendar-foot button { border: 0; background: transparent; color: var(--brand-orange); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }

.release-lead-time {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface-secondary);
}
.release-lead-time > i {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 12px;
  color: var(--ink-secondary);
  background: var(--surface);
}
.release-lead-time > div { display: grid; gap: 3px; min-width: 0; }
.release-lead-time strong { font-size: 13px; line-height: 1.3; }
.release-lead-time span { color: var(--ink-secondary); font-size: 11px; line-height: 1.45; }
.release-lead-time > b {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--ink-secondary);
  background: var(--surface);
  font-size: 11px;
  white-space: nowrap;
}
.release-lead-time.is-ideal,
.release-lead-time.is-good { border-color: #b9dfcf; background: #f2fbf7; }
.release-lead-time.is-ideal > i,
.release-lead-time.is-good > i { color: #147a51; background: #e4f7ee; }
.release-lead-time.is-tight { border-color: #f1d3a4; background: #fffaf1; }
.release-lead-time.is-tight > i { color: #9a5b00; background: #fff2d8; }
.release-lead-time.is-rush,
.release-lead-time.is-risk { border-color: #efc0ba; background: #fff7f6; }
.release-lead-time.is-rush > i,
.release-lead-time.is-risk > i { color: #b53b32; background: #ffebe8; }

.merphi-strategy-stack {
  display: grid;
  gap: 14px;
}
.merphi-strategy-panel {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-secondary);
}

.modal.modal-create-release {
  width: min(820px, 96vw);
  max-width: 840px;
}
.modal.modal-create-release .modal-body,
#modal.modal-create-release {
  width: min(820px, 96vw);
}
.create-release-flow {
  display: grid;
  gap: 22px;
}
.create-release-step[hidden] { display: none !important; }
.create-release-summary {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-secondary);
}
.create-release-summary .key-value {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.create-release-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.mr-create-artist-box { position: relative; display: grid; gap: 8px; min-height: 52px; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.mr-create-artist-box:focus-within { border-color: var(--brand-orange); box-shadow: 0 0 0 3px var(--brand-orange-focus); }
.mr-create-artist-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.mr-create-artist-chip, .mr-create-artist-results button { min-width: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink-primary); font: inherit; text-align: left; cursor: pointer; }
.mr-create-artist-chip { padding: 6px 8px; }
.mr-create-artist-chip .artist-avatar, .mr-create-artist-results .artist-avatar { width: 34px; height: 34px; }
.mr-create-artist-chip span, .mr-create-artist-results button > span { display: grid; min-width: 0; gap: 2px; }
.mr-create-artist-chip strong, .mr-create-artist-results strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.mr-create-artist-chip small, .mr-create-artist-results small { color: var(--ink-secondary); font-size: 10px; }
.mr-create-artist-search { position: relative; display: flex; align-items: center; }
.mr-create-artist-search > i { position: absolute; left: 11px; width: 17px; color: var(--ink-secondary); pointer-events: none; }
.mr-create-artist-search .control { border: 0; padding-left: 38px; box-shadow: none; }
.mr-create-artist-results { position: absolute; z-index: 35; top: calc(100% + 7px); right: 0; left: 0; max-height: 280px; overflow: auto; display: grid; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 45px rgba(15, 23, 42, .16); }
.mr-create-artist-results[hidden] { display: none; }
.mr-create-artist-results button { width: 100%; padding: 8px; }
.mr-create-artist-results button:hover { border-color: var(--brand-orange); background: var(--brand-orange-soft); }
.mr-create-artist-results p { margin: 0; padding: 12px; color: var(--ink-secondary); font-size: 12px; }
.mr-create-artist-results .mr-create-artist-action { color: var(--brand-orange); font-size: 11px; font-weight: 800; }
.mr-create-artist-empty { display: grid; justify-items: start; gap: 8px; padding: 4px; }
.mr-create-artist-empty p { padding: 4px; }
.mr-create-artist-empty > button { display: inline-flex; width: auto; }
.mr-create-artist-empty > small { padding: 0 4px 4px; }

@media (max-width: 900px) {
  .modal.modal-create-release,
  .modal.modal-create-release .modal-body,
  #modal.modal-create-release {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 16px 16px 0 0;
  }
  .merphi-choice-grid { grid-template-columns: 1fr; }
  .create-release-actions { position: sticky; bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0); background: var(--surface); }
  .release-lead-time { grid-template-columns: 38px minmax(0, 1fr); }
  .release-lead-time > b { grid-column: 2; justify-self: start; }
}
