/* Haddad Calendar — always light, three flat colours.
   Composition, not paint: blue is the frame (top band, "Coming up" panel, dialog headers, footer band) and the events;
   white is the content (page, calendar, dialogs, forms); yellow is the signal (main action, today, important, accents).
   Roughly 45 / 45 / 10 on screen. Body text is dark ink; text on blue is white and bold. */
:root {
  --blue: #0094d8;
  --yellow: #face4b;
  --white: #ffffff;
  --ink: #0b2230;
  --soft: rgba(11, 34, 48, 0.6);   /* secondary text on white */
  --line: rgba(0, 148, 216, 0.28); /* hairlines inside white areas */
  --danger: #c4321f;
  --ok: #1f7a4a;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI Variable', 'Segoe UI', Roboto, sans-serif;
  --display: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI Variable Display', 'Segoe UI', sans-serif;
  color-scheme: light only;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--white); }
body {
  margin: 0; background: var(--white); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent;
  min-height: 100dvh; display: flex; flex-direction: column;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2.5px solid var(--yellow); outline-offset: 2px; }
::selection { background: var(--yellow); color: var(--ink); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; width: 100%; }

/* Icons */
.i-clock::before, .i-pin::before, .chev::before {
  content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px;
  background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.i-clock { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.i-pin { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s7-6.2 7-11.5A7 7 0 0 0 5 9.5C5 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.4'/%3E%3C/svg%3E"); }
.chev { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.chev::before { width: 12px; height: 12px; margin: 0 0 0 2px; transition: transform 0.2s; }
.menu[open] .chev::before { transform: rotate(180deg); }

/* Buttons ------------------------------------------------------------------------------------------------------- */
.btn {
  appearance: none; border: 1.5px solid var(--blue); background: var(--white); color: var(--ink);
  padding: 11px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; line-height: 1.2; letter-spacing: 0.02em;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; min-height: 44px;
  transition: transform 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
a.btn { text-decoration: none; }
.btn:hover { transform: translateY(-1px); border-color: var(--ink); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--white); font-weight: 800; }
.btn.primary:hover { border-color: var(--blue); background: var(--ink); }
.btn.gold { background: var(--yellow); border-color: var(--yellow); color: var(--ink); font-weight: 800; }
.btn.gold:hover { border-color: var(--yellow); background: var(--white); }
.btn.light { background: var(--white); border-color: var(--white); color: var(--ink); }
.btn.light:hover { border-color: var(--white); background: var(--yellow); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.quiet:hover { border-color: var(--line); transform: none; }
.btn.small { padding: 7px 13px; font-size: 13px; min-height: 36px; border-radius: 10px; }
.btn[disabled] { opacity: 0.4; cursor: default; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; padding: 0; font-size: 20px; }

.acct { display: flex; gap: 10px; align-items: center; }
.hero-top #account { padding-top: 20px; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px; background: var(--white); color: var(--ink);
  border: 1.5px solid var(--blue); border-radius: 16px; padding: 6px; z-index: 30; display: flex; flex-direction: column;
  box-shadow: 0 18px 40px rgba(11, 34, 48, 0.18); animation: pop 0.16s ease-out; transform-origin: top right;
}
.menu-list button { appearance: none; border: 0; background: transparent; text-align: left; padding: 12px 14px; border-radius: 10px; font-size: 14px; font-weight: 650; min-height: 44px; }
.menu-list button:hover { background: var(--blue); color: var(--white); }

/* Blue band ----------------------------------------------------------------------------------------------------- */
.hero { background: var(--blue); color: var(--white); padding-bottom: 16px; border-bottom: 5px solid var(--yellow); }
.hero-top { display: flex; align-items: flex-start; gap: 16px; padding: 0; margin-bottom: 0; }
.brand { display: flex; align-items: center; gap: 18px; min-width: 0; flex: 1; }
.brand .mark { width: 210px; height: 210px; border-radius: 36px; flex: none; background: var(--white); }
/* Logo cropped to 3:2, centred, edge to edge: the square file's top and bottom (where its faint rounded corners sit) are cut. */
.logo-frame { display: block; width: 210px; height: 140px; overflow: hidden; flex: none; background: var(--blue); }
.logo-frame img { display: block; width: 100%; height: auto; max-width: none; margin-top: -16.67%; border: 0; border-radius: 0; }
.brand h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; font-size: 18px; line-height: 1.25; font-weight: 800; letter-spacing: -0.005em; }
.hero-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 14px 0 0; }
.eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ''; width: 34px; height: 3px; border-radius: 3px; background: var(--yellow); }
.month-title { margin: 0; font-family: var(--display); font-size: clamp(46px, 7vw, 84px); line-height: 1; font-weight: 900; letter-spacing: -0.04em; }
.hero-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Segmented controls */
.seg { display: inline-flex; border: 1.5px solid var(--white); border-radius: 14px; padding: 3px; gap: 2px; }
.seg button {
  appearance: none; border: 0; background: transparent; color: var(--white); padding: 7px 14px; border-radius: 9px;
  font-size: 14px; font-weight: 700; min-height: 36px; transition: background 0.15s, color 0.15s;
}
.seg button:hover { background: rgba(255, 255, 255, 0.18); }
.seg button[disabled] { opacity: 0.35; cursor: default; background: transparent; }
.seg button[aria-pressed]:not([aria-pressed='false']) { background: var(--white); color: var(--blue); }
.seg button[aria-label='Previous month'], .seg button[aria-label='Next month'] { font-size: 22px; line-height: 1; padding: 0 12px; }

/* Layout: white content rises out of the band ------------------------------------------------------------------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin-top: 32px; flex: 1; }
.card { background: var(--white); border: 1.5px solid var(--line); border-radius: 22px; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 12.5px; flex: 1; font-weight: 650; color: var(--soft); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: none; }
.swatch.app { background: var(--blue); }
.swatch.web-app { background: var(--white); border: 2px solid var(--blue); }
.swatch.web-private { background: var(--white); border: 2px dashed var(--blue); }
.swatch.busy { background: #c9d0d4; }
.swatch.imp { background: var(--yellow); border-radius: 50%; width: 11px; height: 11px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; cursor: pointer; min-height: 32px; }
.check input { accent-color: var(--blue); width: 18px; height: 18px; }

/* Month grid: white days, hairline rules, blue events */
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.grid .dow { background: var(--white); padding: 12px 10px 10px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; color: var(--blue); }
.cell { background: var(--white); min-height: 124px; padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cell.out .num { opacity: 0.3; }
.cell.out .chip { opacity: 0.55; }
.num {
  font-size: 13px; font-weight: 800; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  align-self: flex-start; border: 0; background: transparent; font-variant-numeric: tabular-nums; transition: background 0.15s, color 0.15s;
}
button.num:hover { background: var(--blue); color: var(--white); }
.cell.today .num { background: var(--yellow); color: var(--ink); }
.chip {
  appearance: none; border: 0; text-align: left; width: 100%; font-size: 12px; line-height: 1.3; padding: 5px 8px; border-radius: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; font-weight: 700; transition: transform 0.15s;
}
.chip:hover { transform: translateY(-1px); }
.chip .t { font-weight: 500; margin-right: 5px; font-variant-numeric: tabular-nums; }
.chip.app { background: var(--blue); color: var(--white); }
.chip.web-app { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--blue); }
.chip.busy { background: #e3e7e9; color: rgba(11, 34, 48, 0.55); cursor: default; }
.chip.busy:hover { transform: none; }
.chip.web-private { background: var(--white); color: var(--ink); border: 1.5px dashed var(--blue); padding: 3.5px 7px; }
.chip.important::after, .row.important .title::after, .up.important .w b::after {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); margin-left: 7px; vertical-align: 1px;
}
.chip.gone, .row.gone { opacity: 0.45; text-decoration: line-through; }
.more { appearance: none; border: 0; background: transparent; font-size: 12px; font-weight: 800; color: var(--blue); text-align: left; padding: 3px 8px; border-radius: 6px; }
.more:hover { background: var(--blue); color: var(--white); }

/* List */
.list { display: flex; flex-direction: column; padding: 4px 22px 20px; }
.day-group { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.day-group:last-child { border-bottom: 0; }
.day-date { display: flex; flex-direction: column; align-items: center; gap: 5px; padding-top: 2px; }
.day-date .dow { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); }
.day-date .dnum {
  font-family: var(--display); font-size: 26px; font-weight: 900; line-height: 1; letter-spacing: -0.03em;
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 14px; font-variant-numeric: tabular-nums;
}
.day-group.today .dnum { background: var(--yellow); }
.day-events { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.row {
  appearance: none; width: 100%; text-align: left; display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--line); background: var(--white);
  border-radius: 16px; padding: 16px 16px 16px 0; overflow: hidden; transition: transform 0.15s, border-color 0.15s;
}
.row:hover { transform: translateY(-2px); border-color: var(--blue); }
.row .bar { align-self: stretch; width: 6px; background: var(--blue); flex: none; margin: -16px 0; }
.row.web-app .bar { background: var(--white); box-shadow: inset -2px 0 0 var(--blue); }
.row.busy { opacity: 0.75; cursor: default; background: #eef0f1; }
.row.busy:hover { transform: none; border-color: inherit; }
.row.busy .bar { background: #c9d0d4; }
.row.web-private .bar { background: repeating-linear-gradient(180deg, var(--blue) 0 6px, var(--white) 6px 10px); }
.row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.row .title { font-weight: 800; font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.row .meta { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 13px; font-weight: 550; color: var(--soft); }
.row .meta .i-clock::before, .row .meta .i-pin::before { color: var(--blue); }
.row.busy .tag { color: var(--soft); border: 1.5px solid #c9d0d4; }
.row .tag { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); border: 1.5px dashed var(--blue); padding: 4px 10px; border-radius: 999px; flex: none; }
.empty { text-align: center; padding: 72px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; color: var(--soft); }
.empty::before { content: ''; width: 12px; height: 12px; border-radius: 50%; margin-bottom: 12px; background: var(--yellow); box-shadow: 22px 0 0 var(--blue), -22px 0 0 var(--blue); }
.empty b { font-size: 18px; font-weight: 800; color: var(--ink); }

/* "Coming up": the blue column ---------------------------------------------------------------------------------- */
.side-card { background: var(--blue); color: var(--white); border-radius: 22px; padding: 24px 16px 16px; position: sticky; top: 20px; }
.side-card h3 { margin: 0 4px 18px; font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
.side-card h3::before { content: ''; width: 34px; height: 3px; border-radius: 3px; background: var(--yellow); }
.ups { display: flex; flex-direction: column; gap: 8px; }
.up {
  appearance: none; width: 100%; text-align: left; display: flex; gap: 12px; align-items: center; border: 0; color: var(--ink);
  background: var(--white); border-radius: 14px; padding: 10px; transition: transform 0.15s;
}
.up:hover { transform: translateX(4px); }
.up .d { flex: none; width: 48px; border-radius: 10px; background: var(--blue); color: var(--white); display: flex; flex-direction: column; align-items: center; padding: 6px 0 7px; line-height: 1.05; }
.up .d b { font-size: 20px; font-weight: 900; letter-spacing: -0.02em; }
.up .d span { font-size: 9.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.up.web-app .d { background: var(--white); color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.up.web-private .d { background: var(--white); color: var(--blue); border: 1.5px dashed var(--blue); }
.up .w { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.up .w b { font-size: 14px; font-weight: 800; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.up .w span { font-size: 12px; font-weight: 550; color: var(--soft); }
.side-card .none { font-size: 14px; font-weight: 600; margin: 0 4px; }

/* Dialogs: blue header, white body ------------------------------------------------------------------------------ */
dialog {
  border: 0; padding: 0; border-radius: 22px; background: var(--white); color: var(--ink); width: min(580px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); overflow: hidden; box-shadow: 0 30px 80px rgba(11, 34, 48, 0.3);
}
dialog.wide { width: min(880px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(11, 34, 48, 0.5); }
dialog[open] { animation: pop 0.2s ease-out; }
dialog[open]::backdrop { animation: fade 0.2s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
.dlg { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.dlg header { display: flex; align-items: flex-start; gap: 12px; padding: 24px 18px 22px 28px; background: var(--blue); color: var(--white); }
.dlg header h3 { margin: 0; font-family: var(--display); font-size: 24px; letter-spacing: -0.02em; line-height: 1.2; flex: 1; font-weight: 900; overflow-wrap: anywhere; }
.dlg header .btn { background: var(--white); border-color: var(--white); color: var(--ink); }
.dlg header .btn:hover { background: var(--yellow); border-color: var(--yellow); }
.dlg .body { padding: 22px 28px 14px; overflow: auto; overscroll-behavior: contain; }
.dlg footer { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 16px 28px 22px; border-top: 1px solid var(--line); }
.dlg .lead { margin: 0 0 18px; font-size: 14.5px; color: var(--soft); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.badge { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; color: var(--blue); border: 1.5px solid var(--blue); }
.badge.app { background: var(--blue); color: var(--white); }
.badge.imp { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.badge.gone { background: var(--danger); border-color: var(--danger); color: var(--white); }
.facts { display: grid; gap: 8px; margin: 0 0 18px; padding: 16px 18px; border-radius: 14px; border: 1.5px solid var(--line); }
.facts .when { font-weight: 800; font-size: 17px; }
.facts .muted { font-size: 14px; font-weight: 550; color: var(--soft); }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 18px; line-height: 1.6; }
.note { font-size: 13px; font-weight: 550; border-left: 3px solid var(--blue); padding: 10px 14px; margin: 0 0 14px; color: var(--soft); }
.note.warn { border-left-color: var(--yellow); color: var(--ink); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > label, .field > .label { font-size: 12.5px; font-weight: 800; }
.field .hint { font-size: 12px; font-weight: 500; color: var(--soft); }
.err { font-size: 13px; color: var(--danger); margin: 0 0 10px; font-weight: 700; }
.err:empty { display: none; }
input[type='text'], input[type='email'], input[type='url'], input[type='date'], input[type='datetime-local'], input[type='search'], select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--white); border-radius: 12px; padding: 11px 14px; min-height: 48px; font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--blue); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--yellow); }
textarea { min-height: 110px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--white); margin-bottom: 12px; cursor: pointer; transition: border-color 0.15s; }
.switch:hover, .switch:has(input:checked) { border-color: var(--blue); }
.switch input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.switch b { display: block; font-size: 14px; font-weight: 800; }
.switch span { font-size: 13px; color: var(--soft); }
.code-input { font-size: 32px !important; letter-spacing: 0.5em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 900; min-height: 64px !important; }

/* People, imports */
.people { display: flex; flex-direction: column; border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 14px; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.avatar { width: 38px; height: 38px; border-radius: 12px; background: var(--blue); color: var(--white) !important; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; }
.person .who { flex: 1; min-width: 0; }
.person .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who span { font-size: 12px; color: var(--soft); }
h4 { margin: 22px 0 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 800; color: var(--blue); }
.imp-group { border: 1.5px solid var(--line); border-radius: 16px; margin-bottom: 12px; overflow: hidden; }
.imp-group > .gh { padding: 12px 14px; background: var(--blue); color: var(--white); font-weight: 800; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.imp-group .count { font-weight: 800; background: var(--white); color: var(--blue); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.imp-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: start; }
.imp-row input[type='checkbox'] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); }
.imp-row .t { font-weight: 700; overflow-wrap: anywhere; }
.imp-row .m { font-size: 12px; color: var(--soft); overflow-wrap: anywhere; }
.diff { font-size: 12px; margin-top: 4px; }
.diff del { color: var(--danger); }
.diff ins { color: var(--ok); text-decoration: none; font-weight: 800; }
.imp-row select { min-height: 38px; padding: 4px 10px; font-size: 13px; width: auto; }
.drop { border: 2px dashed var(--blue); border-radius: 18px; padding: 40px 16px; text-align: center; cursor: pointer; background: var(--white); color: var(--soft); transition: background 0.15s, color 0.15s; }
.drop b { display: block; font-size: 16px; font-weight: 800; margin-bottom: 4px; color: var(--blue); }
.drop:hover, .drop.over { background: var(--blue); color: var(--white); }
.drop:hover b, .drop.over b { color: var(--white); }
.past-imports { font-size: 13px; }
.past-imports .pi { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.past-imports .pi span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: -4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toasts, skeleton, footer band -------------------------------------------------------------------------------- */
#toasts { position: fixed; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; padding: 0 12px; }
.toast { pointer-events: auto; background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 700; max-width: 520px; transition: opacity 0.4s, transform 0.4s; display: flex; align-items: center; gap: 10px; }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); flex: none; }
.toast.error { background: var(--danger); }
.toast.error::before { background: var(--white); }
.toast.ok { background: var(--blue); }
.toast.out { opacity: 0; transform: translateY(8px); }
.skeleton { height: 600px; border-radius: 22px; background: var(--white); border: 1.5px solid var(--line); animation: sh 1s ease-in-out infinite alternate; }
@keyframes sh { to { opacity: 0.6; } }
footer.site {
  color: var(--soft); font-size: 13px; font-weight: 600; text-align: center; max-width: 1240px; width: calc(100% - 64px);
  margin: 56px auto 0; padding: 32px 0 calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .spinner { animation: spin 2.4s linear infinite !important; }
  html { scroll-behavior: auto; }
}

/* Free time view ----------------------------------------------------------------------------------------------- */
.free-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; width: 100%; font-size: 14px; font-weight: 650; }
.free-controls .fc { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.free-controls select { width: auto; min-height: 40px; padding: 6px 30px 6px 14px; border-radius: 10px; font-weight: 800; font-size: 14px; border-color: var(--blue); }
.free-note { margin: 0; flex-basis: 100%; font-size: 12px; font-weight: 500; color: var(--soft); }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { font-weight: 800; font-size: 14px; padding: 7px 14px; border-radius: 10px; background: var(--blue); color: var(--white); font-variant-numeric: tabular-nums; }
.slot.all { background: var(--yellow); color: var(--ink); }
.booked { font-weight: 700; font-size: 14px; padding: 7px 0; color: var(--soft); }
.daybar { position: relative; height: 8px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 12px; }
.daybar .busy { position: absolute; top: 0; bottom: 0; left: calc(var(--l) * 1%); width: calc(var(--w) * 1%); min-width: 3px; background: var(--ink); opacity: 0.55; }

/* Tablet ------------------------------------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  #side { display: none; }
}

/* Phone -------------------------------------------------------------------------------------------------------- */
@media (max-width: 719px) {
  .grid-only { display: none !important; }
  .wrap { padding: 0 14px; }
  .hero { padding-bottom: 24px; }
  .hero-top { gap: 12px; padding: 0; padding-top: env(safe-area-inset-top); }
  .brand { gap: 10px; }
  .brand h1 { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .brand .mark { width: 128px; height: 128px; }
  .logo-frame { width: 128px; height: 85px; }
  .acct { gap: 6px; }
  .acct .btn { padding: 10px 13px; }
  .hero-main { padding-top: 28px; gap: 18px; }
  .hero-main > div:first-child { width: 100%; }
  .month-title { font-size: clamp(40px, 12vw, 54px); }
  .hero-controls { width: 100%; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; }
  .hero-controls .seg { width: 100%; min-width: 0; }
  .hero-controls .seg button { flex: 1; padding: 8px 4px; min-height: 42px; white-space: nowrap; }
  .hero-controls .seg button[aria-label='Previous month'], .hero-controls .seg button[aria-label='Next month'] { flex: 0 0 auto; padding: 0 8px; }
  .layout { margin-top: 16px; }
  .card { border-radius: 18px; }
  .card-head { padding: 12px 14px; gap: 8px 14px; }
  .legend { font-size: 11.5px; gap: 6px 14px; flex-basis: 100%; }
  .list { padding: 0 14px 12px; }
  .day-group { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding: 16px 0; }
  .day-date .dnum { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; }
  .row { padding: 14px 12px 14px 0; gap: 10px; border-radius: 14px; }
  .row .bar { margin: -14px 0; }
  .row .title { font-size: 15px; }
  .row .tag { display: none; }
  footer.site { margin-top: 36px; width: calc(100% - 28px); }
  /* dialogs become bottom sheets */
  dialog, dialog.wide { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; }
  dialog[open] { animation: sheet 0.25s ease-out; }
  .dlg { max-height: 92dvh; }
  .dlg header { padding: 20px 14px 18px 20px; }
  .dlg header h3 { font-size: 21px; }
  .dlg .body { padding: 18px 20px 12px; }
  .dlg footer { padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); }
  .dlg footer .btn { flex: 1; }
  .two { grid-template-columns: 1fr; gap: 0; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }

/* "In collaboration with SnapTable" badge: only for visitors who are not signed in ----------------------------------- */
.powered {
  position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50;
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px; border-radius: 999px;
  background: linear-gradient(135deg, #14a8ee, var(--blue) 60%, #0079b3); color: rgba(255, 255, 255, 0.9);
  font-size: 15px; letter-spacing: 0.01em; text-decoration: none; border: 1.5px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 28px rgba(0, 148, 216, 0.4), 0 2px 6px rgba(11, 34, 48, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.powered b { color: var(--white); font-weight: 800; font-size: 16px; }
.powered:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 148, 216, 0.5), 0 2px 6px rgba(11, 34, 48, 0.18); }
body.signed-in .powered { display: none; }
/* phone: a fixed bar at the bottom, in the page flow so it never covers content */
@media (max-width: 719px) {
  .powered {
    left: 0; right: 0; bottom: 0; justify-content: center; gap: 6px; border-radius: 0; border: 0;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); font-size: 13px; background: var(--blue);
    box-shadow: 0 -2px 12px rgba(11, 34, 48, 0.12);
  }
  .powered b { font-size: 14px; }
  .powered:hover { transform: none; box-shadow: 0 -2px 12px rgba(11, 34, 48, 0.12); }
  body:not(.signed-in) { padding-bottom: calc(46px + env(safe-area-inset-bottom)); }
}
