:root { color-scheme: light; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --ink: #202b41; --muted: #526078; --accent: #2455c7; --line: #e2e6ec; }
body { background: #f8fafc; margin: 0; color: var(--ink); }
main { margin: 48px auto; width: min(1160px, calc(100% - 48px)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 36px; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -.045em; line-height: 1.12; margin: 0 0 24px; text-wrap: balance; }
h2 { letter-spacing: -.025em; }
.users-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.users-toolbar h1 { margin: 0; }
.users-toolbar .button { margin-left: auto; }
.users-table tbody tr:hover, .users-table tbody tr:focus-within { background: #f0f5ff; }
.user-edit { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 6px; }
.user-edit:hover { background: #eef2f7; }
.resource-actions-cell { width: 1%; }
.resource-actions { display: flex; align-items: center; gap: 8px; }
.resource-actions form { display: block; margin: 0; }
.resource-actions > a { flex-shrink: 0; }
.resource-delete { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; background: transparent; color: #a02020; }
.resource-delete:hover { background: #fcecec; color: #801919; }
p { line-height: 1.65; color: var(--muted); }
.rooms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 28px; }
.room { border: 1px solid #dae1e8; background: #fcfdff; border-radius: 10px; padding: 22px; min-height: 140px; }
.room h2 { margin: 0; font-size: 1.1rem; }
@media (max-width: 600px) { .rooms { grid-template-columns: 1fr; } }

.auth { max-width: 480px; margin: auto; box-shadow: 0 18px 55px #202b4108; }
form { display: grid; gap: 12px; }
input[type=email], .auth input[type=text] { padding: 12px; border: 1px solid #a7b3c5; border-radius: 8px; font: inherit; min-width: 0; }
button { padding: 12px 20px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 650; line-height: 1.4; cursor: pointer; }
button:hover { background: #183f9c; }
:focus-visible { outline: 3px solid #ad7800; outline-offset: 3px; }
[role=alert] { color: #a02020; }

nav { margin-bottom: 18px; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: #183f9c; }
select { padding: 12px; border: 1px solid #a7b3c5; border-radius: 8px; font: inherit; background: white; }
.button { display: inline-flex; justify-content: center; align-items: center; font-weight: 650; line-height: 1.4; padding: 12px 20px; border-radius: 8px; background: #2455c7; color: white; text-decoration: none; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px; border-bottom: 1px solid #e5e7eb; overflow-wrap: anywhere; }
@media (max-width: 600px) { .card { padding: 18px; } th, td { padding: 8px; } }

/* Daily calendar: two pixels per elapsed minute. */
* { box-sizing: border-box; }
main.calendar-page { width: 100%; margin: 0; }
.app-header { min-height: 82px; padding: 18px 32px; display: flex; justify-content: space-between; align-items: center; gap: 20px; background: white; border-bottom: 1px solid #e2e6ec; }
.brand { min-width: 0; overflow-wrap: anywhere; font-size: 26px; letter-spacing: -.06em; font-weight: 800; text-decoration: none; color: #202b41; }
.brand .brand-dot { color: var(--accent); }
.brand-context { display: block; margin-top: 4px; font-size: 14px; font-weight: 450; letter-spacing: normal; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 24px; min-width: 0; }
.header-nav { display: flex; align-items: center; gap: 4px; margin: 0; padding: 4px; border: 1px solid #e2e6ec; border-radius: 12px; background: #f8fafc; }
.header-nav-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px; border-radius: 8px; color: #526078; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.header-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.header-nav-link:hover { background: #eaf0f8; color: #2455c7; }
.header-nav-link[aria-current="page"] { background: #2455c7; color: white; box-shadow: 0 1px 3px #19212b1a; }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; }
.has-navigation .account { padding-left: 24px; border-left: 1px solid #e2e6ec; }
.account-avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: #eaf0fc; color: #2455c7; font-weight: 700; }
.account-name { max-width: 200px; overflow-wrap: anywhere; }
.account form { margin: 0; flex-shrink: 0; }
.account button { background: transparent; color: #526078; padding: 9px 12px; border: 1px solid #dce2eb; border-radius: 8px; }
.account button:hover { background: #eef2f7; color: #202b41; }
@media (max-width: 1100px) { .app-header { flex-wrap: wrap; } .header-actions { flex-wrap: wrap; gap: 16px; } }
@media (max-width: 700px) {
  .app-header { flex-direction: column; }
  .brand { font-size: 21px; }
  .header-actions { width: 100%; }
  .header-nav { width: 100%; }
  .header-nav-link { flex: 1; padding: 9px 8px; }
  .account { width: 100%; }
  .has-navigation .account { padding: 12px 0 0; border-left: 0; border-top: 1px solid #e2e6ec; }
  .account-name { max-width: none; flex: 1; }
}
.day-calendar { padding: 28px 32px; }
.calendar-toolbar, .calendar-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; letter-spacing: .14em; margin: 0 0 8px; font-weight: 750; color: var(--accent); }
.calendar-toolbar h1 { font-size: 28px; margin: 0; }
.control { border: 1px solid #d6dce6; border-radius: 7px; padding: 9px 14px; background: white; text-decoration: none; color: #36445c; }
.control:hover { background: #edf2fa; }
.date-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-form label { font-size: 13px; color: #56657a; }
.date-form input { font: inherit; padding: 8px; border: 1px solid #d6dce6; border-radius: 6px; background: white; }
.date-form button { padding: 9px 13px; }
.calendar-caption { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0 12px; font-size: 12px; color: #64748b; }
.calendar-scroll { overflow: auto; max-height: calc(100dvh - 255px); min-height: 280px; border: 1px solid #dce2eb; border-radius: 14px; background: white; scroll-behavior: smooth; padding-bottom: 14px; }
.calendar-grid { min-width: calc(74px + var(--resource-count) * 240px); }
.resource-headers { display: grid; grid-template-columns: 74px repeat(var(--resource-count), minmax(0, 1fr)); position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid #dce2eb; }
.resource-headers h2 { margin: 0; padding: 21px 20px; border-left: 1px solid #dce2eb; font-size: 15px; font-weight: 650; }
.time-heading { padding: 23px 14px; font-size: 11px; color: #748197; }
.resource-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 10px; background: var(--resource-color, #5475c3); }
.timeline { position: relative; display: grid; grid-template-columns: 74px repeat(var(--resource-count), minmax(0, 1fr)); height: calc(var(--minutes) * 2px); }
.time-axis { position: relative; background: #fcfdff; }
.time-axis > span { position: absolute; right: 12px; font-size: 11px; color: #758198; transform: translateY(-50%); }
.time-axis > span:first-child { transform: none; }
.resource-column { position: relative; border-left: 1px solid #dce2eb; min-width: 0; }
.grid-line { position: absolute; width: 100%; border-top: 1px solid #f0f2f6; pointer-events: none; }
.grid-line.whole-hour { border-color: #dfe5ed; }
.booking { position: absolute; z-index: 1; padding: 2px 5px; min-width: 0; }
.booking-content { height: 100%; border: 1px solid #cbd9f6; border-left: 4px solid var(--resource-color, #5475c3); border-radius: 5px; background: color-mix(in srgb, var(--resource-color, #5475c3) 12%, white); padding: 7px 10px; display: flex; flex-direction: column; gap: 4px; overflow: auto; font-size: 12px; color: #28416a; overflow-wrap: anywhere; }
.booking strong { font-size: 14px; }
.booking:focus { z-index: 3; }
.now-line { position: absolute; left: 65px; right: 0; border-top: 2px solid #e45c62; z-index: 4; pointer-events: none; }
.now-line span { position: absolute; left: -43px; top: -10px; border-radius: 4px; background: #e45c62; color: white; padding: 2px 5px; font-size: 10px; }
@media (max-width: 700px) { .app-header { padding: 14px 16px; align-items: flex-start; } .day-calendar { padding: 20px 12px; } .calendar-controls { gap: 8px; } .date-form { width: 100%; } .calendar-caption span:last-child { display: none; } .calendar-scroll { max-height: 65dvh; } }

dialog { color: var(--ink); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 18px 55px #202b4120; width: min(520px, 94vw); max-height: 90dvh; overflow: auto; }
dialog::backdrop { background: #19212b88; }
dialog label { display: grid; gap: 5px; }
dialog input { padding: 10px; font: inherit; border: 1px solid #a7b3c5; border-radius: 8px; min-width: 0; }
dialog small { color: #a02020; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger { background: #a02020; }
.danger:hover { background: #801919; }
button:disabled { opacity: .6; cursor: wait; }
.booking, .resource-column { cursor: pointer; }

.view-switch { display: flex; margin: 0; gap: 4px; }
.view-switch [aria-current=page] { background: #2455c7; color: white; border-color: #2455c7; }
.month-scroll { overflow-x: auto; background: white; border: 1px solid #dce2eb; border-radius: 14px; }
.month-grid { table-layout: fixed; min-width: 840px; }
.month-grid th { font-size: 12px; color: #64748b; background: #f8fafc; }
.month-grid td { vertical-align: top; height: 150px; padding: 8px; border-right: 1px solid #e5e7eb; }
.month-grid td:last-child { border-right: 0; }
.month-grid tr:last-child td { border-bottom: 0; }
.month-date { display: inline-block; padding: 3px 7px; margin-bottom: 7px; font-size: 13px; font-weight: 650; text-decoration: none; border-radius: 5px; }
.month-day[data-action] { cursor: pointer; }
.month-day[data-action]:hover { background: #eef3fc; }
.month-create { float: right; min-width: 32px; min-height: 32px; padding: 3px 7px; background: transparent; color: #2455c7; opacity: 0; }
.month-create:hover { background: #dce7fc; color: #183f9c; }
.month-create:focus-visible { opacity: 1; outline: 2px solid #2455c7; outline-offset: 2px; }
.month-create:disabled { opacity: 0; cursor: default; }
.outside-month { background: #f8fafc; }
.outside-month .month-date { color: #64748b; }
.is-today .month-date { background: #2455c7; color: white; }
.month-booking { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; padding: 6px 7px; border-radius: 5px; border-left: 3px solid var(--resource-color, #5475c3); background: color-mix(in srgb, var(--resource-color, #5475c3) 12%, white); color: #28416a; font-size: 11px; cursor: pointer; overflow-wrap: anywhere; }
.month-booking time { font-weight: 650; }
.month-booking:hover { filter: brightness(.96); }

.auth input[type=color] { width: 64px; height: 44px; padding: 4px; border: 1px solid #a7b3c5; border-radius: 8px; background: white; cursor: pointer; }

/* Compact language links belong to the header, alongside account controls. */
.app-language-switch { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 2px; margin: 0; padding: 0; font-size: 14px; }
.app-language-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 44px; text-decoration: none; color: var(--muted); border-radius: 6px; }
.app-language-switch a:hover { background: #f0f4fb; color: var(--accent); }
.app-language-switch [aria-current="page"] { color: var(--accent); font-weight: 750; text-decoration: underline; text-underline-offset: 5px; }
.app-language-switch span { color: var(--muted); }
.auth-header { padding-inline: max(24px, calc((100vw - 1160px) / 2)); }
.auth-header + main { margin-top: 64px; }
.auth label { color: var(--ink); font-weight: 550; }
.auth input, .auth select { width: 100%; }
.auth input[type=color] { width: 64px; }
.auth button[type=submit] { min-height: 46px; }
.button:hover { background: #183f9c; color: #fff; }
@media (max-width: 700px) {
  .auth-header { flex-direction: row; align-items: center; }
  .auth-header + main { margin-top: 32px; }
  main { width: calc(100% - 32px); margin-top: 24px; }
  .account { flex-wrap: wrap; }
  .account-name { flex: 1; min-width: 0; }
  .account .app-language-switch { margin-left: auto; }
  .header-nav-link { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .calendar-scroll { scroll-behavior: auto; } }

.demo-banner {
    border-bottom: 1px solid var(--line);
    font-size: .875rem;
}
.demo-banner-notice {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .4rem;
    padding: .5rem 2rem;
    background: #fff8e5;
    color: #69521c;
    border-bottom: 1px solid #f0e3bd;
    font-size: .75rem;
    line-height: 1.5;
}
.demo-banner-notice time { white-space: nowrap; }
.demo-banner-offer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding: 1rem 2rem;
    background: #f5f8ff;
}
.demo-banner-copy { min-width: 0; }
.demo-banner-copy strong { color: var(--ink); font-size: .95rem; }
.demo-banner-copy p { margin: .3rem 0 0; color: var(--muted); line-height: 1.5; }
.demo-banner-actions { display: flex; align-items: center; gap: 1.25rem; flex-shrink: 0; }
.demo-banner-actions .button { white-space: nowrap; }
.demo-banner-contact { color: var(--accent); font-size: .8rem; text-underline-offset: 3px; }
@media (max-width: 900px) {
    .demo-banner-offer { align-items: flex-start; flex-direction: column; gap: .85rem; }
}
@media (max-width: 600px) {
    .demo-banner-notice { padding: .5rem 1rem; }
    .demo-banner-offer { padding: 1rem; }
    .demo-banner-actions { flex-wrap: wrap; gap: .75rem 1rem; }
}

/* Demo entry: a focused introduction before creating the sample workspace. */
main.demo-start-page { max-width: 600px; margin-block: 48px; }
.demo-start { padding: 40px; box-shadow: 0 18px 55px #202b4108; }
.demo-start-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 24px; border-radius: 14px; background: #eaf0fc; color: var(--accent); }
.demo-start h1 { margin-bottom: 16px; }
.demo-start .eyebrow { margin-bottom: 12px; }
.demo-start-intro { margin: 0; font-size: 1.05rem; }
.demo-start-highlights { display: grid; gap: 12px; list-style: none; margin: 24px 0 28px; padding: 0; font-size: .95rem; }
.demo-start-highlights li { display: flex; gap: 10px; align-items: baseline; line-height: 1.5; }
.demo-start-highlights span { color: var(--accent); font-weight: 700; }
.demo-start button { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; }
.demo-start-notice { margin: 16px 0 0; font-size: .85rem; }
.demo-start-contact { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); text-align: center; font-size: .95rem; }
.demo-start-contact p { margin: 0 0 6px; }
.demo-start-contact a:not(.button) { display: inline-block; padding: 6px; font-weight: 600; }
.demo-start-alert { padding: 12px 16px; background: #fff5f5; border: 1px solid #f0caca; border-radius: 8px; }
@media (max-width: 600px) {
  main.demo-start-page { width: calc(100% - 32px); margin-block: 28px; }
  .demo-start { padding: 28px 24px; }
  .demo-start-icon { margin-bottom: 20px; }
}

/* Resource settings: recurring windows share the application's form controls. */
.resource-form { max-width: 760px; }
.resource-form *, .resource-form *::before, .resource-form *::after { box-sizing: border-box; }
.availability-editor { min-width: 0; margin: 16px 0 8px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.availability-editor legend { padding: 0 8px; font-size: 1.1rem; font-weight: 650; }
.availability-timezone { display: inline-block; margin-bottom: 16px; padding: 4px 10px; border: 1px solid #dce4ef; border-radius: 6px; background: #fff; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.availability-editor label { display: grid; gap: 7px; min-width: 0; font-size: .9rem; }
.availability-editor input, .availability-editor select { min-height: 46px; width: 100%; }
.availability-help { margin: 14px 0 0; font-size: .9rem; }
.availability-weekly { margin-top: 20px; }
.availability-weekly[hidden], .availability-empty[hidden] { display: none; }
.availability-rows { display: grid; gap: 12px; }
.availability-window { display: grid; grid-template-columns: minmax(140px, 1.4fr) repeat(2, minmax(90px, 1fr)); gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.availability-window input { font-variant-numeric: tabular-nums; }
.availability-remove { grid-column: 1 / -1; justify-self: end; padding: 8px 12px; min-height: 40px; background: #fff; border: 1px solid #e8cccc; color: #a02020; font-size: .85rem; }
.availability-remove:hover { background: #fcecec; color: #801919; }
.availability-add { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 10px 14px; border: 1px solid #c9d6f1; background: #edf3ff; color: var(--accent); font-size: .9rem; }
.availability-add:hover { background: #dfeaff; color: #183f9c; }
.availability-empty { margin: 0; padding: 12px 16px; border: 1px dashed #c5ceda; border-radius: 8px; background: #fff; font-weight: 600; }
.availability-conflicts { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .availability-editor { padding: 14px; }
  .availability-window { padding: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .availability-day { grid-column: 1 / -1; }
  .availability-remove { justify-self: stretch; }
}

.resource-form .field-error { color: #a02020; font-size: .85rem; font-weight: 400; line-height: 1.5; }
.resource-form .field-error:empty { display: none; }
.resource-form [aria-invalid="true"] { border-color: #b33030; background: #fff8f8; }
.availability-window { align-items: start; }

/* Availability summary in the booking dialog. */
.booking-dialog { box-sizing: border-box; }
.booking-dialog h2 { margin: 0 0 4px; font-size: 1.4rem; }
.booking-dialog [data-booking-target=message]:empty, .booking-dialog small:empty { display: none; }
.booking-dialog [data-booking-target=message] { margin: 0; }
.booking-availability { display: grid; gap: 10px; padding: 16px; margin: 0 0 4px; background: #f3f6fc; border: 1px solid #dce5f4; border-radius: 12px; }
.booking-availability-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.booking-availability-zone { font-size: .75rem; font-weight: 400; overflow-wrap: anywhere; }
.booking-availability-resource { font-size: .95rem; overflow-wrap: anywhere; }
.booking-availability-windows { display: flex; flex-wrap: wrap; gap: 8px; }
.booking-availability-window { display: inline-flex; padding: 5px 10px; border: 1px solid #d5e0f2; border-radius: 6px; background: white; color: #234b95; font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.booking-availability.is-closed { background: #fff8f1; border-color: #efdbc3; }
.booking-availability.is-closed .booking-availability-window { color: #88511c; border-color: #efdbc3; }
.booking-dialog .modal-actions { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.booking-dialog button[data-action="booking#close"] { background: #eef1f6; color: var(--ink); }
.booking-dialog button[data-action="booking#close"]:hover { background: #dfe5ef; }
@media (max-width: 600px) {
  .booking-dialog { padding: 20px; }
  .booking-availability { padding: 12px; }
}

/* Closed-day status belongs to the resource heading, outside the event area. */
.resource-closed-badge { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; padding: 3px 8px; border: 1px solid #dce2eb; border-radius: 6px; background: #f3f5f8; color: #647084; font-size: 11px; font-weight: 500; vertical-align: middle; line-height: 1.4; }
.resource-closed-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #8793a5; }
.resource-column.is-closed-day, .resource-closed-period { background: repeating-linear-gradient(135deg, #f3f5f8 0, #f3f5f8 6px, #edf0f5 6px, #edf0f5 7px); }

.resource-closed-period { position: absolute; left: 0; width: 100%; pointer-events: none; }

/* Copy a recurring window without replacing a day's existing windows. */
.availability-window-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 12px; }
.availability-copy { min-width: 0; flex: 1 1 210px; }
.availability-copy summary { width: fit-content; padding: 9px 0; color: var(--accent); font-size: .85rem; font-weight: 600; cursor: pointer; }
.availability-copy-panel { margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.availability-copy-panel > p { margin: 0 0 12px; font-size: .85rem; }
.availability-copy-days { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 14px; }
.availability-copy-days label { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; cursor: pointer; }
.availability-copy-days input[type=checkbox] { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--accent); }
.availability-copy-days label:has(input:disabled) { opacity: .5; cursor: default; }
.availability-copy-apply { padding: 8px 12px; font-size: .85rem; }
.availability-copy-panel .field-error, .availability-copy-panel .availability-copy-status { margin: 12px 0 0; }
.availability-copy-panel p:empty { display: none; }
.availability-copy-status { color: #286344; }
@media (max-width: 600px) {
  .availability-window-actions { flex-direction: column; align-items: stretch; }
  .availability-copy { flex-basis: auto; }
}

.booking-dialog input[aria-invalid="true"], .booking-dialog select[aria-invalid="true"] { border-color: #b33030; background: #fff8f8; box-shadow: 0 0 0 1px #b3303020; }
.booking-dialog label:has([aria-invalid="true"]) { color: #a02020; }
.booking-dialog label small { font-size: .85rem; line-height: 1.5; }
