/* ---------------------------------------------------------------------------
   SHELL
   Everything outside the mockup itself: page chrome, the app switcher, the
   phone frame, and the feedback layer. Per-app styling lives in its own file
   and is scoped under .app-<name>, so nothing here leaks into the mockups.
   --------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #ececed;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* --- Toolbar above the phone ---------------------------------------------- */

.toolbar {
  max-width: 430px;
  margin: 0 auto;
  padding: 14px 16px 10px;
}

.toolbar h1 {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 2px;
}
.toolbar .tagline {
  font-size: 13px;
  color: #6d6d72;
  margin: 0 0 12px;
  line-height: 1.4;
}

.tabs {
  display: flex;
  gap: 4px;
  background: #e0e0e3;
  border-radius: 12px;
  padding: 4px;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 9px 6px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  color: #5c5c63;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab[aria-selected="true"] {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #4a4a51;
  cursor: pointer;
  user-select: none;
}
.switch {
  width: 40px;
  height: 24px;
  border-radius: 12px;
  background: #c3c3c9;
  position: relative;
  flex-shrink: 0;
  transition: background 0.18s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.18s;
}
.switch-label input { position: absolute; opacity: 0; pointer-events: none; }
.switch-label input:checked + .switch { background: #2f9e5e; }
.switch-label input:checked + .switch::after { transform: translateX(16px); }

.link-btn {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #3a6fd8;
  cursor: pointer;
  padding: 6px 2px;
}
.link-btn .count {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  margin-left: 4px;
  border-radius: 9px;
  background: #3a6fd8;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.link-btn .count:empty, .link-btn .count[data-empty="true"] { display: none; }

.save-status {
  font-size: 11.5px;
  font-weight: 600;
  color: #8a8a90;
  min-height: 15px;
  margin-top: 4px;
  transition: color 0.15s;
}
.save-status[data-state="saved"] { color: #2f9e5e; }
.save-status[data-state="offline"], .save-status[data-state="pending"] { color: #b8791f; }

.name-input {
  width: 100%;
  margin-top: 10px;
  border: 1.5px solid #dededf;
  border-radius: 12px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14.5px;
}
.name-input:focus { outline: none; border-color: #3a6fd8; }

/* --- Phone frame ----------------------------------------------------------- */

.device-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 12px 40px;
}

.device {
  width: 390px;
  height: 812px;
  background: #000;
  border-radius: 54px;
  padding: 13px;
  box-shadow: 0 24px 50px rgba(0,0,0,0.32), 0 2px 8px rgba(0,0,0,0.18);
  position: relative;
  flex-shrink: 0;
}

.notch {
  position: absolute;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  width: 118px;
  height: 27px;
  background: #000;
  border-radius: 16px;
  z-index: 60;
}

.screen {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 42px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.screen::-webkit-scrollbar { display: none; }

.statusbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 55;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 28px 0;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(0,0,0,0.35);
}

.home-indicator {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 132px;
  height: 5px;
  border-radius: 3px;
  background: #111;
  opacity: 0.85;
  z-index: 58;
  pointer-events: none;
}

/* --- Feedback layer -------------------------------------------------------
   Only active when feedback mode is on, so the mockup can also be viewed
   completely clean.                                                          */

[data-fb] { position: relative; }

.fb-on [data-fb] {
  cursor: pointer;
  outline: 2px dashed rgba(58,111,216,0.5);
  outline-offset: -3px;
  border-radius: 6px;
}
.fb-on [data-fb]:hover { outline-color: rgba(58,111,216,0.95); }
.fb-on [data-fb][data-has-feedback="true"] {
  outline: 2px solid #2f9e5e;
  outline-offset: -3px;
}

/* Tags straddle the element's top edge, sitting in the gap between blocks so
   they never cover the copy being reviewed. Photos are the exception: there
   the tag sits inside, over the image. */
.fb-tag {
  display: none;
  position: absolute;
  top: 0;
  right: 10px;
  transform: translateY(-50%);
  z-index: 30;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 11px;
  background: rgba(58,111,216,0.94);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.fb-on .fb-tag { display: inline-flex; }
[data-has-feedback="true"] > .fb-tag { background: #2f9e5e; }

.media > .fb-tag {
  top: 8px;
  left: 8px;
  right: auto;
  transform: none;
}

/* --- Bottom sheet ---------------------------------------------------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sheet-backdrop.open { display: flex; }

.sheet {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 8px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: 88vh;
  overflow-y: auto;
  animation: sheet-up 0.2s ease-out;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }

.sheet-grabber {
  width: 38px; height: 4px; border-radius: 2px;
  background: #d5d5da; margin: 6px auto 14px;
}
.sheet h2 { font-size: 17px; margin: 0 0 3px; }
.sheet .sheet-sub { font-size: 12.5px; color: #7a7a80; margin: 0 0 14px; }

.sheet-preview {
  background: #f6f6f8;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: #40404a;
  margin-bottom: 16px;
  max-height: 150px;
  overflow: hidden;
}
.sheet-preview img { max-width: 90px; border-radius: 6px; display: block; }

.rating-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.rating {
  border: 1.5px solid #dededf;
  background: #fff;
  border-radius: 18px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #55555c;
  cursor: pointer;
}
.rating[aria-pressed="true"] { background: #eef3fd; border-color: #3a6fd8; color: #24509f; }

.sheet textarea {
  width: 100%;
  min-height: 108px;
  border: 1.5px solid #dededf;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: vertical;
}
.sheet textarea:focus { outline: none; border-color: #3a6fd8; }

.sheet-buttons { display: flex; gap: 10px; margin-top: 14px; }
.btn {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 13px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.btn-primary { background: #3a6fd8; color: #fff; }
.btn-secondary { background: #ededf0; color: #3c3c43; }
.btn-danger { background: transparent; color: #c0392b; flex: 0 0 auto; padding: 13px 16px; }

/* --- Review list ----------------------------------------------------------- */

.review-item {
  border-bottom: 1px solid #eeeef0;
  padding: 14px 0;
}
.review-item:last-child { border-bottom: 0; }
.review-item .where {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8a8a90;
  margin-bottom: 4px;
}
.review-item .rating-chip {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  color: #24509f;
  background: #eef3fd;
  border-radius: 8px;
  padding: 2px 7px;
  margin-bottom: 5px;
}
.review-item .note { font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; }
.review-empty { color: #8a8a90; font-size: 14px; padding: 20px 0; text-align: center; }

/* --- Real phones: drop the device chrome ----------------------------------- */

@media (max-width: 470px) {
  .toolbar { max-width: 100%; }
  .device-wrap { padding: 0; }
  .device {
    width: 100%;
    height: calc(100dvh - 172px);
    min-height: 420px;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .notch { display: none; }
  .screen { border-radius: 0; height: 100%; }
  .statusbar { display: none; }
  .home-indicator { display: none; }
}
