/* Kviesk Mondi — unified brand and application design */
:root {
  --navy: #103449;
  --navy-hover: #1c4d64;
  --orange: #ee7936;
  --orange-hover: #ff9251;
  --cream: #faf6ef;
  --paper: #fffdfa;
  --ink: #223d4b;
  --muted: #5e7079;
  --line: #e3e0d9;
  --focus: #ad4210;
  --shadow: 0 10px 35px rgba(16, 52, 73, .055);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { color-scheme: light; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.65 Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--navy); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; }
img { display: block; max-width: 100%; }
:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.skip-link {
  position: fixed; top: 10px; left: 16px; z-index: 100;
  padding: 12px 18px; background: var(--navy); color: white;
  border-radius: 10px; transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px 24px;
  padding: 10px max(24px, calc((100vw - 1160px) / 2));
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 76px; height: 76px; object-fit: contain; border-radius: 12px; flex: 0 0 auto; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 23px; letter-spacing: -.7px; line-height: 1.25; }
.brand-copy small { font-size: 12px; }
.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.site-nav a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 14px; min-height: 44px; border-radius: 10px;
  font-size: 14px; font-weight: 600; line-height: 1.4;
}
.site-nav a:hover { background: #f0eae1; text-decoration: none; }
.site-nav a[aria-current="page"] { background: var(--navy); color: white; }
.site-nav button { margin-left: 4px; }
main { max-width: 1216px; margin: 0 auto; padding: 28px 28px 64px; min-height: calc(100vh - 213px); }
main:focus { outline: none; }
h1, h2, h3 { color: var(--navy); overflow-wrap: anywhere; }
h1 { margin: 0 0 22px; font-size: clamp(30px, 3.3vw, 42px); line-height: 1.16; letter-spacing: -1.2px; }
h2 { margin: 0 0 18px; font-size: 23px; line-height: 1.3; letter-spacing: -.4px; }
h3 { margin: 8px 0; font-size: 17px; line-height: 1.4; }
p { margin: 0 0 20px; }
small, .muted { color: var(--muted); }
small { font-size: 13px; line-height: 1.55; }
.muted { font-size: 14px; }
.eyebrow { color: #934017; font-size: 12px; font-weight: 700; letter-spacing: 1.6px; line-height: 1.5; text-transform: uppercase; margin-bottom: 14px; }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
  margin-bottom: 24px; box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.tinted { background: #edf3f5; border-color: #d7e2e7; }
.columns { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
.columns > *, .mail-layout > *, .booking-layout > * { min-width: 0; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 16px 0 26px; }
.heading h1 { margin-bottom: 8px; }
.heading p { margin-bottom: 0; }
.heading input { min-width: 180px; }
.heading > a { font-size: 14px; font-weight: 600; }
.hero-media {
  overflow: hidden; border-radius: 20px; background: #fcf9f3;
  border: 1px solid #ece3d6; margin-bottom: 36px;
  box-shadow: var(--shadow);
}
.hero-media img { width: 100%; height: auto; aspect-ratio: 2020 / 778; object-fit: contain; }
.booking-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, 1fr); align-items: start; gap: 56px; }
.intro { padding: 12px 0 0 6px; }
.intro h1 { max-width: 18ch; }
.intro > p:not(.eyebrow):not(.muted) { max-width: 46ch; font-size: 17px; line-height: 1.75; }
.intro > .muted { max-width: 52ch; }
.booking-steps { padding: 0; margin: 26px 0; list-style: none; counter-reset: steps; display: grid; gap: 16px; }
.booking-steps li { position: relative; counter-increment: steps; padding-left: 52px; min-height: 42px; }
.booking-steps li::before {
  content: "0" counter(steps); position: absolute; left: 0; top: 1px;
  width: 36px; height: 36px; display: grid; place-items: center;
  color: var(--navy); background: #fce6d4; border-radius: 11px;
  font-weight: 700; font-size: 12px;
}
.booking-steps strong { display: block; color: var(--navy); font-size: 14px; line-height: 1.55; }
.booking-steps span { display: block; font-size: 13px; color: var(--muted); line-height: 1.6; }
.availability-card { margin-top: 26px; background: var(--navy); border-color: var(--navy); padding: 26px; box-shadow: none; }
.availability-card h2 { color: #f6c3a0; font-size: 13px; letter-spacing: .6px; margin-bottom: 12px; }
.availability-card #availability { color: #fff; font-size: 22px; font-weight: 700; line-height: 1.5; margin-bottom: 12px; overflow-wrap: anywhere; }
.availability-card small { color: #d6e4eb; }
.booking-card { border-top: 4px solid var(--orange); padding: 30px; box-shadow: 0 16px 42px rgba(16, 52, 73, .075); }
.booking-card h2 { margin-bottom: 10px; }
.form-intro { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: var(--navy); font-size: 14px; font-weight: 600; line-height: 1.5; min-width: 0; }
input, textarea {
  width: 100%; min-width: 0; min-height: 48px;
  padding: 12px 14px; border: 1px solid #c7d1d5;
  border-radius: 10px; background: #fff; color: var(--ink);
  font-size: 16px; line-height: 1.5;
}
input::placeholder, textarea::placeholder { color: #6a7b85; opacity: 1; }
input:hover, textarea:hover { border-color: #8599a3; }
input:focus, textarea:focus { border-color: var(--focus); outline: 3px solid rgba(173,66,16,.22); outline-offset: 2px; }
textarea { resize: vertical; min-height: 110px; }
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 18px; border: 1px solid transparent;
  border-radius: 10px; background: var(--navy); color: #fff;
  font-size: 14px; font-weight: 700; line-height: 1.4; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
button:hover:not(:disabled) { background: var(--navy-hover); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.secondary, .site-nav button {
  background: #edf2f4; border-color: #d8e2e6; color: var(--navy);
  font-size: 13px; padding: 9px 13px; min-height: 44px;
}
button.secondary:hover:not(:disabled), .site-nav button:hover:not(:disabled) { background: #dee8ed; }
#booking-submit { background: var(--orange); color: #132f40; min-height: 52px; font-size: 16px; box-shadow: 0 5px 15px rgba(238,121,54,.15); }
#booking-submit:hover:not(:disabled) { background: var(--orange-hover); }
.form-note { font-size: 12px; }
.two { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.trap { display: none; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 0; display: flex; flex-wrap: wrap; gap: 16px 24px; min-width: 0; }
legend { font-size: 13px; font-weight: 600; padding: 0 5px; }
.radio { display: inline-flex; align-items: center; gap: 8px; }
.radio input { width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 0; accent-color: var(--navy); }
#booking-result { background: #f7f1e7; border: 1px solid #ebd8c0; border-radius: 12px; padding: 22px; overflow-wrap: anywhere; }
#booking-result h2 { font-size: 21px; }
#booking-result p:last-child { margin-bottom: 0; }
#message { padding: 18px 22px; border-radius: 12px; border: 1px solid #d3dfe6; background: #edf3f7; color: var(--navy); margin-top: 24px; overflow-wrap: anywhere; }
.narrow { max-width: 480px; margin: 42px auto; padding: 32px; }
.narrow h1 { font-size: 32px; }
.narrow > .muted { margin-bottom: 26px; }
#setup-result { font-size: 14px; margin-top: 18px; }
.event { border-left: 4px solid var(--navy); background: #edf3f6; border-radius: 10px; padding: 16px 18px; margin: 14px 0; overflow-wrap: anywhere; }
.event.work { border-color: var(--orange); background: #fff1e3; }
.event p { margin: 9px 0; font-size: 14px; }
.event a { font-size: 14px; font-weight: 600; }
.event > a { display: block; }
.event small { font-size: 12px; }
.event-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.event-actions button { min-height: 42px; }
.edit-dialog { width: min(580px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; padding: 30px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 80px rgba(16,52,73,.24); }
.edit-dialog::backdrop { background: rgba(12,35,49,.6); }
#edit-work-fields, #edit-call-fields { display: grid; gap: 18px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin-bottom: 6px; }
.stats .card { padding: 24px; }
.stats span { font-size: 13px; color: var(--muted); }
.stats strong { display: block; margin-top: 10px; color: var(--navy); font-size: clamp(24px,2.7vw,32px); line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; }
td,th { padding: 14px 10px; border-bottom: 1px solid #e9e7e2; }
td { overflow-wrap: anywhere; }
td.income { color: #226541; font-weight: 600; }
td.expense { color: #a54836; font-weight: 600; }
#finance-total { margin-top: 20px; }
.chartrow { display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 14px; padding: 10px 0; border-bottom: 1px solid #e9e7e2; }
.chartrow label { font-size: 12px; font-weight: 400; color: var(--muted); gap: 6px; }
.chartrow strong { font-size: 13px; font-weight: 600; }
progress { width: 100%; height: 8px; accent-color: #3e8963; }
.chartrow label + label progress { accent-color: var(--orange); }
.chartrow label + label { margin-top: 8px; }
.month-card { padding: 24px; }
.month-controls { display: grid; grid-template-columns: 42px minmax(0,1fr) 42px auto; align-items: center; gap: 10px; margin-bottom: 20px; }
.month-controls h2 { margin: 0; text-align: center; text-transform: capitalize; font-size: 21px; }
.month-controls button { padding: 8px; min-width: 0; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 7px; }
.calendar-weekdays { margin-bottom: 8px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; }
.calendar-weekdays span { padding: 6px 0; border-bottom: 1px solid #e7e9e7; }
.calendar-grid { grid-auto-rows: minmax(68px,auto); align-items: stretch; }
.calendar-empty { min-height: 68px; }
button.calendar-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 100%; min-width: 0; min-height: 68px; margin: 0; padding: 7px 2px;
  border: 1px solid #dce3e7; border-radius: 10px; background: #f2f5f6;
  color: var(--ink); font-size: 14px; line-height: 1.2; font-weight: 400;
}
button.calendar-day.green { background: #e0efdb; border-color: #b8d6ad; color: #31572b; }
button.calendar-day.orange { background: #ffecd8; border-color: #efc598; color: #89421e; }
button.calendar-day.red { background: #f9e2df; border-color: #e6b3ae; color: #923a32; }
button.calendar-day.nonworking { background: #f2f2ef; border-color: #e3e5df; color: #6b757a; }
button.calendar-day.weekend { background: #eceff0; border-color: #dce2e4; color: #62717a; }
button.calendar-day:hover:not(:disabled) { background: #e4edf1; border-color: #95abb7; color: var(--navy); }
button.calendar-day.selected { outline: 3px solid var(--navy); outline-offset: 1px; z-index: 1; }
button.calendar-day:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.calendar-number { font-size: 15px; font-weight: 700; }
button.calendar-day.today .calendar-number { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--navy); }
.calendar-free { max-width: 100%; font-size: 10px; color: inherit; line-height: 1.2; white-space: nowrap; }
#calendar-summary { margin: 16px 0 0; padding: 12px 14px; border-radius: 9px; background: #f5f1e9; color: var(--muted); }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 16px; font-size: 12px; color: var(--muted); }
.calendar-legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; }
.legend-dot.green { background: #599748; }
.legend-dot.orange { background: #dd8b39; }
.legend-dot.red { background: #c35c51; }
.mail-layout { display: grid; grid-template-columns: minmax(260px,1fr) minmax(0,1.8fr); gap: 24px; align-items: start; }
.mail-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; }
.mail-toolbar h2 { margin: 0; }
.mail-toolbar strong { min-width: 0; flex: 1 1 180px; }
.mail-toolbar button { width: auto; }
button.mail-item { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; width: 100%; text-align: left; color: var(--ink); background: #f5f3ee; border: 1px solid var(--line); margin: 8px 0; padding: 14px; overflow-wrap: anywhere; }
button.mail-item.unread { border-left: 4px solid var(--orange); background: #fff0e2; }
button.mail-item:hover:not(:disabled) { color: var(--navy); background: #eee7da; }
.mail-item span, .mail-item small { font-size: 12px; font-weight: 400; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 15px; line-height: 1.75; max-height: 65vh; overflow: auto; padding: 4px 0; }
#mail-subject,#mail-sender,#mail-preview-name,#mail-send-status { overflow-wrap: anywhere; }
#mail-send-status { margin-top: 16px; font-size: 14px; }
.mail-row { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.mail-row .event-actions { margin: 0; gap: 8px; }
.mail-row .event-actions button { width: auto; }
.mail-attachment { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.mail-attachment span { flex: 1 1 200px; overflow-wrap: anywhere; }
.mail-attachment button { width: auto; }
#mail-preview { width: 100%; height: 65vh; border: 1px solid var(--line); border-radius: 10px; background: white; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px max(24px,calc((100vw - 1160px)/2)); border-top: 1px solid var(--line); background: var(--paper); }
.footer-brand { display: grid; gap: 3px; }
.footer-brand strong { color: var(--navy); font-size: 17px; letter-spacing: -.3px; }
.footer-brand span { color: var(--muted); font-size: 12px; }
.site-footer > a { font-size: 14px; font-weight: 600; }
@media (max-width: 1000px) {
  .booking-layout { gap: 28px; grid-template-columns: minmax(0,1fr) minmax(320px,1fr); }
  .columns { grid-template-columns: minmax(0,1.2fr) minmax(300px,1fr); gap: 20px; }
  .card { padding: 24px; }
  .booking-card { padding: 26px; }
  .mail-layout { grid-template-columns: minmax(240px,1fr) minmax(0,1.5fr); gap: 20px; }
  .month-controls { grid-template-columns: 38px minmax(0,1fr) 38px; }
  .month-controls > button:last-child { grid-column: 1/-1; justify-self: end; padding: 9px 14px; }
  .month-controls h2 { font-size: 18px; }
  .calendar-weekdays,.calendar-grid { gap: 5px; }
  .calendar-free { font-size: 9px; }
}
@media (max-width: 760px) {
  .site-header { padding: 10px 18px 14px; gap: 8px; }
  .brand-logo { width: 60px; height: 60px; }
  .brand-copy strong { font-size: 21px; }
  .site-nav { width: 100%; gap: 5px; }
  .site-nav a { padding: 9px 12px; }
  .site-nav button { margin-left: 0; }
  main { padding: 20px 18px 36px; }
  h1 { font-size: 32px; letter-spacing: -.8px; }
  h2 { font-size: 22px; }
  .hero-media { margin-bottom: 24px; border-radius: 12px; }
  .booking-layout,.columns,.mail-layout { grid-template-columns: minmax(0,1fr); gap: 22px; }
  .intro { padding: 0; }
  .intro h1 { max-width: 24ch; }
  .intro > p:not(.eyebrow):not(.muted) { font-size: 16px; }
  .booking-steps { gap: 12px; margin: 22px 0; }
  .availability-card { margin: 22px 0 0; padding: 22px; }
  .availability-card #availability { font-size: 20px; }
  .card { padding: 22px 20px; border-radius: 14px; margin-bottom: 20px; }
  .booking-card { padding: 24px 20px; }
  .form-intro { margin-bottom: 22px; }
  .heading { margin-top: 6px; flex-direction: column; align-items: stretch; gap: 18px; margin-bottom: 22px; }
  .heading input { width: 100%; }
  .narrow { margin: 8px auto; padding: 26px 22px; }
  .narrow h1 { font-size: 29px; }
  .stats { gap: 12px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stats .card:last-child { grid-column: 1/-1; }
  .stats .card { padding: 18px 16px; }
  .stats strong { font-size: 25px; }
  .month-card { padding: 18px 14px; }
  .calendar-grid { grid-auto-rows: minmax(60px,auto); }
  .calendar-empty { min-height: 60px; }
  button.calendar-day { min-height: 60px; border-radius: 8px; gap: 4px; }
  .calendar-legend { gap: 8px 12px; }
  .edit-dialog { padding: 24px 20px; }
  .site-footer { padding: 24px 18px; gap: 14px; }
}
@media (max-width: 400px) {
  main { padding-left: 12px; padding-right: 12px; }
  .site-header { padding-left: 12px; padding-right: 12px; }
  .two { grid-template-columns: minmax(0,1fr); }
  .month-card { padding: 16px 12px; }
  .month-controls { grid-template-columns: 34px minmax(0,1fr) 34px; gap: 7px; }
  .month-controls h2 { font-size: 17px; }
  .calendar-weekdays,.calendar-grid { gap: 4px; }
  .calendar-free { font-size: 8px; }
  .calendar-number { font-size: 14px; }
  .calendar-legend { font-size: 11px; }
  .stats strong { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
/* Keep day labels inside narrow calendar cells. Full labels remain in aria-label. */
.calendar-free { overflow: hidden; text-overflow: ellipsis; }

/* Private phone-app and push settings */
.push-heading{display:flex;align-items:center;gap:16px;margin-bottom:22px}
.push-heading img{border-radius:12px;flex:0 0 auto}
.push-heading h2{margin:0 0 5px}.push-heading p{margin:0}
.push-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:28px}
.push-columns h3{margin:0 0 10px}.push-columns p{margin:0 0 14px}
.push-columns .event-actions{margin-top:0}
#install-status,#push-status{margin-top:14px;overflow-wrap:anywhere}
#install-status:empty{display:none}
@media(max-width:760px){.push-columns{grid-template-columns:minmax(0,1fr);gap:24px}.push-heading{align-items:flex-start}.push-heading h2{font-size:21px}.push-heading img{width:52px;height:52px}}

/* Phone setup is a dismissible dialog, not a permanent dashboard card. */
.pwa-dialog{width:min(700px,calc(100% - 32px));padding:28px}
.pwa-dialog .push-columns{gap:24px}
.pwa-dialog .push-columns.push-single{grid-template-columns:minmax(0,1fr)}
.pwa-dialog-actions{display:flex;justify-content:flex-end;margin-top:24px;padding-top:18px;border-top:1px solid var(--line)}
#pwa-settings{flex:0 0 auto;align-self:center}
@media(max-width:760px){.pwa-dialog{padding:22px 18px}#pwa-settings{align-self:flex-start}}
