/* The clients' app in a browser, drawn as the app is on the iPhone: grouped lists on grey, the
   studio's terracotta for what can be tapped, the same colours for each kind of thing — and dark
   when the device is. */

:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --raised: #ffffff;
  --text: #000000;
  --secondary: #6e6e73;
  --tertiary: #aeaeb2;
  --separator: rgba(60, 60, 67, .22);
  --fill: rgba(118, 118, 128, .12);
  --lurra: #c75c2e;
  --lurra-soft: rgba(199, 92, 46, .12);
  --autonomous: #8054db;
  --event: #af52de;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --blue: #007aff;
  --logo: #c4a990;
  --boy: #2bb5de;
  --girl: #fa7899;
  --man: #5c66f5;
  --woman: #c23db8;
  --shadow: 0 10px 40px rgba(0, 0, 0, .18);
  --sheet: #f2f2f7;
  --sheet-card: #ffffff;
  --dim: rgba(0, 0, 0, .35);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --raised: #2c2c2e;
    --text: #ffffff;
    --secondary: #98989f;
    --tertiary: #636366;
    --separator: rgba(84, 84, 88, .6);
    --fill: rgba(118, 118, 128, .24);
    --lurra-soft: rgba(199, 92, 46, .22);
    --event: #bf5af2;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --blue: #0a84ff;
    --shadow: 0 10px 40px rgba(0, 0, 0, .6);
    --sheet: #1c1c1e;
    --sheet-card: #2c2c2e;
    --dim: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--lurra); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--secondary); }
.small { font-size: 13px; }
.footnote { font-size: 13px; color: var(--secondary); }
.strong { font-weight: 600; }
.green { color: var(--green); }
.orange { color: var(--orange); }
.red { color: var(--red); }
.lurra { color: var(--lurra); }
.event-color { color: var(--event); }
.hidden { display: none !important; }
svg.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--fill); border-top-color: var(--secondary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-spinner { display: flex; justify-content: center; padding: 40px 0; }

/* MARK: The screen */

.screen { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
.bar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  padding-top: env(safe-area-inset-top);
}
.bar-inner {
  max-width: 700px; margin: 0 auto; padding: 10px 16px 8px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.bar h1 { font-size: 30px; line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.bar .back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--lurra); padding: 4px 0; font-size: 17px; }
.bar-actions { display: flex; gap: 6px; align-items: center; }
.icon-button {
  position: relative; border: 0; background: var(--fill); color: var(--lurra);
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}
.icon-button .dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.content { max-width: 700px; margin: 0 auto; padding: 4px 16px 24px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; justify-content: center;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--separator);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1; max-width: 160px; border: 0; background: none; color: var(--tertiary);
  padding: 7px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 500;
}
.tabs button svg.icon { width: 25px; height: 25px; }
.tabs button[aria-current="page"] { color: var(--lurra); }

/* Above the tab bar while the page can't follow the studio (app.js, watchChanges). */
.sync-banner {
  position: fixed; z-index: 6; left: 50%; transform: translateX(-50%);
  bottom: calc(58px + env(safe-area-inset-bottom));
  max-width: calc(100% - 32px); width: max-content;
  display: flex; align-items: center; gap: 8px;
  border: .5px solid var(--separator); border-radius: 18px;
  background: var(--card); background: color-mix(in srgb, var(--card) 92%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
  padding: 9px 14px; color: inherit; font-size: 13px; font-weight: 500; text-align: left;
}
.sync-banner svg.icon { width: 17px; height: 17px; flex: none; color: var(--orange, #ff9500); }

/* MARK: Grouped lists */

.group { margin: 22px 0 0; }
.group:first-child { margin-top: 10px; }
.group-header { font-size: 13px; text-transform: uppercase; letter-spacing: .02em; color: var(--secondary); padding: 0 16px 7px; }
.group-header.plain { text-transform: none; font-size: 15px; letter-spacing: 0; }
.group-footer { font-size: 13px; color: var(--secondary); padding: 7px 16px 0; }
.group-footer p { margin: 0 0 7px; }
.card { background: var(--card); border-radius: 12px; overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 44px;
  padding: 11px 16px; position: relative; width: 100%; text-align: left;
  border: 0; background: none; border-radius: 0;
}
.row + .row::before, .row + .row-wrap::before, .row-wrap + .row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--separator);
}
.row-wrap { position: relative; }
button.row:active, a.row:active { background: var(--fill); }
a.row { color: inherit; text-decoration: none; }
.row .grow { flex: 1; min-width: 0; }
.row .end { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.row .chevron { color: var(--tertiary); flex: none; }
.row.link { color: var(--lurra); }
.row.danger { color: var(--red); }
.row.center { justify-content: center; }
.row.top { align-items: flex-start; }
.row .label { flex: 1; }
.row .value { color: var(--secondary); text-align: right; }
.stack { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.title { font-weight: 600; }
.headline { font-weight: 600; font-size: 17px; }
.sub { font-size: 15px; }
.caption { font-size: 12px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bar-stripe { align-self: stretch; width: 5px; border-radius: 3px; background: var(--lurra); flex: none; }
.bar-stripe.autonomous { background: var(--autonomous); }
.bar-stripe.event { background: var(--event); }
.with-icon { display: flex; gap: 6px; align-items: flex-start; }
.with-icon svg.icon { margin-top: .1em; }
.note { padding: 0 16px; font-size: 15px; color: var(--secondary); margin: 12px 0 0; }
.note.lurra { color: var(--lurra); }
.note.orange { color: var(--orange); }
.error { color: var(--red); font-size: 15px; }

/* Folded parts of the calendar */
.fold { width: 100%; }
.fold .count { color: var(--secondary); }
.fold .count.orange { color: var(--orange); }
.fold .turn { color: var(--lurra); transition: transform .15s; }
.fold[aria-expanded="true"] .turn { transform: rotate(90deg); }

/* MARK: Controls */

.segmented { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin: 10px 0 0; }
.segmented button {
  flex: 1; border: 0; background: none; border-radius: 7px; padding: 6px 4px; font-size: 14px; font-weight: 500;
}
.segmented button[aria-pressed="true"] { background: var(--raised); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background .2s; }
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s;
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--lurra); outline-offset: 2px; }
input.text, textarea.text, select.text {
  width: 100%; border: 0; background: none; padding: 0; outline: none; min-width: 0;
}
textarea.text { resize: vertical; min-height: 4.5em; }
select.text, input[type="date"].text { color: var(--secondary); text-align: right; text-align-last: right; appearance: none; -webkit-appearance: none; }
select.text { cursor: pointer; }
.select-wrap { display: flex; align-items: center; gap: 4px; color: var(--secondary); flex: 0 1 auto; min-width: 0; }
.select-wrap select.text { width: auto; max-width: 100%; }
input.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .03em; text-transform: uppercase; }
.field-box { background: var(--card); border-radius: 10px; padding: 12px; }
.stepper { display: inline-flex; background: var(--fill); border-radius: 8px; flex: none; }
.stepper button { border: 0; background: none; width: 46px; height: 32px; font-size: 20px; line-height: 1; color: var(--text); }
.stepper button:disabled { color: var(--tertiary); }
.stepper button + button { border-left: .5px solid var(--separator); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 7px 14px; font-weight: 600; font-size: 15px;
  background: var(--lurra); color: #fff; text-decoration: none; flex: none;
}
.button.large { width: 100%; padding: 14px 16px; font-size: 17px; border-radius: 12px; }
.button.orange { background: var(--orange); }
.button.plain { background: var(--lurra-soft); color: var(--lurra); }
.button:disabled { background: var(--fill); color: var(--tertiary); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--lurra); flex: none; }

/* MARK: The month */

.month { padding: 12px 8px 8px; touch-action: pan-y; }
.month-head { display: flex; align-items: center; gap: 4px; padding: 0 8px 10px; color: var(--lurra); }
.month-head h2 { margin: 0; font-size: 20px; color: var(--text); flex: 1; }
.month-head button { border: 0; background: none; color: var(--lurra); padding: 6px 8px; font-size: 15px; }
.weekdays, .days { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays span { text-align: center; font-size: 11px; font-weight: 600; color: var(--secondary); padding-bottom: 6px; }
.days button {
  border: 0; background: none; min-height: 46px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 0;
}
.days .number {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.days .today .number { color: var(--lurra); font-weight: 600; }
.days .selected .number { background: var(--text); color: var(--bg); font-weight: 600; }
.days .today.selected .number { background: var(--lurra); color: #fff; }
.dots { display: flex; gap: 3px; height: 5px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--lurra); }
.dots i.autonomous { background: var(--autonomous); }
.dots i.event { background: var(--event); }
.dots i.missed { background: var(--orange); }

/* MARK: Choosing a day and a time */

.strip { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; margin: 0 -16px; scrollbar-width: none; overscroll-behavior-x: contain; }
.strip::-webkit-scrollbar { display: none; }
/* With a mouse, the days further on are reached with the bar under them. */
@media (hover: hover) and (pointer: fine) {
  .strip { scrollbar-width: thin; padding-bottom: 6px; }
  .strip::-webkit-scrollbar { display: block; height: 6px; }
  .strip::-webkit-scrollbar-thumb { background: var(--fill); border-radius: 3px; }
}
.strip button {
  flex: none; width: 50px; height: 60px; border: 0; border-radius: 12px; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.strip button small { font-size: 12px; }
.strip button b { font-size: 20px; font-weight: 600; }
.strip button.closed { color: var(--secondary); }
.strip button[aria-pressed="true"] { background: var(--lurra); color: #fff; }
.chooser { position: relative; }
.chooser.working > * { opacity: .5; pointer-events: none; }

/* MARK: Sheets, dialogs and alerts */

.overlay {
  position: fixed; inset: 0; z-index: 20; background: var(--dim);
  display: flex; align-items: flex-end; justify-content: center;
}
/* Only as it comes up: drawn again while open, it stays as it is. */
.overlay.appear { animation: fade .15s ease-out; }
.appear .sheet { animation: rise .2s ease-out; }
.appear .dialog { animation: rise .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(30px); opacity: .6; } }
.sheet {
  background: var(--sheet); width: 100%; max-width: 640px; max-height: 92vh; max-height: 92dvh;
  border-radius: 14px 14px 0 0; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
@media (min-width: 700px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 14px; max-height: 86vh; }
}
.sheet-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 14px 16px 10px; border-bottom: .5px solid var(--separator);
}
.sheet-head h2 { margin: 0; font-size: 17px; text-align: center; }
.sheet-head button { border: 0; background: none; color: var(--lurra); padding: 2px 0; font-size: 17px; }
.sheet-head button:disabled { color: var(--tertiary); }
.sheet-head .start { justify-self: start; }
.sheet-head .end { justify-self: end; font-weight: 600; }
.sheet .card, .sheet .strip button:not([aria-pressed="true"]) { background: var(--sheet-card); }
.sheet-body { overflow-y: auto; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

.dialog-overlay { align-items: center; z-index: 30; padding: 16px; }
.dialog {
  background: var(--raised); width: 100%; max-width: 330px; border-radius: 14px; overflow: hidden;
  text-align: center; box-shadow: var(--shadow);
}
.dialog .message { padding: 18px 16px 14px; }
.dialog h3 { margin: 0 0 4px; font-size: 17px; }
.dialog p { margin: 0; font-size: 13px; color: var(--secondary); white-space: pre-line; }
.dialog button {
  display: block; width: 100%; border: 0; border-top: .5px solid var(--separator); background: none;
  padding: 12px 10px; font-size: 17px; color: var(--lurra);
}
.dialog button:active { background: var(--fill); }
.dialog button.destructive { color: var(--red); }
.dialog button.cancel { font-weight: 600; }

.viewer {
  position: fixed; inset: 0; z-index: 40; background: #000; display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* MARK: Account */

.profile { display: flex; gap: 16px; align-items: center; padding: 14px 16px; }
.avatar {
  position: relative; width: 72px; height: 72px; flex: none; border: 0; padding: 0; background: none;
}
.avatar .face {
  width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: var(--fill); color: #fff; font-size: 30px; font-weight: 700;
}
.avatar .face img { width: 100%; height: 100%; object-fit: cover; }
.avatar .face.boy { background: var(--boy); }
.avatar .face.girl { background: var(--girl); }
.avatar .face.man { background: var(--man); }
.avatar .face.woman { background: var(--woman); }
.avatar .face.inactive, .avatar .face.guest { background: var(--tertiary); }
.avatar .badge {
  position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--lurra); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.avatar .badge svg.icon { width: 14px; height: 14px; }
.badges { display: flex; gap: 12px; font-size: 15px; font-weight: 600; flex-wrap: wrap; }
.kind-boy { color: var(--boy); } .kind-girl { color: var(--girl); } .kind-man { color: var(--man); } .kind-woman { color: var(--woman); }
.figures { display: flex; border-top: .5px solid var(--separator); }
.figures > div, .figures > button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 4px; background: none; border: 0; font: inherit; color: inherit; }
.figures > * + * { border-left: .5px solid var(--separator); }
.figures svg.icon { width: 22px; height: 22px; color: var(--lurra); }
.figures .orange svg.icon { color: var(--orange); }
.figures .muted svg.icon { color: var(--secondary); }
.figures b { font-size: 17px; color: var(--text); }
.figures small { font-size: 11px; color: var(--secondary); }

/* MARK: Signing in */

.welcome {
  min-height: 100vh; min-height: 100dvh; max-width: 460px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 26px;
}
.welcome .top { display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
.welcome .top a { color: var(--secondary); font-size: 15px; text-decoration: none; }
.languages { display: flex; gap: 2px; margin-left: auto; }
.languages button { border: 0; background: none; color: var(--secondary); font-size: 13px; letter-spacing: .06em; padding: 4px 7px; border-radius: 6px; }
.languages button[aria-pressed="true"] { color: var(--text); background: var(--fill); }
.welcome .hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.welcome .hero img { width: 150px; height: auto; }
.welcome .hero p { margin: 0; font-size: 16px; color: var(--secondary); }
.welcome label.field-label { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.welcome .sign-in { display: flex; flex-direction: column; gap: 12px; }
.provider {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px;
  border-radius: 10px; font-size: 18px; font-weight: 500; border: 0;
}
.provider.apple { background: #000; color: #fff; }
.provider.google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
@media (prefers-color-scheme: dark) {
  .provider.apple { background: #fff; color: #000; }
  .provider.google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
}
.provider:disabled { opacity: .4; }
.provider svg { width: 19px; height: 19px; }
.provider.apple svg { margin-top: -3px; }
.choices { display: flex; flex-direction: column; gap: 8px; }
