:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e2e8f0;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --brand: #1d4ed8;
  --brand-bright: #1d4ed8;
  --brand-bg: #eff6ff;
  --green: #059669;
  --green-bg: #ecfdf5;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--text);
  background: #e2e8f0;
  -webkit-font-smoothing: antialiased;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.studio-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 20px 40px;
}

.iphone-frame {
  position: relative;
  width: 417px;
  height: 876px;
  padding: 12px;
  border-radius: 56px;
  background: linear-gradient(145deg, #334155 0%, #0f172a 50%, #1e293b 100%);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(15, 23, 42, 0.14);
}

.iphone-screen {
  position: relative;
  width: 393px;
  height: 852px;
  border-radius: 46px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 34px;
  background: #0f172a;
  border-radius: 20px;
  z-index: 40;
}

.ios-statusbar {
  height: 54px;
  padding: 16px 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text);
  flex-shrink: 0;
  z-index: 30;
}

.ios-statusbar .status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.screen-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 16px 20px;
  scrollbar-width: none;
}

.screen-body::-webkit-scrollbar {
  display: none;
}

.ios-tabbar {
  height: 82px;
  padding: 8px 6px 22px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  flex-shrink: 0;
  z-index: 30;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 600;
  position: relative;
}

.tab-item svg {
  width: 22px;
  height: 22px;
}

.tab-item.active {
  color: var(--brand);
}

.tab-badge {
  position: absolute;
  top: 0;
  right: 22px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--red);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-indicator {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.28);
  z-index: 40;
  pointer-events: none;
}

body.embedded {
  background: var(--bg);
  overflow: hidden;
}

body.embedded .studio-shell {
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
}

body.embedded .iphone-frame {
  width: 100%;
  height: 100vh;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.embedded .iphone-screen {
  width: 100%;
  height: 100vh;
  border-radius: 0;
}

@media (max-width: 450px) {
  .studio-shell { padding: 0; background: var(--bg); }
  .iphone-frame { width: 100vw; height: 100vh; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .iphone-screen { width: 100vw; height: 100vh; border-radius: 0; }
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.app-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.15;
}

.app-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.card-tight {
  padding: 12px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin: 14px 0 8px 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.pill-success { background: var(--green-bg); color: var(--green); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-danger { background: var(--red-bg); color: var(--red); }
.pill-info { background: var(--brand-bg); color: var(--brand); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.kpi-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
}

.kpi-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.kpi-val {
  font-size: 14px;
  font-weight: 700;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.kpi-sub {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.25s ease;
}

.btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s ease, opacity 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #ffffff; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
.btn-success { background: var(--green); color: #ffffff; }
.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 10px; }

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }

.toast {
  position: absolute;
  bottom: 94px;
  left: 16px;
  right: 16px;
  background: #0f172a;
  color: #ffffff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.toast.show { opacity: 1; transform: translateY(0); }

.total-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 70%);
  border-color: #bfdbfe;
}

.total-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.total-hero-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand);
}

.total-hero-val {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 3px;
}

.total-hero-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.tap-num {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--brand-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  flex-shrink: 0;
}

.line-row-stack {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.line-row-stack:last-child { border-bottom: 0; padding-bottom: 0; }
.line-row-stack:first-child { padding-top: 0; }

.line-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.tap-card-btn {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 9px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tap-card-btn:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.tap-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.beer-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.beer-swatch {
  width: 8px;
  height: 28px;
  border-radius: 4px;
  flex-shrink: 0;
}

.tap-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.tap-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 10px 2px;
}

.shift-back-btn {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--brand);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.shift-bars {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  align-items: end;
  height: 156px;
  padding-top: 18px;
}

.shift-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 5px;
}

.shift-col-val {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
}

.shift-col-bar {
  width: 100%;
  border-radius: 6px 6px 3px 3px;
  background: #93c5fd;
  min-height: 8px;
}

.shift-col.peak .shift-col-bar {
  background: var(--brand);
}

.shift-col.peak .shift-col-val {
  color: var(--brand);
}

.shift-col-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
}

.feed-date {
  text-align: center;
  margin: 0 auto 10px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
}

.bubble {
  padding: 11px 12px 9px;
  border-radius: 14px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.4;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.bubble-out {
  background: var(--brand-bg);
  border-color: #bfdbfe;
  margin-left: 28px;
}

.bubble-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 12.5px;
}

.bubble-time {
  display: block;
  text-align: right;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
}

.bubble-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--brand);
  font-weight: 600;
  font-size: 11.5px;
  text-decoration: none;
}

.reply-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 6px 0 12px;
}

.reply-btn {
  border: 1px solid #bfdbfe;
  background: var(--brand-bg);
  color: var(--brand);
  border-radius: 10px;
  padding: 9px 6px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.reply-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-size: 12px; font-weight: 700; text-decoration: none; margin-bottom: 6px; }
.urgent-banner { background: var(--red-bg); border: 1px solid #fecaca; border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.pours-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 8px; }
.glass-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.glass-cup { width: 30px; height: 44px; border-radius: 3px 3px 8px 8px; border: 1.5px solid var(--border-strong); overflow: hidden; display: flex; flex-direction: column; background: var(--surface-2); }
.glass-foam { background: #ffffff; width: 100%; }
.glass-beer { background: linear-gradient(180deg, #60a5fa, #1d4ed8); width: 100%; flex: 1; }
.check-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.check-item:last-child { border-bottom: 0; padding-bottom: 0; }
.check-item:first-child { padding-top: 0; }
.check-box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; font-size: 12px; color: #ffffff; font-weight: 800; }
.check-item.done .check-box { background: var(--green); border-color: var(--green); }
.check-item.done .check-text { text-decoration: line-through; color: var(--text-dim); }
