/* Coach editor styles */

.login-box {
  max-width: 360px; margin: 4dvh auto 0; text-align: center;
  display: grid; gap: 12px;
}
.login-box .login-brand { height: 34px; margin: 0 auto 4px; justify-self: center; width: auto; }
.login-box h1 { font-size: 30px; }
.login-sub { color: var(--ink-dim); font-size: 13.5px; margin-top: -8px; }
.login-box form { text-align: left; display: grid; gap: 4px; }

/* Pedro's polaroid, taped to the office door */
.polaroid {
  background: var(--ink);
  padding: 10px 10px 12px;
  border-radius: 3px;
  transform: rotate(-2.5deg);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  position: relative;
  margin: 14px auto 6px;
  max-width: 250px;
  animation: pin 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
@keyframes pin { from { opacity: 0; transform: rotate(-2.5deg) translateY(-14px) scale(1.04); } }
.polaroid::before { /* strip of tape */
  content: ''; position: absolute; top: -11px; left: 50%;
  width: 92px; height: 24px;
  transform: translateX(-50%) rotate(2deg);
  background: rgba(242, 242, 242, 0.25);
  border-left: 1px dashed rgba(1, 18, 38, 0.2);
  border-right: 1px dashed rgba(1, 18, 38, 0.2);
}
.polaroid img { display: block; width: 100%; border-radius: 2px; }
.polaroid-caption {
  font-family: var(--font-body); font-style: italic; font-weight: 400;
  color: var(--navy-deep); font-size: 12.5px; padding-top: 9px;
}
.iconbtn.wide { width: 100%; justify-content: center; min-height: 46px; font-size: 15px; }

/* Date bar */
.datebar {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: 8px; align-items: stretch;
  margin: 0 -16px; padding: 10px 16px;
  background: linear-gradient(180deg, var(--navy-deep) 82%, transparent);
}
.datebar .weeknav { flex: 0 0 40px; }
.datebox { position: relative; flex: 1; min-width: 0; }
.datebox input[type="date"] {
  position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer;
}
.datebox-label {
  display: flex; align-items: center; justify-content: center; height: 100%;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; font-size: 15px; padding: 8px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}

/* Section editor cards */
#sections { display: grid; gap: 14px; padding-top: 14px; }
.esec { padding: 14px 16px 16px; }
.esec.off { opacity: 0.45; }
.esec.off .esec-body { display: none; }
.esec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.esec-head h2 { font-size: 19px; flex: 1; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; cursor: pointer; z-index: 2; margin: 0; }
.switch .knob {
  position: absolute; inset: 0; border-radius: 999px; background: var(--navy-deep);
  border: 1px solid var(--line); transition: background 0.15s;
}
.switch .knob::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--ink-dim); transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .knob { background: var(--blue); border-color: var(--blue); }
.switch input:checked + .knob::after { transform: translateX(18px); background: var(--ink); }

.esec .picker { margin-bottom: 10px; }
.picker { display: flex; gap: 8px; }
.picker select {
  flex: 1.4; min-width: 0;
  background: var(--navy-deep); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.picker .sec-detail {
  flex: 1; min-width: 0;
  background: var(--navy-deep); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.03em;
}
.picker select:focus, .picker .sec-detail:focus { outline: none; border-color: var(--blue-bright); }

/* Editable lines */
.elines { display: grid; gap: 6px; }
.eline { display: flex; gap: 6px; align-items: center; }
.eline .grip { color: rgba(242,242,242,0.25); cursor: grab; font-size: 15px; padding: 0 2px; user-select: none; touch-action: none; }
.eline input {
  min-width: 0;
  background: var(--navy-deep); color: var(--ink);
  border: 1px solid transparent; border-bottom-color: var(--line);
  border-radius: 6px; padding: 8px 10px; font-size: 15px; font-weight: 500;
}
.eline input:focus { outline: none; border-color: var(--blue-bright); background: rgba(4, 66, 191, 0.08); }
.eline .l-text { width: 100%; }
.eline .ac-wrap { flex: 1; min-width: 0; position: relative; }
.eline .l-reps, .eline .l-weight {
  flex: 0 0 52px; width: 52px; padding: 8px 6px; text-align: center;
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.02em;
}
.eline .l-weight { flex-basis: 60px; width: 60px; }
.eline input::placeholder { color: rgba(178, 178, 178, 0.45); font-family: var(--font-body); font-weight: 400; font-size: 12.5px; letter-spacing: 0; }

/* Custom live-search dropdown (replaces native <datalist>, which Safari
   never filters — see attachAutocomplete in coach.js) */
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50;
  background: var(--navy-deep); border: 1px solid var(--line); border-radius: 10px;
  max-height: 230px; overflow-y: auto; list-style: none;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}
.ac-list[hidden] { display: none; }
.ac-list li { padding: 10px 13px; font-size: 14.5px; font-weight: 500; cursor: pointer; }
.ac-list li.active, .ac-list li:hover { background: var(--blue); color: var(--ink); }
.ac-list li.ac-add {
  color: var(--blue-text); font-size: 13.5px;
  border-top: 1px dashed var(--line);
}
.eline .rm {
  background: none; border: none; color: rgba(242,242,242,0.3);
  font-size: 18px; line-height: 1; padding: 4px 6px;
}
.eline .rm:hover { color: var(--danger); }
.eline.dragging { opacity: 0.4; }

.addrow { display: flex; margin-top: 10px; }
.addrow .iconbtn {
  flex: 1; justify-content: center;
  border-style: dashed; background: none; color: var(--blue-text);
}
.addrow .iconbtn:hover { border-color: var(--blue-bright); background: rgba(4, 66, 191, 0.08); }

/* Extra blocks */
.esec.extra::before { background: linear-gradient(180deg, var(--ink-dim), rgba(178,178,178,0.4)); }
.extra-title {
  flex: 1; min-width: 0;
  background: var(--navy-deep); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: 17px; letter-spacing: 0.04em;
}
.extra-title:focus { outline: none; border-color: var(--blue-bright); }
.movebtn {
  flex: 0 0 34px; height: 34px;
  background: var(--card); color: var(--ink-dim);
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 16px; line-height: 1;
}
.movebtn:hover { color: var(--ink); border-color: var(--blue-bright); }
.movebtn.mv-rm:hover { color: var(--danger); border-color: var(--danger); }

.addblock {
  width: 100%; margin-top: 14px; padding: 13px;
  background: none; border: 1px dashed var(--line); border-radius: 14px;
  color: var(--blue-text);
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.addblock:hover { border-color: var(--blue-bright); background: rgba(4, 66, 191, 0.08); }
.addblock small { color: var(--ink-dim); font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-weight: 500; }

/* Save bar */
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, var(--navy-deep) 70%, transparent);
}
.savebar #save-state { margin-right: auto; font-size: 12.5px; color: var(--ink-dim); }
.savebar #save-state.dirty { color: #eec55f; }
.savebar .iconbtn.primary { min-width: 130px; justify-content: center; min-height: 46px; font-size: 15px; }
