/* =========================================================================
   MachiYou wireframes — low-fi shared system
   ========================================================================= */

:root {
  --bg-page: #fafafa;
  --bg-frame: #ffffff;
  --bg-block: #ededed;
  --bg-block-2: #e0e0e0;
  --bg-block-dim: #f5f5f5;
  --border: #d4d4d4;
  --border-dark: #bdbdbd;
  --text-muted: #757575;
  --text: #212121;
  --cta: #212121;
  --cta-text: #ffffff;
  --accent-stamp: #424242;
  --status: #9e9e9e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

/* =========================================================================
   PAGE LAYOUT — phone + annotations side by side
   ========================================================================= */

.wf-page {
  display: grid;
  grid-template-columns: auto minmax(260px, 320px);
  gap: 24px;
  padding: 24px;
  min-height: 100vh;
  align-items: start;
  justify-content: center;
}

@media (max-width: 900px) {
  .wf-page {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

/* =========================================================================
   PHONE FRAME
   ========================================================================= */

.wf-phone {
  width: 375px;
  height: 812px;
  background: var(--bg-frame);
  border: 12px solid #1a1a1a;
  border-radius: 44px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

.wf-phone::before {
  /* notch */
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 26px;
  background: #1a1a1a;
  border-radius: 0 0 16px 16px;
  z-index: 100;
}

/* =========================================================================
   TABLET FRAME — kelner handheld (iPad portrait)
   ========================================================================= */

.wf-tablet {
  width: 720px;
  height: 980px;
  background: var(--bg-frame);
  border: 16px solid #1a1a1a;
  border-radius: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

/* =========================================================================
   KDS FRAME — kitchen display (dark, landscape monitor)
   ========================================================================= */

.wf-kds {
  width: 1100px;
  height: 720px;
  background: #0a0a0a;
  color: #f0f0f0;
  border: 16px solid #2a2a2a;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.wf-kds .wf-kds-header {
  background: #1a1a1a;
  color: #f0f0f0;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
}

.wf-kds .wf-kds-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
  background: #0a0a0a;
}

.wf-kds-ticket {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #f0f0f0;
}

.wf-kds-ticket--new { border-left: 4px solid #3b82f6; }
.wf-kds-ticket--prep { border-left: 4px solid #f59e0b; }
.wf-kds-ticket--ready { border-left: 4px solid #10b981; }
.wf-kds-ticket--late { border-left: 4px solid #ef4444; background: #1a0a0a; }

.wf-kds-col {
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
}

.wf-kds-col-head {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2a2a2a;
  color: #888;
}

.wf-kds-col--new .wf-kds-col-head { color: #60a5fa; }
.wf-kds-col--prep .wf-kds-col-head { color: #fbbf24; }
.wf-kds-col--ready .wf-kds-col-head { color: #34d399; }

.wf-kds-timer {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 700;
  font-size: 18px;
}

.wf-kds-timer--ok { color: #34d399; }
.wf-kds-timer--warn { color: #fbbf24; }
.wf-kds-timer--late { color: #ef4444; }

.wf-kds-meta { color: #888; font-size: 11px; }

/* iOS-style status bar */
.wf-status {
  height: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 24px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  flex-shrink: 0;
}

.wf-status-right {
  display: flex;
  gap: 4px;
  align-items: center;
}

.wf-status-icon {
  display: inline-block;
  width: 14px;
  height: 10px;
  background: var(--text);
  border-radius: 1px;
}

.wf-status-icon--wifi {
  width: 14px;
  height: 10px;
  background: linear-gradient(135deg, var(--text) 50%, transparent 50%);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.wf-status-icon--battery {
  width: 24px;
  height: 11px;
  border: 1px solid var(--text);
  border-radius: 2px;
  background: transparent;
  position: relative;
}

.wf-status-icon--battery::before {
  content: "";
  position: absolute;
  inset: 1px;
  background: var(--text);
  width: 80%;
  border-radius: 1px;
}

/* =========================================================================
   SCREEN — area inside phone (below status bar)
   ========================================================================= */

.wf-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-frame);
  position: relative;
}

.wf-scrollable {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 16px;
}

.wf-scrollable::-webkit-scrollbar {
  width: 0;
}

/* =========================================================================
   HEADER — sticky top
   ========================================================================= */

.wf-header {
  display: flex;
  align-items: center;
  padding: 8px 16px 12px;
  gap: 12px;
  background: var(--bg-frame);
  border-bottom: 1px solid transparent;
  flex-shrink: 0;
}

.wf-header--bordered {
  border-bottom-color: var(--border);
}

.wf-header-back,
.wf-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-block);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.wf-header-title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.wf-header-title--left {
  text-align: left;
}

.wf-header-kicker {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 2px;
}

.wf-header-spacer {
  width: 32px;
  flex-shrink: 0;
}

/* =========================================================================
   BODY — content sections
   ========================================================================= */

.wf-body {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wf-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wf-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wf-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.wf-section-kicker {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wf-section-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
}

/* =========================================================================
   PLACEHOLDER BLOCKS (gray bars representing text/elements)
   ========================================================================= */

.wf-bar {
  height: 12px;
  background: var(--bg-block);
  border-radius: 4px;
  width: 100%;
}

.wf-bar--lg { height: 16px; }
.wf-bar--xl { height: 22px; background: var(--bg-block-2); }
.wf-bar--sm { height: 8px; background: var(--bg-block-dim); }

.wf-bar--w90 { width: 90%; }
.wf-bar--w80 { width: 80%; }
.wf-bar--w70 { width: 70%; }
.wf-bar--w60 { width: 60%; }
.wf-bar--w50 { width: 50%; }
.wf-bar--w40 { width: 40%; }
.wf-bar--w30 { width: 30%; }
.wf-bar--w20 { width: 20%; }

.wf-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wf-stack--lg { gap: 10px; }

.wf-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wf-row--between {
  justify-content: space-between;
}

.wf-row--wrap {
  flex-wrap: wrap;
}

/* =========================================================================
   IMAGE / AVATAR PLACEHOLDERS
   ========================================================================= */

.wf-img {
  background: var(--bg-block);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  background-image:
    linear-gradient(135deg, var(--bg-block-2) 25%, transparent 25%),
    linear-gradient(225deg, var(--bg-block-2) 25%, transparent 25%);
  background-size: 16px 16px;
  background-position: 0 0;
}

.wf-img-label {
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 3px;
}

.wf-img--hero {
  width: 100%;
  height: 200px;
}

.wf-img--card {
  width: 100%;
  height: 140px;
}

.wf-img--thumb {
  width: 64px;
  height: 64px;
}

.wf-img--thumb-lg {
  width: 96px;
  height: 96px;
}

.wf-img--square {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.wf-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-block-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.wf-avatar--lg { width: 80px; height: 80px; font-size: 18px; }
.wf-avatar--xl { width: 96px; height: 96px; font-size: 22px; }
.wf-avatar--sm { width: 28px; height: 28px; font-size: 9px; }

/* =========================================================================
   CARDS
   ========================================================================= */

.wf-card {
  background: var(--bg-frame);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wf-card--dim {
  background: var(--bg-block-dim);
}

.wf-card--row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.wf-card--featured {
  background: var(--bg-block-dim);
  border: 1px dashed var(--border-dark);
}

/* =========================================================================
   BUTTONS
   ========================================================================= */

.wf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg-block);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
}

.wf-btn--primary {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--cta-text);
}

.wf-btn--ghost {
  background: transparent;
  border-color: var(--border-dark);
}

.wf-btn--full {
  width: 100%;
}

.wf-btn--sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
}

.wf-btn--xs {
  padding: 4px 8px;
  font-size: 11px;
  min-height: 24px;
  border-radius: 6px;
}

.wf-btn-arrow {
  font-size: 14px;
}

/* CTA group — sticky bottom */
.wf-footer {
  padding: 12px 16px 16px;
  background: var(--bg-frame);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.wf-footer--transparent {
  border-top: none;
}

/* =========================================================================
   CHIPS / PILLS
   ========================================================================= */

.wf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-block);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  min-height: 28px;
}

.wf-chip--active {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--cta-text);
}

.wf-chip--ghost {
  background: transparent;
}

.wf-chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.wf-chip-row::-webkit-scrollbar { height: 0; }

/* Status badges — uppercase mini */
.wf-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: var(--bg-block-2);
  color: var(--text);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
}

.wf-badge--dark {
  background: var(--text);
  color: var(--cta-text);
}

/* =========================================================================
   INPUTS
   ========================================================================= */

.wf-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wf-input-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wf-input-field {
  background: var(--bg-block-dim);
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.wf-input-field--textarea {
  height: 80px;
  align-items: flex-start;
  padding-top: 12px;
}

/* Toggle switch */
.wf-toggle {
  width: 40px;
  height: 22px;
  background: var(--bg-block-2);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.wf-toggle::after {
  content: "";
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 0.2s;
}

.wf-toggle--on {
  background: var(--cta);
}

.wf-toggle--on::after {
  left: 20px;
}

/* Stepper +/- */
.wf-stepper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-block-dim);
  border-radius: 999px;
  padding: 4px;
}

.wf-stepper-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-frame);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.wf-stepper-value {
  font-size: 14px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* Radio / checkbox dot */
.wf-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-dark);
  flex-shrink: 0;
}

.wf-dot--checked {
  background: var(--cta);
  border-color: var(--cta);
  position: relative;
}

.wf-dot--checked::after {
  content: "";
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.wf-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-dark);
  border-radius: 4px;
  flex-shrink: 0;
}

.wf-check--on {
  background: var(--cta);
  border-color: var(--cta);
  position: relative;
}

.wf-check--on::after {
  content: "✓";
  color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 700;
}

/* =========================================================================
   BOTTOM TAB BAR (mobile nav)
   ========================================================================= */

.wf-tabbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  background: var(--bg-frame);
  border-top: 1px solid var(--border);
  padding: 6px 8px 16px;
  flex-shrink: 0;
}

.wf-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--text-muted);
}

.wf-tab-icon {
  width: 22px;
  height: 22px;
  background: var(--bg-block-2);
  border-radius: 4px;
}

.wf-tab-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.wf-tab--active {
  color: var(--text);
}

.wf-tab--active .wf-tab-icon {
  background: var(--text);
}

.wf-tab--fab .wf-tab-icon {
  width: 44px;
  height: 44px;
  background: var(--cta);
  border-radius: 50%;
  margin-top: -16px;
  border: 4px solid var(--bg-frame);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* =========================================================================
   ANNOTATIONS — right column
   ========================================================================= */

.wf-anno {
  position: sticky;
  top: 32px;
  background: var(--bg-frame);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 12px;
  line-height: 1.5;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.wf-anno-id {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.wf-anno-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-top: -8px;
}

.wf-anno-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wf-anno-key {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wf-anno-val {
  color: var(--text);
}

.wf-anno ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wf-anno ul li {
  padding-left: 14px;
  position: relative;
}

.wf-anno ul li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.wf-anno-link {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-block);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-right: 4px;
  margin-bottom: 4px;
}

.wf-anno-link:hover {
  background: var(--cta);
  color: var(--cta-text);
  border-color: var(--cta);
}

.wf-anno-tbd {
  background: #fff7d6;
  border-left: 3px solid #d4a017;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 0 6px 6px 0;
}

.wf-anno-tbd strong {
  color: #856c00;
  display: block;
  font-size: 10px;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

/* =========================================================================
   INDEX PAGE
   ========================================================================= */

.wf-index {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px;
}

.wf-index h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.wf-index .wf-lead {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 640px;
}

.wf-index h2 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.wf-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.wf-index-card {
  display: block;
  padding: 12px 16px;
  background: var(--bg-frame);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: all 0.15s;
}

.wf-index-card:hover {
  border-color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wf-index-card-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.wf-index-card-name {
  font-weight: 600;
}

.wf-index-flow {
  background: var(--bg-frame);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 12px;
  line-height: 1.8;
  overflow-x: auto;
  white-space: nowrap;
}

.wf-index-flow strong {
  display: block;
  font-family: -apple-system, sans-serif;
  font-size: 13px;
  margin-bottom: 6px;
  letter-spacing: normal;
}

.wf-index-flow a {
  color: var(--text);
  text-decoration: underline;
  font-weight: 600;
}

.wf-index-flow a:hover {
  background: var(--cta);
  color: var(--cta-text);
  text-decoration: none;
  padding: 0 4px;
  border-radius: 3px;
}

/* =========================================================================
   UTILS
   ========================================================================= */

.wf-text-mute { color: var(--text-muted); }
.wf-text-sm { font-size: 11px; }
.wf-text-bold { font-weight: 700; }
.wf-text-center { text-align: center; }
.wf-pad-sm { padding: 8px; }
.wf-pad-md { padding: 12px; }
.wf-mt-sm { margin-top: 6px; }
.wf-mt-md { margin-top: 12px; }
.wf-grow { flex: 1; }
.wf-divider { height: 1px; background: var(--border); }

/* =========================================================================
   A11Y - focus-visible (globalny, tylko klawiatura)
   ========================================================================= */

a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus,
[data-pick]:focus {
  outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible,
[data-pick]:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 4px;
}
