/* CastSight AI Production Revision 7 — final scoped repair layer */
:root{
  --r7-logo-blue:#0a5dc7;
  --r7-logo-blue-deep:#073f86;
  --r7-blue:#1479d2;
  --r7-blue-bright:#55a7ef;
  --r7-panel:rgba(5,24,42,.92);
  --r7-panel-strong:rgba(4,20,36,.97);
  --r7-border:rgba(86,166,224,.30);
  --r7-text:#f7fbff;
  --r7-muted:#a9bfd3;
  --r7-amber:#d8a83f;
}

/* Global background: visible sunset/water, still dark enough behind content. */
html.castsight-r7 body::before{
  background:
    linear-gradient(180deg,rgba(2,12,24,.68),rgba(2,12,24,.78) 48%,rgba(2,10,20,.84)),
    url("assets/welcome-beach.png") center/cover fixed no-repeat!important;
  filter:brightness(.82) saturate(.98) contrast(1.02)!important;
  opacity:1!important;
}
html.castsight-r7 body::after{
  background:
    radial-gradient(circle at 68% 8%,rgba(22,105,190,.15),transparent 34%),
    linear-gradient(90deg,rgba(2,12,24,.20),transparent 44%,rgba(2,12,24,.15))!important;
}

/* Gradient belongs ONLY to the large top app title. */
html.castsight-r7 .page-title h1,
html.castsight-r7 .page-title h2,
html.castsight-r7 .section-head h1,
html.castsight-r7 .section-head h2,
html.castsight-r7 .panel h1,
html.castsight-r7 .panel h2,
html.castsight-r7 .panel h3,
html.castsight-r7 [data-page-title]:not(#pageLabel){
  color:var(--r7-text)!important;
  -webkit-text-fill-color:var(--r7-text)!important;
  background:none!important;
  background-image:none!important;
  -webkit-background-clip:border-box!important;
  background-clip:border-box!important;
  text-shadow:none!important;
}
html.castsight-r7 .app-header.app-header-centered #pageLabel,
html.castsight-r7 .app-header-centered h1#pageLabel{
  display:inline-block!important;
  width:fit-content!important;
  color:transparent!important;
  -webkit-text-fill-color:transparent!important;
  background:linear-gradient(100deg,#fff 0%,#fff 68%,#d5e8fb 80%,#4a8dcc 91%,var(--r7-logo-blue-deep) 100%)!important;
  -webkit-background-clip:text!important;
  background-clip:text!important;
  text-shadow:none!important;
}
html.castsight-r7 .eyebrow{
  color:var(--r7-blue-bright)!important;
  -webkit-text-fill-color:var(--r7-blue-bright)!important;
  background:none!important;
}
html.castsight-r7 .page-title p,
html.castsight-r7 .section-head p{color:var(--r7-muted)!important}

/* Keep all primary controls in the CastSight palette — no pink. */
html.castsight-r7 .primary-action,
html.castsight-r7 .button-primary,
html.castsight-r7 .btn-primary,
html.castsight-r7 [data-view="conditions"] button:not(.secondary-action):not(.ghost-action){
  background:linear-gradient(135deg,var(--r7-blue),var(--r7-logo-blue-deep))!important;
  color:#fff!important;
  border:1px solid rgba(83,165,229,.52)!important;
  box-shadow:0 12px 30px rgba(10,93,199,.22)!important;
}
html.castsight-r7 .primary-action:hover{filter:brightness(1.08)}

/* Conditions: keep approved layout, fix warning/button consistency. */
html.castsight-r7 .verify-local-signs,
html.castsight-r7 [data-verify-signs],
html.castsight-r7 .local-signs-warning{
  background:rgba(65,48,16,.35)!important;
  color:#ffe7ad!important;
  border:1px solid rgba(216,168,63,.58)!important;
}
html.castsight-r7 .verify-local-signs summary,
html.castsight-r7 .verify-local-signs p{color:inherit!important}

/* Live Report: owner/admin actions. */
html.castsight-r7 .r7-owner-report-actions{
  display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;justify-content:flex-end;
}
html.castsight-r7 .r7-owner-report-actions button{
  min-height:38px;padding:.48rem .72rem;border-radius:10px;
  background:rgba(12,48,78,.95);color:#fff;border:1px solid rgba(76,160,222,.4);font-weight:800;cursor:pointer;
}
html.castsight-r7 .r7-owner-report-actions button[data-r7-owner-action="delete"]{
  background:rgba(99,29,39,.38);border-color:rgba(226,91,105,.48);color:#ffd8dc;
}
html.castsight-r7 .r7-admin-report-list{display:grid;gap:.75rem}
html.castsight-r7 .r7-admin-report-row{
  display:grid;grid-template-columns:72px 1fr auto;gap:.9rem;align-items:center;
  padding:.9rem;border:1px solid var(--r7-border);border-radius:16px;background:rgba(7,30,51,.88);
}
html.castsight-r7 .r7-admin-report-row img{width:72px;height:72px;object-fit:cover;border-radius:12px}
html.castsight-r7 .r7-admin-report-row small{display:block;color:var(--r7-muted)}

/* Submit Catch: make the studio genuinely wide and prevent overflow. */
html.castsight-r7 [data-view="submit"] .page-title,
html.castsight-r7 [data-view="submit"] .submit-panel{max-width:1460px!important;margin-inline:auto!important}
html.castsight-r7 [data-view="submit"] .submit-panel{padding:1.45rem!important;overflow:hidden!important}
html.castsight-r7 [data-view="submit"] #catchForm{
  display:grid!important;
  grid-template-columns:minmax(320px,360px) repeat(4,minmax(170px,1fr))!important;
  gap:1rem 1.05rem!important;
  align-items:end!important;
}
html.castsight-r7 [data-view="submit"] #catchForm>label{min-width:0!important;width:100%!important}
html.castsight-r7 [data-view="submit"] #catchForm input,
html.castsight-r7 [data-view="submit"] #catchForm select{width:100%!important;min-width:0!important;max-width:100%!important}
html.castsight-r7 [data-view="submit"] .catch-photo-field{grid-column:1!important;grid-row:1 / span 3!important;min-width:0!important}
html.castsight-r7 [data-view="submit"] .catch-photo-uploader{min-height:310px!important;width:100%!important}
html.castsight-r7 [data-view="submit"] #catchDateInput{min-width:0!important}
html.castsight-r7 [data-view="submit"] .catch-analyze-button{
  min-width:175px!important;min-height:48px!important;background:linear-gradient(135deg,#258cf0,#0a56aa)!important;
  color:#fff!important;-webkit-text-fill-color:#fff!important;opacity:1!important;
}
html.castsight-r7 [data-view="submit"] .catch-analyze-button:disabled{
  opacity:.58!important;color:#d8e7f4!important;background:linear-gradient(135deg,#244963,#173348)!important;
}
html.castsight-r7 [data-view="submit"] .form-note{grid-column:1/-1!important}
@media(max-width:1280px){
  html.castsight-r7 [data-view="submit"] #catchForm{grid-template-columns:minmax(280px,330px) repeat(3,minmax(170px,1fr))!important}
}
@media(max-width:980px){
  html.castsight-r7 [data-view="submit"] #catchForm{grid-template-columns:1fr 1fr!important}
  html.castsight-r7 [data-view="submit"] .catch-photo-field{grid-column:1/-1!important;grid-row:auto!important}
}
@media(max-width:640px){html.castsight-r7 [data-view="submit"] #catchForm{grid-template-columns:1fr!important}}

/* Bite Map 7: compact left controller + one large real map. */
html.castsight-r7 [data-view="map"] .map-toolbar,
html.castsight-r7 [data-view="map"] .surf-location-panel{display:none!important}
html.castsight-r7 [data-view="map"] .bite-map-panel{padding:1rem!important;overflow:visible!important}
html.castsight-r7 [data-view="map"] .map-layout.r7-map-layout{
  position:relative!important;display:grid!important;
  grid-template-columns:300px minmax(0,1fr)!important;gap:1rem!important;
  height:min(780px,calc(100vh - 150px))!important;min-height:600px!important;
  overflow:visible!important;
}
html.castsight-r7 .r7-map-sidebar{
  min-width:0;height:100%;display:flex;flex-direction:column;gap:.85rem;
  padding:1rem;background:linear-gradient(145deg,rgba(7,30,51,.98),rgba(3,18,32,.98));
  border:1px solid var(--r7-border);border-radius:20px;overflow:hidden;
}
html.castsight-r7 .r7-map-sidebar h2{margin:0;color:#fff!important;font-size:1.12rem!important}
html.castsight-r7 .r7-map-sidebar p{margin:.15rem 0;color:var(--r7-muted)!important;font-size:.82rem}
html.castsight-r7 .r7-map-search{display:grid;grid-template-columns:1fr auto;gap:.5rem}
html.castsight-r7 .r7-map-search input{min-width:0}
html.castsight-r7 .r7-map-filter-row{display:grid;grid-template-columns:1fr 1fr;gap:.55rem}
html.castsight-r7 .r7-map-filter-row select,
html.castsight-r7 .r7-map-filter-row button,
html.castsight-r7 .r7-layer-button{
  min-width:0;min-height:42px;border-radius:11px;padding:.58rem .7rem;background:rgba(11,46,75,.88);color:#eaf5ff;border:1px solid rgba(75,156,218,.32);cursor:pointer;
}
html.castsight-r7 .r7-layer-button.active{background:#1267b5;color:#fff;border-color:#4ba7ed}
html.castsight-r7 .r7-beach-list{min-height:0;overflow:auto;display:grid;gap:.45rem;padding-right:.2rem}
html.castsight-r7 .r7-beach-item{
  display:grid;grid-template-columns:1fr auto;gap:.55rem;align-items:center;text-align:left;
  padding:.68rem .75rem;border-radius:11px;background:rgba(11,42,68,.8);border:1px solid rgba(74,151,209,.24);color:#e8f4ff;cursor:pointer;
}
html.castsight-r7 .r7-beach-item small{display:block;color:#9fb8cd}
html.castsight-r7 .r7-beach-item strong{color:#fff}
html.castsight-r7 .r7-beach-item.selected{background:#125fa8;border-color:#55a9ed}
html.castsight-r7 .r7-map-stage{
  position:relative;min-width:0;height:100%;border-radius:22px;overflow:hidden;
  background:#081c2f;border:1px solid var(--r7-border);
}
html.castsight-r7 #coastMap.r7-real-map{width:100%!important;height:100%!important;min-height:600px!important;border:0!important;border-radius:0!important}
html.castsight-r7 #zoneDetail.r7-map-drawer{
  position:absolute!important;right:14px!important;top:14px!important;bottom:14px!important;width:min(355px,42%)!important;
  z-index:10!important;overflow:auto!important;padding:1rem!important;border-radius:18px!important;
  background:rgba(4,22,38,.96)!important;border:1px solid rgba(86,166,224,.34)!important;
  box-shadow:0 22px 58px rgba(0,0,0,.42)!important;color:#fff!important;
}
html.castsight-r7 #zoneDetail.r7-map-drawer.is-collapsed{display:none!important}
html.castsight-r7 .r7-map-close{position:sticky;float:right;top:0;width:34px;height:34px;border-radius:50%;background:rgba(20,66,102,.9);color:#fff;border:1px solid rgba(94,174,229,.35);cursor:pointer}
html.castsight-r7 .r7-map-fact{padding:.72rem 0;border-bottom:1px solid rgba(126,171,205,.15)}
html.castsight-r7 .r7-map-fact span{display:block;color:#8faec6;font-size:.72rem;text-transform:uppercase;letter-spacing:.05em}
html.castsight-r7 .r7-map-fact strong{display:block;color:#fff;margin-top:.25rem}
html.castsight-r7 .r7-map-actions{display:flex;gap:.55rem;flex-wrap:wrap;margin-top:1rem}
html.castsight-r7 .r7-map-actions a,
html.castsight-r7 .r7-map-actions button{min-height:42px;padding:.65rem .85rem;border-radius:999px;background:#1267b5;color:#fff;border:1px solid #4a9bd8;text-decoration:none;font-weight:850;cursor:pointer}
html.castsight-r7 .r7-map-parking{display:grid;gap:.45rem;margin-top:.45rem}
html.castsight-r7 .r7-map-parking a{display:grid;padding:.55rem .65rem;border-radius:10px;background:rgba(13,48,76,.82);text-decoration:none}
html.castsight-r7 .r7-map-parking a strong{font-size:.83rem}.r7-map-parking a small{color:#a9bfd3}
html.castsight-r7 .r7-map-fallback{height:100%;display:grid;place-items:center;text-align:center;padding:2rem;background:radial-gradient(circle at 50% 30%,rgba(30,110,170,.25),transparent 38%),linear-gradient(145deg,#0a2944,#06192c)}
html.castsight-r7 .r7-map-fallback h2{color:#fff!important}
@media(max-width:980px){
  html.castsight-r7 [data-view="map"] .map-layout.r7-map-layout{grid-template-columns:1fr!important;height:auto!important}
  html.castsight-r7 .r7-map-sidebar{max-height:410px}
  html.castsight-r7 .r7-map-stage{height:68vh;min-height:520px}
  html.castsight-r7 #zoneDetail.r7-map-drawer{width:min(360px,90%)!important}
}

/* Tackle Box capacity row: labels and no mystery red X. */
html.castsight-r7 .reel-capacity-row{grid-template-columns:repeat(4,minmax(120px,1fr))!important;gap:.7rem!important;align-items:end!important;padding:.8rem;border-radius:14px;background:rgba(6,27,46,.55);border:1px solid rgba(83,159,216,.18)}
html.castsight-r7 .reel-capacity-row .r7-capacity-field{display:grid;gap:.32rem;min-width:0}
html.castsight-r7 .reel-capacity-row .r7-capacity-field>span{color:#9fb8cd;font-size:.7rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
html.castsight-r7 .reel-capacity-row .capacity-remove{grid-column:span 2!important;min-width:0!important;width:auto!important;color:#ffd2d6!important}
html.castsight-r7 .reel-capacity-row .capacity-remove::after{content:" Remove capacity row"!important}
@media(max-width:760px){html.castsight-r7 .reel-capacity-row{grid-template-columns:1fr 1fr!important}.reel-capacity-row .capacity-remove{grid-column:1/-1!important}}
