/* ===== Scrim Planner ===== */

.pl-wrap { max-width: 1400px; margin: 0 auto; padding: 0 20px 80px; }

.pl-hero { text-align: center; padding: 48px 0 32px; }
.pl-hero h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; }
.pl-hero h1 span { color: var(--accent); }
.pl-hero p { color: var(--text-secondary); max-width: 640px; margin: 10px auto 0; }

/* ---- landing ---- */
.pl-landing { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .pl-landing { grid-template-columns: 1fr; } }

.pl-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
}
.pl-card h2 { font-size: 1.15rem; margin-bottom: 4px; }
.pl-card > p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; }
.pl-eyebrow {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em;
    color: var(--accent); margin-bottom: 8px;
}

.pl-field { display: block; margin-bottom: 14px; }
.pl-field > span {
    display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px;
}
.pl-field em { text-transform: none; letter-spacing: 0; font-style: normal; color: var(--text-muted); font-weight: 400; }
.pl-field input, .pl-field select {
    width: 100%; padding: 9px 11px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary);
    font-family: inherit; font-size: 0.92rem;
}
.pl-field input:focus, .pl-field select:focus { outline: none; border-color: var(--accent); }
.pl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pl-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .pl-row, .pl-row-3 { grid-template-columns: 1fr; } }

.pl-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius); border: 1px solid var(--border-light);
    background: var(--bg-tertiary); color: var(--text-primary);
    font-family: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pl-btn:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.pl-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.pl-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.pl-btn-wide { width: 100%; }
.pl-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pl-btn-sm { padding: 5px 10px; font-size: 0.78rem; }

.pl-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pl-chip {
    padding: 5px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer;
}
.pl-chip:hover { border-color: var(--text-muted); color: var(--text-primary); }
.pl-chip.on { background: rgba(255, 70, 85, 0.12); border-color: var(--accent); color: var(--accent); }

.pl-error {
    margin-top: 10px; padding: 9px 12px; border-radius: var(--radius);
    background: var(--red-bg); border: 1px solid rgba(255, 70, 85, 0.35);
    color: #ffb3ba; font-size: 0.85rem;
}
.pl-note { color: var(--text-muted); font-size: 0.8rem; margin-top: 10px; }

/* ---- board header ---- */
.pl-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding: 20px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.pl-head-main { flex: 1 1 320px; min-width: 0; }
.pl-head h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
.pl-head-sub { color: var(--text-secondary); font-size: 0.85rem; margin-top: 3px; }
.pl-head-sub b { color: var(--text-primary); font-weight: 600; }
.pl-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.pl-you {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 12px 14px; margin-bottom: 16px;
}
.pl-you label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.pl-you input {
    padding: 7px 10px; background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary); font-family: inherit;
    font-size: 0.9rem; min-width: 180px;
}
.pl-you input:focus { outline: none; border-color: var(--accent); }
.pl-saved { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }
.pl-saved.ok { color: var(--green); }

.pl-modes { display: inline-flex; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pl-modes button {
    padding: 7px 14px; border: none; background: transparent; color: var(--text-secondary);
    font-family: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.pl-modes button.on { background: var(--accent); color: #fff; }

/* ---- layout ---- */
.pl-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .pl-body { grid-template-columns: 1fr; } }

.pl-grid-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px; overflow: hidden;
}
.pl-grid-scroll { overflow-x: auto; padding-bottom: 4px; }

/* ---- the grid ---- */
.pl-grid { display: grid; gap: 0; user-select: none; min-width: max-content; }
.pl-time-col { display: flex; flex-direction: column; }
.pl-corner { height: 42px; }
.pl-time {
    height: 18px; font-size: 0.68rem; color: var(--text-muted);
    text-align: right; padding-right: 8px; white-space: nowrap;
    display: flex; align-items: center; justify-content: flex-end;
}
.pl-time.hour { color: var(--text-secondary); font-weight: 600; }

.pl-day { display: flex; flex-direction: column; min-width: 54px; }
.pl-day-head {
    height: 42px; text-align: center; padding: 3px 4px;
    border-bottom: 1px solid var(--border); margin-bottom: 2px;
}
.pl-day-dow { font-size: 0.72rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.pl-day-date { font-size: 0.7rem; color: var(--text-muted); }
.pl-day.today .pl-day-dow { color: var(--accent); }

.pl-cell {
    height: 18px; border: 1px solid rgba(42, 47, 61, 0.55); border-top: none; border-left: none;
    background: var(--bg-tertiary); cursor: pointer; position: relative;
    /* painting owns the gesture that starts on a cell; the scroll container
       around the grid still scrolls from anywhere else */
    touch-action: none;
}
.pl-cell.hour-start { border-top: 1px solid var(--border-light); }
.pl-cell.mine::after {
    content: ''; position: absolute; inset: 2px auto 2px 2px; width: 3px;
    background: var(--blue); border-radius: 2px;
}
.pl-cell.sel { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 2; }
/* Booked time has to read through the availability heat under it: the point of
   putting scrims on the same grid is that nobody offers an hour that is gone. */
.pl-cell.scrim {
    background-image: repeating-linear-gradient(45deg,
        rgba(245, 197, 66, 0.55) 0 3px, rgba(245, 197, 66, 0.08) 3px 8px);
    box-shadow: inset 2px 0 0 rgba(245, 197, 66, 0.75), inset -2px 0 0 rgba(245, 197, 66, 0.75);
}
.pl-cell.scrim-start { border-top: 2px solid var(--yellow); }
.pl-cell.peak { box-shadow: inset 0 0 0 1px rgba(62, 207, 142, 0.55); }

.pl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; font-size: 0.76rem; color: var(--text-muted); }
.pl-legend-scale { display: flex; align-items: center; gap: 4px; }
.pl-legend-box { width: 16px; height: 12px; border: 1px solid var(--border); border-radius: 2px; }
.pl-legend-key { display: flex; align-items: center; gap: 6px; }
.pl-legend-swatch { width: 12px; height: 12px; border-radius: 2px; border: 1px solid var(--border); }

/* ---- side panels ---- */
.pl-side { display: flex; flex-direction: column; gap: 16px; }
.pl-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.pl-panel h3 {
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 12px;
}
.pl-panel h3 span { color: var(--text-primary); }

.pl-best { display: flex; flex-direction: column; gap: 8px; }
.pl-best-row {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px;
    background: var(--bg-tertiary); border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
}
.pl-best-row:hover { border-color: var(--border-light); }
.pl-best-row.full { border-color: rgba(62, 207, 142, 0.45); background: rgba(62, 207, 142, 0.06); }
.pl-best-when { flex: 1; min-width: 0; }
.pl-best-day { font-size: 0.86rem; font-weight: 600; }
.pl-best-time { font-size: 0.74rem; color: var(--text-muted); }
.pl-best-count { font-size: 0.95rem; font-weight: 700; color: var(--green); white-space: nowrap; }
.pl-best-row.clash .pl-best-count { color: var(--yellow); }
.pl-best-tag { font-size: 0.66rem; color: var(--yellow); display: block; }

.pl-people { display: flex; flex-direction: column; gap: 4px; }
.pl-person {
    display: flex; align-items: center; gap: 8px; padding: 6px 8px;
    border-radius: var(--radius); cursor: pointer; font-size: 0.86rem;
}
.pl-person:hover { background: var(--bg-hover); }
a.pl-person { text-decoration: none; color: var(--text-primary); }
.pl-note a { color: var(--accent); text-decoration: none; }
.pl-note a:hover { text-decoration: underline; }
.pl-person.on { background: rgba(91, 141, 234, 0.14); }
.pl-person-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-person-n { font-size: 0.76rem; color: var(--text-muted); }
.pl-person.me .pl-person-name { color: var(--blue); font-weight: 600; }

.pl-scrims { display: flex; flex-direction: column; gap: 8px; }
.pl-scrim {
    padding: 9px 10px; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-left: 3px solid var(--yellow);
    border-radius: var(--radius);
}
.pl-scrim.block { border-left-color: var(--purple); }
.pl-scrim-top { display: flex; align-items: baseline; gap: 8px; }
.pl-scrim-title { font-weight: 600; font-size: 0.88rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-scrim-x { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; }
.pl-scrim-x:hover { color: var(--accent); }
.pl-scrim-when { font-size: 0.76rem; color: var(--text-secondary); margin-top: 2px; }
.pl-scrim-note { font-size: 0.76rem; color: var(--text-muted); margin-top: 3px; }
.pl-scrim-by { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }

.pl-empty { color: var(--text-muted); font-size: 0.82rem; padding: 6px 0; }

/* ---- hover tip ---- */
.pl-tip {
    position: fixed; z-index: 60; pointer-events: none;
    background: var(--bg-secondary); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 9px 11px; box-shadow: var(--shadow-lg);
    font-size: 0.8rem; max-width: 260px;
}
.pl-tip-when { font-weight: 700; margin-bottom: 5px; }
.pl-tip-line { color: var(--text-secondary); }
.pl-tip-free { color: var(--green); }
.pl-tip-out { color: var(--text-muted); }
.pl-tip-scrim { color: var(--yellow); margin-top: 4px; }

/* ---- modal ---- */
.pl-modal-back {
    position: fixed; inset: 0; background: rgba(6, 8, 12, 0.72);
    display: flex; align-items: center; justify-content: center; z-index: 70; padding: 20px;
}
.pl-modal {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); padding: 22px; width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.pl-modal h2 { font-size: 1.1rem; margin-bottom: 14px; }
.pl-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

.pl-hidden { display: none !important; }

/* a day whose availability is not this person's usual week */
.pl-day.override .pl-day-head { border-bottom-color: var(--purple); }
.pl-day.override .pl-day-date::after { content: ' *'; color: var(--purple); font-weight: 700; }

/* whose planner you are looking at */
.pl-teampick {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
    margin: 0 auto 22px; max-width: 900px;
}
.pl-teampick .pl-chip { padding: 7px 15px; font-size: 0.85rem; }
.pl-chip-n {
    display: inline-block; margin-left: 6px; padding: 0 6px;
    border-radius: 999px; background: rgba(139, 150, 165, 0.22);
    font-size: 0.72rem; font-weight: 700;
}
.pl-chip.on .pl-chip-n { background: rgba(255, 70, 85, 0.25); }
.pl-for { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
