/* Koal Pot Staff - components, following the v7 prototype's visual language */

/* --- Buttons ----------------------------------------------------------- */
.btn {
  border: 0; border-radius: 11px; padding: 11px 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: var(--kp-fs-md); font-weight: 800; line-height: 1.2;
  min-height: var(--kp-tapmin); text-align: center;
  transition: background-color .16s var(--kp-ease), border-color .16s var(--kp-ease),
              transform .08s var(--kp-ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: scale(.985); }
.btn svg { width: 15px; height: 15px; }
.btn--primary   { background: var(--kp-red); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--kp-red-dark); }
.btn--light     { background: #fff; color: #21272A; }
.btn--light:hover { background: #EDEDED; }
.btn--secondary { background: #F0F1F2; color: #353A40; }
.btn--secondary:hover { background: #E7E9EA; }
.btn--outline   { background: #fff; border: 1px solid #DEDFE1; color: #35383D; }
.btn--outline:hover { background: var(--kp-paper); }
.btn--success   { background: var(--kp-green); color: #fff; }
.btn--danger    { background: #fff; border: 1px solid #F4CDD5; color: var(--kp-red); }
.btn--ghost     { background: none; color: var(--kp-muted); padding-inline: 10px; }
.btn--block     { display: flex; width: 100%; }
.btn--lg        { padding: 14px 22px; font-size: var(--kp-fs-base); border-radius: 13px; }
.btn--sm        { padding: 8px 11px; font-size: var(--kp-fs-sm); border-radius: var(--kp-r-sm); min-height: var(--kp-tapmin); }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }

.text-link {
  display: inline-flex; align-items: center; gap: 5px; color: var(--kp-red);
  background: none; border: 0; font-size: var(--kp-fs-md); font-weight: 750;
  min-height: 32px;
}
.text-link svg { width: 14px; height: 14px; }

/* --- Demo / environment ribbon ------------------------------------------ */
.ribbon {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 14px;
  background: var(--kp-amber-ribbon); color: var(--kp-amber-text);
  border: 1px solid var(--kp-amber-line); border-radius: var(--kp-r-md);
  font-size: var(--kp-fs-md); margin-bottom: 20px; line-height: 1.5;
}
.ribbon svg { width: 17px; height: 17px; margin-top: 1px; }
.ribbon > span { flex: 1 1 240px; min-width: 0; }
.ribbon select {
  border: 1px solid var(--kp-amber-line); background: #fff; border-radius: var(--kp-r-sm);
  padding: 5px 8px; font-size: var(--kp-fs-sm); color: var(--kp-ink);
  margin-left: auto; min-height: 34px; max-width: 220px;
}
.ribbon--offline { background: #F1F5FA; color: #3C5670; border-color: #D5E2EF; }

/* --- Hero ---------------------------------------------------------------- */
.hero {
  position: relative; min-height: 232px; overflow: hidden;
  border-radius: var(--kp-r-xl); background: var(--kp-hero); color: #fff;
  padding: 29px 32px; display: flex; justify-content: space-between; gap: 16px;
  box-shadow: var(--kp-shadow); margin-bottom: 19px;
}
.hero::before {
  content: ''; position: absolute; width: 450px; height: 450px;
  border: 87px solid rgba(200, 16, 45, .22); border-radius: 50%;
  right: -95px; top: -230px; transform: rotate(20deg);
}
.hero::after {
  content: ''; position: absolute; width: 330px; height: 330px;
  border: 1px solid rgba(255, 255, 255, .10); border-radius: 50%;
  right: 70px; top: -170px;
}
.hero-text { z-index: 1; display: flex; flex-direction: column; align-items: flex-start; max-width: 74%; }
.hero .eyebrow {
  font-size: var(--kp-fs-xs); letter-spacing: 1.7px; text-transform: uppercase;
  font-weight: 800; color: var(--kp-hero-eyebrow); margin-bottom: 13px;
}
.hero h2 {
  font-size: clamp(23px, 3vw, 32px); font-weight: 800;
  margin-bottom: 10px; letter-spacing: -.8px;
}
.hero .meta {
  font-size: var(--kp-fs-base); color: #C4C9CB; display: flex; align-items: center;
  gap: 9px; flex-wrap: wrap; line-height: 1.7;
}
.hero .meta svg { width: 15px; height: 15px; }
.hero .btn-row { margin-top: auto; padding-top: 21px; }
.hero-logo {
  width: 160px; height: 160px; object-fit: contain; opacity: .085;
  align-self: center; margin-right: 15px; z-index: 1;
  filter: brightness(0) invert(1);
}

/* --- Stats --------------------------------------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 15px; margin: 19px 0 27px;
}
.stat {
  background: #fff; border: 1px solid #EEEEEF; border-radius: var(--kp-r-lg);
  padding: 20px; box-shadow: var(--kp-shadow);
}
.stat-head {
  display: flex; align-items: center; justify-content: space-between;
  color: #6B7076; font-size: var(--kp-fs-md); font-weight: 600; gap: 10px;
}
.stat-head .ico {
  width: 34px; height: 34px; border-radius: 10px; background: var(--kp-red-soft);
  color: var(--kp-red); display: grid; place-items: center; flex: none;
}
.stat-head .ico svg { width: 18px; height: 18px; }
.stat strong {
  display: block; font-size: var(--kp-fs-2xl); letter-spacing: -1px; margin-top: 9px;
  font-weight: 800; font-variant-numeric: tabular-nums lining-nums; line-height: 1.15;
}
.stat small { display: block; margin-top: 5px; }
.stat--alert strong { color: var(--kp-red); }

/* --- Panels -------------------------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(285px, .9fr); gap: 19px; }
.panel {
  background: #fff; border: 1px solid #EEEFF0; border-radius: 17px;
  padding: 23px; box-shadow: var(--kp-shadow); min-width: 0; margin-bottom: 19px;
}
.panel:last-child { margin-bottom: 0; }
.section-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 17px;
}
.section-head h2 { font-size: var(--kp-fs-xl); }
.section-head p { font-size: var(--kp-fs-md); color: var(--kp-muted); margin-top: 6px; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 15px; margin-bottom: 20px; flex-wrap: wrap;
}

/* --- Rows and date tiles -------------------------------------------------- */
.row {
  display: flex; align-items: center; gap: 14px; padding: 15px 0;
  border-bottom: 1px solid var(--kp-line-soft);
}
.row:last-child { border-bottom: none; padding-bottom: 0; }
.row:first-child { padding-top: 0; }
.row > .btn, .row > .badge, .row > .btn-row { flex: none; }
.date-square {
  min-width: 54px; width: 54px; height: 56px; border-radius: 11px;
  background: #F7F7F8; display: flex; flex-direction: column;
  align-items: center; justify-content: center; flex: none;
}
.date-square span {
  font-size: 9px; color: #777D81; text-transform: uppercase;
  font-weight: 800; letter-spacing: .8px;
}
.date-square b {
  font-size: 21px; letter-spacing: -.5px; font-weight: 800;
  font-variant-numeric: lining-nums;
}
.row-main { min-width: 0; flex: 1; }
.row-main h3 {
  font-size: var(--kp-fs-base); margin-bottom: 6px; font-weight: 700;
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
.row-main p {
  font-size: var(--kp-fs-sm); color: #81868C; display: flex; align-items: center;
  gap: 5px; flex-wrap: wrap;
}
.row-main p svg { width: 12px; height: 12px; }

/* --- Badges --------------------------------------------------------------- */
.badge {
  padding: 5px 9px; font-size: var(--kp-fs-xs); font-weight: 800;
  letter-spacing: .04em; border-radius: var(--kp-r-pill);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.badge i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge--red    { background: var(--kp-red-tint); color: var(--kp-danger); }
.badge--green  { background: var(--kp-green-tint); color: var(--kp-green-text); }
.badge--orange { background: var(--kp-amber-soft); color: var(--kp-amber); }
.badge--grey   { background: var(--kp-grey-badge); color: var(--kp-grey-text); }
.badge--dark   { background: var(--kp-dark-badge); color: #fff; }
.badge--blue   { background: #E8F1FC; color: #15558F; }

/* --- Opening / shift cards (green = available, per the brief) -------------- */
.opening-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.opening-card {
  padding: 18px; background: #fff; border: 1px solid #E8EAED;
  border-radius: 15px; box-shadow: var(--kp-shadow-sm); min-width: 0;
  text-align: left; width: 100%; display: block;
}
.opening-card.is-open {
  border: 1.5px solid var(--kp-green-line);
  background: linear-gradient(145deg, var(--kp-green-bg) 0%, #fff 65%);
}
.opening-card.is-pending { border-color: #F2DCA8; background: linear-gradient(145deg, #FFFBF2 0%, #fff 65%); }
.opening-card.is-invited { border-color: #BBD3EE; background: linear-gradient(145deg, #F4F9FF 0%, #fff 65%); }
.opening-card.is-muted   { background: #F8F9F9; border-color: #D7DCE0; }
.opening-card-top { display: flex; align-items: center; gap: 12px; }
.opening-card-title { min-width: 0; flex: 1; }
.opening-card-title strong {
  display: block; font-size: var(--kp-fs-base); font-weight: 700; margin-bottom: 4px;
}
.opening-card-title small { font-size: var(--kp-fs-sm); color: #6C757C; }
.opening-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 14px 0;
  font-size: var(--kp-fs-sm); color: #536069;
}
.opening-grid span { display: flex; align-items: flex-start; gap: 6px; line-height: 1.45; min-width: 0; }
.opening-grid svg { width: 14px; height: 14px; flex: none; color: #568067; margin-top: 1px; }
.opening-notice {
  margin-top: 9px; padding: 9px 12px; border-radius: var(--kp-r-sm);
  background: #FFF5DF; color: var(--kp-amber-text); font-weight: 500; font-size: var(--kp-fs-sm);
}
.opening-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.opening-actions > * { flex: 1; justify-content: center; min-width: max-content; }

/* --- Tabs / chips ----------------------------------------------------------- */
.tabs { display: flex; gap: 8px; margin: 0 0 18px; overflow: auto; padding-bottom: 3px; }
.tabs button {
  background: #fff; border: 1px solid #E6E9EB; border-radius: var(--kp-r-pill);
  padding: 11px 18px; white-space: nowrap; font-size: var(--kp-fs-md); font-weight: 800;
  color: #5F6970; display: flex; gap: 8px; align-items: center; min-height: var(--kp-tapmin);
}
.tabs button[aria-pressed="true"] { background: #1F262B; border-color: #1F262B; color: #fff; }
.tabs button span {
  border-radius: 8px; background: #F3E3E8; color: #982B44; padding: 2px 6px; font-size: var(--kp-fs-xs);
}
.tabs button[aria-pressed="true"] span { background: #ffffff30; color: #fff; }

/* --- Venue link (required: blue, tappable) ---------------------------------- */
.venue-link {
  display: inline-flex; align-items: flex-start; gap: 7px; color: var(--kp-link);
  font-size: var(--kp-fs-md); font-weight: 800; text-decoration: underline;
  text-underline-offset: 3px; line-height: 1.6; overflow-wrap: anywhere;
  min-height: 26px;
}
.venue-link:hover { color: var(--kp-link-dark); }
.venue-link.on-dark { color: #79BEFF; }
.venue-link svg { width: 15px; height: 15px; margin-top: 3px; }
.venue-map-block {
  margin-top: 16px; padding: 15px; background: #F3F8FF; border: 1px solid #D7E8FF;
  border-radius: var(--kp-r-md); display: grid; justify-items: start; gap: 9px;
}
.venue-map-block strong { font-size: var(--kp-fs-md); font-weight: 700; }
.venue-map-block .venue-link { font-size: var(--kp-fs-base); }
.apple-map-link { font-size: var(--kp-fs-sm); color: #35679A; text-decoration: underline; min-height: 26px; display: inline-block; }

/* --- Briefing --------------------------------------------------------------- */
.briefing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.briefing-detail {
  display: flex; gap: 11px; padding: 15px; background: #FAFBFB;
  border: 1px solid #ECEFF1; border-radius: 11px; min-width: 0;
}
.briefing-detail > span { color: var(--kp-red); }
.briefing-detail svg { width: 18px; height: 18px; }
.briefing-detail small {
  display: block; margin-bottom: 7px; font-size: var(--kp-fs-sm);
  color: #7C8289; font-weight: 700;
}
.briefing-detail p { font-size: var(--kp-fs-md); line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.role-note {
  margin-top: 18px; background: #FFF5EF; padding: 15px; border: 1px solid #FFE4D5;
  border-radius: var(--kp-r-md);
}
.role-note strong { display: flex; align-items: center; gap: 8px; font-size: var(--kp-fs-md); color: #A64C20; }
.role-note p { font-size: var(--kp-fs-md); margin-top: 8px; }
.briefing-file {
  display: flex; align-items: center; gap: 10px; padding: 12px; background: #F5F8FA;
  color: #165D97; border-radius: var(--kp-r-sm); font-size: var(--kp-fs-md);
  margin-bottom: 7px; width: 100%; text-align: left;
}
.briefing-file span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.acknowledge-row {
  margin-top: 18px; padding: 16px; border: 1px solid #CCE8D7; background: #F2FAF5;
  border-radius: 13px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.acknowledge-row > div { display: grid; gap: 5px; }
.acknowledge-row strong { font-size: var(--kp-fs-md); font-weight: 750; }
.ack-done { color: #157545; display: flex; align-items: center; gap: 7px; }

/* --- Notices ------------------------------------------------------------------ */
.notice {
  border-radius: var(--kp-r-md); background: #F6F8FA; color: #5E656D;
  padding: 12px 14px; font-size: var(--kp-fs-md); line-height: 1.6;
}
.notice--red   { background: #FFF1F3; color: #97223B; }
.notice--green { background: #EAF8F1; color: #227154; }

/* --- Crew / people -------------------------------------------------------------- */
.crew-member {
  display: flex; align-items: center; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--kp-line-soft); min-width: 0;
}
.crew-member:last-child { border-bottom: 0; }
.crew-member:first-child { padding-top: 0; }
.crew-detail { display: grid; gap: 5px; min-width: 0; flex: 1; }
.crew-detail strong { font-size: var(--kp-fs-base); font-weight: 700; }
.crew-detail > span { font-size: var(--kp-fs-sm); color: var(--kp-muted); }
.crew-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.crew-metric {
  padding: 16px; background: #F0F8F3; color: #166C4E; font-size: var(--kp-fs-lg);
  font-weight: 800; border-radius: 11px; margin-bottom: 9px;
}
.person-avatar {
  flex: 0 0 42px; width: 42px; height: 42px; overflow: hidden; border-radius: 50%;
  background: #FFE8ED; display: grid; place-items: center; font-size: var(--kp-fs-lg);
  font-weight: 500; color: var(--kp-red);
}
.person-avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-avatar.large { flex-basis: 75px; width: 75px; height: 75px; font-size: 26px; }
.contact-link {
  display: inline-flex; align-items: center; gap: 5px; font-size: var(--kp-fs-sm);
  font-weight: 750; padding: 8px 10px; border: 1px solid #EFC4CE;
  border-radius: var(--kp-r-sm); color: #AE1533; background: #FFF6F8; min-height: var(--kp-tapmin);
}
.contact-link svg { width: 13px; height: 13px; }
.contact-number { font-size: var(--kp-fs-sm); color: #566067; font-variant-numeric: tabular-nums; }
.contact-hidden { font-size: var(--kp-fs-xs); color: #969A9E; }
.profile-banner {
  display: flex; gap: 15px; align-items: center; margin-bottom: 20px;
  padding: 16px; border-radius: 13px; background: #F8F9F9;
}
.profile-banner > div { display: grid; gap: 5px; min-width: 0; }
.profile-banner strong { font-size: var(--kp-fs-lg); font-weight: 800; }
.profile-banner span, .profile-banner small { font-size: var(--kp-fs-sm); color: var(--kp-muted); }

/* --- Clock ----------------------------------------------------------------------- */
.clock-card {
  display: grid; gap: 16px; justify-items: center; padding: 26px;
  border: 1px solid #ECEDEE; border-radius: var(--kp-r-lg); background: #FAFAFA;
}
.timer {
  font-size: 36px; font-variant-numeric: tabular-nums lining-nums;
  font-weight: 850; letter-spacing: -1.8px; line-height: 1.15;
}
.clock-btn { width: min(340px, 100%); padding: 15px 36px; font-size: var(--kp-fs-base); border-radius: 13px; }
.break-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; width: 100%; }
.break-summary > div {
  padding: 13px 10px; background: #fff; border: 1px solid #E8EAED; border-radius: var(--kp-r-md);
  display: flex; flex-direction: column; gap: 5px; min-width: 0; text-align: center;
}
.break-summary small { font-size: var(--kp-fs-xs); }
.break-summary strong { font-variant-numeric: tabular-nums; font-size: var(--kp-fs-lg); font-weight: 800; }
.break-active {
  background: #FFF2E2; border: 1px solid #FFE0B7; border-radius: var(--kp-r-md);
  padding: 17px; display: flex; flex-direction: column; gap: 7px; align-items: center;
  text-align: center; color: #75440D; width: 100%;
}
.break-active strong { display: flex; gap: 8px; align-items: center; font-weight: 750; }
.break-active span { font-size: var(--kp-fs-md); }
.break-history { width: 100%; margin-top: 10px; border-top: 1px solid #E9EBEC; padding-top: 15px; }
.break-history-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 1px; border-bottom: 1px solid var(--kp-line-soft); gap: 15px;
}
.break-history-row:last-child { border-bottom: 0; }
.break-history-row strong { font-size: var(--kp-fs-md); font-weight: 750; }
.break-history-row small { display: block; margin-top: 4px; color: #7A7F83; font-size: var(--kp-fs-sm); }
.break-history-row b { white-space: nowrap; font-size: var(--kp-fs-base); font-variant-numeric: tabular-nums; }

/* --- Tables --------------------------------------------------------------------- */
.table-wrap { overflow: auto; border: 1px solid #EDEEEF; border-radius: 13px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: var(--kp-fs-md); min-width: 650px; }
th {
  background: #F9FAFA; color: #7B8085; font-weight: 750; font-size: var(--kp-fs-xs);
  letter-spacing: .07em; text-transform: uppercase; padding: 14px 15px;
}
td { padding: 15px; border-top: 1px solid #F0F1F2; color: #333940; }
td strong { font-weight: 750; }
td .muted { display: block; color: #899096; font-size: var(--kp-fs-sm); margin-top: 4px; }

/* --- Forms ----------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field.span { grid-column: 1 / -1; }
.field > label { font-weight: 720; font-size: var(--kp-fs-md); }
.field input, .field select, .field textarea, .input, .select, .textarea {
  width: 100%; background: #fff; border: 1px solid #DFE1E3; border-radius: 10px;
  padding: 11px 12px; min-height: 42px; outline: none; font-size: 16px;
}
.field textarea, .textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
.input:focus, .select:focus, .textarea:focus {
  border-color: #D33657; box-shadow: 0 0 0 3px rgba(210, 43, 76, .1);
}
.field .hint { font-size: var(--kp-fs-sm); color: var(--kp-muted); line-height: 1.5; }
.field .error { font-size: var(--kp-fs-sm); color: var(--kp-danger); }
.form-foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 4px; }
.check {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 0;
  font-size: var(--kp-fs-md); color: #515960; min-height: var(--kp-tapmin);
}
.check input { width: 19px; height: 19px; accent-color: var(--kp-red); flex-shrink: 0; margin-top: 2px; }
.check strong { display: block; font-weight: 750; }
.check small { display: block; margin-top: 4px; line-height: 1.45; }
.email-preference {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 15px 0; border-bottom: 1px solid var(--kp-line-soft);
}
.email-preference:last-child { border-bottom: 0; }
.email-preference strong { display: block; font-size: var(--kp-fs-md); font-weight: 750; }
.email-preference small { display: block; margin-top: 5px; line-height: 1.4; }
.email-preference input { accent-color: var(--kp-red); height: 20px; width: 20px; flex-shrink: 0; }

/* --- Dialog / sheet ---------------------------------------------------------------- */
.dialog-backdrop {
  position: fixed; inset: 0; background: rgba(7, 10, 14, .65);
  display: grid; place-items: center; z-index: 100; padding: 20px;
}
.dialog {
  width: min(560px, 100%); max-height: 88vh; max-height: 88dvh; overflow: auto;
  background: #fff; border-radius: var(--kp-r-xl); padding: 25px;
  box-shadow: var(--kp-shadow-lg);
}
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.dialog-head h2 { font-weight: 800; letter-spacing: -.4px; }
.close-btn {
  border: 0; background: var(--kp-line-soft); border-radius: 50%;
  width: 36px; height: 36px; display: grid; place-items: center; flex: none;
}

/* --- Empty, skeleton, detail grid, toast -------------------------------------------- */
.empty { padding: 36px 18px; display: grid; place-items: center; text-align: center; gap: 11px; color: #737981; }
.empty svg { width: 28px; height: 28px; color: #ADB1B5; }
.empty h3 { color: var(--kp-ink); font-weight: 750; }
.empty p { max-width: 350px; font-size: var(--kp-fs-md); }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; }
.detail-box { border: 1px solid #EFF0F1; padding: 15px; border-radius: var(--kp-r-md); }
.detail-box small { display: block; margin-bottom: 8px; }
.detail-box b { font-size: var(--kp-fs-base); font-weight: 700; }

.skeleton {
  background: linear-gradient(90deg, #F1F1F2 25%, #E6E6E8 37%, #F1F1F2 63%);
  background-size: 400% 100%; animation: kp-shimmer 1.3s ease infinite; border-radius: var(--kp-r-sm);
}
@keyframes kp-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.toast-stack {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(24px + var(--kp-safe-bottom)); z-index: 150;
  width: min(92vw, 440px); display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
@media (max-width: 760px) { .toast-stack { bottom: calc(84px + var(--kp-safe-bottom)); } }
.toast {
  background: #1E262A; color: #fff; padding: 12px 17px; font-weight: 700;
  font-size: var(--kp-fs-md); border-radius: var(--kp-r-md);
  box-shadow: 0 10px 30px #0002; pointer-events: auto;
  animation: kp-intro-in .22s var(--kp-ease);
}
.toast--error { background: #A4142F; }
.toast--success { background: #176B4E; }

.announcement { padding: 13px 0; border-bottom: 1px solid var(--kp-line-soft); }
.announcement:last-child { border-bottom: 0; }
.announcement:first-child { padding-top: 0; }
.announcement-title {
  display: flex; justify-content: space-between; align-items: center; gap: 9px;
  font-size: var(--kp-fs-md); font-weight: 750; margin-bottom: 6px;
}
.announcement p { font-size: var(--kp-fs-md); color: #686E75; line-height: 1.6; }

/* Signed-out screens and onboarding share one responsive layout. */
.auth-main {
  min-height: 100svh;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.auth-wrap {
  width: min(100%, 560px);
  padding: clamp(22px, 5vw, 48px);
  background: var(--kp-white);
  border: 1px solid var(--kp-line);
  border-radius: 24px;
  box-shadow: 0 12px 36px rgba(23, 25, 28, .06);
}
.auth-logo { width: min(64%, 240px); height: auto; margin: 0 auto 24px; }
.auth-wrap h1 { margin-bottom: 24px; font-size: clamp(26px, 4vw, 36px); }
.auth-wrap .field + .field { margin-top: 16px; }
.auth-wrap .input, .auth-wrap .select { min-height: 48px; font-size: 16px; }
.auth-wrap form .btn--primary { min-height: 48px; margin-top: 12px; }
.auth-wrap [aria-live]:empty, .auth-wrap .field__error:empty { display: none; }

@media (max-width: 480px) {
  .auth-main { align-items: start; padding-top: max(28px, env(safe-area-inset-top)); }
  .auth-wrap { border-radius: 18px; }
}

.dl { display: grid; grid-template-columns: minmax(96px, 36%) 1fr; gap: 9px 16px; margin: 0; font-size: var(--kp-fs-md); }
.dl dt { color: var(--kp-muted); }
.dl dd { margin: 0; }
.muted { color: var(--kp-muted); }
.stack > * + * { margin-top: 12px; }

@media (max-width: 1050px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .ribbon { flex-wrap: wrap; }
  .ribbon select { margin-left: 0; width: 100%; max-width: none; }
  .hero { min-height: 220px; padding: 24px 22px; border-radius: 17px; }
  .hero h2 { font-size: 24px; }
  .hero-text { max-width: 86%; }
  .hero-logo { position: absolute; right: -14px; width: 170px; height: 170px; opacity: .06; }
  .hero .meta { font-size: var(--kp-fs-sm); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 20px; }
  .stat { padding: 14px 12px; border-radius: var(--kp-r-md); }
  .stat-head { font-size: var(--kp-fs-sm); }
  .stat-head .ico { width: 28px; height: 28px; }
  .stat-head .ico svg { width: 15px; height: 15px; }
  .stat strong { font-size: 23px; }
  .panel { padding: 17px; border-radius: 14px; }
  .opening-list { grid-template-columns: 1fr; gap: 12px; }
  .opening-card { padding: 14px; }
  .opening-grid { grid-template-columns: 1fr; gap: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span { grid-column: auto; }
  .detail-grid { grid-template-columns: 1fr; }
  .dialog { padding: 19px; }
  .acknowledge-row { flex-direction: column; align-items: stretch; }
  .break-summary { gap: 6px; }
  .break-summary > div { padding: 10px 6px; }
  .break-summary strong { font-size: var(--kp-fs-base); }
}

/* ==========================================================================
   Compatibility layer
   The view modules were written against an earlier set of class names. These
   map them onto the v7 visual language so both spellings render identically.
   ========================================================================== */
.card {
  background: #fff; border: 1px solid #EEEFF0; border-radius: 17px;
  padding: 20px; box-shadow: var(--kp-shadow); min-width: 0; margin-bottom: 16px;
}
.card--flat { box-shadow: none; }
.card__title { font-size: var(--kp-fs-base); font-weight: 700; margin: 0 0 5px; }
.card__meta  { color: var(--kp-muted); font-size: var(--kp-fs-md); margin: 0; }

.section-title {
  font-size: var(--kp-fs-xs); text-transform: uppercase; letter-spacing: .08em;
  color: #7B8085; font-weight: 800; margin: 26px 0 13px;
}
.section-title:first-child { margin-top: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 15px; margin-bottom: 19px; }
.stat__value { font-size: var(--kp-fs-2xl); font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -1px; }
.stat__label { font-size: var(--kp-fs-xs); color: var(--kp-muted); margin-top: 5px; text-transform: uppercase; letter-spacing: .06em; }

.roster-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--kp-line-soft); min-width: 0; }
.roster-row:last-child { border-bottom: 0; }
.roster-row:first-child { padding-top: 0; }
.roster-row > svg { width: 20px; height: 20px; flex: none; color: var(--kp-muted); }
.roster-row > .btn, .roster-row > a.btn, .roster-row > .badge, .roster-row > div:not(.roster-row__body) { flex: none; }
.roster-row__body { flex: 1; min-width: 0; }
.roster-row__name { font-weight: 700; font-size: var(--kp-fs-base); }
.roster-row__meta { font-size: var(--kp-fs-sm); color: var(--kp-muted); }

.field__label { display: block; font-size: var(--kp-fs-md); font-weight: 720; margin-bottom: 6px; }
.field__hint  { font-size: var(--kp-fs-sm); color: var(--kp-muted); margin-top: 6px; line-height: 1.5; }
.field__error { font-size: var(--kp-fs-sm); color: var(--kp-danger); margin-top: 6px; }
.checkbox, .radio {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 0;
  min-height: var(--kp-tapmin); font-size: var(--kp-fs-md);
}
.checkbox input, .radio input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--kp-red); flex: none; }

.btn--dark { background: var(--kp-ink); color: #fff; }
.chip-row { display: flex; gap: 8px; overflow: auto; padding-bottom: 3px; margin-bottom: 18px; }
.chip {
  flex: none; background: #fff; border: 1px solid #E6E9EB; border-radius: var(--kp-r-pill);
  padding: 10px 17px; font-size: var(--kp-fs-md); font-weight: 800; color: #5F6970;
  min-height: var(--kp-tapmin); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: #1F262B; border-color: #1F262B; color: #fff; }

/* Shift cards rendered inline by the dashboard. */
.shift-card {
  display: block; width: 100%; text-align: left; padding: 18px; background: #fff;
  border: 1px solid #E8EAED; border-radius: 15px; box-shadow: var(--kp-shadow-sm);
  margin-bottom: 13px;
}
.shift-card--confirmed { border-color: #E8EAED; }
.shift-card--pending   { border: 1.5px solid #F2DCA8; background: linear-gradient(145deg, #FFFBF2 0%, #fff 65%); }
.shift-card--invited   { border: 1.5px solid #BBD3EE; background: linear-gradient(145deg, #F4F9FF 0%, #fff 65%); }
.shift-card--muted     { background: #F8F9F9; border-color: #D7DCE0; }
.shift-card__top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.shift-card__name { flex: 1; font-weight: 700; font-size: var(--kp-fs-base); margin: 0; }
.shift-card__row { display: flex; align-items: center; gap: 7px; font-size: var(--kp-fs-sm); color: #536069; margin-top: 6px; }
.shift-card__row svg { width: 14px; height: 14px; flex: none; color: #568067; }
.shift-card__foot { display: flex; align-items: center; gap: 8px; margin-top: 13px; flex-wrap: wrap; }
.shift-card__when { font-weight: 500; }

/* Bottom sheet used for confirmations and short forms. */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(7,10,14,.6); z-index: 100; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 101; background: #fff;
  border-radius: var(--kp-r-xl) var(--kp-r-xl) 0 0;
  padding: 20px 20px calc(var(--kp-safe-bottom) + 22px);
  max-height: 88dvh; overflow-y: auto; box-shadow: var(--kp-shadow-lg);
  animation: kp-sheet-up .26s var(--kp-ease);
}
@media (min-width: 761px) {
  .sheet { left: 50%; right: auto; bottom: 50%; transform: translate(-50%, 50%);
           width: min(560px, 92vw); border-radius: var(--kp-r-xl); animation: none; }
}
@keyframes kp-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet__grab { width: 38px; height: 4px; border-radius: 2px; background: #CFCCC9; margin: 0 auto 16px; }
@media (min-width: 761px) { .sheet__grab { display: none; } }
.sheet h2 { font-weight: 800; letter-spacing: -.4px; margin-bottom: 8px; }

.divider { height: 1px; background: var(--kp-line); margin: 20px 0; border: 0; }
.offline-bar { display: none; }
.clock { text-align: center; }
.clock__time { font-size: 36px; font-weight: 850; letter-spacing: -1.5px; font-variant-numeric: tabular-nums lining-nums; margin: 0; }
.clock__state { color: var(--kp-muted); font-size: var(--kp-fs-md); margin: 6px 0 18px; }
.clock__state--on { color: var(--kp-green); font-weight: 500; }
.clock__state--break { color: var(--kp-amber); font-weight: 500; }
.address-link { color: var(--kp-link); text-decoration: underline; text-underline-offset: 3px; font-weight: 800; }
.address-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: #FFE8ED; display: grid; place-items: center; font-weight: 850; color: var(--kp-red); flex: none; }
.avatar--lg { width: 75px; height: 75px; font-size: 26px; }

/* --- Green promo strip (from the reference demo) --------------------------- */
.open-shift-promo {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 20px; margin: 0 0 19px;
  background: #F0F9F2; border: 1px solid #C4E8D2; border-radius: 14px;
}
.open-shift-promo > div { display: grid; gap: 4px; min-width: 0; }
.open-shift-promo strong { font-size: var(--kp-fs-lg); font-weight: 800; color: #186A41; }
.open-shift-promo span { font-size: var(--kp-fs-md); color: #587367; }
.open-shift-promo .btn { white-space: nowrap; flex: none; }
.open-shift-promo--invite { background: #F3F7FE; border-color: #CBDDF6; }
.open-shift-promo--invite strong { color: #15558F; }
.open-shift-promo--invite span { color: #5B6C82; }
@media (max-width: 760px) {
  .open-shift-promo { flex-direction: column; align-items: stretch; padding: 15px; }
  .open-shift-promo .btn { width: 100%; justify-content: center; }
  .open-shift-promo strong { font-size: var(--kp-fs-base); }
}

/* --- 14-day availability picker -------------------------------------------- */
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-day {
  background: #F8F8F8; border: 1px solid #EDEEEF; border-radius: 11px;
  padding: 9px 4px; min-height: 70px; display: grid; place-items: center; gap: 5px;
  font-size: var(--kp-fs-sm); font-weight: 700; color: var(--kp-ink);
}
.calendar-day small { font-size: 9px; color: #777D81; font-weight: 700; }
.calendar-day strong { font-size: var(--kp-fs-lg); font-weight: 800; font-variant-numeric: lining-nums; }
.calendar-day.marked {
  border-color: var(--kp-red); background: #FFF1F4; color: var(--kp-red);
}
.calendar-day.marked small { color: var(--kp-red); }
@media (max-width: 760px) { .calendar-days { gap: 4px; } .calendar-day { min-height: 60px; padding: 7px 2px; } }

/* --- Preview-as picker (demonstration build only) -------------------------- */
.preview-person {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px; margin-bottom: 8px; background: #fff; border: 1px solid #E8EAED;
  border-radius: var(--kp-r-md); min-height: 62px;
}
.preview-person:hover { background: var(--kp-paper); border-color: #DADDE0; }
.preview-person[aria-current="true"] { border-color: var(--kp-red); background: var(--kp-red-soft); }
.preview-person .person-avatar { flex: 0 0 38px; width: 38px; height: 38px; font-size: var(--kp-fs-base); }
.preview-person__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.preview-person__body strong { font-size: var(--kp-fs-base); font-weight: 750; }
.preview-person__body span { font-size: var(--kp-fs-sm); color: var(--kp-muted); }
.preview-person > svg { width: 17px; height: 17px; color: var(--kp-muted); flex: none; }
.preview-person[aria-current="true"] > svg { color: var(--kp-red); }
.side-action--quiet { background: transparent; border-color: #3B4142; color: #A7AEB1; }
.side-action--quiet:hover { background: #262B2C; color: #fff; }
