/* ========================================================================
 *  Mobile prototype shell — emulates iPhone 13 / 14 viewport.
 *  Designed for desktop viewing: surrounding `mobile-stage` provides padding
 *  & shadowed phone frame; the 375×812 inner area renders the screen.
 * ====================================================================== */

/* 演示備註卡 */
.demo-note {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 4px 0 18px;
  padding: 10px 12px;
  background: var(--color-warning-soft);
  border: 1px dashed var(--color-warning);
  border-radius: 10px;
  font-size: 11px; line-height: 1.6;
  color: var(--color-warning);
}
.demo-note .tag {
  flex-shrink: 0;
  background: var(--color-warning);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-top: 1px;
}
.mobile-stage {
  min-height: 100vh;
  background: linear-gradient(135deg, #E5E7EB 0%, #CBD5E1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
}

.phone-frame {
  width: var(--frame-width);
  height: var(--frame-height);
  background: #000;
  border-radius: var(--frame-radius);
  padding: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4),
              0 0 0 2px #1f2937 inset;
  position: relative;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  border-radius: calc(var(--frame-radius) - 12px);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* iOS notch / Dynamic Island */
.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 30px;
  background: #000;
  border-radius: 18px;
  z-index: 20;
}

/* Status bar (time / signal / battery) */
.status-bar {
  flex-shrink: 0;
  height: 44px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--color-bg);
  position: relative;
  z-index: 10;
}
.status-bar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
}
.status-bar-icon { width: 14px; height: 14px; opacity: 0.9; }

/* Top nav bar (page title) */
.nav-bar {
  flex-shrink: 0;
  height: 52px;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 9;
}
.nav-bar-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
  text-align: center;
}
.nav-bar-back, .nav-bar-action {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: transparent;
  border: none;
}
.nav-bar-back:hover, .nav-bar-action:hover { background: var(--color-surface-alt); }
.nav-bar-back svg, .nav-bar-action svg { width: 22px; height: 22px; }

/* Main scrollable content area */
.screen-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-4);
}
.screen-body-flat { padding: 0; }
.screen-body::-webkit-scrollbar { width: 4px; }
.screen-body::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 2px; }

/* Bottom tab bar */
.tab-bar {
  flex-shrink: 0;
  height: 64px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  padding-bottom: var(--frame-safe-bottom);
  height: calc(64px + var(--frame-safe-bottom));
  z-index: 9;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-muted);
  font-size: 11px;
  text-decoration: none;
  position: relative;
  padding-top: 8px;
}
.tab-item .icon { width: 24px; height: 24px; }
.tab-item.active { color: var(--color-primary); }
.tab-item .badge-dot {
  position: absolute;
  top: 6px;
  right: 35%;
  width: 8px;
  height: 8px;
  background: var(--color-unread);
  border-radius: 50%;
  border: 2px solid var(--color-surface);
}

/* List item (used in inbox / settings) */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  cursor: pointer;
}
.list-item:hover { background: var(--color-surface-alt); }
.list-item .icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.list-item .icon svg { width: 20px; height: 20px; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title {
  font-size: var(--text-md);
  font-weight: 500;
  margin-bottom: 2px;
}
.list-item .subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.list-item .meta {
  flex-shrink: 0;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-align: right;
}
.list-item .chevron { color: var(--color-text-faint); }
.list-item .chevron svg { width: 18px; height: 18px; }

/* Message bubble (chat-room style for salary, appeal) */
.msg-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-card);
}
.msg-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.msg-card-title { font-weight: 600; font-size: var(--text-md); }
.msg-card-time { font-size: var(--text-xs); color: var(--color-text-faint); }
.msg-card-body { font-size: var(--text-sm); color: var(--color-text); line-height: var(--lh-loose); }
.msg-card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

/* Banner / hero card on home */
.hero-card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: var(--color-text-inverse);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

/* Quick entry grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text);
  text-decoration: none;
  text-align: center;
}
.quick-tile .icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-tile .icon-wrap svg { width: 22px; height: 22px; }

/* Section heading inside mobile body */
.section-heading {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: none;
  margin: var(--space-4) var(--space-2) var(--space-2);
}
.section-heading:first-child { margin-top: 0; }

/* Floating action button */
.fab {
  position: absolute;
  right: var(--space-4);
  bottom: calc(var(--frame-safe-bottom) + 80px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  border: none;
  cursor: pointer;
  z-index: 8;
}
.fab svg { width: 24px; height: 24px; }
