/* ==========================================================================
   Seven Bites Kitchen — styles
   Tablet first: big text, big buttons, 4 order columns side by side.
   Phones: one column at a time (tabs above the board).
   ========================================================================== */

:root {
  --navy: #0a0a0a;
  --navy-2: #1f1f1f;
  --yellow: #fcd206;
  --yellow-hover: #f2c600;
  --yellow-soft: #fff4bf;
  --yellow-tint: #fffaf0;
  --bg: #f6f3ea;
  --surface: #ffffff;
  --border: #e6e1d3;
  --border-strong: #d6cfbc;
  --text: #111111;
  --text-2: #4d4d4d;
  --muted: #808080;
  --green: #12865a;
  --green-soft: #e3f6ec;
  --red: #d63c41;
  --red-soft: #fde8e8;
  --amber: #a15c00;
  --amber-soft: #fff1d6;
  --r: 14px;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.05), 0 6px 18px rgba(17, 17, 17, 0.07);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --brand: "Cinzel", "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  color: var(--navy);
  font-weight: 600;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.k-muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.k-empty {
  padding: 20px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.k-noscript {
  padding: 24px;
  text-align: center;
}

/* ---------- buttons ---------- */

.k-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--yellow);
  color: var(--navy);
  font-weight: 700;
  transition: background 0.15s, transform 0.1s;
}

.k-btn:hover {
  background: var(--yellow-hover);
}

.k-btn:active {
  transform: scale(0.98);
}

.k-btn:disabled {
  background: #eceae3;
  color: var(--muted);
  cursor: not-allowed;
}

.k-btn--ghost {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
}

.k-btn--ghost:hover {
  background: var(--yellow-tint);
}

.k-btn--danger {
  background: var(--red);
  color: #fff;
}

.k-btn--danger:hover {
  background: #bd3338;
}

.k-btn--lg {
  width: 100%;
  min-height: 54px;
  font-size: 1.05rem;
}

/* ---------- sign in ---------- */

.k-login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 80% 0%, rgba(252, 210, 6, 0.18), transparent 50%),
    var(--navy);
}

.k-login__card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 32px 24px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.k-login__card img {
  justify-self: center;
  height: auto;
}

.k-login__card h1 {
  font: 700 1.5rem var(--brand);
  color: var(--navy);
}

.k-login__card h1 span {
  display: block;
  font: 700 0.85rem var(--font);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--amber);
}

.k-login__card label {
  display: grid;
  gap: 6px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

.k-login__card input,
.k-form input {
  min-height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 400;
}

.k-login__card input:focus,
.k-form input:focus,
.k-reply textarea:focus,
.k-search:focus,
.k-stock__field input:focus {
  border-color: var(--navy);
  outline: none;
  box-shadow: 0 0 0 3px var(--yellow-soft);
}

.k-alert {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- top bar & tabs ---------- */

.k-top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
}

.k-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.k-brand b {
  font: 700 1.1rem var(--brand);
  color: var(--yellow);
}

.k-brand span {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(252, 210, 6, 0.15);
  color: var(--yellow);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.k-prep {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 4px 6px 4px 12px;
  border-radius: 999px;
  background: var(--navy-2);
  font-size: 0.8rem;
}

.k-prep button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 800;
}

.k-prep strong {
  min-width: 56px;
  text-align: center;
  color: var(--yellow);
}

.k-top__end {
  display: flex;
  align-items: center;
  gap: 8px;
}

.k-icon {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--navy-2);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

.k-who {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
}

.k-tabs {
  position: sticky;
  top: 58px;
  z-index: 9;
  display: flex;
  gap: 4px;
  padding: 8px 16px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.k-tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-bottom: 3px solid transparent;
  color: var(--text-2);
  font-weight: 700;
}

.k-tabs button[aria-selected="true"] {
  border-color: var(--navy);
  color: var(--navy);
}

.k-tabs b,
.k-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
}

.k-main {
  padding: 14px 16px 40px;
}

/* ---------- order board ---------- */

.k-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.k-seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: #ebe6d8;
}

.k-seg button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 9px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.9rem;
}

.k-seg button[aria-selected="true"] {
  background: var(--surface);
  color: var(--navy);
  box-shadow: var(--shadow);
}

.k-seg b {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--yellow);
  font-size: 0.7rem;
}

.k-seg--cols {
  display: none;
}

.k-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.k-col {
  display: grid;
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
  background: #ece7d9;
  min-height: 140px;
}

.k-col h2 {
  display: flex;
  justify-content: space-between;
  padding: 2px 4px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.k-col h2 span {
  color: var(--navy);
}

.k-order {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
}

.k-order.is-new {
  border-color: var(--yellow);
  animation: k-pulse 1.2s ease-in-out 3;
}

@keyframes k-pulse {
  50% { box-shadow: 0 0 0 6px rgba(252, 210, 6, 0.45); }
}

.k-order.is-waiting {
  opacity: 0.75;
  background: #faf9f5;
}

.k-order__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.k-order__id {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.k-order__head time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.8rem;
}

.k-pay {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.k-pay--paid {
  background: var(--green-soft);
  color: var(--green);
}

.k-pay--cash {
  background: var(--amber-soft);
  color: var(--amber);
}

.k-pay--wait {
  background: #ececec;
  color: var(--muted);
}

.k-later {
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--yellow-soft);
  font-weight: 700;
  font-size: 0.85rem;
}

.k-items {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-block: 1px dashed var(--border-strong);
  list-style: none;
}

.k-items li {
  display: flex;
  gap: 8px;
  font-size: 1rem;
}

.k-items b {
  min-width: 30px;
  color: var(--navy);
}

.k-items small {
  display: block;
  color: var(--text-2);
  font-size: 0.82rem;
}

.k-note {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--yellow-tint);
  border: 1px solid var(--yellow-soft);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.k-cust {
  display: grid;
  gap: 2px;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.k-rider {
  font-size: 0.85rem;
  font-weight: 600;
}

.k-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eeebe3;
  color: var(--text-2);
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: 1px;
}

.k-order__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.k-total {
  font-size: 1.15rem;
  font-weight: 800;
}

.k-order__btns {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* done today */
.k-donelist {
  display: grid;
  gap: 8px;
  list-style: none;
  padding: 0;
}

.k-done {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.k-done.is-cancelled {
  opacity: 0.7;
}

/* ---------- dialogs ---------- */

.k-dialog {
  width: min(460px, calc(100% - 32px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.k-dialog::backdrop {
  background: rgba(10, 10, 10, 0.6);
}

.k-form {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.k-form h2 {
  font-size: 1.2rem;
}

.k-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.k-form__btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.k-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.k-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f1eee5;
  font-size: 0.82rem;
  font-weight: 600;
}

.k-chip:hover {
  background: var(--yellow-soft);
}

/* ---------- chat ---------- */

.k-chat {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
  height: calc(100dvh - 150px);
}

.k-threads {
  display: grid;
  align-content: start;
  gap: 6px;
  overflow-y: auto;
}

.k-thread {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  border: 2px solid transparent;
}

.k-thread.is-open {
  border-color: var(--navy);
}

.k-thread.is-unread b {
  color: var(--navy);
}

.k-thread__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.k-thread__top time {
  color: var(--muted);
  font-size: 0.75rem;
}

.k-thread__last {
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.85rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.k-thread .k-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
}

.k-convo {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.k-convo__empty {
  grid-row: 1 / -1;
  align-self: center;
}

.k-convo__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.k-convo__head small {
  display: block;
  color: var(--muted);
}

.k-back {
  display: none;
}

.k-msgs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  overflow-y: auto;
  list-style: none;
  background: #faf8f2;
}

.k-msg {
  max-width: 78%;
}

.k-msg p {
  padding: 10px 14px;
  border-radius: 16px 16px 16px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.k-msg--staff {
  align-self: flex-end;
}

.k-msg--staff p {
  border-radius: 16px 16px 4px 16px;
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.k-msg time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.k-msg--staff time {
  text-align: right;
}

.k-reply {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.k-reply textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  resize: none;
}

/* ---------- stock ---------- */

.k-search {
  min-height: 46px;
  width: min(360px, 100%);
  padding: 0 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
}

.k-stockgroup {
  margin-bottom: 18px;
}

.k-stockgroup h2 {
  margin: 0 4px 8px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.k-stockgroup ul {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.k-stock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
}

.k-stock.is-low {
  border-left-color: var(--amber);
}

.k-stock.is-off {
  border-left-color: var(--red);
  background: #fbf7f7;
}

.k-stock__name {
  display: grid;
  flex: 1;
  min-width: 180px;
}

.k-stock__name small {
  color: var(--muted);
}

.k-stock__field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
}

.k-stock__field input {
  width: 92px;
  min-height: 44px;
  padding: 0 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  text-align: center;
  font-weight: 700;
}

.k-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.k-switch input {
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

/* ---------- toasts ---------- */

.k-toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 50;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
}

.k-toast {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: k-in 0.25s ease-out;
}

.k-toast.is-error {
  background: var(--red);
}

@keyframes k-in {
  from { transform: translateY(10px); opacity: 0; }
}

/* ---------- tablets (portrait) ---------- */

@media (max-width: 1100px) {
  .k-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- phones ---------- */

@media (max-width: 700px) {
  .k-top {
    gap: 8px;
  }

  .k-prep {
    order: 3;
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .k-who {
    display: none;
  }

  /* the header is 3 rows here: let it scroll away, keep the tabs on top */
  .k-top {
    position: static;
  }

  .k-tabs {
    top: 0;
  }

  /* one page, top to bottom: New, Confirmed, Preparing, On the way —
     no sideways scrolling, no column switcher */
  .k-seg--cols {
    display: none;
  }

  .k-board {
    grid-template-columns: 1fr;
  }

  .k-col {
    min-height: 0;
  }

  .k-stock {
    gap: 8px 12px;
  }

  .k-pair {
    grid-template-columns: 1fr;
  }

  .k-done {
    grid-template-columns: auto 1fr auto;
  }

  .k-done span:nth-child(3) {
    display: none;
  }

  .k-chat {
    grid-template-columns: 1fr;
    height: calc(100dvh - 190px);
  }

  .k-chat.has-open .k-threads {
    display: none;
  }

  .k-chat:not(.has-open) .k-convo {
    display: none;
  }

  .k-back {
    display: inline-flex;
    min-height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* rider picker (registered riders only) */
.k-riders {
  display: grid;
  gap: 8px;
  max-height: 50dvh;
  overflow-y: auto;
}

.k-ridercard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
}

.k-ridercard:has(input:checked) {
  border-color: var(--navy);
  background: var(--yellow-tint);
}

.k-ridercard input {
  width: 20px;
  height: 20px;
  accent-color: var(--navy);
}

.k-ridercard span {
  display: grid;
}

.k-ridercard small {
  color: var(--muted);
}

/* ---------- menu items: photo, edit, add ---------- */

.k-btn--sm {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.85rem;
}

.k-stock__name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.k-stock__name > span {
  display: grid;
  min-width: 0;
}

.k-stock__name img {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.k-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}

.k-form select,
.k-form textarea {
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  font-weight: 400;
}

.k-form textarea {
  resize: vertical;
}

.k-form select:focus,
.k-form textarea:focus {
  border-color: var(--navy);
  outline: none;
  box-shadow: 0 0 0 3px var(--yellow-soft);
}

.k-form label small {
  color: var(--muted);
  font-weight: 400;
}

.k-form label.k-switch {
  display: flex;
  align-items: center;
  min-height: 50px;
}

.k-photo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.k-photo img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #f1eee5;
}

.k-photo small {
  flex-basis: 100%;
}

.k-dialog {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

/* the admin's 2-step code */
.k-code {
  text-align: center;
  font: 700 1.5rem/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.3em;
}

.k-link {
  justify-self: start;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- shop closed (opening hours / switch) ---------- */

.k-closed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 16px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.k-closed small {
  font-weight: 500;
  opacity: 0.9;
}

/* ---------- chat: customers / delivery ---------- */

.k-chatcats {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.k-chatcats button {
  flex: 1;
  min-height: 44px;
  border-radius: 12px;
  background: #ebe6d8;
  font-weight: 700;
}

.k-chatcats button[aria-selected="true"] {
  background: var(--navy);
  color: var(--yellow);
}

.k-chatcats b {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
}

/* ---------- Add / Edit item: a live copy of the shop's product card ---------- */

.k-dialog:has(.k-itemform--preview) {
  width: min(760px, calc(100% - 24px));
}

.k-itemform--preview {
  grid-template-columns: minmax(0, 1fr) 220px;
  column-gap: 20px;
}

.k-itemform--preview > :not(.k-preview) {
  grid-column: 1;
}

.k-preview {
  grid-column: 2;
  grid-row: 1 / span 12;
  align-self: start;
  position: sticky;
  top: 0;
  margin: 0;
}

.k-preview figcaption {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.k-pcard {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.k-pcard__img {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: #f3efe4;
}

.k-pcard__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.k-pcard__img img.is-placeholder {
  width: 40%;
  height: auto;
  opacity: 0.5;
}

.k-pcard__img span {
  position: absolute;
  bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.k-pcard__new {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 800;
}

.k-pcard__body {
  display: grid;
  gap: 2px;
  padding: 10px 12px 12px;
}

.k-pcard__body b {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.k-pcard__body small {
  color: var(--text-2);
  font-size: 0.75rem;
}

.k-pcard__body strong {
  font-size: 1.05rem;
}

.k-pcard__stars {
  color: #e3dfd3;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.k-pcard__stars i {
  color: var(--muted);
  font-style: normal;
  font-size: 0.75rem;
}

.k-pcard__btn {
  display: grid;
  place-items: center;
  min-height: 36px;
  margin-top: 6px;
  border-radius: 10px;
  background: var(--yellow);
  font-weight: 700;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .k-itemform--preview {
    grid-template-columns: minmax(0, 1fr);
  }
  .k-preview {
    grid-column: 1;
    grid-row: auto;
    position: static;
    width: min(220px, 70%);
    justify-self: center;
  }
}

/* ==========================================================================
   Shared with the rider site: sign-in, header, forms (the kitchen styles above, plus these)
   ========================================================================== */

.r-card {
  gap: 12px;
}

.r-form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.r-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.r-form label small,
.r-form legend small {
  color: var(--muted);
  font-weight: 400;
}

.r-form input,
.r-form select,
.r-form textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  font-weight: 400;
}

.r-form input:focus,
.r-form select:focus {
  border-color: var(--navy);
  outline: none;
  box-shadow: 0 0 0 3px var(--yellow-soft);
}

.r-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--yellow-soft);
  font-weight: 600;
}

.r-spin {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(10, 10, 10, 0.25);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: r-spin 0.8s linear infinite;
}

@keyframes r-spin {
  to { transform: rotate(360deg); }
}

.r-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
}

.r-top b {
  font-family: "Cinzel", serif;
  color: var(--yellow);
}

.r-top span {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(252, 210, 6, 0.15);
  color: var(--yellow);
  font-size: 0.75rem;
  font-weight: 700;
}

.r-top .k-btn {
  margin-left: auto;
}

.r-main {
  display: grid;
  gap: 14px;
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.r-main h1 {
  font-size: 1.4rem;
}

/* verification */
.r-verify fieldset {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.r-verify legend {
  float: left;
  width: 100%;
  margin-bottom: 4px;
  padding: 0;
  font-weight: 800;
  font-size: 1rem;
}

.r-verify legend small {
  display: block;
  font-size: 0.8rem;
}

.r-docs {
  display: grid;
  gap: 8px;
}

.r-doc {
  display: flex !important;
  align-items: center;
  gap: 12px !important;
  padding: 10px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
}

.r-doc.is-done {
  border-style: solid;
  border-color: var(--green);
  background: var(--green-soft, #e3f6ec);
}

.r-doc.is-busy {
  opacity: 0.6;
}

.r-doc > span:last-of-type {
  display: grid;
  min-width: 0;
}

.r-doc small {
  color: var(--text-2);
  font-weight: 500;
}

.r-doc__img {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 10px;
  background: #f1eee5;
  font-size: 1.4rem;
}

.r-doc__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.r-agree {
  display: flex !important;
  align-items: flex-start;
  gap: 10px !important;
  font-weight: 500 !important;
}

.r-agree input {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 0;
  margin-top: 2px;
  accent-color: var(--navy);
}

/* deliveries */
.r-tabs {
  position: sticky;
  top: 61px;
  z-index: 4;
}

.r-job {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-left: 5px solid var(--yellow);
}

.r-job header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 1.15rem;
}

.r-cash,
.r-paid {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
}

.r-cash {
  background: var(--amber-soft, #fff1d6);
  color: var(--amber, #a15c00);
}

.r-paid {
  background: var(--green-soft, #e3f6ec);
  color: var(--green, #12865a);
}

.r-job small {
  color: var(--text-2);
}

.r-job__who a {
  font-weight: 700;
}

.r-items {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
}

.r-note {
  font-style: italic;
  color: var(--text-2);
}

.r-job__btns {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

.r-sub {
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--text-2);
}

.r-done {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.r-done li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
}

.r-done span {
  color: var(--muted);
}

/* chat: messages scroll, the box stays at the bottom */
.r-chat {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 61px - 56px - 32px);
  min-height: 320px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.r-msgs {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 14px;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.r-msg {
  max-width: 85%;
}

.r-msg p {
  padding: 10px 12px;
  border-radius: 14px;
  background: #f1eee5;
  overflow-wrap: anywhere;
}

.r-msg--me {
  align-self: flex-end;
}

.r-msg--me p {
  background: var(--navy);
  color: #fff;
}

.r-msg time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.r-msg--me time {
  text-align: right;
}

.r-send {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
}

.r-send textarea {
  flex: 1;
  min-height: 46px;
  max-height: 120px;
  padding: 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  font: inherit;
  resize: none;
}

/* ==========================================================================
   Blog site: the list of posts and the writing page
   ========================================================================== */

.b-who {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
}

.r-top .b-who + .k-btn {
  margin-left: 8px;
}

.b-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.b-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.b-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}

.b-item:hover {
  outline: 2px solid var(--yellow);
}

.b-item__img {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 64px;
  height: 48px;
  overflow: hidden;
  border-radius: 8px;
  background: #f1eee5;
  font-size: 1.3rem;
}

.b-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.b-item__text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.b-item__text b {
  overflow-wrap: anywhere;
}

.b-item__text small {
  color: var(--muted);
}

.b-pill {
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: middle;
}

.b-pill--published {
  background: var(--green-soft);
  color: var(--green);
}

.b-pill--draft {
  background: #ebe6d8;
  color: var(--text-2);
}

/* writing page: the form on the left, the live preview on the right */
.b-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.b-form {
  align-content: start;
}

.b-form h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
}

.b-form textarea {
  min-height: 0;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.b-photo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 12px;
}

.b-photo > div {
  display: grid;
  gap: 4px;
}

.b-photo small {
  color: var(--muted);
}

.b-photo__img {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 96px;
  height: 64px;
  overflow: hidden;
  border-radius: 10px;
  background: #f1eee5;
  font-size: 1.5rem;
}

.b-photo__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.b-photo__btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.b-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.b-delete {
  margin-left: auto;
  color: var(--red);
}

.b-preview {
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100dvh - 90px);
  overflow-y: auto;
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.b-preview__label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.b-preview article {
  display: grid;
  gap: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.b-preview h1 {
  font-size: 1.6rem;
  line-height: 1.2;
}

.b-preview h2 {
  margin-top: 6px;
  font-size: 1.15rem;
}

.b-preview ul {
  margin: 0;
  padding-left: 20px;
}

.b-lead {
  color: var(--text-2);
  font-size: 1.05rem;
}

.b-cover {
  width: 100%;
  border-radius: 12px;
}

@media (max-width: 860px) {
  .b-edit {
    grid-template-columns: minmax(0, 1fr);
  }
  .b-preview {
    position: static;
    max-height: none;
  }
}
