/* Skymetric.Ink.Scheduler — theme + layout (LinkedInk v2 look).
   Every color maps to a --lti-* brand token with a literal fallback, so the scheduler
   looks right before/after the host defines the tokens. Override any --sched-* on a
   parent to re-theme without a rebuild. */

.sched {
    /* Brand tokens (host may override the --lti-* set globally) */
    --sched-accent: var(--lti-pink, #ff1e9c);
    --sched-accent-deep: var(--lti-pink-deep, #cb0c9f);
    --sched-accent-bright: var(--lti-pink-bright, #ff6db8);
    --sched-accent-ink: #ffffff;
    --sched-bg: var(--lti-ink-000, #0a070e);
    --sched-surface: var(--lti-ink-100, #120e18);
    --sched-surface-2: var(--lti-ink-200, #1a1524);
    --sched-surface-3: var(--lti-ink-300, #241d32);
    --sched-line: var(--lti-line, #2e2740);
    --sched-line-soft: color-mix(in srgb, var(--lti-line, #2e2740) 55%, transparent);
    --sched-text: var(--lti-text, #f3ecfa);
    --sched-text-muted: var(--lti-muted, #a99fbd);
    --sched-text-faint: var(--lti-faint, #6f6685);
    --sched-avail: color-mix(in srgb, var(--lti-ink-200, #1a1524) 70%, transparent);
    --sched-now: var(--lti-pink, #ff1e9c);
    --sched-radius: var(--lti-radius, 14px);
    --sched-radius-sm: var(--lti-radius-sm, 9px);
    --sched-font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --sched-display: "Bebas Neue", "Manrope", system-ui, sans-serif;

    /* Status accents — tuned to read on near-black */
    --sched-status-tentative: #a99fbd;
    --sched-status-booked: #8b7bff;
    --sched-status-confirmed: #34d399;
    --sched-status-checkedin: #fbbf24;
    --sched-status-inprogress: #ff6db8;
    --sched-status-completed: #6f6685;
    --sched-status-cancelled: #f87171;
    --sched-status-noshow: #f87171;

    /* Geometry */
    --gutter-w: 64px;
    --lane-min: 150px;
    --sched-max-h: calc(100vh - 250px);

    color: var(--sched-text);
    background: var(--sched-surface);
    border: 1px solid var(--sched-line);
    border-radius: var(--sched-radius);
    overflow: hidden;
    font-family: var(--sched-font);
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}
.sched.is-week { --lane-min: 132px; }

.sched.sched-light {
    --sched-bg: #ffffff;
    --sched-surface: #f7f7fa;
    --sched-surface-2: #eeeef3;
    --sched-surface-3: #e4e4ec;
    --sched-line: #e2e2ea;
    --sched-text: #16161a;
    --sched-text-muted: #6b6b7b;
    --sched-avail: rgba(255, 30, 156, 0.05);
}

.sched-visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- Toolbar ---- */
.sched-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    padding: 12px 14px;
    background: var(--sched-surface);
    border-bottom: 1px solid var(--sched-line);
    flex-wrap: wrap;
}
.sched-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sched-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sched-title {
    font-family: var(--sched-display);
    font-size: 1.55rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1;
    margin-left: 8px;
    white-space: nowrap;
}

.sched-btn {
    appearance: none;
    background: var(--sched-surface-2);
    color: var(--sched-text);
    border: 1px solid var(--sched-line);
    border-radius: var(--sched-radius-sm);
    padding: 8px 14px;
    min-height: 40px;
    min-width: 40px;
    font: 600 .9rem/1 var(--sched-font);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.sched-btn-icon { font-size: 1.35rem; padding: 0 10px; }
.sched-btn:hover { border-color: var(--sched-accent); }
.sched-btn:focus-visible, .sched-seg:focus-visible, .sched-chip:focus-visible,
.sched-reshead:focus-visible, .sched-dayhead:focus-visible {
    outline: 2px solid var(--sched-accent);
    outline-offset: 2px;
}

.sched-viewswitch {
    display: inline-flex;
    background: var(--sched-surface-2);
    border: 1px solid var(--sched-line);
    border-radius: 999px;
    padding: 3px;
}
.sched-seg {
    appearance: none; border: 0; background: transparent; color: var(--sched-text-muted);
    font: 700 .82rem/1 var(--sched-font); letter-spacing: .04em; text-transform: uppercase;
    padding: 9px 16px; border-radius: 999px; cursor: pointer; min-height: 34px;
}
.sched-seg.is-active {
    background: linear-gradient(135deg, var(--sched-accent), var(--sched-accent-deep));
    color: var(--sched-accent-ink);
    box-shadow: 0 2px 12px color-mix(in srgb, var(--sched-accent) 35%, transparent);
}

/* ---- Artist chips ---- */
.sched-artists {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--sched-line);
    background: var(--sched-surface);
    overflow-x: auto;
    scrollbar-width: thin;
}
.sched-chip {
    appearance: none; flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--sched-surface-2);
    color: var(--sched-text-muted);
    border: 1px solid var(--sched-line);
    border-radius: 999px;
    padding: 6px 12px;
    min-height: 34px;
    font: 600 .82rem/1 var(--sched-font);
    cursor: pointer;
    white-space: nowrap;
}
.sched-chip:hover { color: var(--sched-text); border-color: var(--lane-accent, var(--sched-accent)); }
.sched-chip.is-active {
    color: var(--sched-text);
    border-color: var(--lane-accent, var(--sched-accent));
    background: color-mix(in srgb, var(--lane-accent, var(--sched-accent)) 18%, var(--sched-surface-2));
}
.sched-chip-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lane-accent, var(--sched-accent)); }
.sched-chip-all { color: var(--sched-text); }
.sched-artist-select { display: none; flex: 1; }
.sched-artist-select select {
    width: 100%; min-height: 42px;
    background: var(--sched-surface-3); color: var(--sched-text);
    border: 1px solid var(--sched-line); border-radius: var(--sched-radius-sm);
    padding: 0 12px; font: 600 .95rem var(--sched-font);
}

.sched-error {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 9px 14px;
    background: color-mix(in srgb, var(--sched-status-cancelled) 18%, var(--sched-surface));
    color: var(--sched-text);
    border-bottom: 1px solid var(--sched-line);
    font-size: .9rem;
}
.sched-error-x { background: none; border: 0; color: inherit; font-size: 1.2rem; cursor: pointer; }
.sched-loading, .sched-empty {
    padding: 40px; text-align: center; color: var(--sched-text-muted);
}
.sched-spinner {
    display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px;
    border: 2px solid var(--sched-line); border-top-color: var(--sched-accent); border-radius: 50%;
    animation: sched-spin .8s linear infinite;
}
@keyframes sched-spin { to { transform: rotate(360deg); } }

/* ---- Grid frame ---- */
.sched-scroll {
    overflow: auto;
    min-height: 420px;
    max-height: var(--sched-max-h);
    flex: 1;
    overscroll-behavior: contain;
    background: var(--sched-bg);
}

.sched-grid {
    display: grid;
    grid-template-columns: var(--gutter-w) 1fr;
    /* row 1: headers · row 2: all-day strip (collapses when unused) · row 3: time grid */
    grid-template-rows: auto auto 1fr;
    min-width: max-content;
    width: 100%;
}

.sched-corner {
    grid-row: 1; grid-column: 1;
    position: sticky; top: 0; left: 0; z-index: 8;
    background: var(--sched-surface);
    border-right: 1px solid var(--sched-line);
    border-bottom: 1px solid var(--sched-line);
    display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px;
}
.sched-tzlabel { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sched-text-faint); }

.sched-headers {
    grid-row: 1; grid-column: 2;
    position: sticky; top: 0; z-index: 7;
    background: var(--sched-surface);
    border-bottom: 1px solid var(--sched-line);
}

.sched-reshead-row { display: flex; }

.sched-dayhead, .sched-reshead {
    appearance: none;
    flex: 1 1 0;
    min-width: var(--lane-min);
    background: var(--sched-surface);
    color: var(--sched-text);
    border: 0;
    border-left: 1px solid var(--sched-line);
    font-family: var(--sched-font);
    cursor: pointer;
    text-align: left;
}
.sched-dayhead {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 4px 9px;
}
.sched-dayhead:hover { background: var(--sched-surface-2); }
.sched-dayhead-dow { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sched-text-muted); }
.sched-dayhead-date {
    font-family: var(--sched-display); font-size: 1.6rem; line-height: 1;
    width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
}
.sched-dayhead.is-today .sched-dayhead-date {
    background: linear-gradient(135deg, var(--sched-accent), var(--sched-accent-deep));
    color: #fff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sched-accent) 25%, transparent);
}
.sched-dayhead.is-today .sched-dayhead-dow { color: var(--sched-accent-bright); }
.sched-dayhead-count { font-size: .68rem; color: var(--sched-text-faint); }

.sched-reshead {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-top: 3px solid var(--lane-accent, var(--sched-accent));
}
.sched-reshead:hover { background: var(--sched-surface-2); }
.sched-reshead.is-focused { background: color-mix(in srgb, var(--lane-accent) 12%, var(--sched-surface)); }
.sched-avatar-wrap {
    flex: 0 0 auto; display: inline-grid; place-items: center;
    width: 38px; height: 38px; border-radius: 50%;
    padding: 2px;
    background: conic-gradient(from 210deg, var(--lane-accent, var(--sched-accent)), color-mix(in srgb, var(--lane-accent, var(--sched-accent)) 35%, #fff), var(--lane-accent, var(--sched-accent)));
}
.sched-avatar {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--sched-surface);
}
.sched-avatar-initials {
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--lane-accent, var(--sched-accent)) 30%, var(--sched-surface-2));
    color: #fff; font: 800 .8rem/1 var(--sched-font); letter-spacing: .02em;
}
.sched-resmeta { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.sched-resname { font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-rescount { font-size: .7rem; color: var(--sched-text-muted); }

/* ---- All-day / Untimed strip ---- */
.sched-allday-gutter {
    grid-row: 2; grid-column: 1;
    position: sticky; left: 0; z-index: 4;
    background: var(--sched-surface);
    border-right: 1px solid var(--sched-line);
    border-bottom: 1px solid var(--sched-line);
    display: flex; align-items: flex-start; justify-content: flex-end;
    padding: 8px 8px;
    font-size: .62rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--sched-text-faint);
}
.sched-allday-lanes {
    grid-row: 2; grid-column: 2;
    display: flex;
    border-bottom: 1px solid var(--sched-line);
    background: var(--sched-surface);
}
.sched-allday-cell {
    flex: 1 1 0;
    min-width: var(--lane-min);
    display: flex; flex-direction: column; gap: 4px;
    padding: 6px 4px;
    border-left: 1px solid var(--sched-line);
    max-height: 118px;
    overflow-y: auto;
}
.sched-allday-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--sched-surface-2);
    border: 1px solid color-mix(in srgb, var(--ev-accent) 40%, var(--sched-line));
    cursor: pointer;
    user-select: none;
}
.sched-allday-chip:hover, .sched-allday-chip.is-selected { border-color: var(--ev-accent); }
.sched-allday-chip:focus-visible { outline: 2px solid var(--sched-accent); outline-offset: 1px; }
.sched-allday-chip-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--ev-accent); }
.sched-allday-chip-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.sched-allday-chip-client { font-weight: 700; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-allday-chip-service { font-size: .66rem; color: var(--sched-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Gutter (hour labels) ---- */
.sched-gutter {
    grid-row: 3; grid-column: 1;
    position: sticky; left: 0; z-index: 5;
    height: var(--col-h);
    background: var(--sched-surface);
    border-right: 1px solid var(--sched-line);
}
.sched-hour {
    position: absolute; right: 8px;
    transform: translateY(-50%);
    font-size: .68rem; font-weight: 600;
    color: var(--sched-text-faint);
    white-space: nowrap;
}
.sched-hour:first-child { transform: none; }
.sched-now-label {
    position: absolute; right: 4px; transform: translateY(-50%);
    background: var(--sched-now); color: #fff;
    font: 800 .64rem/1 var(--sched-font);
    padding: 3px 5px; border-radius: 6px; z-index: 2;
}

/* ---- Lanes ---- */
.sched-lanes { grid-row: 3; grid-column: 2; display: flex; position: relative; }

.sched-lane {
    flex: 1 1 0;
    min-width: var(--lane-min);
    position: relative;
    height: var(--col-h);
    border-left: 1px solid var(--sched-line);
    /* off-hours: dark + faint diagonal hatch; hour lines solid, half-hours dotted-soft */
    background:
        repeating-linear-gradient(to bottom,
            transparent 0, transparent calc(var(--slot-h) - 1px),
            var(--sched-line-soft) calc(var(--slot-h) - 1px), var(--sched-line-soft) var(--slot-h)),
        repeating-linear-gradient(to bottom,
            transparent 0, transparent calc(var(--slot-h) * 2 - 1px),
            var(--sched-line) calc(var(--slot-h) * 2 - 1px), var(--sched-line) calc(var(--slot-h) * 2)),
        repeating-linear-gradient(135deg,
            transparent 0, transparent 7px,
            rgba(255, 255, 255, .018) 7px, rgba(255, 255, 255, .018) 8px),
        var(--sched-bg);
    cursor: cell;
    touch-action: pan-x pan-y;
}
.sched-lane.is-today { box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--sched-accent) 2.5%, transparent); }

.sched-avail {
    position: absolute; left: 0; right: 0;
    background: var(--sched-avail);
    pointer-events: none;
    box-shadow: inset 2px 0 0 color-mix(in srgb, var(--lane-accent, var(--sched-accent)) 45%, transparent);
}

.sched-now {
    position: absolute; left: 0; right: 0; height: 2px;
    background: var(--sched-now);
    z-index: 4; pointer-events: none;
    box-shadow: 0 0 10px color-mix(in srgb, var(--sched-now) 60%, transparent);
}
.sched-now::before {
    content: ""; position: absolute; left: -5px; top: -4px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--sched-now);
}

/* ---- Event blocks ---- */
.sched-event {
    position: absolute;
    background: color-mix(in srgb, var(--ev-accent) 20%, var(--sched-surface-2));
    border: 1px solid color-mix(in srgb, var(--ev-accent) 55%, var(--sched-line));
    border-radius: var(--sched-radius-sm);
    overflow: hidden;
    display: flex;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: pan-x pan-y;
    z-index: 2;
    transition: box-shadow .15s, transform .15s, opacity .15s;
}
.sched-event:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .55), 0 0 0 1px var(--ev-accent); z-index: 3; }
.sched-event:focus-visible { outline: 2px solid var(--sched-accent); outline-offset: 1px; }
.sched-event.is-selected {
    box-shadow: 0 0 0 2px var(--sched-accent), 0 6px 20px color-mix(in srgb, var(--sched-accent) 35%, transparent);
    z-index: 3;
}
.sched-event.is-armed { transform: scale(1.03); box-shadow: 0 8px 24px rgba(0, 0, 0, .6), 0 0 0 2px var(--sched-accent); }
.sched-event.is-drag-source { opacity: .3; }
.sched-event.is-readonly { cursor: pointer; }
.sched-event.is-completed { opacity: .6; }
.sched-event.is-noshow {
    background:
        repeating-linear-gradient(135deg, transparent 0 6px, rgba(248, 113, 113, .12) 6px 12px),
        color-mix(in srgb, var(--ev-accent) 12%, var(--sched-surface-2));
}
.sched-event.is-noshow .sched-event-client { text-decoration: line-through; text-decoration-color: var(--sched-status-noshow); }
.sched-event.is-tentative { border-style: dashed; }

.sched-event-bar { width: 4px; background: var(--ev-status, var(--ev-accent)); flex: 0 0 4px; }
.sched-event-body {
    padding: 5px 7px; min-width: 0; flex: 1;
    display: flex; flex-direction: column; gap: 1px;
}
.sched-event-line1 { display: flex; align-items: center; gap: 5px; min-width: 0; }
.sched-event-artist {
    flex: 0 0 auto; font: 800 .6rem/1 var(--sched-font);
    background: var(--ev-accent); color: #0a070e; border-radius: 4px; padding: 2px 3px;
}
.sched-event-client { font-weight: 700; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-event-service { font-size: .72rem; color: var(--sched-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-event-time { font-size: .68rem; color: var(--sched-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-event-status {
    margin-top: 3px; align-self: flex-start;
    font: 700 .6rem/1 var(--sched-font); letter-spacing: .05em; text-transform: uppercase;
    color: var(--ev-status); border: 1px solid color-mix(in srgb, var(--ev-status) 55%, transparent);
    padding: 3px 6px; border-radius: 999px;
}
.sched-event-tag {
    position: absolute; top: 4px; right: 5px;
    font: 800 .62rem/1 var(--sched-font); color: #34d399;
    background: rgba(52, 211, 153, .12); border-radius: 4px; padding: 2px 4px;
}
.sched-event.is-compact .sched-event-body { flex-direction: row; align-items: center; gap: 6px; padding: 2px 6px; }
.sched-event.is-compact .sched-event-tag { top: 50%; transform: translateY(-50%); }
.sched-event.is-narrow .sched-event-time, .sched-event.is-narrow .sched-event-tag { display: none; }
.sched-event-recur { position: absolute; bottom: 3px; right: 5px; font-size: .7rem; color: var(--ev-accent); }
.sched-event-resize {
    position: absolute; left: 0; right: 0; bottom: 0; height: 9px;
    cursor: ns-resize;
}
.sched-event-resize::after {
    content: ""; position: absolute; left: 50%; bottom: 3px; width: 22px; height: 3px;
    transform: translateX(-50%); border-radius: 2px; background: var(--sched-text-faint);
    opacity: 0; transition: opacity .15s;
}
.sched-event:hover .sched-event-resize::after { opacity: .9; }

/* ---- JS drag / select ghosts ---- */
.sched-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.sched-ghost {
    position: absolute;
    border-radius: var(--sched-radius-sm);
    pointer-events: none;
    display: flex;
    overflow: hidden;
}
.sched-ghost-event {
    background: color-mix(in srgb, var(--ev-accent) 35%, var(--sched-surface-2));
    border: 2px solid var(--sched-accent);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .6);
    opacity: .95;
}
.sched-ghost-event .sched-event-resize { display: none; }
.sched-ghost-select {
    background: color-mix(in srgb, var(--sched-accent) 22%, transparent);
    border: 2px dashed var(--sched-accent);
}
.sched-ghost-label {
    position: absolute; left: 6px; bottom: 4px;
    font: 800 .7rem/1 var(--sched-font); color: #fff;
    background: var(--sched-accent-deep); padding: 3px 6px; border-radius: 6px;
    white-space: nowrap;
}
.sched.is-dragging, .sched.is-dragging * { cursor: grabbing !important; }

.sched-hint {
    display: flex; flex-wrap: wrap; gap: 6px 18px;
    padding: 8px 14px; border-top: 1px solid var(--sched-line);
    font-size: .72rem; color: var(--sched-text-faint);
}
.sched-hint span::before { content: "•"; margin-right: 6px; color: var(--sched-accent); }

/* ---- Responsive / touch ---- */
@media (max-width: 700px) {
    .sched { --gutter-w: 50px; --lane-min: 108px; --sched-max-h: calc(100vh - 230px); border-radius: var(--sched-radius-sm); }
    .sched.is-day .sched-lane, .sched.is-day .sched-reshead, .sched.is-day .sched-allday-cell { min-width: 0; }
    .sched-title { font-size: 1.2rem; margin-left: 2px; }
    .sched-toolbar { padding: 10px; }
    .sched-btn-today { padding: 8px 10px; }
    .sched-chip { display: none; }
    .sched-artist-select { display: block; }
    .sched-hint { display: none; }
    .sched-event-time { font-size: .64rem; }
}
@media (hover: none) {
    .sched-event-resize { height: 16px; }
    .sched-event-resize::after { opacity: .7; }
}

/* ==========================================================================
   Ink Hub scheduling panels (.ihs-*): Book Appointment + Appointment details
   slide-overs used by the host's /scheduling page. Kept here (the scheduler RCL
   stylesheet is already linked by the host) so panels share one style source.
   ========================================================================== */
.ihs-page { --ihs-panel-w: 460px; }

.ihs-jump-input {
    min-height: 40px; padding: 0 10px;
    background: var(--lti-ink-300, #241d32); color: var(--lti-text, #f3ecfa);
    border: 1px solid var(--lti-line, #2e2740); border-radius: var(--lti-radius-sm, 9px);
    font: 600 .85rem "Manrope", system-ui, sans-serif; color-scheme: dark;
}

.ihs-backdrop {
    position: fixed; inset: 0; z-index: 1300;
    background: rgba(5, 3, 8, .55);
    backdrop-filter: blur(2px);
    animation: ihs-fade .15s ease-out;
}
.ihs-panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1301;
    width: min(var(--ihs-panel-w, 460px), 100vw);
    display: flex; flex-direction: column;
    background: var(--lti-ink-100, #120e18);
    color: var(--lti-text, #f3ecfa);
    border-left: 1px solid var(--lti-line, #2e2740);
    box-shadow: -18px 0 48px rgba(0, 0, 0, .55);
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    animation: ihs-slide .2s cubic-bezier(.2, .8, .2, 1);
    color-scheme: dark;
}
@keyframes ihs-slide { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes ihs-fade { from { opacity: 0; } to { opacity: 1; } }

.ihs-panel-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--lti-line, #2e2740);
    background: linear-gradient(180deg, color-mix(in srgb, var(--lti-pink, #ff1e9c) 8%, transparent), transparent);
}
.ihs-head-client { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.ihs-eyebrow {
    display: block; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: var(--lti-pink-bright, #ff6db8);
}
.ihs-title {
    margin: 2px 0 0; font-family: "Bebas Neue", "Manrope", sans-serif; font-weight: 400;
    font-size: 1.9rem; letter-spacing: .03em; line-height: 1; text-transform: uppercase;
    overflow-wrap: anywhere;
}
.ihs-icon-btn {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--lti-line, #2e2740); background: var(--lti-ink-200, #1a1524);
    color: var(--lti-text, #f3ecfa); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.ihs-icon-btn:hover { border-color: var(--lti-pink, #ff1e9c); }

.ihs-panel-body {
    flex: 1; overflow-y: auto; padding: 16px 20px 22px;
    display: flex; flex-direction: column; gap: 16px;
    overscroll-behavior: contain;
}
.ihs-panel-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--lti-line, #2e2740);
    background: var(--lti-ink-100, #120e18);
}

.ihs-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ihs-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.ihs-label {
    font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
    color: var(--lti-muted, #a99fbd); padding: 0;
}
.ihs-muted { color: var(--lti-muted, #a99fbd); font-weight: 500; letter-spacing: 0; text-transform: none; }
.ihs-small { font-size: .8rem; }
.ihs-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ihs-input {
    width: 100%; min-height: 44px; padding: 10px 12px;
    background: var(--lti-ink-300, #241d32); color: var(--lti-text, #f3ecfa);
    border: 1px solid var(--lti-line, #2e2740); border-radius: var(--lti-radius-sm, 9px);
    font: 500 .95rem "Manrope", system-ui, sans-serif;
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.ihs-input::placeholder { color: var(--lti-faint, #6f6685); }
.ihs-input:focus { border-color: var(--lti-pink, #ff1e9c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lti-pink, #ff1e9c) 22%, transparent); }
.ihs-input:disabled { opacity: .7; }
.ihs-input-sm { width: auto; min-height: 36px; padding: 6px 10px; font-size: .85rem; }
.ihs-textarea { resize: vertical; min-height: 84px; line-height: 1.4; }

.ihs-check { display: flex; gap: 8px; align-items: flex-start; font-size: .85rem; cursor: pointer; }
.ihs-check input { accent-color: var(--lti-pink, #ff1e9c); width: 18px; height: 18px; margin-top: 1px; }

.ihs-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 42px; padding: 0 16px; border-radius: 999px;
    font: 800 .82rem/1 "Manrope", system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase;
    border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.ihs-btn:disabled { opacity: .45; cursor: not-allowed; }
.ihs-btn-primary {
    color: #fff; border: 0;
    background: linear-gradient(135deg, var(--lti-pink, #ff1e9c), var(--lti-pink-deep, #cb0c9f));
    box-shadow: 0 4px 18px color-mix(in srgb, var(--lti-pink, #ff1e9c) 35%, transparent);
}
.ihs-btn-primary:not(:disabled):hover { filter: brightness(1.08); }
.ihs-btn-soft { background: var(--lti-ink-200, #1a1524); color: var(--lti-text, #f3ecfa); border-color: var(--lti-line, #2e2740); }
.ihs-btn-soft:hover { border-color: var(--lti-pink, #ff1e9c); }
.ihs-btn-ghost { background: transparent; color: var(--lti-muted, #a99fbd); border-color: var(--lti-line, #2e2740); }
.ihs-btn-ghost-danger { background: transparent; color: #f87171; border-color: color-mix(in srgb, #f87171 45%, transparent); }
.ihs-btn-danger { background: #dc2626; color: #fff; }
.ihs-link-btn {
    align-self: flex-start; background: none; border: 0; padding: 2px 0; cursor: pointer;
    color: var(--lti-pink-bright, #ff6db8); font: 700 .85rem "Manrope", system-ui, sans-serif;
}
.ihs-link-btn:hover { text-decoration: underline; }
.ihs-a { color: var(--lti-pink-bright, #ff6db8); text-decoration: none; font-weight: 700; }

.ihs-chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.ihs-chip {
    min-height: 36px; padding: 0 13px; border-radius: 999px; cursor: pointer;
    background: var(--lti-ink-200, #1a1524); color: var(--lti-muted, #a99fbd);
    border: 1px solid var(--lti-line, #2e2740);
    font: 700 .82rem "Manrope", system-ui, sans-serif;
}
.ihs-chip:hover { color: var(--lti-text, #f3ecfa); }
.ihs-chip.is-active {
    color: #fff; border-color: var(--lti-pink, #ff1e9c);
    background: color-mix(in srgb, var(--lti-pink, #ff1e9c) 22%, var(--lti-ink-200, #1a1524));
}

.ihs-seg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ihs-seg {
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
    padding: 10px 12px; border-radius: var(--lti-radius-sm, 9px); cursor: pointer;
    background: var(--lti-ink-200, #1a1524); color: var(--lti-text, #f3ecfa);
    border: 1px solid var(--lti-line, #2e2740);
}
.ihs-seg:hover { border-color: color-mix(in srgb, var(--lti-pink, #ff1e9c) 60%, var(--lti-line, #2e2740)); }
.ihs-seg.is-active {
    border-color: var(--lti-pink, #ff1e9c);
    background: color-mix(in srgb, var(--lti-pink, #ff1e9c) 14%, var(--lti-ink-200, #1a1524));
    box-shadow: inset 0 0 0 1px var(--lti-pink, #ff1e9c);
}
.ihs-seg-title { font: 800 .88rem "Manrope", system-ui, sans-serif; }
.ihs-seg-hint { font-size: .72rem; color: var(--lti-muted, #a99fbd); }

.ihs-yn { display: inline-flex; border: 1px solid var(--lti-line, #2e2740); border-radius: 999px; padding: 3px; align-self: flex-start; background: var(--lti-ink-200, #1a1524); }
.ihs-yn button {
    border: 0; background: transparent; color: var(--lti-muted, #a99fbd); cursor: pointer;
    min-height: 32px; padding: 0 16px; border-radius: 999px; font: 800 .8rem "Manrope", system-ui, sans-serif;
}
.ihs-yn button.is-active { background: var(--lti-pink, #ff1e9c); color: #fff; }

.ihs-warn, .ihs-error, .ihs-ok {
    padding: 9px 12px; border-radius: var(--lti-radius-sm, 9px); font-size: .85rem; line-height: 1.35;
}
.ihs-warn { background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35); color: #fde68a; }
.ihs-error { background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .4); color: #fecaca; }
.ihs-ok { background: rgba(52, 211, 153, .08); border: 1px solid rgba(52, 211, 153, .3); color: #a7f3d0; }

/* client typeahead */
.ihs-typeahead { position: relative; }
.ihs-typeahead-spin {
    position: absolute; right: 12px; top: 13px; width: 16px; height: 16px;
    border: 2px solid var(--lti-line, #2e2740); border-top-color: var(--lti-pink, #ff1e9c); border-radius: 50%;
    animation: sched-spin .8s linear infinite;
}
.ihs-results {
    list-style: none; margin: 6px 0 0; padding: 4px;
    background: var(--lti-ink-200, #1a1524); border: 1px solid var(--lti-line, #2e2740);
    border-radius: var(--lti-radius-sm, 9px); max-height: 300px; overflow-y: auto;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}
.ihs-result {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer;
}
.ihs-result:hover, .ihs-result.is-active { background: color-mix(in srgb, var(--lti-pink, #ff1e9c) 14%, transparent); }
.ihs-result.is-blocked { opacity: .55; }
.ihs-result-new { border-top: 1px solid var(--lti-line, #2e2740); margin-top: 4px; color: var(--lti-pink-bright, #ff6db8); }
.ihs-result-empty { padding: 10px; color: var(--lti-muted, #a99fbd); font-size: .85rem; }
.ihs-client-card {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    background: var(--lti-ink-200, #1a1524); border: 1px solid color-mix(in srgb, var(--lti-pink, #ff1e9c) 45%, var(--lti-line, #2e2740));
    border-radius: var(--lti-radius-sm, 9px);
}
.ihs-client-card .ihs-link-btn { align-self: center; margin-left: auto; }
.ihs-client-initials {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; font: 800 .8rem "Manrope", system-ui, sans-serif; color: #fff;
    background: linear-gradient(135deg, var(--lti-pink, #ff1e9c), var(--lti-pink-deep, #cb0c9f));
}
.ihs-client-initials.sm { width: 30px; height: 30px; font-size: .7rem; }
.ihs-client-initials.lg { width: 48px; height: 48px; font-size: 1rem; }
.ihs-client-meta { display: flex; flex-direction: column; min-width: 0; }
.ihs-client-name { font-weight: 800; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ihs-client-sub { font-size: .76rem; color: var(--lti-muted, #a99fbd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ihs-newclient { display: flex; flex-direction: column; gap: 8px; }
.ihs-inline-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.ihs-consult {
    display: flex; flex-direction: column; gap: 4px; padding: 10px 12px;
    border-radius: var(--lti-radius-sm, 9px);
    background: color-mix(in srgb, #8b7bff 12%, var(--lti-ink-200, #1a1524));
    border: 1px solid color-mix(in srgb, #8b7bff 45%, transparent);
    font-size: .85rem;
}
.ihs-consult-badge { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #c4b5fd; }
.ihs-consult-note { color: var(--lti-muted, #a99fbd); font-style: italic; }

/* details */
.ihs-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ihs-pill, .ihs-status {
    display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px;
    font: 800 .68rem "Manrope", system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase;
    border: 1px solid currentColor;
}
.ihs-status { color: #8b7bff; background: rgba(139, 123, 255, .12); }
.ihs-status.is-tentative { color: #a99fbd; background: rgba(169, 159, 189, .1); }
.ihs-status.is-confirmed { color: #34d399; background: rgba(52, 211, 153, .1); }
.ihs-status.is-checkedin { color: #fbbf24; background: rgba(251, 191, 36, .1); }
.ihs-status.is-inprogress { color: #ff6db8; background: rgba(255, 109, 184, .12); }
.ihs-status.is-completed { color: #a99fbd; background: rgba(111, 102, 133, .2); }
.ihs-status.is-cancelled, .ihs-status.is-noshow { color: #f87171; background: rgba(248, 113, 113, .1); }
.ihs-pill-ok { color: #34d399; }
.ihs-pill-warn { color: #fbbf24; }
.ihs-pill-bad { color: #f87171; }

.ihs-facts { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--lti-line, #2e2740); border-radius: var(--lti-radius-sm, 9px); overflow: hidden; }
.ihs-facts > div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 10px 12px; background: var(--lti-ink-200, #1a1524); }
.ihs-facts > div + div { border-top: 1px solid var(--lti-line, #2e2740); }
.ihs-facts dt { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--lti-faint, #6f6685); padding-top: 2px; }
.ihs-facts dd { margin: 0; font-size: .9rem; min-width: 0; }
.ihs-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ihs-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; }
.ihs-money { font-weight: 800; color: #34d399; }
.ihs-note {
    white-space: pre-wrap; font-size: .88rem; line-height: 1.45; padding: 10px 12px;
    background: var(--lti-ink-000, #0a070e); border: 1px dashed var(--lti-line, #2e2740); border-radius: var(--lti-radius-sm, 9px);
    color: var(--lti-text, #f3ecfa);
}
.ihs-links { display: flex; gap: 8px; flex-wrap: wrap; }
.ihs-links .ihs-btn { flex: 1 1 160px; }
.ihs-section { display: flex; flex-direction: column; gap: 9px; }
.ihs-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ihs-resched { padding: 12px; border-radius: var(--lti-radius-sm, 9px); background: var(--lti-ink-200, #1a1524); border: 1px solid var(--lti-line, #2e2740); }
.ihs-skeleton { height: 64px; border-radius: 9px; background: linear-gradient(90deg, #1a1524, #241d32, #1a1524); background-size: 200% 100%; animation: ihs-shimmer 1.2s infinite; }
.ihs-skeleton.short { height: 120px; }
@keyframes ihs-shimmer { to { background-position: -200% 0; } }

@media (max-width: 700px) {
    /* bottom sheet on phones */
    .ihs-panel {
        top: auto; left: 0; right: 0; width: 100vw; max-height: 92vh;
        border-left: 0; border-top: 1px solid var(--lti-line, #2e2740);
        border-radius: 18px 18px 0 0;
        animation: ihs-rise .22s cubic-bezier(.2, .8, .2, 1);
    }
    .ihs-panel-head { padding: 14px 16px 12px; }
    .ihs-panel-body { padding: 14px 16px 18px; }
    .ihs-title { font-size: 1.6rem; }
    .ihs-jump-input { max-width: 150px; }
}
@keyframes ihs-rise { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ---------- Month view ---------- */
.sched-month { border: 1px solid var(--sched-line); border-radius: var(--sched-radius); overflow: hidden; background: var(--sched-bg); }
.sched-month-dows, .sched-month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sched-month-dow { padding: 8px 10px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sched-text-muted); background: var(--sched-surface); border-bottom: 1px solid var(--sched-line); }
.sched-month-week + .sched-month-week { border-top: 1px solid var(--sched-line-soft); }
.sched-month-cell { min-width: 0; min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 3px; border: 0; border-left: 1px solid var(--sched-line-soft); background: transparent; color: var(--sched-text); font: inherit; text-align: left; }
.sched-month-cell:first-child { border-left: 0; }
.sched-month-cell.is-outside { background: color-mix(in srgb, var(--sched-surface) 65%, transparent); }
.sched-month-cell.is-outside .sched-month-num { color: var(--sched-text-faint); }
.sched-month-date { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; padding: 2px 4px; border: 0; border-radius: var(--sched-radius-sm); background: transparent; color: var(--sched-text); font: inherit; cursor: pointer; }
.sched-month-date:hover { background: var(--sched-surface-2); }
.sched-month-num { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 50%; font-family: var(--sched-display); font-size: 1.15rem; line-height: 1; letter-spacing: .02em; }
.sched-month-cell.is-today .sched-month-num { background: var(--sched-accent); color: var(--sched-accent-ink); }
.sched-month-count { font-size: .66rem; color: var(--sched-text-faint); white-space: nowrap; }
.sched-month-chip { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; padding: 3px 6px; border: 1px solid transparent; border-radius: 6px; background: color-mix(in srgb, var(--ev-accent) 14%, transparent); color: var(--sched-text); font: inherit; font-size: .74rem; text-align: left; cursor: pointer; }
.sched-month-chip:hover, .sched-month-chip.is-selected { border-color: var(--ev-accent); }
.sched-month-chip:focus-visible, .sched-month-date:focus-visible, .sched-month-more:focus-visible, .sched-month-cell:focus-visible { outline: 2px solid var(--sched-accent); outline-offset: 1px; }
.sched-month-chip-dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--ev-accent); }
.sched-month-chip-time { flex: none; color: var(--sched-text-muted); font-variant-numeric: tabular-nums; }
.sched-month-chip-client { min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-month-chip.is-cancelled .sched-month-chip-client, .sched-month-chip.is-noshow .sched-month-chip-client { text-decoration: line-through; opacity: .7; }
.sched-month-more { align-self: flex-start; padding: 1px 6px; border: 0; background: transparent; color: var(--sched-accent-bright); font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; }
.sched-month-more:hover { text-decoration: underline; }
.sched-month-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.sched-month-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ev-accent); }
.sched.is-narrow .sched-month-cell { min-height: 56px; padding: 4px 2px; align-items: center; cursor: pointer; }
.sched.is-narrow .sched-month-dow { padding: 6px 2px; text-align: center; font-size: .62rem; }
