html, body {
    font-family: 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

h1:focus {
    outline: none;
}

/* Tri-state slot buttons stay tappable one-handed on small screens */
.slot-row .mud-button-root {
    min-width: 44px;
}

/* ---- Create page: tap-to-pick week timeline grid ---- */
.slot-grid-wrap {
    overflow-x: auto;
}

.slot-grid {
    display: grid;
    grid-template-columns: 44px repeat(7, minmax(46px, 1fr));
    min-width: 420px;
    user-select: none;
}

.slot-grid-day {
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.25;
    padding: 4px 0;
    color: var(--mud-palette-text-secondary);
}

.slot-grid-day.today {
    color: var(--mud-palette-primary);
}

.slot-grid-time {
    font-size: 0.62rem;
    color: var(--mud-palette-text-secondary);
    text-align: right;
    padding-right: 6px;
    transform: translateY(-0.55em);
    white-space: nowrap;
}

.slot-cell {
    height: 22px;
    border-right: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px dashed var(--mud-palette-lines-default);
    cursor: pointer;
    overflow: hidden;
}

/* Solid line at each hour boundary, dashed at the half hour */
.slot-cell.hour {
    border-top: 1px solid var(--mud-palette-lines-default);
    border-bottom-style: dashed;
}

.slot-cell:not(.hour) {
    border-bottom-style: solid;
}

/* Left edge of the first day column (cell right after the time label) */
.slot-grid-time + .slot-cell {
    border-left: 1px solid var(--mud-palette-lines-default);
}

.slot-cell:hover {
    background: var(--mud-palette-action-default-hover);
}

.slot-cell.covered,
.slot-cell.covered:hover {
    background: var(--mud-palette-primary);
    border-color: var(--mud-palette-primary);
}

.slot-cell.start {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.slot-cell-label {
    display: block;
    color: var(--mud-palette-primary-text);
    font-size: 0.6rem;
    line-height: 22px;
    padding-left: 4px;
    pointer-events: none;
}

.slot-cell.disabled,
.slot-cell.disabled:hover {
    background: var(--mud-palette-background-gray);
    cursor: default;
    opacity: 0.55;
}

/* Times already on the event — visible for context but not editable */
.slot-cell.existing,
.slot-cell.existing:hover {
    background: var(--mud-palette-action-disabled-background);
    border-color: var(--mud-palette-action-disabled);
    cursor: default;
}

.slot-cell.existing .slot-cell-label {
    color: var(--mud-palette-text-secondary);
}

/* ---- Create page: all-day month grid ---- */
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    max-width: 420px;
    user-select: none;
}

.month-grid-dow {
    text-align: center;
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
}

.month-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
}

.month-cell:hover {
    background: var(--mud-palette-action-default-hover);
}

.month-cell.today {
    border: 1px solid var(--mud-palette-primary);
}

.month-cell.selected,
.month-cell.selected:hover {
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.month-cell.disabled,
.month-cell.disabled:hover {
    opacity: 0.35;
    cursor: default;
    background: none;
}

/* Days already offered on the event — visible for context but not editable */
.month-cell.existing,
.month-cell.existing:hover {
    background: var(--mud-palette-action-disabled-background);
    color: var(--mud-palette-text-secondary);
    cursor: default;
}

.month-cell.blank,
.month-cell.blank:hover {
    cursor: default;
    background: none;
}

/* ---- Event page: tap-to-vote week calendar ---- */
.vote-cal-wrap {
    overflow-x: auto;
    padding-bottom: 4px;
}

.vote-cal {
    display: grid;
    user-select: none;
}

.vote-cal-head {
    text-align: center;
    padding-bottom: 6px;
}

.vote-cal-head.today .vote-day-date {
    color: var(--mud-palette-primary);
}

/* All-day lane sits between the headers and the timed canvas */
.vote-cal-axis-allday {
    font-size: 0.6rem;
    color: var(--mud-palette-text-secondary);
    text-align: right;
    padding: 6px 6px 6px 0;
}

.vote-cal-allday {
    padding: 2px;
    border-left: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.vote-cal-allday:last-child {
    border-right: 1px solid var(--mud-palette-lines-default);
}

.vote-cal-allday .vote-slot {
    margin: 2px;
    padding: 4px 8px;
}

/* Hour labels down the left edge, one per 56px row */
.vote-cal-axis {
    overflow: hidden;
}

.vote-cal-hour {
    height: 56px;
    font-size: 0.62rem;
    color: var(--mud-palette-text-secondary);
    text-align: right;
    padding-right: 6px;
    white-space: nowrap;
}

/* Day column with hour gridlines; slot blocks are positioned absolutely.
   The 56px row height must match CalPxPerHour in EventPage.razor. */
.vote-cal-canvas {
    position: relative;
    border-left: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: repeating-linear-gradient(
        to bottom,
        var(--mud-palette-lines-default) 0 1px,
        transparent 1px 56px);
}

.vote-cal-canvas:last-child {
    border-right: 1px solid var(--mud-palette-lines-default);
}

.vote-cal-canvas .vote-slot {
    position: absolute;
    left: 3px;
    right: 3px;
    margin: 0;
    padding: 2px 6px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--mud-palette-surface);
    box-sizing: border-box;
}

.vote-cal-canvas .vote-slot-time {
    font-size: 0.66rem;
}

.vote-cal-canvas .vote-slot-count {
    font-size: 0.6rem;
    display: block;
}

/* Solid surface underneath the translucent state tints so gridlines
   don't show through the blocks */
.vote-cal-canvas .vote-slot.yes {
    background: linear-gradient(var(--mud-palette-success-hover), var(--mud-palette-success-hover)) var(--mud-palette-surface);
}

.vote-cal-canvas .vote-slot.maybe {
    background: linear-gradient(var(--mud-palette-warning-hover), var(--mud-palette-warning-hover)) var(--mud-palette-surface);
}

.vote-day-dow {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.vote-day-date {
    font-weight: 600;
    font-size: 0.85rem;
}

.vote-slot {
    border: 1.5px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    padding: 8px 10px;
    margin-top: 8px;
    cursor: pointer;
    user-select: none;
}

.vote-slot:hover {
    border-color: var(--mud-palette-primary);
}

.vote-slot-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

.vote-slot-time {
    font-size: 0.78rem;
    font-weight: 600;
}

.vote-slot-state {
    font-weight: 700;
}

.vote-slot-count {
    font-size: 0.68rem;
    color: var(--mud-palette-text-secondary);
}

.vote-slot.yes {
    border-color: var(--mud-palette-success);
    background: var(--mud-palette-success-hover);
}

.vote-slot.yes .vote-slot-state {
    color: var(--mud-palette-success);
}

.vote-slot.maybe {
    border-color: var(--mud-palette-warning);
    background: var(--mud-palette-warning-hover);
}

.vote-slot.maybe .vote-slot-state {
    color: var(--mud-palette-warning);
}


#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
