:root {
  --accent: #58E46D;
  --accent-rgb: 88, 228, 109;
  --accent-soft: rgba(88, 228, 109, .12);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #080808;
  color: #fff;
}

.brand-accent { color: var(--accent); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #080808;
}

body {
  display: grid;
  place-items: center;
  overflow: auto;
}

button, input { font: inherit; }

.stage {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 28px;
}

.app-shell {
  width: 600px;
  height: 600px;
  position: relative;
  overflow: hidden;
  padding: 24px 26px 26px;
  display: grid;
  grid-template-rows: 56px 1fr;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 26px 80px rgba(0,0,0,.58);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
}

.brand {
  padding-top: 8px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .20em;
  opacity: .62;
}

.tabs {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.tab {
  appearance: none;
  border: 0;
  padding: 5px 3px 8px;
  background: transparent;
  color: rgba(255,255,255,.42);
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: .09em;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-divider {
  padding-top: 4px;
  color: rgba(255,255,255,.22);
}

.count-label {
  padding-top: 8px;
  padding-right: 9px;
  text-align: right;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .10em;
  opacity: .52;
}

.content {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) 1px minmax(0, .92fr);
  gap: 22px;
  align-items: stretch;
}

.pane-divider {
  width: 1px;
  height: 64%;
  align-self: start;
  margin-top: 36px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.12) 14%, rgba(255,255,255,.12) 86%, transparent);
}

.list-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 60px;
}

.list-view {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
}

.list-item,
.add-row {
  position: relative;
  width: 100%;
  min-height: 57px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 9px 9px 0;
  padding: 7px 9px 7px 12px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  background: transparent;
  color: rgba(255,255,255,.48);
  text-align: left;
  transition: opacity 150ms ease, transform 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.list-item.selected,
.add-row.selected {
  color: #fff;
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(var(--accent-rgb),.13), rgba(var(--accent-rgb),.025));
  transform: translateX(3px);
}

.cursor {
  font-size: 22px;
  font-weight: 750;
  opacity: 0;
  transform: translateX(-2px);
}

.selected .cursor { opacity: .9; }

.item-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 720;
  line-height: 1.05;
}

.item-note {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 550;
  opacity: .50;
}

.item-qty {
  min-width: 25px;
  text-align: right;
  font-size: 17px;
  font-weight: 850;
  opacity: .85;
}

.list-item::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 38px;
  right: 8px;
  top: 50%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

.list-item.done { color: rgba(255,255,255,.38); }
.list-item.done::after { transform: scaleX(1); }
.list-item.done.selected { color: rgba(255,255,255,.82); }

.list-item.completing::after {
  animation: drawStrike 250ms cubic-bezier(.22,.8,.35,1) forwards;
}

.list-item.restoring::after {
  transform-origin: right center;
  animation: eraseStrike 200ms ease forwards;
}

.glint-star {
  position: absolute;
  z-index: 3;
  right: 16px;
  top: calc(50% - 17px);
  font-size: 23px;
  opacity: 0;
  transform: scale(.2) rotate(-25deg);
  pointer-events: none;
  color: var(--accent);
}

.list-item.completing .glint-star {
  animation: glint 360ms 125ms ease-out forwards;
}

.list-item.moving-to-done { animation: moveRight 190ms ease-in forwards; }
.list-item.moving-to-todo { animation: moveLeft 190ms ease-in forwards; }

@keyframes drawStrike { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes eraseStrike { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes glint {
  0% { opacity: 0; transform: scale(.2) rotate(-25deg); }
  38% { opacity: 1; transform: scale(1.15) rotate(5deg); }
  100% { opacity: 0; transform: scale(.6) rotate(22deg); }
}
@keyframes moveRight { to { opacity: 0; transform: translateX(38px) scale(.98); } }
@keyframes moveLeft { to { opacity: 0; transform: translateX(-38px) scale(.98); } }

.add-row {
  grid-template-columns: 24px 1fr;
  margin-top: 3px;
  min-height: 51px;
  cursor: pointer;
}

.add-label {
  font-size: 15px;
  font-weight: 850;
  letter-spacing: .08em;
}

.reset-row {
  position: relative;
  width: 100%;
  min-height: 51px;
  margin-top: 5px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 9px 9px 0;
  padding: 7px 9px 7px 12px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 9px;
  background: transparent;
  color: rgba(255,255,255,.48);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.reset-row.selected {
  color: #fff;
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(var(--accent-rgb),.13), rgba(var(--accent-rgb),.025));
  transform: translateX(3px);
}

.reset-row.selected .cursor { opacity: .9; }

.reset-label {
  font-size: 15px;
  font-weight: 850;
  letter-spacing: .08em;
}

.empty-row {
  padding: 18px 12px 18px 45px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  opacity: .35;
}

.hero-pane {
  min-width: 0;
  min-height: 0;
  padding: 57px 2px 34px 0;
  display: flex;
  align-items: flex-start;
}

.hero-content {
  min-width: 0;
  width: 100%;
  display: grid;
  align-content: start;
  gap: 9px;
  padding-top: 48px;
}

.hero-qty {
  position: relative;
  width: fit-content;
  max-width: 100%;
  font-size: 54px;
  font-weight: 900;
  line-height: .88;
  letter-spacing: -.045em;
}

.hero-name {
  position: relative;
  width: fit-content;
  max-width: 100%;
  font-size: clamp(26px, 5.8vw, 36px);
  font-weight: 900;
  line-height: .94;
  letter-spacing: -.025em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.hero-note {
  max-width: 210px;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.25;
  opacity: .55;
}

.hero-options-affordance {
  margin-top: 22px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  opacity: .24;
}

.hero-content.done .hero-qty,
.hero-content.done .hero-name { opacity: .60; }

.hero-content.done .hero-qty::after,
.hero-content.done .hero-name::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -3px;
  top: 52%;
  height: 1px;
  background: currentColor;
}

.utility-row .item-qty { color: var(--accent); min-width: 62px; text-align: right; }
.utility-row.sounds-off .item-qty { color: rgba(255,255,255,.38); }
.hero-settings-icon { color: var(--accent); font-size: 48px; font-weight: 900; margin-bottom: 14px; }
.hero-account-email { color: rgba(255,255,255,.72); font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; margin-top: 14px; }
.hero-add-icon,
.hero-reset-icon {
  font-size: 48px;
  font-weight: 250;
  line-height: .8;
  opacity: .92;
}

.hero-add-title {
  margin-top: 4px;
  font-size: 29px;
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.02em;
  text-transform: uppercase;
}

.hero-add-copy {
  max-width: 205px;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
  opacity: .50;
}

.hero-empty-mark {
  font-size: 42px;
  line-height: 1;
  opacity: .72;
}

.hero-empty-title {
  margin-top: 6px;
  font-size: 27px;
  font-weight: 880;
  line-height: 1;
  text-transform: uppercase;
}

.menu-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 64px;
  background: rgba(0,0,0,.78);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.menu-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.menu-card {
  width: 100%;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px;
  background: rgba(5,5,5,.98);
  padding: 24px;
  box-shadow: 0 18px 60px rgba(0,0,0,.65);
}

.menu-kicker {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
  opacity: .42;
}

.menu-title {
  margin-top: 8px;
  margin-bottom: 20px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.menu-options {
  display: grid;
  gap: 7px;
}

.menu-option {
  width: 100%;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  padding: 12px 12px 12px 6px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: rgba(255,255,255,.48);
  text-align: left;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: .06em;
}

.menu-option.selected {
  color: #fff;
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(var(--accent-rgb),.13), rgba(var(--accent-rgb),.025));
}

.menu-option.danger.selected { color: #fff; }
.menu-option.danger:not(.selected) { color: rgba(255,255,255,.42); }
.menu-cursor { opacity: 0; font-size: 20px; }
.menu-option.selected .menu-cursor { opacity: .9; }

.screen-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent 35%, rgba(255,255,255,.055), transparent 65%);
}

.screen-flash.right { animation: flashRight 240ms ease-out; }
.screen-flash.left { animation: flashLeft 240ms ease-out; }

@keyframes flashRight { from { opacity: .8; transform: translateX(-20%); } to { opacity: 0; transform: translateX(35%); } }
@keyframes flashLeft { from { opacity: .8; transform: translateX(20%); } to { opacity: 0; transform: translateX(-35%); } }

.desktop-hints {
  width: 600px;
  display: flex;
  justify-content: center;
  gap: 18px;
  color: rgba(255,255,255,.46);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
}

.edit-dialog {
  width: min(500px, calc(100vw - 32px));
  border: 1px solid rgba(255,255,255,.50);
  border-radius: 18px;
  background: #080808;
  color: #fff;
  padding: 0;
  box-shadow: 0 25px 80px rgba(0,0,0,.65);
}

.edit-dialog::backdrop { background: rgba(0,0,0,.78); }

.edit-form {
  padding: 24px;
  display: grid;
  gap: 14px;
}

.dialog-kicker {
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .18em;
  opacity: .45;
}

.edit-form label {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .02em;
}

.edit-form .secondary-label {
  margin-top: 2px;
  font-size: 13px;
  letter-spacing: .08em;
}

.secondary-label span {
  margin-left: 5px;
  font-size: 9px;
  opacity: .42;
}

.edit-form input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 12px;
  background: #000;
  color: #fff;
  padding: 14px;
  font-size: 20px;
  outline: none;
}

.edit-form input:focus { border-color: #fff; }

.composer-note {
  margin: -2px 0 2px;
  font-size: 12px;
  line-height: 1.4;
  opacity: .48;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions button {
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  padding: 9px 14px;
  font-weight: 800;
  cursor: pointer;
}

.dialog-actions #confirmAdd,
.dialog-actions #confirmEdit {
  background: #fff;
  color: #000;
}

@media (max-width: 700px), (max-height: 700px) {
  html, body { background: #000; }
  body { display: block; overflow: hidden; }
  .stage { padding: 0; display: block; }
  .app-shell {
    width: 100vw;
    height: 100vh;
    min-width: 0;
    min-height: 0;
    box-shadow: none;
  }
  .desktop-hints { display: none; }
}

@media (max-width: 520px), (max-height: 520px) {
  .app-shell { padding: 18px 18px 20px; grid-template-rows: 48px 1fr; }
  .brand { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .tabs { justify-content: start; }
  .content { grid-template-columns: minmax(0, 1fr) 1px minmax(0, .88fr); gap: 14px; }
  .list-pane { padding-top: 38px; }
  .list-item, .add-row { min-height: 49px; }
  .item-name { font-size: 17px; }
  .hero-pane { padding-top: 38px; }
  .hero-content { padding-top: 38px; }
  .hero-qty { font-size: 46px; }
  .hero-name { font-size: 27px; }
  .menu-overlay { padding: 38px; }
}

/* ---------- Phase 2A: multiple reusable lists ---------- */
.lists-heading {
  padding-top: 5px;
  padding-bottom: 8px;
  color: #fff;
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: .09em;
  border-bottom: 2px solid var(--accent);
}

.list-selector-row .item-name {
  text-transform: uppercase;
  font-size: 18px;
}

.list-selector-row .item-note {
  text-transform: uppercase;
  letter-spacing: .06em;
}

.back-row {
  position: relative;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 9px 9px 0;
  padding: 6px 9px 6px 12px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  background: transparent;
  color: rgba(255,255,255,.42);
  text-align: left;
  transition: opacity 150ms ease, transform 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.back-row.selected {
  color: #fff;
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(var(--accent-rgb),.13), rgba(var(--accent-rgb),.025));
  transform: translateX(3px);
}

.back-row.selected .cursor { opacity: .9; }

.back-label {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .10em;
}

.hero-list-count {
  width: fit-content;
  max-width: 100%;
  font-size: 54px;
  font-weight: 900;
  line-height: .88;
  letter-spacing: -.045em;
}

.hero-back-mark {
  font-size: 52px;
  font-weight: 300;
  line-height: .7;
  opacity: .9;
}

.menu-title { white-space: pre-line; }

/* ---------- Phase 2B: desktop-only cloud status ---------- */
.cloud-status {
  margin-top: 8px;
  min-height: 16px;
  color: rgba(255,255,255,.55);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cloud-status[data-state="ready"] { color: rgba(255,255,255,.82); }
.cloud-status[data-state="syncing"] { color: rgba(255,255,255,.68); }
.cloud-status[data-state="offline"] { color: rgba(255,255,255,.44); }

@media (max-width: 700px), (max-height: 700px) {
  .cloud-status { display: none; }
}


/* ---------- Phase 2B.1: account authentication ---------- */
.auth-dialog { width: min(520px, calc(100vw - 28px)); }
.auth-message[data-state="error"] { color: #fff; opacity: .95; }
.auth-message[data-state="success"] { color: #fff; opacity: .78; }
.auth-actions { justify-content: space-between; }
.auth-actions #confirmSignIn,
#savePassword { background: #fff; color: #000; }
.text-button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.58);
  padding: 2px 0;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  cursor: pointer;
}
.text-button:hover, .text-button:focus { color: #fff; }

/* Phase 2B.3 phone-to-glasses pairing */
.pair-dialog .pair-card { text-align: center; min-width: min(82vw, 450px); }
.pair-title { color: #c8cdd2; font-size: 13px; font-weight: 800; letter-spacing: 1.7px; margin-top: 8px; }
.pair-code { color: #fff; font-size: clamp(44px, 9vw, 72px); font-weight: 900; letter-spacing: 8px; line-height: 1; margin: 30px 0 22px; font-variant-numeric: tabular-nums; }
.pair-message { max-width: 380px; margin-left: auto; margin-right: auto; }
.pair-waiting { color: #747b83; font-size: 11px; font-weight: 900; letter-spacing: 1.6px; margin-top: 26px; }
