@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800;900&display=swap');

/* ============================
   SUSHI CHECKLIST UI — STYLES
   Soft glass + modern iOS
   ============================ */

:root {
  /* Accent palette */
  --accent: #E85A8A;           /* pink */
  --accent-2: #2EC4A6;         /* teal */
  --accent-warm: #F2C94C;      /* yellow */

  /* Neutrals */
  --bg: #F7F4F6;
  --bg-2: #FBFAFB;
  --card: rgba(255, 255, 255, 0.86);
  --text: #12131A;
  --muted: #6B7280;
  --border: rgba(17, 24, 39, 0.10);

  /* Radii */
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;

  /* Shadows */
  --sh-sm: 0 8px 22px rgba(17, 24, 39, 0.07);
  --sh-md: 0 16px 42px rgba(17, 24, 39, 0.12);

  /* Buttons */
  --btnText: #FFFFFF;

  /* Status */
  --danger: #D64545;
  --ok: #2EC4A6;
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
  min-height: 100%;
  background-color: var(--bg);
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 16px;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background-color: var(--bg);
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(232, 90, 138, 0.14), transparent 60%),
    radial-gradient(820px 520px at 110% 0%, rgba(46, 196, 166, 0.12), transparent 62%),
    radial-gradient(820px 520px at 50% 120%, rgba(242, 201, 76, 0.12), transparent 62%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* iOS Safari: fixed background can look glitchy; fall back to scroll */
@supports (-webkit-touch-callout: none) {
  body { background-attachment: scroll; }
}

.container {
  max-width: 560px;
  margin: 0 auto;
}

#app {
  min-height: calc(100vh - 32px);
}

/* Optional wrapper to sticky the whole header (branch/user + tabs).
   Works if you wrap those blocks with <div class="stickyHeader"> ... </div> */
.stickyHeader{
  position: sticky;
  top: 0;
  z-index: 120;
  background: rgba(247, 244, 246, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(17,24,39,0.06);
  padding: 10px 0 0;
  margin: 0 0 8px;
}

.stickyTabsHeader{
  padding: 0;
  margin: 0 0 8px;
  border-bottom: 0;
}

.stickyTabsHeader .tabsCard{
  margin-top: 0;
}

/* Typography */
h1 {
  font-size: 34px;
  line-height: 1.05;
  font-weight: 900;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 16px;
  line-height: 1.25;
  font-weight: 900;
  margin: 16px 0 10px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px;
  margin: 12px 0;
  box-shadow: var(--sh-sm);
  backdrop-filter: blur(12px);
}

.card.error {
  border-color: rgba(214, 69, 69, 0.45);
  box-shadow: 0 10px 28px rgba(214, 69, 69, 0.10);
}

/* Inputs */
select,
input[type="text"],
input[type="date"],
input[type="number"],
textarea {
  width: 100%;
  padding: 12px 44px 12px 12px; /* right padding for select arrow */
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  font-size: 16px; /* iOS zoom fix */
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  font-family: inherit;
}

/* IMPORTANT: don't force tall textarea globally */
textarea { resize: vertical; }

select:focus,
input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: rgba(232, 90, 138, 0.35);
  box-shadow: 0 0 0 4px rgba(232, 90, 138, 0.12);
}

/* Make selects app-like + center arrow vertically */
select {
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.2;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(18, 19, 26, 0.55) 50%),
    linear-gradient(135deg, rgba(18, 19, 26, 0.55) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 2px 12px;
  margin: 10px 0 6px;
  background: rgba(247, 244, 246, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
  scroll-behavior: smooth;
  flex: 1;
  min-width: 0;
}
.tabs::-webkit-scrollbar { height: 0; }

.tabsWrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tabsArrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(17,24,39,0.08);
  color: #374151;
  transition: background 0.15s, opacity 0.15s;
}
.tabsArrow:active { background: #f3f4f6; }
.tabsArrow:disabled { opacity: 0.3; pointer-events: none; }

.tab {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.05);
}
.tab.active {
  border-color: rgba(232, 90, 138, 0.25);
  background:
    radial-gradient(900px 450px at 15% -20%, rgba(232, 90, 138, 0.22), transparent 60%),
    radial-gradient(900px 450px at 110% 120%, rgba(46, 196, 166, 0.16), transparent 62%),
    rgba(255, 255, 255, 0.96);
}
.tab.completed {
  background: rgba(236, 238, 242, 0.92);
  color: rgba(107, 114, 128, 0.9);
  border-color: rgba(107, 114, 128, 0.25);
}
.tab.completed.active {
  background: rgba(236, 238, 242, 0.96);
  border-color: rgba(107, 114, 128, 0.35);
}

/* Question header layout */
.qHead, .qHeader{
  display:flex;
  align-items:flex-start;
  gap: 12px;
}
.qHeadMain, .qHeaderLeft{
  flex: 1;
  min-width: 0;
}
.qHeadAside, .qHeaderRight{
  flex: 0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  margin-left: auto;
  padding-top: 2px;
}

/* Question text — semi-bold, black */
.q-title, .qTitle{
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.q-desc, .qDesc{
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.45;
}

.q-desc a, .qDesc a{
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Buttons */
button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.btn{
  width: auto;
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  background: #fff;
  border: 2px solid rgba(15, 17, 23, 0.9);
  box-shadow: none;
  transition: transform .06s ease, filter .15s ease, opacity .15s ease;
  font-family: inherit;
}

/* Only primary actions full-width */
#startBtn, .startBtn,
#currentCheckBtn, .currentCheckBtn,
#finishBtn, .finishBtn,
#newCheckBtn, .newCheckBtn,
#resetDraftBtn, .resetDraftBtn,
#shareResultLinkBtn, .shareResultLinkBtn,
#copyResultLinkBtn, .copyResultLinkBtn,
.btnPrimary {
  width: 100%;
}

.btn:hover { filter: none; background: rgba(255, 255, 255, 0.92); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.btnSecondary {
  background: #fff;
  color: var(--text);
  border: 2px solid rgba(15, 17, 23, 0.9);
  box-shadow: none;
}

.btnOutline{
  width: 100%;
  background: #fff;
  color: var(--text);
  border: 2px solid rgba(15, 17, 23, 0.9);
  box-shadow: none;
  font-weight: 700;
}
.btnOutline:hover{
  filter: none;
  background: rgba(255, 255, 255, 0.92);
}

.btnDanger {
  background: #fff;
  color: #7C2C2C;
  border: 2px solid #7C2C2C;
  box-shadow: none;
}

/* Form layout */
.row{
  display:flex;
  flex-direction:column;
  gap: 12px;
}
.row > button{ margin-top: 12px; }
.card select{ margin-bottom: 10px; }
#startBtn, .startBtn{ margin-top: 12px; }

label{
  display:block;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin: 2px 2px 6px;
}

/* Photo toggle */
.photoToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, rgba(232, 90, 138, 0.96), rgba(232, 90, 138, 0.72));
  color: #fff;
  font-weight: 1000;
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 14px 36px rgba(232, 90, 138, 0.26);
  cursor: pointer;
  transition: transform .06s ease, filter .15s ease;
  flex: 0 0 auto;
}
.photoToggle:empty::after{ content: "+"; }
.photoToggle:hover { filter: brightness(1.02); }
.photoToggle:active { transform: scale(.97); }

.photoWrap { display: none; margin-top: 12px; scroll-margin-top: 90px; }
.photoWrap.open { display: block; }
.photoWrap img { width: 100%; border-radius: var(--r-lg); box-shadow: var(--sh-sm); }

/* Thumbs */
.thumbRow{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.thumbWrap{
  position: relative;
  display: inline-flex;
}
.thumbDel{
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(15,17,23,.9);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0,0,0,.2);
}
.thumbGrid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb {
  width: 78px; height: 78px; border-radius: 16px; object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.10);
}

/* Zone banner with % circle */
.zoneBanner {
  position: relative;
  padding: 14px 70px 14px 18px;
  border-radius: var(--r-xl);
  font-weight: 1000;
  text-align: center;
  letter-spacing: 0.02em;
  box-shadow: var(--sh-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
}

.zoneTitle{
  text-transform: uppercase;
  font-size: 18px;
  line-height: 1.1;
}

.zonePct{
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.01em;
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(10px);
  color: inherit;
}

.zoneMeta{ margin-top: 8px; font-size: 13px; color: var(--muted); }
.zoneMetaStack{ display: grid; gap: 4px; }

/* Softer “into white” gradients */
.zoneBanner.green  { background: linear-gradient(135deg, rgba(255,255,255,.95) 0%, rgba(46,196,166,.92) 55%, #1E7D6A 100%); color: #FFFFFF; }
.zoneBanner.yellow { background: linear-gradient(135deg, rgba(255,255,255,.95) 0%, rgba(242,201,76,.92) 55%, #F2C94C 100%); color: #241A00; }
.zoneBanner.red    { background: linear-gradient(135deg, rgba(255,255,255,.94) 0%, rgba(185,75,75,.92) 55%, #6F2A2A 100%); color: #FFFFFF; }
.zoneBanner.gray   { background: linear-gradient(135deg, rgba(255,255,255,.9) 0%, rgba(140,140,148,.92) 55%, #2F2F35 100%); color: #FFFFFF; }

.zoneBanner.yellow .zonePct{ background: rgba(255,255,255,.36); border-color: rgba(255,255,255,.42); }
.zoneBanner.gray .zonePct,
.zoneBanner.red .zonePct{ background: rgba(0,0,0,.18); border-color: rgba(255,255,255,.22); }
.zoneBanner.green .zonePct{ background: rgba(255,255,255,.20); border-color: rgba(255,255,255,.30); }

/* Image modal */
body.modal-open {
  overflow: hidden;
}

.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 18px;
}
.modalOverlay.open { display: flex; }

.imgModalInner,
.modalBox {
  width: min(100%, 920px);
  max-height: calc(100vh - 36px);
  position: relative;
  background: #0B0C10;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}

.imgModalImg,
.modalImg {
  width: 100%;
  height: min(82vh, calc(100vh - 36px));
  object-fit: contain;
  display: block;
}

/* Modal controls */
#imgClose{
  all: unset;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  width: 44px;
  height: 44px;
  border-radius: 14px;

  display: none;
  align-items: center;
  justify-content: center;

  font-size: 22px;
  font-weight: 900;
  line-height: 1;

  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 38px rgba(0,0,0,.35);
}

#imgClose{ position: absolute; top: 14px; right: 14px; }

.modalOverlay.open #imgClose{
  display: inline-flex !important;
}

/* ============================
   Segmented answers (SINGLE)
   ============================ */
.segmented{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:1fr;
  gap:10px;
  margin-top:10px;
}

.segInput{ position:absolute; opacity:0; pointer-events:none; }

.segBtn{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:12px 10px;
  border-radius:16px;
  border:1px solid rgba(17,24,39,.12);
  background:rgba(255,255,255,.94);
  font-weight:900;
  cursor:pointer;
  user-select:none;
  min-height:44px;
  box-shadow:0 10px 22px rgba(17,24,39,.06);
  transition:transform .06s ease, box-shadow .15s ease, filter .15s ease, background .15s ease;
  position: relative;
  white-space: normal;
}

.segBtn:active{ transform:scale(.985); }
.optBtn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}

.segBtn.answer--bad{ border-color:rgba(214,69,69,.45); }
.segBtn.answer--ok{ border-color:rgba(242,201,76,.55); }
.segBtn.answer--good{ border-color:rgba(46,196,166,.45); }

.segBtn.is-active{
  transform: translateY(-1px);
  box-shadow: 0 22px 60px rgba(17,24,39,.22);
  border-width: 2px;
}
.segBtn.is-active::after{
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 20px;
  pointer-events: none;
  box-shadow: 0 0 0 5px rgba(18,19,26,.05);
}

.segBtn.answer--bad.is-active{
  background: linear-gradient(135deg, rgba(214,69,69,.44), rgba(255,255,255,.98));
  border-color: rgba(214,69,69,.86);
}
.segBtn.answer--ok.is-active{
  background: linear-gradient(135deg, rgba(242,201,76,.48), rgba(255,255,255,.98));
  border-color: rgba(242,201,76,.92);
}
.segBtn.answer--good.is-active{
  background: linear-gradient(135deg, rgba(46,196,166,.42), rgba(255,255,255,.98));
  border-color: rgba(46,196,166,.86);
}

/* Checkbox toggle (ideal/bad) */
.cbToggleWrap{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cbToggleLabel{
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  max-width: 40%;
}
.cbToggleLabel--good{ color: #1E7D6A; }
.cbToggleLabel--bad{ color: #B94949; }

.cbToggle{
  position: relative;
  display: inline-flex;
  width: 92px;
  height: 44px;
}
.cbToggle input{
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.cbToggleTrack{
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(214,69,69,.65), rgba(214,69,69,.95));
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.12), 0 12px 24px rgba(17,24,39,.08);
  transition: background .2s ease;
}
.cbToggleThumb{
  position: absolute;
  top: 4px;
  left: 4px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(17,24,39,.2);
  transition: transform .2s ease;
}
.cbToggleIcon{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 900;
  color: rgba(255,255,255,.95);
  transition: opacity .2s ease;
  pointer-events: none;
}
.cbToggleIcon--good{ right: 16px; opacity: 0; }
.cbToggleIcon--bad{ left: 18px; opacity: 1; }

.cbToggle input:checked + .cbToggleTrack{
  background: linear-gradient(135deg, rgba(46,196,166,.65), rgba(46,196,166,.95));
}
.cbToggle input:checked + .cbToggleTrack .cbToggleThumb{
  transform: translateX(48px);
}
.cbToggle input:checked + .cbToggleTrack .cbToggleIcon--good{ opacity: 1; }
.cbToggle input:checked + .cbToggleTrack .cbToggleIcon--bad{ opacity: 0; }
.cbToggle input:disabled + .cbToggleTrack{
  opacity: 0.6;
}

/* ============================
   Comment field: 1 line -> up to 3 lines, then scroll
   ============================ */
.commentWrap{ margin-top: 10px; }

.commentLabel{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size:12px;
  font-weight:800;
  color: var(--muted);
  margin: 8px 2px 6px;
}

textarea.comment{
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  min-height: 38px;     /* ~1 line */
  max-height: 96px;     /* ~3 lines */
  overflow-y: auto;
  resize: none;
  font-size: 15px;
  line-height: 1.25;
}

textarea.comment::-webkit-scrollbar{ width: 8px; }
textarea.comment::-webkit-scrollbar-thumb{
  background: rgba(17, 24, 39, 0.18);
  border-radius: 999px;
}
textarea.comment::placeholder{ color: rgba(107, 114, 128, 0.75); }

/* Notes (comment + photo) */
.noteRow{
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.noteRowTop{
  align-items: center;
}

.noteInput{
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
  min-height: 44px;
  max-height: 120px;
  overflow-y: auto;
  resize: none;
  font-size: 15px;
  line-height: 1.4;
}

.noteInput::placeholder{ color: rgba(107, 114, 128, 0.75); }

.fileBtn{
  position: relative;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 22px rgba(17,24,39,.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fileBtn input{
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.fileBtnIcon::before{
  content: "📷";
  font-size: 18px;
  line-height: 1;
}

.photoSaveStatus{
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  min-width: 120px;
}

.photoSaveStatus.is-error{
  color: var(--danger);
}

.bottomBar{
  position: sticky;
  bottom: 0;
  z-index: 110;
  padding: 8px 0 calc(16px + env(safe-area-inset-bottom, 0));
  background: rgba(247, 244, 246, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(17,24,39,0.06);
}

body.is-number-editing .bottomBar{
  display: none;
}

.bottomActions{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.startActions{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.startActions .btn{
  width: 100%;
  border-radius: 18px;
}

.startActions .btn:only-child{
  grid-column: 1 / -1;
}

.homeCard{
  padding: 18px 16px 20px;
}
.homeHeader{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.homeUserInfo{
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.homeUserName{
  font-size: 18px;
  font-weight: 700;
}
.homeUserHandle{
  font-size: 14px;
  color: var(--muted);
}
.homeUserAvatar{
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 2px solid rgba(15, 17, 23, 0.9);
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}
.homeActions{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.homePrimaryActions,
.homeSecondaryActions{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.homePrimaryActions .homeActionBtn:only-child{
  grid-column: 1 / -1;
}
.homeActionWide{
  grid-column: 1 / -1;
}
.homeCurrentCheck{
  display: grid;
  gap: 8px;
}
.homeResetBtn{
  width: 100%;
}
.homeActionBtn{
  padding: 16px 18px;
  border-radius: 20px;
}
.homeAnalytics{
  margin-top: 18px;
  padding: 28px 20px;
  min-height: 260px;
  border-radius: 24px;
  border: 2px solid rgba(15, 17, 23, 0.9);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.homeAnalyticsTitle{
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
}
.homeAnalyticsHint{
  max-width: 320px;
}
.homeVersion{
  margin-top: 14px;
  text-align: center;
}
.authWidgetWrap{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.authWidget{
  min-height: 52px;
}
.browserAuthForm{
  display: grid;
  gap: 14px;
  width: 100%;
  margin-top: 16px;
}
.formField{
  display: grid;
  gap: 6px;
}
.fieldLabel{
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.screenHeader{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.screenHeaderTitles{
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.iconBtn{
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 2px solid rgba(15, 17, 23, 0.9);
  background: #fff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  box-shadow: none;
}
.iconBtn:active{
  transform: scale(.98);
}
.branchPickerHeader{
  margin-top: 6px;
}

.resultActions{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.resultShareBox{
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  width: 100%;
}
.resultShareBox input{
  font-size: 14px;
  padding-right: 12px;
}

.resultActions .btn{
  width: 100%;
  border-radius: 18px;
}
.resultActions .btn:only-child{
  grid-column: 1 / -1;
}

.userGlow{
  color: var(--accent);
  font-weight: 800;
  text-shadow: 0 0 14px rgba(232, 90, 138, 0.35);
}

.userCard{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-top: 8px;
  border-radius: 18px;
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(15,17,23,.08);
}
.userCardAvatar{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #1B1D26;
  background: linear-gradient(135deg, #FFD27C, #F2994A);
  box-shadow: 0 12px 24px rgba(17,24,39,.16);
}
.userCardName{
  font-weight: 700;
  font-size: 15px;
}
.userCardHandle{
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.noticeBlock{
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(214, 69, 69, 0.4);
  background: rgba(214, 69, 69, 0.12);
  color: #6F2A2A;
  box-shadow: 0 10px 22px rgba(214, 69, 69, 0.08);
}
.noticeTitle{
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 6px;
}
.noticeText{
  font-size: 13px;
  line-height: 1.4;
}

.cabinetHeader{
  margin-bottom: 6px;
}
.cabinetHeader .title{
  font-size: 26px;
  font-weight: 800;
}
.cabinetActions{
  grid-template-columns: 1fr;
  margin-top: 4px;
}
.cabinetCard{
  padding-top: 10px;
}

.cabinetSortBar{
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.cabinetSortField{
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  min-width: 220px;
}

.cabinetSortField span{
  letter-spacing: .02em;
}

.cabinetSortField select{
  padding: 10px 12px;
  font-size: 14px;
}

@media (max-width: 720px) {
  .cabinetSortBar{
    justify-content: stretch;
  }
  .cabinetSortField{
    width: 100%;
    min-width: 0;
  }
}

.cabinetTableWrap{
  overflow-x: auto;
}

.cabinetTable{
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border: 1.5px solid rgba(17,24,39,.22);
  background: rgba(255,255,255,.7);
}

.cabinetTable th,
.cabinetTable td{
  padding: 12px 10px;
  border: 1.5px solid rgba(17,24,39,.22);
  text-align: left;
  vertical-align: middle;
}

.cabinetTable thead th{
  font-weight: 800;
  background: rgba(255,255,255,.92);
  padding: 0;
}

.cabinetSortBtn{
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 800;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 10px;
  cursor: pointer;
}

.cabinetSortBtn:focus-visible{
  outline: 2px solid rgba(232, 90, 138, 0.7);
  outline-offset: -2px;
}

.cabinetSortLabel{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cabinetSortIndicator{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(17,24,39,.55);
  font-size: 11px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.cabinetSortIcon{
  width: 14px;
  height: 14px;
  color: rgba(17,24,39,.65);
}

.cabinetSortDirection::before{
  content: "↕";
}

.cabinetSortBtn.is-active .cabinetSortDirection::before{
  content: "↑";
}

.cabinetSortBtn.is-active[data-dir="desc"] .cabinetSortDirection::before{
  content: "↓";
}

.cabinetShowMore{
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.cabinetRow{
  cursor: pointer;
  transition: background-color .18s ease, transform .06s ease;
}

.cabinetRow:hover{
  background: rgba(255,255,255,.92);
}

.cabinetRow:active{
  transform: scale(.995);
}

.cabinetRow[data-loading="true"]{
  opacity: 0.6;
  pointer-events: none;
}

.cabinetRow:focus-visible{
  outline: 2px solid rgba(232, 90, 138, 0.7);
  outline-offset: -2px;
}

.cabinetZoneCell{
  font-weight: 800;
}

.cabinetZoneCell--green{
  background: rgba(46,196,166,.16);
}

.cabinetZoneCell--yellow{
  background: rgba(242,201,76,.24);
}

.cabinetZoneCell--red{
  background: rgba(214,69,69,.16);
}

.cabinetZoneCell--gray{
  background: rgba(107,114,128,.18);
}

.zoneBadge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .02em;
  border: 1px solid transparent;
}

.zoneBadge.green{
  color: #0F5132;
  background: rgba(46,196,166,.18);
  border-color: rgba(46,196,166,.38);
}

.zoneBadge.yellow{
  color: #7A5900;
  background: rgba(242,201,76,.22);
  border-color: rgba(242,201,76,.42);
}

.zoneBadge.red{
  color: #7A1F1F;
  background: rgba(214,69,69,.16);
  border-color: rgba(214,69,69,.34);
}

.zoneBadge.gray{
  color: #374151;
  background: rgba(107,114,128,.18);
  border-color: rgba(107,114,128,.32);
}

.cabinetMeta{
  margin-top: 6px;
}

.loadingPill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15,17,23,.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}
.loadingPill::after{
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid rgba(107,114,128,.35);
  border-top-color: rgba(232,90,138,.8);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

/* ============================
   optRow / optBtn — SINGLE SOURCE OF TRUTH (NO DUPLICATES)
   ============================ */
.optRow{
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px;
  align-items: stretch;
}

.optRow.two{
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Make option buttons look like chips (even if they have .btn by mistake) */
.optRow .optBtn,
.optRow button.optBtn,
.optRow .btn.optBtn,
.optRow button.btn.optBtn{
  width: 100% !important;
  background: rgba(255,255,255,0.94) !important;
  color: var(--text) !important;
  border: 1px solid rgba(17,24,39,.12) !important;
  box-shadow: 0 10px 22px rgba(17,24,39,.06) !important;
  border-radius: 16px !important;
  padding: 12px 10px !important;
  min-height: 44px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  white-space: normal !important;
  line-height: 1.2;
}

.optRow .optBtn.selected,
.optRow .optBtn.is-active{
  transform: translateY(-1px) !important;
  box-shadow: 0 22px 60px rgba(17,24,39,.22) !important;
  border-width: 2px !important;
}

.optRow .optBtn.bad.selected,
.optRow .optBtn.bad.is-active{
  background: linear-gradient(135deg, rgba(214,69,69,.44), rgba(255,255,255,.98)) !important;
  border-color: rgba(214,69,69,.86) !important;
}
.optRow .optBtn.ok.selected,
.optRow .optBtn.ok.is-active{
  background: linear-gradient(135deg, rgba(242,201,76,.48), rgba(255,255,255,.98)) !important;
  border-color: rgba(242,201,76,.92) !important;
}
.optRow .optBtn.good.selected,
.optRow .optBtn.good.is-active{
  background: linear-gradient(135deg, rgba(46,196,166,.42), rgba(255,255,255,.98)) !important;
  border-color: rgba(46,196,166,.86) !important;
}

/* Number input (roll weight) */
.optCol.number{
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.numberField{
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.numberLabel{
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.numberSelect,
.numberInput{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,0.95);
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  box-shadow: 0 10px 22px rgba(17,24,39,.06);
  scroll-margin-bottom: 160px;
}
.numberSelect:disabled,
.numberInput:disabled{
  opacity: 0.6;
}
.numberInputRow{
  display: flex;
  gap: 10px;
  align-items: center;
}
.numberInputRow.is-active{
  margin-bottom: 64px;
}
.numberInputRow .numberInput{
  flex: 1;
}
.numberDoneBtn{
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(17,24,39,.12);
  background: rgba(255,255,255,0.95);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(17,24,39,.06);
  white-space: nowrap;
  cursor: pointer;
}
.numberInputRow.is-active .numberDoneBtn{
  display: inline-flex;
}
.numberMeta{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}
.numberMetaItem strong{
  color: var(--text);
  font-weight: 600;
}

/* Mobile */
@media (max-width: 480px) {
  body { padding: 12px; }
  h1 { font-size: 34px; }
  .tab { padding: 9px 12px; }
}
@media (max-width: 420px){
  .segmented{ gap:8px; }
  .segBtn{ font-size:14px; padding:11px 8px; }
  .optRow{ gap: 8px; }
  .optRow .optBtn,
  .optRow .btn.optBtn{
    font-size: 14px !important;
    padding: 11px 8px !important;
  }
}

@media (max-width: 360px){
  .bottomActions,
  .resultActions{
    grid-template-columns: 1fr;
  }
  .optRow{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.issueSection{
  margin-top: 18px;
}
.issueSection:first-child{
  margin-top: 0;
}
.issueSectionName{
  text-align: center;
  font-weight: 800;
  color: var(--accent);
  margin: 16px 0 12px;
  position: relative;
}
.issueSectionName::before,
.issueSectionName::after{
  content: "";
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: rgba(232, 90, 138, 0.25);
}
.issueSectionName::before{ left: 0; }
.issueSectionName::after{ right: 0; }

.issueTableWrap{
  overflow-x: auto;
}
.issueTable{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.issueTable th,
.issueTable td{
  padding: 8px;
  border-bottom: 1px solid rgba(17,24,39,.08);
  vertical-align: top;
  text-align: left;
}

.continueDraftActions{
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.continueDraftActions .btn{
  width: 100%;
}
.copyManualHelp{
  color: var(--muted);
  font-size: 12px;
}
#draftSyncLine{
  margin-top: 8px;
}
