/**
 * Echoholics Project Estimator.
 *
 * Hardcoded hex, dark by default. Button rules scoped past the reset.
 */

.ech-est, .ech-est-manage, .ech-est-notice {
  font-family: "Just Sanz", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}
.ech-est *, .ech-est-manage * { box-sizing: border-box; }

/* The hidden attribute only works via the browser default stylesheet,
   which any author `display` rule beats. Several elements here set
   display: flex, so without this they ignore `hidden` entirely — the
   modal opens on page load and can't be closed. Global so it also
   covers anything added later. */
.ech-est [hidden], .ech-est-manage [hidden],
.ech-est[hidden], .ech-est-manage[hidden] { display: none !important; }

.ech-est button, .ech-est-manage button {
  all: unset !important; box-sizing: border-box !important; cursor: pointer !important;
  font-family: "Just Sanz", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
}
.ech-est .ech-est-btn, .ech-est-manage .ech-est-btn, .ech-est-manage a.ech-est-btn {
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  font-size: 14px !important; font-weight: 600 !important; padding: 13px 24px !important;
  border-radius: 6px !important; border-width: 1px !important; border-style: solid !important;
  line-height: 1.2 !important; text-decoration: none !important; width: 100% !important;
}
.ech-est .ech-est-btn.is-small, .ech-est-manage .ech-est-btn.is-small {
  padding: 9px 16px !important; font-size: 12.5px !important; width: auto !important;
}
.ech-est-manage a.ech-est-full { width: 100% !important; margin-top: 8px !important; }
.ech-est .ech-est-btn:disabled { opacity: 0.55 !important; cursor: not-allowed !important; }

/* ---------- Layout ---------- */
.ech-est-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; }
.ech-est-picker { min-width: 0; }
.ech-est-resumed { border-radius: 8px; padding: 12px 16px; font-size: 13px; margin-bottom: 18px; }

.ech-est-songs { border-radius: 10px; border-width: 1px; border-style: solid; padding: 20px; margin-bottom: 22px; }
.ech-est-stepper { display: inline-flex; align-items: center; gap: 4px; }
.ech-est .ech-est-step {
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  width: 40px !important; height: 40px !important; border-radius: 6px !important;
  font-size: 19px !important; border-width: 1px !important; border-style: solid !important;
}
.ech-est-song-input {
  width: 70px !important; text-align: center !important; padding: 10px !important;
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace !important;
  font-size: 16px !important; font-weight: 600 !important;
  border-radius: 6px !important; border-width: 1px !important; border-style: solid !important;
}

.ech-est-group { margin-bottom: 24px; }
.ech-est-group-title {
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 10px;
}
.ech-est-service { border-radius: 10px; border-width: 1px; border-style: solid; margin-bottom: 7px; overflow: hidden; }
.ech-est-service-head { display: flex; align-items: center; gap: 13px; padding: 15px 17px; cursor: pointer; }
.ech-est-service-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ech-est-service-title { font-size: 14.5px; font-weight: 600; }
.ech-est-service-sub { font-size: 12px; line-height: 1.45; }
.ech-est-service-price {
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 14px; font-weight: 600; text-align: right; flex-shrink: 0;
}
.ech-est-service-price small { display: block; font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 400; }
.ech-est-tiers { display: flex; flex-direction: column; gap: 2px; padding: 0 17px 15px 47px; }
.ech-est-tier { display: flex; align-items: center; gap: 9px; padding: 8px 0; font-size: 13px; cursor: pointer; }
.ech-est-tier-price { margin-left: auto; font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; }

/* ---------- Summary ---------- */
.ech-est-summary { position: sticky; top: 24px; }
.ech-est-summary-inner { border-radius: 12px; border-width: 1px; border-style: solid; padding: 22px; }
.ech-est-summary-title { font-family: "Gunterz", Georgia, serif; font-weight: 600; font-size: 18px; margin: 0 0 14px; }
.ech-est-lines { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.ech-est-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.ech-est-line-label em { font-style: normal; opacity: 0.7; }
.ech-est-line-label small { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 10.5px; }
.ech-est-line-total { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 13px; white-space: nowrap; }
.ech-est-empty { font-size: 13px; line-height: 1.6; margin: 0; }
.ech-est-total-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding-top: 13px; border-top-width: 1px; border-top-style: solid;
}
.ech-est-total-row span { font-size: 14px; font-weight: 600; }
.ech-est-total-row strong { font-family: "Gunterz", Georgia, serif; font-weight: 600; font-size: 26px; }
.ech-est-hours { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 11px; margin: 6px 0 0; }
.ech-est-package { border-radius: 8px; padding: 16px; margin-top: 16px; }
.ech-est-package-flag {
  display: block; font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 5px;
}
.ech-est-package-name { display: block; font-size: 15px; margin-bottom: 5px; }
.ech-est-package-text { font-size: 12.5px; line-height: 1.55; margin: 0 0 12px; }
.ech-est-disclaimer { font-size: 11.5px; line-height: 1.55; margin: 14px 0 0; }
.ech-est-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* ---------- Modal ---------- */
.ech-est-modal {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0,0,0,0.72);
}
.ech-est-modal-inner {
  position: relative; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  border-radius: 12px; border-width: 1px; border-style: solid; padding: 30px;
}
.ech-est .ech-est-modal-close {
  position: absolute !important; top: 12px !important; right: 14px !important;
  font-size: 24px !important; line-height: 1 !important; padding: 6px !important;
}
.ech-est-modal-title { font-family: "Gunterz", Georgia, serif; font-weight: 600; font-size: 20px; margin: 0 0 6px; }
.ech-est-modal-sub { font-size: 13px; line-height: 1.55; margin: 0 0 20px; }
.ech-est-field { margin-bottom: 14px; }
.ech-est-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ech-est-label {
  display: block; margin-bottom: 6px;
  font-family: "JetBrains Mono", ui-monospace, Menlo, monospace;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
}
.ech-est-input, .ech-est-textarea {
  width: 100% !important; border-radius: 6px !important; padding: 11px 13px !important;
  font-size: 14px !important; font-family: inherit !important;
  border-width: 1px !important; border-style: solid !important; box-shadow: none !important;
}
.ech-est-textarea { resize: vertical !important; }
.ech-est-error { border-radius: 6px; padding: 10px 13px; font-size: 13px; margin-bottom: 12px; }
.ech-est-hint { font-size: 11.5px; line-height: 1.55; margin: 6px 0 0; }
.ech-est-modal-foot { text-align: center; margin-top: 12px; }
.ech-est-done { text-align: center; padding: 14px 0; }
.ech-est-done p { font-size: 13.5px; line-height: 1.6; }

/* ---------- Manage ---------- */
.ech-est-tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.ech-est-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px; font-size: 12.5px; text-decoration: none !important; }
.ech-est-tab-count { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 9.5px; padding: 2px 7px; border-radius: 999px; }
.ech-est-lead-list { display: flex; flex-direction: column; gap: 8px; }
.ech-est-lead { border-radius: 10px; border-width: 1px; border-style: solid; overflow: hidden; }
.ech-est-manage .ech-est-lead-head {
  display: flex !important; align-items: center !important; gap: 14px !important;
  width: 100% !important; padding: 16px 18px !important; text-align: left !important;
}
.ech-est-lead-who { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ech-est-lead-name { font-size: 14.5px; font-weight: 600; }
.ech-est-lead-meta { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 10.5px; }
.ech-est-lead-total { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 15px; font-weight: 700; flex-shrink: 0; }
.ech-est-badge { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 9.5px; letter-spacing: 0.07em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; flex-shrink: 0; }
.ech-est-lead-detail { padding: 0 18px 18px; }
.ech-est-lead-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.ech-est-h4 { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 9px; }
.ech-est-meta { list-style: none; margin: 0 0 16px; padding: 0; }
.ech-est-meta li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; }
.ech-est-meta li em { font-style: normal; opacity: 0.7; }
.ech-est-meta-total { font-weight: 700; border-top-width: 1px; border-top-style: solid; margin-top: 4px; padding-top: 9px !important; }
.ech-est-text { font-size: 13px; line-height: 1.6; margin: 0 0 14px; }
.ech-est-lead-actions { display: flex; align-items: center; gap: 12px; margin-top: 9px; flex-wrap: wrap; }
.ech-est-lead-status { font-size: 12px; }
.ech-est-notice { border-radius: 10px; border-width: 1px; border-style: solid; padding: 26px; }
.ech-est-notice strong { display: block; font-size: 15px; margin-bottom: 5px; }
.ech-est-notice p { font-size: 13px; margin: 0; }

@media (max-width: 900px) {
  .ech-est-layout { grid-template-columns: 1fr; }
  .ech-est-summary { position: static; }
  .ech-est-lead-grid { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 520px) {
  .ech-est-field-row { grid-template-columns: 1fr; }
}

/* Dark — the default */
html:not(.psk-theme-light) .ech-est-songs,
html:not(.psk-theme-light) .ech-est-service,
html:not(.psk-theme-light) .ech-est-summary-inner,
html:not(.psk-theme-light) .ech-est-modal-inner,
html:not(.psk-theme-light) .ech-est-lead,
html:not(.psk-theme-light) .ech-est-notice { background: #161616; border-color: #2A2A2A; color: #9A9A9A; }
html:not(.psk-theme-light) .ech-est-service:hover { border-color: #3A3A3A; }
html:not(.psk-theme-light) .ech-est-service-title,
html:not(.psk-theme-light) .ech-est-service-price,
html:not(.psk-theme-light) .ech-est-summary-title,
html:not(.psk-theme-light) .ech-est-modal-title,
html:not(.psk-theme-light) .ech-est-lead-name,
html:not(.psk-theme-light) .ech-est-lead-total,
html:not(.psk-theme-light) .ech-est-notice strong,
html:not(.psk-theme-light) .ech-est-line-label { color: #E3E3E3; }
html:not(.psk-theme-light) .ech-est-total-row strong { color: #83BDE7; }
html:not(.psk-theme-light) .ech-est-total-row { border-top-color: #2A2A2A; }
html:not(.psk-theme-light) .ech-est-service-sub,
html:not(.psk-theme-light) .ech-est-hint,
html:not(.psk-theme-light) .ech-est-disclaimer,
html:not(.psk-theme-light) .ech-est-hours,
html:not(.psk-theme-light) .ech-est-group-title,
html:not(.psk-theme-light) .ech-est-label,
html:not(.psk-theme-light) .ech-est-lead-meta,
html:not(.psk-theme-light) .ech-est-h4,
html:not(.psk-theme-light) .ech-est-empty { color: #6B6B6B; }
html:not(.psk-theme-light) .ech-est-input,
html:not(.psk-theme-light) .ech-est-textarea,
html:not(.psk-theme-light) .ech-est-song-input { background: #1E1E1E !important; border-color: #3A3A3A !important; color: #E3E3E3 !important; }
html:not(.psk-theme-light) .ech-est-step { background: #1E1E1E !important; border-color: #3A3A3A !important; color: #E3E3E3 !important; }
html:not(.psk-theme-light) .ech-est-btn { background: #33769F !important; border-color: transparent !important; color: #FFFFFF !important; }
html:not(.psk-theme-light) .ech-est-btn.is-secondary { background: #1E1E1E !important; border-color: #3A3A3A !important; color: #E3E3E3 !important; }
html:not(.psk-theme-light) .ech-est-package { background: #12202B; border: 1px solid rgba(75,155,213,0.3); }
html:not(.psk-theme-light) .ech-est-package-flag { color: #4ADE80; }
html:not(.psk-theme-light) .ech-est-package-name { color: #E3E3E3; }
html:not(.psk-theme-light) .ech-est-package-text { color: #9A9A9A; }
html:not(.psk-theme-light) .ech-est-resumed { background: #12202B; color: #83BDE7; }
html:not(.psk-theme-light) .ech-est-error { background: rgba(248,113,113,0.12); color: #F87171; }
html:not(.psk-theme-light) .ech-est-modal-close { color: #6B6B6B !important; }
html:not(.psk-theme-light) .ech-est-tab { background: #161616; color: #9A9A9A; }
html:not(.psk-theme-light) .ech-est-tab.is-active { background: #12202B; color: #83BDE7; }
html:not(.psk-theme-light) .ech-est-tab-count { background: rgba(255,255,255,0.08); }
html:not(.psk-theme-light) .ech-est-badge { background: #1E1E1E; color: #9A9A9A; }
html:not(.psk-theme-light) .ech-est-status-sent { background: rgba(245,185,59,0.14); color: #F5B93B; }
html:not(.psk-theme-light) .ech-est-status-converted { background: rgba(74,222,128,0.14); color: #4ADE80; }
html:not(.psk-theme-light) .ech-est-meta { color: #9A9A9A; }
html:not(.psk-theme-light) .ech-est-meta a { color: #83BDE7; }
html:not(.psk-theme-light) .ech-est-meta-total { border-top-color: #2A2A2A; color: #E3E3E3; }
html:not(.psk-theme-light) .ech-est-lead-status { color: #4ADE80; }
html:not(.psk-theme-light) .ech-est-tier { color: #9A9A9A; }

/* Light — explicit override */
html.psk-theme-light .ech-est-songs,
html.psk-theme-light .ech-est-service,
html.psk-theme-light .ech-est-summary-inner,
html.psk-theme-light .ech-est-modal-inner,
html.psk-theme-light .ech-est-lead,
html.psk-theme-light .ech-est-notice { background: #FFFFFF; border-color: #E3E3E3; color: #4A4A4A; }
html.psk-theme-light .ech-est-service-title,
html.psk-theme-light .ech-est-service-price,
html.psk-theme-light .ech-est-summary-title,
html.psk-theme-light .ech-est-modal-title,
html.psk-theme-light .ech-est-lead-name,
html.psk-theme-light .ech-est-lead-total,
html.psk-theme-light .ech-est-notice strong,
html.psk-theme-light .ech-est-line-label { color: #0E0E0E; }
html.psk-theme-light .ech-est-total-row strong { color: #33769F; }
html.psk-theme-light .ech-est-total-row { border-top-color: #E3E3E3; }
html.psk-theme-light .ech-est-service-sub,
html.psk-theme-light .ech-est-hint,
html.psk-theme-light .ech-est-disclaimer,
html.psk-theme-light .ech-est-hours,
html.psk-theme-light .ech-est-group-title,
html.psk-theme-light .ech-est-label,
html.psk-theme-light .ech-est-lead-meta,
html.psk-theme-light .ech-est-h4,
html.psk-theme-light .ech-est-empty { color: #6B6B6B; }
html.psk-theme-light .ech-est-input,
html.psk-theme-light .ech-est-textarea,
html.psk-theme-light .ech-est-song-input { background: #F7F7F5 !important; border-color: #D1D1CE !important; color: #0E0E0E !important; }
html.psk-theme-light .ech-est-step { background: #F7F7F5 !important; border-color: #D1D1CE !important; color: #0E0E0E !important; }
html.psk-theme-light .ech-est-btn { background: #33769F !important; border-color: transparent !important; color: #FFFFFF !important; }
html.psk-theme-light .ech-est-btn.is-secondary { background: #F7F7F5 !important; border-color: #D1D1CE !important; color: #0E0E0E !important; }
html.psk-theme-light .ech-est-package { background: #EAF2F8; border: 1px solid rgba(51,118,159,0.25); }
html.psk-theme-light .ech-est-package-flag { color: #16A34A; }
html.psk-theme-light .ech-est-package-name { color: #0E0E0E; }
html.psk-theme-light .ech-est-package-text { color: #4A4A4A; }
html.psk-theme-light .ech-est-resumed { background: #EAF2F8; color: #33769F; }
html.psk-theme-light .ech-est-error { background: rgba(220,38,38,0.08); color: #DC2626; }
html.psk-theme-light .ech-est-modal-close { color: #6B6B6B !important; }
html.psk-theme-light .ech-est-tab { background: #F0F0EE; color: #4A4A4A; }
html.psk-theme-light .ech-est-tab.is-active { background: #EAF2F8; color: #33769F; }
html.psk-theme-light .ech-est-tab-count { background: rgba(0,0,0,0.07); }
html.psk-theme-light .ech-est-badge { background: #F0F0EE; color: #4A4A4A; }
html.psk-theme-light .ech-est-status-sent { background: rgba(217,119,6,0.10); color: #B45309; }
html.psk-theme-light .ech-est-status-converted { background: rgba(22,163,74,0.10); color: #16A34A; }
html.psk-theme-light .ech-est-meta a { color: #33769F; }
html.psk-theme-light .ech-est-meta-total { border-top-color: #E3E3E3; color: #0E0E0E; }
html.psk-theme-light .ech-est-lead-status { color: #16A34A; }
