/* Auth screen and account chrome for the server-backed app. */
html.auth-screen,
html.auth-screen body {
  overflow: auto;
  height: auto;
  min-height: 100%;
  background:
    radial-gradient(1100px 520px at 50% -12%, rgba(255, 201, 40, 0.18), transparent 62%),
    linear-gradient(180deg, #FBF5EA 0%, #F1E7D6 60%, #F1E7D6 100%);
}

.tv-auth {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: 40px 16px 56px;
  font-family: "Jost", "Josefin Sans", Futura, "Century Gothic", sans-serif;
  color: #1E2A2F;
}

.tv-auth-card {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  min-width: 0;
  flex: 0 1 auto;
  background: #fbf5ea;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(43, 43, 43, 0.14);
  padding: 22px 30px 26px;
  text-align: left;
  margin: 10px 0;
}

.tv-auth-logo {
  display: block;
  width: 260px;
  max-width: 78%;
  margin: 0 auto 4px;
}
.tv-auth-logo img { display: block; width: 100%; height: auto; }

.tv-auth-card h1 {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.tv-auth-tag {
  display: table;
  margin: 6px auto 4px;
  font-family: "Jost", "Josefin Sans", Futura, "Century Gothic", sans-serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.28rem;
  line-height: 1.1;
  color: #1E2A2F;
  background: #F1E7D6;
  padding: 6px 14px 9px;
  transform: rotate(-1.5deg);
  box-shadow: 1px 2px 0 rgba(43, 43, 43, 0.12);
  background-image: linear-gradient(transparent calc(100% - 7px), #F28A3B calc(100% - 7px), #F28A3B calc(100% - 4px), transparent calc(100% - 4px));
  background-size: 86% 100%;
  background-position: 50% 0;
  background-repeat: no-repeat;
  background-color: #FBF5EA;
}
.tv-auth-descriptor {
  display: table;
  margin: 10px auto 14px;
  font-family: "Jost", "Josefin Sans", Futura, "Century Gothic", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fbf5ea;
  background: #1F6B2E;
  padding: 4px 10px 3px;
  border-radius: 3px;
  transform: rotate(1.5deg);
}

.tv-auth-card p.lede {
  text-align: center;
  color: #48565c;
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 20px;
}

.tv-auth form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tv-auth label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #48565c;
}

/* More specific than [hidden], so hidden labels (email on login, password on forgot) stay hidden. */
.tv-auth [hidden] {
  display: none !important;
}

.tv-auth input {
  appearance: none;
  border: 1px solid #c9bba1;
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  color: #1E2A2F;
}

.tv-auth input:focus {
  outline: 2px solid #E8691E;
  outline-offset: 1px;
}

.tv-btn {
  appearance: none;
  border: 1px solid #1E2A2F;
  background: #ffffff;
  color: #1E2A2F;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.tv-btn.primary {
  background: #E8691E;
  border-color: #E8691E;
  color: #ffffff;
}

.tv-btn.primary:hover { background: #C9581A; border-color: #C9581A; }
.tv-btn.secondary { background: #ffffff; border-color: #1E2A2F; color: #1E2A2F; }
.tv-btn.secondary:hover { background: #dce7ea; }
.tv-btn.danger {
  background: #c62828;
  border-color: #a51f1f;
  color: #ffffff;
}
.tv-btn.danger:hover { background: #a51f1f; }
.tv-btn:disabled { opacity: 0.6; cursor: default; }

.tv-modal label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #48565c;
  margin-bottom: 12px;
}
.tv-modal input {
  appearance: none;
  border: 1px solid #e2d6c1;
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem;
  color: #1E2A2F;
}
.tv-modal input:focus {
  outline: 2px solid #E8691E;
  outline-offset: 1px;
}

.tv-auth-error {
  min-height: 1.2em;
  color: #c62828;
  font-size: 0.85rem;
}

.tv-auth-switch {
  margin-top: 8px;
  font-size: 0.88rem;
  color: #48565c;
}

.tv-auth-switch button {
  appearance: none;
  border: 0;
  background: none;
  color: #0e4a5c;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.tv-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 45, 45, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 20px;
}

.tv-modal {
  width: 100%;
  max-width: 420px;
  background: #F1E7D6;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 18px 50px rgba(45, 45, 45, 0.35);
  color: #1E2A2F;
}

.tv-modal h2 {
  font-family: "Jost", "Josefin Sans", Futura, "Century Gothic", sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: #1E2A2F;
  margin-bottom: 10px;
}

.tv-modal p {
  color: #48565c;
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 16px;
}

.tv-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-left: 4px;
}

.account-bar .whoami {
  font-size: 0.82rem;
  color: #F1E7D6;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-bar .save-status {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #F28A3B;
}

.account-bar .save-status[data-kind="saved"] { color: #7fd18f; }
.account-bar .save-status[data-kind="saving"] { color: #f28a3b; }
.account-bar .save-status[data-kind="error"] { color: #fca5a5; }

.account-menu {
  position: relative;
  overflow: visible;
}

.account-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
}

.account-menu-toggle .whoami {
  max-width: 140px;
}

.account-menu-toggle::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #F1E7D6;
  opacity: 0.8;
}

.account-menu-list {
  --am-ink: #1E2A2F;
  --am-navy: #0E4A5C;
  --am-paper: #FBF5EA;
  --am-sand: #F1E7D6;
  --am-mist: #DCE7EA;
  --am-muted: #6B7A74;
  --am-line: #E2D6C1;
  --am-danger: #C62828;
  --am-icon-fingerprint: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2010a2%202%200%200%200-2%202c0%201.02-.1%202.51-.26%204%22%2F%3E%3Cpath%20d%3D%22M14%2013.12c0%202.38%200%206.38-1%208.88%22%2F%3E%3Cpath%20d%3D%22M17.29%2021.02c.12-.6.43-2.3.5-3.02%22%2F%3E%3Cpath%20d%3D%22M2%2012a10%2010%200%200%201%2018-6%22%2F%3E%3Cpath%20d%3D%22M2%2016h.01%22%2F%3E%3Cpath%20d%3D%22M21.8%2016c.2-2%20.131-5.354%200-6%22%2F%3E%3Cpath%20d%3D%22M5%2019.5C5.5%2018%206%2015%206%2012a6%206%200%200%201%20.34-2%22%2F%3E%3Cpath%20d%3D%22M8.65%2022c.21-.66.45-1.32.57-2%22%2F%3E%3Cpath%20d%3D%22M9%206.8a6%206%200%200%201%209%205.2v2%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-map: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M14.106%205.553a2%202%200%200%200%201.788%200l3.659-1.83A1%201%200%200%201%2021%204.619v12.764a1%201%200%200%201-.553.894l-4.553%202.277a2%202%200%200%201-1.788%200l-4.212-2.106a2%202%200%200%200-1.788%200l-3.659%201.83A1%201%200%200%201%203%2019.381V6.618a1%201%200%200%201%20.553-.894l4.553-2.277a2%202%200%200%201%201.788%200z%22%2F%3E%3Cpath%20d%3D%22M15%205.76v16%22%2F%3E%3Cpath%20d%3D%22M9%203.24v16%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-mountain: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m8%203%204%208%205-5%205%2015H2L8%203z%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-trophy: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%209H4.5a2.5%202.5%200%200%201%200-5H6%22%2F%3E%3Cpath%20d%3D%22M18%209h1.5a2.5%202.5%200%200%200%200-5H18%22%2F%3E%3Cpath%20d%3D%22M4%2022h16%22%2F%3E%3Cpath%20d%3D%22M10%2014.66V17c0%20.55-.47.98-.97%201.21C7.85%2018.75%207%2020.24%207%2022%22%2F%3E%3Cpath%20d%3D%22M14%2014.66V17c0%20.55.47.98.97%201.21C16.15%2018.75%2017%2020.24%2017%2022%22%2F%3E%3Cpath%20d%3D%22M18%202H6v7a6%206%200%200%200%2012%200V2Z%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-calendar: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%202v4%22%2F%3E%3Cpath%20d%3D%22M16%202v4%22%2F%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%224%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M3%2010h18%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-download: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203v12%22%2F%3E%3Cpath%20d%3D%22m7%2010%205%205%205-5%22%2F%3E%3Cpath%20d%3D%22M5%2021h14%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-upload: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2021V9%22%2F%3E%3Cpath%20d%3D%22m7%2014%205-5%205%205%22%2F%3E%3Cpath%20d%3D%22M5%203h14%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-mail: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2220%22%20height%3D%2216%22%20x%3D%222%22%20y%3D%224%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22m22%207-8.97%205.7a1.94%201.94%200%200%201-2.06%200L2%207%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-lock: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2218%22%20height%3D%2211%22%20x%3D%223%22%20y%3D%2211%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M7%2011V7a5%205%200%200%201%2010%200v4%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-shield: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%2013c0%205-3.5%207.5-7.66%208.95a1%201%200%200%201-.67-.01C7.5%2020.5%204%2018%204%2013V6a1%201%200%200%201%201-1c2%200%204.5-1.2%206.24-2.72a1.17%201.17%200%200%201%201.52%200C14.51%203.81%2017%205%2019%205a1%201%200%200%201%201%201z%22%2F%3E%3Cpath%20d%3D%22m9%2012%202%202%204-4%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-handshake: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m11%2017%202%202a1%201%200%201%200%203-3%22%2F%3E%3Cpath%20d%3D%22m14%2014%202.5%202.5a1%201%200%201%200%203-3l-3.88-3.88a3%203%200%200%200-4.24%200l-.88.88a1%201%200%201%201-3-3l2.81-2.81a5.79%205.79%200%200%201%207.06-.87l.47.28a2%202%200%200%200%201.42.25L21%204%22%2F%3E%3Cpath%20d%3D%22m21%203%201%2011h-2%22%2F%3E%3Cpath%20d%3D%22M3%203%202%2014l6.5%206.5a1%201%200%201%200%203-3%22%2F%3E%3Cpath%20d%3D%22M3%204h8%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-layers: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m12.83%202.18a2%202%200%200%200-1.66%200L2.6%206.08a1%201%200%200%200%200%201.83l8.58%203.91a2%202%200%200%200%201.66%200l8.58-3.9a1%201%200%200%200%200-1.83z%22%2F%3E%3Cpath%20d%3D%22m22%2017.65-9.17%204.16a2%202%200%200%201-1.66%200L2%2017.65%22%2F%3E%3Cpath%20d%3D%22m22%2012.65-9.17%204.16a2%202%200%200%201-1.66%200L2%2012.65%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%222%22%20ry%3D%222%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%229%22%20r%3D%222%22%2F%3E%3Cpath%20d%3D%22m21%2015-3.086-3.086a2%202%200%200%200-2.828%200L6%2021%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-user-cog: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%229%22%20cy%3D%228%22%20r%3D%223.2%22%2F%3E%3Cpath%20d%3D%22M3.5%2019.5v-.8A5.2%205.2%200%200%201%208.7%2013.5h.6%22%2F%3E%3Ccircle%20cx%3D%2217.5%22%20cy%3D%2216.5%22%20r%3D%222.2%22%2F%3E%3Cpath%20d%3D%22M17.5%2013.4v.8M17.5%2018.8v.8M14.8%2016.5h.8M19.4%2016.5h.8M15.4%2014.4l.6.6M18.9%2017.9l.6.6M15.4%2018.6l.6-.6M18.9%2015.1l.6-.6%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-refresh: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2012a9%209%200%200%201%2015.5-6.36L21%208%22%2F%3E%3Cpath%20d%3D%22M21%203v5h-5%22%2F%3E%3Cpath%20d%3D%22M21%2012a9%209%200%200%201-15.5%206.36L3%2016%22%2F%3E%3Cpath%20d%3D%22M8%2016H3v5%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-trash: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%206h18%22%2F%3E%3Cpath%20d%3D%22M8%206V4a2%202%200%200%201%202-2h4a2%202%200%200%201%202%202v2%22%2F%3E%3Cpath%20d%3D%22M19%206v14a2%202%200%200%201-2%202H7a2%202%200%200%201-2-2V6%22%2F%3E%3Cpath%20d%3D%22M10%2011v6%22%2F%3E%3Cpath%20d%3D%22M14%2011v6%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-logout: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M9%2021H5a2%202%200%200%201-2-2V5a2%202%200%200%201%202-2h4%22%2F%3E%3Cpath%20d%3D%22M16%2017l5-5-5-5%22%2F%3E%3Cpath%20d%3D%22M21%2012H9%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-login: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M15%203h4a2%202%200%200%201%202%202v14a2%202%200%200%201-2%202h-4%22%2F%3E%3Cpath%20d%3D%22M10%2017l5-5-5-5%22%2F%3E%3Cpath%20d%3D%22M15%2012H3%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-signup: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.75%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M16%2021v-2a4%204%200%200%200-4-4H6a4%204%200%200%200-4%204v2%22%2F%3E%3Ccircle%20cx%3D%229%22%20cy%3D%227%22%20r%3D%224%22%2F%3E%3Cpath%20d%3D%22M19%208v6%22%2F%3E%3Cpath%20d%3D%22M22%2011h-6%22%2F%3E%3C%2Fsvg%3E");
  --am-icon-chevron: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m9%2018%206-6-6-6%22%2F%3E%3C%2Fsvg%3E");
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 360px;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 96px);
  display: flex;
  flex-direction: column;
  background: var(--am-paper);
  border: 1px solid var(--am-line);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(30, 42, 47, 0.18), 0 2px 8px rgba(30, 42, 47, 0.06);
  overflow: hidden;
  z-index: 80;
  font-family: "Jost", "Josefin Sans", Futura, "Century Gothic", sans-serif;
  color: var(--am-ink);
}
.account-menu-list[hidden] { display: none !important; }

.account-menu-banner {
  flex: 0 0 auto;
  height: 92px;
  background: var(--am-paper);
  pointer-events: none;
}
.account-menu-banner svg {
  display: block;
  width: 100%;
  height: 100%;
}

.account-menu-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 8px 8px;
}

.account-menu-section {
  padding: 6px 0 8px;
}
.account-menu-section + .account-menu-section {
  border-top: 1px solid var(--am-line);
  margin-top: 2px;
  padding-top: 8px;
}
.account-menu-section:not(:has(.account-menu-item:not([hidden]))) {
  display: none;
}

.account-menu-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 4px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--am-muted);
  line-height: 1;
}
.account-menu-heading::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}
.account-menu-section-danger .account-menu-heading {
  color: var(--am-danger);
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--am-ink);
  padding: 9px 10px;
  min-height: 40px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.account-menu-item[hidden] { display: none !important; }
.account-menu-item:hover,
.account-menu-item:focus-visible,
.account-menu-item[aria-pressed="true"] {
  background: var(--am-mist);
  outline: none;
}
.account-menu-item::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  -webkit-mask: var(--am-icon, var(--am-icon-map)) center / contain no-repeat;
  mask: var(--am-icon, var(--am-icon-map)) center / contain no-repeat;
}
.account-menu-item::after {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: auto;
  background-color: #8A9498;
  -webkit-mask: var(--am-icon-chevron) center / contain no-repeat;
  mask: var(--am-icon-chevron) center / contain no-repeat;
}
.account-menu-item:has(.dna-badge)::after { margin-left: 0; }

#menu-travel-dna, .account-menu-item[data-icon="fingerprint"] { --am-icon: var(--am-icon-fingerprint); }
#menu-share-map, .account-menu-item[data-icon="map"] { --am-icon: var(--am-icon-map); }
#menu-territories, .account-menu-item[data-icon="mountain"] { --am-icon: var(--am-icon-mountain); }
#menu-rankings, .account-menu-item[data-icon="trophy"] { --am-icon: var(--am-icon-trophy); }
#menu-trip-history, .account-menu-item[data-icon="calendar"] { --am-icon: var(--am-icon-calendar); }
#menu-import, .account-menu-item[data-icon="download"] { --am-icon: var(--am-icon-download); }
#menu-export, .account-menu-item[data-icon="upload"] { --am-icon: var(--am-icon-upload); }
#btn-account-email, .account-menu-item[data-icon="mail"] { --am-icon: var(--am-icon-mail); }
#btn-change-password, .account-menu-item[data-icon="lock"] { --am-icon: var(--am-icon-lock); }
#menu-privacy, .account-menu-item[data-icon="shield"] { --am-icon: var(--am-icon-shield); }
#menu-disclosure, .account-menu-item[data-icon="handshake"] { --am-icon: var(--am-icon-handshake); }
#menu-curate, .account-menu-item[data-icon="layers"] { --am-icon: var(--am-icon-layers); }
#menu-photo-admin, .account-menu-item[data-icon="image"] { --am-icon: var(--am-icon-image); }
#btn-admin-reset, .account-menu-item[data-icon="user-cog"] { --am-icon: var(--am-icon-user-cog); }
#menu-reset, .account-menu-item[data-icon="refresh"] { --am-icon: var(--am-icon-refresh); }
#btn-delete-account, .account-menu-item[data-icon="trash"] { --am-icon: var(--am-icon-trash); }
#btn-logout, .account-menu-item[data-icon="logout"] { --am-icon: var(--am-icon-logout); }
#btn-guest-login, .account-menu-item[data-icon="login"] { --am-icon: var(--am-icon-login); }
#btn-guest-signup, .account-menu-item[data-icon="signup"] { --am-icon: var(--am-icon-signup); }

.account-menu-item.danger,
.account-menu-section-danger .account-menu-item {
  color: var(--am-danger);
  font-weight: 400;
}
.account-menu-item.danger:hover,
.account-menu-section-danger .account-menu-item:hover,
.account-menu-item.danger:focus-visible,
.account-menu-section-danger .account-menu-item:focus-visible {
  background: #fde2e2;
}

.account-menu-logout {
  flex: 0 0 auto;
  margin: 0 8px 8px;
  padding: 4px;
  background: var(--am-sand);
  border-radius: 12px;
}
.account-menu-logout:not(:has(.account-menu-item:not([hidden]))) { display: none; }
.account-menu-logout .account-menu-item { min-height: 42px; font-weight: 500; }
.account-menu-logout .account-menu-item::after { content: none; }
.account-menu-logout .account-menu-item:hover,
.account-menu-logout .account-menu-item:focus-visible {
  background: rgba(14, 74, 92, 0.08);
}

html.guest-mode .account-menu-logout,
html.guest-mode .account-menu-section-danger {
  display: none !important;
}

@media (max-width: 520px) {
  .account-menu-list {
    max-height: calc(100dvh - 76px);
  }
  .account-menu-banner { height: 64px; }
  .account-menu-item { min-height: 40px; padding: 8px 10px; }
  .account-menu-scroll { padding-bottom: 6px; }
}

.tv-auth-divider {
  margin: 16px 0 14px;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #55636a;
  position: relative;
}
.tv-auth-divider::before,
.tv-auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 20%;
  height: 1px;
  background: #e2d6c1;
}
.tv-auth-divider::before { left: 0; }
.tv-auth-divider::after { right: 0; }

#tv-guest-explore {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  font-size: 1rem;
}

#tv-guest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 7px 14px;
  background: #1F6B2E;
  color: #F1E7D6;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 214, 160, 0.18);
  z-index: 45;
}
#tv-guest-banner .tv-guest-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
#tv-guest-banner button {
  appearance: none;
  border: 1px solid rgba(255, 214, 160, 0.35);
  background: transparent;
  color: #F1E7D6;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
#tv-guest-banner #tv-guest-banner-signup {
  background: #E8691E;
  border-color: #E8691E;
  color: #F1E7D6;
}

#tv-guest-nudge {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 560px);
  background: #1E2A2F;
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font: 0.9rem "Jost", "Josefin Sans", Futura, "Century Gothic", sans-serif;
}
#tv-guest-nudge .tv-guest-nudge-x {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px;
  margin: 0;
  cursor: pointer;
}
#tv-guest-nudge #tv-guest-nudge-text { margin: 0; flex: 1 1 auto; min-width: 0; }
#tv-guest-nudge .tv-guest-nudge-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; flex-shrink: 0; }
#tv-guest-nudge .tv-btn { padding: 6px 12px; font-size: 0.82rem; white-space: nowrap; }

@media (max-width: 840px) {
  #tv-guest-nudge {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: min(calc(100vw - 24px), 360px);
    max-width: calc(100vw - 24px);
    max-height: min(40vh, 280px);
    overflow: auto;
    padding: 12px 14px 14px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  #tv-guest-nudge .tv-guest-nudge-x {
    display: block;
    position: absolute;
    top: 4px;
    right: 6px;
    min-width: 44px;
    min-height: 44px;
  }
  #tv-guest-nudge { position: fixed; }
  #tv-guest-nudge #tv-guest-nudge-text {
    padding-right: 36px;
    font-size: 0.9rem;
    line-height: 1.35;
  }
  #tv-guest-nudge .tv-guest-nudge-actions { width: 100%; }
  #tv-guest-nudge .tv-btn {
    flex: 1 1 0;
    min-height: 44px;
    padding: 10px 12px;
  }
  .pe-bn-link { min-height: 44px; box-sizing: border-box; }
}

html.guest-mode #menu-export,
html.guest-mode #menu-import,
html.guest-mode #menu-reset,
html.guest-mode #btn-logout,
html.guest-mode #btn-delete-account,
html.guest-mode .btn-add-photos {
  display: none !important;
}

.tv-auth-forgot {
  margin: -4px 0 0;
  text-align: right;
}
.tv-auth-forgot button {
  appearance: none;
  border: 0;
  background: none;
  color: #0e4a5c;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}
.tv-auth-error.tv-auth-ok {
  color: #1F6B2E;
}
.tv-hint {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: #78716c;
}
.tv-reset-url {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin: 0 0 12px;
}
.tv-reset-url input {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
}

.tv-auth-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 18px;
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  min-width: 0;
  flex: none;
  margin: 16px 0 8px;
  padding: 0 8px;
  text-align: center;
  font-size: 13px;
}
.tv-auth-legal a {
  color: #fbf5ea;
  text-decoration: none;
  font-weight: 600;
  text-underline-offset: 2px;
}
.tv-auth-legal a:hover { text-decoration: underline; }
.account-menu-list .menu-legal { display: contents; }

@media (max-width: 520px) {
  .tv-auth { padding: 20px 16px 28px; }
  .tv-auth-legal { margin-top: 14px; gap: 8px 16px; }
}
