:root {
  color-scheme: dark;
  --bg: #100e18;
  --bg-elev: #1a1725;
  --bg-elev-2: #221e30;
  --border: #2e2a3f;
  --text: #f2eefb;
  --text-dim: #a79fc0;
  --text-faint: #766e8d;
  --accent: #ff7a45;
  --accent-2: #34d1bf;
  --danger: #ff5c7a;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --sfa-fg: var(--text);
  --sfa-bg: var(--bg-elev-2);
  --sfa-bg-hover: var(--bg-elev);
  --sfa-line: var(--border);
  --sfa-line-hover: var(--text-faint);
  --sfa-accent: var(--accent);
  --sfa-accent-ink: #1a0d06;
  --sfa-pop-bg: var(--bg-elev);
  --sfa-pop-fg: var(--text);
  --sfa-danger: var(--danger);
  --sfa-shadow: var(--shadow);
}

* {
  box-sizing: border-box;
}

/* refer CODE_NOTES.txt #1 */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  padding-bottom: calc(24px + var(--safe-bottom));
  background-image: radial-gradient(circle at 15% -10%, rgba(255, 122, 69, 0.14), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(52, 209, 191, 0.1), transparent 35%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

img {
  max-width: 100%;
}

/* refer CODE_NOTES.txt #2 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(16px + var(--safe-top)) 20px 14px;
  background: linear-gradient(var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
}

.topbar h1 {
  font-size: 22px;
  margin: 0;
  flex: 1;
  min-width: 0;
  letter-spacing: -0.02em;
  /* refer CODE_NOTES.txt #3 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--bg-elev-2);
  display: grid;
  place-items: center;
  font-size: 15px;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* refer CODE_NOTES.txt #4 */
.logo-mark {
  width: 62%;
  height: 62%;
  color: var(--accent);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

/* refer CODE_NOTES.txt #5 */
.share-icon,
.link-plus-icon {
  width: 1.1em;
  height: 1.1em;
  color: currentColor;
}

.icon-btn:active {
  transform: scale(0.94);
}

/* refer CODE_NOTES.txt #6 */
@media (hover: hover) {
  .icon-btn:hover {
    background: var(--bg-elev-2);
    border-color: var(--accent);
  }
}

main {
  padding: 0 20px 40px;
  max-width: 720px;
  margin: 0 auto;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  display: inline-block;
  margin-right: 6px;
  transition: background 0.3s;
}

.sync-dot.online {
  background: var(--accent-2);
}

.sync-dot.syncing {
  background: var(--accent);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* refer CODE_NOTES.txt #7 */

.fab {
  position: fixed;
  right: 20px;
  bottom: calc(24px + var(--safe-bottom));
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1006;
  border: none;
  font-size: 28px;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px -8px rgba(255, 122, 69, 0.55);
  cursor: pointer;
  z-index: 20;
}

.fab:active {
  transform: scale(0.94);
}

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 28px 0 12px;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  color: var(--text-dim);
  font-size: 11px;
}

/* refer CODE_NOTES.txt #8 */

.cat-section {
  margin-bottom: 16px;
  padding: 14px 14px 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease;
}

.cat-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.cat-section-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cat-section-icon {
  font-size: 17px;
  flex-shrink: 0;
}

.cat-section-name {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-section-count {
  font-size: 12px;
  color: var(--text-faint);
  background: var(--bg-elev-2);
  border-radius: 999px;
  padding: 2px 8px;
}

.cat-section-action {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.15s ease;
}

/* refer CODE_NOTES.txt #9 */
.cat-section-action[data-action="delete"] {
  color: var(--danger);
}

.cat-section-action:active {
  background: var(--bg-elev-2);
}

.cat-section-empty {
  color: var(--text-faint);
  font-size: 13px;
  padding: 10px 4px;
  margin: 0;
}

.link-row-list {
  display: flex;
  flex-direction: column;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.link-row:last-child {
  border-bottom: none;
}

.link-row-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
}

@media (hover: hover) {
  .link-row-open:hover {
    background: var(--bg-elev-2);
  }
}

.link-row-thumb,
.link-row-thumb-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  background: var(--bg-elev-2);
}

.link-row-thumb-placeholder {
  display: grid;
  place-items: center;
  font-size: 18px;
}

.link-row-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.link-row-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-faint);
  min-width: 0;
}

/* refer CODE_NOTES.txt #10 */
.link-row-meta .pill {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-row-meta span:last-child {
  flex-shrink: 0;
  white-space: nowrap;
}

.link-row-edit {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 15px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.15s ease;
}

.link-row-edit:active {
  background: var(--bg-elev-2);
}

.link-row-delete {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--danger);
  font-size: 15px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.15s ease;
}

.link-row-delete:active {
  background: rgba(255, 92, 122, 0.18);
}

@media (hover: hover) {
  .link-row-edit:hover {
    background: var(--bg-elev-2);
  }
  .link-row-delete:hover {
    background: rgba(255, 92, 122, 0.18);
  }
  .cat-section-action:hover {
    background: var(--bg-elev-2);
  }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
}

.empty-state .emoji {
  font-size: 44px;
  display: block;
  margin-bottom: 12px;
}

/* refer CODE_NOTES.txt #11 */

.item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.item-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}

.item-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.item-card-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: var(--bg-elev-2);
}

.item-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card-text {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-faint);
  min-width: 0;
}

.item-card-meta .pill {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-card-meta span:last-child {
  flex-shrink: 0;
  white-space: nowrap;
}

/* refer CODE_NOTES.txt #12 */

.auth-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  max-width: 420px;
  margin: 0 auto;
}

/* refer CODE_NOTES.txt #13 */
@media (min-width: 720px) {
  .auth-shell {
    max-width: 620px;
    padding: 48px 64px;
    margin: 40px auto;
    min-height: 0;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  body.auth-page {
    justify-content: center;
  }

  body.auth-page .auth-shell {
    flex: 0 0 auto;
  }
}

/* refer CODE_NOTES.txt #14 */
body.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

body.auth-page .auth-shell {
  min-height: 0;
  flex: 1 1 auto;
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.auth-logo .brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  font-size: 30px;
  box-shadow: 0 0 0 1px var(--border), 0 14px 32px -12px color-mix(in srgb, var(--accent) 45%, transparent);
}

.auth-logo h1 {
  font-size: 24px;
  margin: 0;
  letter-spacing: -0.02em;
}

.auth-logo p {
  color: var(--text-dim);
  margin: 0;
  font-size: 14px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #1a1006;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, background-color 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn.secondary {
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.danger {
  background: var(--danger);
  color: #240009;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

@media (hover: hover) {
  .btn:not(:disabled):hover {
    filter: brightness(1.08);
  }
  .btn.secondary:not(:disabled):hover,
  .btn.ghost:not(:disabled):hover {
    background: var(--bg-elev);
    border-color: var(--accent);
    filter: none;
  }
}

.google-auth-icon,
.facebook-auth-icon,
.discord-auth-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* refer CODE_NOTES.txt #15 */
.google-auth-btn,
.facebook-auth-btn {
  margin-bottom: 10px;
}
.discord-panel[hidden] { display: none; }
.settings-note { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin: 8px 0; }
.discord-panel h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; text-align: center; }
.discord-panel > p:first-of-type { color: var(--text-dim); font-size: 14px; line-height: 1.55; margin: 0 0 16px; text-align: center; }
.discord-panel .btn { margin-top: 14px; }
.discord-panel > p:first-of-type a { color: var(--accent); text-decoration: underline; }

/* refer CODE_NOTES.txt #16 */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
  transition: opacity 0.15s ease;
}

@media (hover: hover) {
  .link-btn:hover {
    opacity: 0.75;
  }
}

/* refer CODE_NOTES.txt #17 */
.feature-locked {
  opacity: 0.45;
  cursor: pointer;
}

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-dim);
}

.error-box {
  background: rgba(255, 92, 122, 0.12);
  border: 1px solid rgba(255, 92, 122, 0.4);
  color: #ffb4c2;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

.error-box.show {
  display: block;
  animation: error-box-in 0.2s ease;
}

@keyframes error-box-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.share-saved-banner {
  background: rgba(52, 209, 191, 0.12);
  border: 1px solid rgba(52, 209, 191, 0.4);
  color: var(--accent-2);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 14px;
}

/* refer CODE_NOTES.txt #18 */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 10, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.sheet-backdrop.open {
  display: flex;
}

.sheet {
  width: 100%;
  max-width: 480px;
  background: var(--bg-elev);
  border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(28px + var(--safe-bottom));
  max-height: 82dvh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-bottom: none;
  animation: sheet-up 0.22s ease;
}

@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  margin: 0 auto 16px;
}

.sheet h2 {
  margin: 0 0 16px;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.category-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 16px;
}

.category-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  border: 1px solid transparent;
  cursor: pointer;
}

.category-picker-item.selected {
  border-color: var(--accent);
}

.category-picker-item .icon {
  font-size: 18px;
}

/* refer CODE_NOTES.txt #19 */

.share-preview {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.share-preview img,
.share-preview .placeholder {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-elev-2);
  display: grid;
  place-items: center;
  font-size: 26px;
  flex-shrink: 0;
}

.share-preview-body {
  min-width: 0;
}

.share-preview-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.share-preview-url {
  font-size: 12px;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

/* refer CODE_NOTES.txt #20 */

.category-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.category-hero h1 {
  margin: 0;
  font-size: 21px;
}

.category-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.category-actions .btn {
  width: auto;
  padding: 10px 16px;
  font-size: 13px;
}

/* refer CODE_NOTES.txt #21 */

.legal-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-dim);
}

.legal-updated {
  font-size: 12px;
  color: var(--text-faint);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
}

.legal-page h2 {
  font-size: 16px;
  color: var(--text);
  margin: 28px 0 8px;
}

.legal-page h2:first-of-type {
  margin-top: 0;
}

.legal-page a {
  color: var(--accent);
}

.legal-page ul {
  margin: 8px 0;
  padding-left: 22px;
}

.legal-page li {
  margin: 4px 0;
}

/* refer CODE_NOTES.txt #22 */

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 15px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.settings-row:last-child {
  margin-bottom: 0;
}

.settings-label {
  font-size: 14px;
  color: var(--text-dim);
}

.settings-value {
  font-size: 14px;
  font-weight: 600;
}

.share-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.share-link-row input {
  flex: 1;
  /* refer CODE_NOTES.txt #23 */
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
}

.share-link-row-full {
  margin-bottom: 14px;
}

.share-link-row-full .share-link-row {
  margin-bottom: 6px;
}

.share-link-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 0 4px;
  font-size: 13px;
  color: var(--text-dim);
}

.share-tag-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  margin-bottom: 18px;
  /* refer CODE_NOTES.txt #24 */
  max-height: 150px;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
}

.share-tag-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  font-size: 13px;
  cursor: pointer;
  /* refer CODE_NOTES.txt #25 */
  flex: 0 0 auto;
}

.share-tag-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.share-tag-select-all {
  padding: 6px 12px;
  white-space: nowrap;
  border-style: dashed;
  color: var(--text-dim);
}

.share-opts-row {
  display: flex;
  gap: 10px;
}
.share-opts-row .field {
  margin-bottom: 10px;
}
.share-opt-small {
  flex: 0 0 150px;
}
.share-people-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.share-people-input input {
  width: 64px;
  min-width: 0;
}
.share-people-input span {
  font-size: 13px;
  color: var(--text-dim);
}
.share-opt-grow {
  flex: 1 1 auto;
  min-width: 0;
}
.share-webhook-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  margin: 0 2px 14px;
  cursor: pointer;
}
.share-webhook-toggle small {
  color: var(--text-faint);
}
.share-webhook-toggle input {
  accent-color: var(--accent);
  margin-top: 2px;
}

.share-tag-option input {
  accent-color: var(--accent);
}

/* refer CODE_NOTES.txt #26 */
.link-row-list-readonly .link-row-edit,
.link-row-list-readonly .link-row-delete {
  display: none;
}

/* refer CODE_NOTES.txt #27 */

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 16px;
}

.note-row {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}

.note-row-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.note-row-author {
  font-weight: 700;
  font-size: 13px;
}

.note-row-time {
  font-size: 11px;
  color: var(--text-faint);
}

.note-row-text {
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.note-row-actions {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}

.note-edit-input {
  width: 100%;
}


/* refer CODE_NOTES.txt #28 */
.add-mode-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.add-mode-btn {
  flex: 1;
  padding: 8px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  cursor: pointer;
}
.add-mode-btn.active { background: var(--accent); color: #1a1208; }

/* refer CODE_NOTES.txt #29 */
.rich-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  overflow: hidden;
}
.rich-toolbar {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
}
.rich-toolbar button {
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
}
.rich-toolbar button:hover { background: var(--bg-elev); color: var(--text); }
.rich-area {
  min-height: 72px;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  outline: none;
  word-break: break-word;
}
.rich-area:empty::before {
  content: attr(data-placeholder);
  color: var(--text-faint);
  pointer-events: none;
}
.rich-area ul, .rich-area ol, .note-row-text ul, .note-row-text ol { margin: 4px 0; padding-left: 22px; }
.rich-area a, .note-row-text a { color: var(--accent-2); text-decoration: underline; }
.note-row-text div, .note-row-text p { margin: 0; }
.rich-area img, .note-row-text img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin: 6px 0;
  border-radius: 8px;
  object-fit: contain;
}
.rich-area img.img-broken, .note-row-text img.img-broken { min-height: 40px; min-width: 120px; border: 1px dashed var(--border); }

/* refer CODE_NOTES.txt #30 */

#toast-host {
  position: fixed;
  top: calc(76px + var(--safe-top));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}

.toast {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-error {
  border-color: rgba(255, 92, 122, 0.5);
  color: #ffb4c2;
}

.toast-success {
  border-color: rgba(52, 209, 191, 0.5);
}

/* refer CODE_NOTES.txt #31 */

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.swatch {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 17px;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--bg-elev-2);
}

.swatch.color-swatch {
  font-size: 0;
}

.swatch.selected {
  border-color: var(--text);
}

.tag-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

/* refer CODE_NOTES.txt #32 */
.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.tag-chip.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-elev-2));
  color: var(--text);
  font-weight: 600;
}

@media (hover: hover) {
  .tag-chip:not(.selected):hover {
    border-color: var(--text-faint);
    color: var(--text);
  }
}

/* refer CODE_NOTES.txt #33 */

.tag-manage-list {
  margin-bottom: 16px;
}

.tag-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.tag-manage-row:last-child {
  border-bottom: none;
}

.tag-manage-edit,
.tag-manage-delete {
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.tag-manage-delete {
  color: var(--danger);
}

.tag-manage-edit:hover {
  background: var(--bg-elev-2);
}

.tag-manage-delete:hover {
  background: rgba(255, 92, 122, 0.18);
}

/* refer CODE_NOTES.txt #34 */
/* refer CODE_NOTES.txt #35 */

.icon-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.icon-picker-current {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-elev-2);
  font-size: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}

.icon-picker-current img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-picker-edit-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-size: 12px;
  border: 2px solid var(--bg-elev-1, var(--bg));
}

.icon-picker-hint {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* refer CODE_NOTES.txt #36 */

.emoji-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.emoji-tab {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}

.emoji-tab.active {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-elev-2));
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 2px;
  max-height: 38vh;
  overflow-y: auto;
  margin-bottom: 14px;
}

.emoji-item {
  border: none;
  background: none;
  font-size: 22px;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}

.emoji-item:hover {
  background: var(--bg-elev-2);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

.loading-center {
  display: flex;
  justify-content: center;
  padding: 60px 0;
  color: var(--text-faint);
}

.breadcrumbs {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.breadcrumbs a {
  color: var(--text-dim);
}

/* refer CODE_NOTES.txt #37 */
/* refer CODE_NOTES.txt #38 */

body.workspace-page {
  padding-bottom: 0;
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* refer CODE_NOTES.txt #39 */
/* refer CODE_NOTES.txt #40 */

.welcome-screen {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

[data-view="welcome"] .welcome-screen {
  display: block;
}

[data-view="welcome"] .workspace-main {
  display: none;
}

[data-view="welcome"] .guest-banner {
  display: none;
}

[data-view="welcome"] .map-search,
[data-view="welcome"] .map-tag-filter-wrap,
[data-view="grid"] .map-tag-filter-wrap,
[data-view="grid"] #share-board-btn,
[data-view="welcome"] .grid-only-action,
[data-view="welcome"] .map-only-action {
  display: none !important;
}

.welcome-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 36px 24px 40px;
  text-align: center;
}

/* refer CODE_NOTES.txt #41 */
.welcome-hero {
  display: flex;
  flex-direction: column;
}

.welcome-hero-art {
  order: -1;
  max-width: 300px;
  margin: 0 auto 8px;
}

.hero-anim {
  width: 100%;
  height: auto;
  display: block;
}

.welcome-logo {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--bg-elev-2);
  font-size: 30px;
  margin-bottom: 16px;
}

.welcome-inner h1 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.welcome-tagline {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-2);
}

.welcome-body {
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
}

.welcome-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.welcome-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 22px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 14%, var(--bg-elev)), var(--bg-elev));
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.welcome-choice-card:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .welcome-choice-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.65);
  }
}

.welcome-choice-icon {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 4px;
}

.welcome-choice-title {
  font-size: 16px;
  font-weight: 700;
}

.welcome-choice-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
}

.welcome-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--text-faint);
  text-align: left;
}

.welcome-features li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.welcome-features a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.welcome-features li::before {
  content: "";
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* The memory-palace note is marked with an asterisk, not a bullet point. */
.welcome-features li.welcome-note::before {
  content: "*";
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}

/* On desktop the memory-palace note stays on one line (it runs a few px past the text column, into the gap before the artwork). */
@media (min-width: 1100px) {
  .welcome-features li.welcome-note {
    white-space: nowrap;
  }
}

/* refer CODE_NOTES.txt #42 */
.app-footer {
  max-width: 480px;
  margin: 40px auto 0;
  padding: 20px 24px 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.app-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-bottom: 10px;
}

.app-footer-links a {
  font-size: 13px;
  color: var(--text-dim);
  transition: color 0.15s ease;
}

@media (hover: hover) {
  .app-footer-links a:hover {
    color: var(--accent);
  }
}

.app-footer-copy {
  margin: 0;
  font-size: 12px;
  color: var(--text-faint);
}

/* refer CODE_NOTES.txt #43 */
@media (min-width: 860px) {
  .welcome-inner {
    max-width: 1080px;
    padding: 88px 48px;
  }

  .welcome-hero {
    flex-direction: row;
    align-items: center;
    gap: 64px;
  }

  .welcome-hero-text {
    flex: 1 1 54%;
    text-align: left;
  }

  .welcome-tagline,
  .welcome-body {
    max-width: 46ch;
  }

  .welcome-hero-art {
    order: 0;
    flex: 1 1 46%;
    max-width: 420px;
    margin: 0;
  }

  .welcome-choices {
    flex-direction: row;
  }

  .welcome-choice-card {
    flex: 1 1 0;
  }

  .app-footer {
    max-width: 1080px;
    padding: 24px 48px 40px;
  }
}

/* refer CODE_NOTES.txt #44 */
.workspace-header {
  flex: 0 0 auto;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.5);
  padding: calc(10px + var(--safe-top)) 14px calc(10px + var(--safe-top) * 0);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  transition: opacity 0.15s ease;
}

@media (hover: hover) {
  .header-brand:hover {
    opacity: 0.82;
  }
}

/* refer CODE_NOTES.txt #45 */
.workspace-header .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.5);
}

.header-brand-name {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* refer CODE_NOTES.txt #46 */
.workspace-header-end {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  /* refer CODE_NOTES.txt #47 */
  position: sticky;
  right: 0;
  background: var(--bg-elev);
}

/* refer CODE_NOTES.txt #48 */
.topbar .workspace-header-end {
  position: static;
  background: none;
}

/* refer CODE_NOTES.txt #49 */
.workspace-header-row {
  display: contents;
}

.header-brand {
  order: 1;
}

.view-switch {
  order: 2;
}

.map-tag-filter-wrap {
  order: 3;
}

.map-search {
  order: 4;
}

.workspace-header-end {
  order: 5;
}

@media (max-width: 480px) {
  /* refer CODE_NOTES.txt #50 */
  .header-brand-name {
    display: none;
  }

  .workspace-header {
    flex-wrap: wrap;
    row-gap: 8px;
    padding-left: calc(8px + env(safe-area-inset-left, 0px));
    padding-right: calc(8px + env(safe-area-inset-right, 0px));
    /* refer CODE_NOTES.txt #51 */
    overflow-y: visible;
  }

  .workspace-header-row {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
  }

  .map-search {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
  }

  .workspace-header-end {
    gap: 6px;
    padding-left: 6px;
  }

  

  

  .workspace-header .icon-btn {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  
}

.workspace-header .icon-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.workspace-header .sync-dot {
  flex-shrink: 0;
  margin: 0 2px;
}









/* refer CODE_NOTES.txt #52 */






/* refer CODE_NOTES.txt #53 */




















/* refer CODE_NOTES.txt #55 */
.view-switch {
  display: flex;
  flex-shrink: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.view-switch-btn {
  border: 2px solid transparent;
  background: none;
  color: var(--text-dim);
  font-size: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  white-space: nowrap;
  display: grid;
  place-items: center;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

/* refer CODE_NOTES.txt #56 */
.view-switch-btn.active {
  background: var(--accent);
  color: #1a1006;
  border-color: var(--text);
  font-weight: 900;
}

@media (hover: hover) {
  .view-switch-btn:not(.active):hover {
    background: var(--bg-elev-2);
    color: var(--text);
  }
}

/* refer CODE_NOTES.txt #57 */
[data-view="map"] .grid-only-action {
  display: none !important;
}

/* refer CODE_NOTES.txt #58 */
.map-tag-filter-wrap {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.map-tag-filter {
  /* refer CODE_NOTES.txt #59 */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  max-width: 120px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 26px 7px 14px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
}

.map-tag-filter-arrow {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  color: var(--text-faint);
  pointer-events: none;
}

@media (max-width: 480px) {
  .map-tag-filter {
    max-width: 64px;
    padding: 7px 20px 7px 10px;
    font-size: 12px;
  }

  .map-tag-filter-arrow {
    right: 8px;
  }
}

/* refer CODE_NOTES.txt #60 */
.map-search {
  flex: 0 1 280px;
  max-width: 280px;
  min-width: 60px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
}

.map-search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
}

.map-search input:focus {
  outline: none;
}

.map-search-btn {
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 14px;
  cursor: pointer;
}

.map-search-btn:hover {
  color: var(--accent);
}

.workspace-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* refer CODE_NOTES.txt #61 */
.guest-banner {
  flex: 0 0 auto;
  padding: 10px 16px;
  background: var(--bg-elev-2);
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.workspace-body {
  flex: 1 1 75%;
  min-height: 0;
  display: grid;
}

/* refer CODE_NOTES.txt #62 */
.view-pane {
  grid-area: 1 / 1;
  min-height: 0;
  min-width: 0;
  visibility: hidden;
  pointer-events: none;
}

[data-view="grid"] .view-pane-grid,
[data-view="map"] .view-pane-map {
  visibility: visible;
  pointer-events: auto;
}

.view-pane-grid {
  overflow-y: auto;
  padding: 16px 20px 24px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.map-canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  /* refer CODE_NOTES.txt #63 */
  background-position: 0 0;
  touch-action: none;
}

.map-canvas-wrap canvas {
  display: block;
  position: relative;
  z-index: 1;
}

/* refer CODE_NOTES.txt #64 */
.map-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: 0 0;
  filter: brightness(var(--map-brightness, 1));
}

/* refer CODE_NOTES.txt #65 */
.map-bg-world {
  background-color: #000;
  background-image: url("/img/world-map.svg");
  background-repeat: no-repeat;
}

.map-toolbar {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}

.map-toolbar button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(26, 23, 37, 0.9);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

@media (hover: hover) {
  .map-toolbar button:hover {
    background: var(--bg-elev-2);
    border-color: var(--accent);
  }
}

/* refer CODE_NOTES.txt #66 */
.map-toolbar-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 8px;
}

.map-toolbar-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 4px;
}

/* refer CODE_NOTES.txt #67 */
.map-inbox-wrap {
  flex: 0 0 10%;
  min-height: 134px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
}

/* refer CODE_NOTES.txt #68 */
body:not([data-view="map"]) .map-inbox-wrap {
  display: none;
}

.map-inbox-row {
  flex: 1;
  display: flex;
  gap: 10px;
  min-height: 0;
  padding: 6px 0 14px 16px;
}

.map-inbox-row .map-inbox {
  flex: 1;
  min-width: 0;
  padding: 0 16px 0 0;
}

/* refer CODE_NOTES.txt #69 */
.inbox-add-tile {
  flex: 0 0 104px;
  width: 104px;
  height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 122, 69, 0.08);
  border: 1px dashed var(--accent);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.inbox-add-tile i {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1006;
  font-size: 15px;
  display: grid;
  place-items: center;
}

/* refer CODE_NOTES.txt #70 */
.inbox-add-tile i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: inbox-add-ripple 1.8s ease-out infinite;
}

@keyframes inbox-add-ripple {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inbox-add-tile i::after {
    animation: none;
  }
}

@media (hover: hover) {
  .inbox-add-tile:hover {
    background: rgba(255, 122, 69, 0.16);
  }
}

.map-inbox-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 10px 16px 4px;
}

.map-inbox {
  flex: 1;
  display: flex;
  gap: 10px;
  padding: 6px 16px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: flex-start;
}

.map-inbox-empty {
  color: var(--text-faint);
  font-size: 12px;
  padding: 10px 4px;
}

.capsule {
  position: relative;
  flex: 0 0 104px;
  width: 104px;
  height: 84px;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: grab;
  user-select: none;
}

.capsule.dragging {
  opacity: 0.4;
}

.link-row.dragging {
  opacity: 0.4;
}

/* refer CODE_NOTES.txt #71 */
.row-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  opacity: 0.9;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.capsule.selected-for-placement {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.capsule-body {
  cursor: pointer;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.capsule-place-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(16, 14, 24, 0.85);
  color: var(--text);
  font-size: 13px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.capsule-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(16, 14, 24, 0.85);
  color: var(--text-dim);
  font-size: 11px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

@media (hover: hover) {
  .capsule-delete-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
  }
}

.capsule-media {
  width: 100%;
  height: 28px;
  flex: 0 0 28px;
  object-fit: cover;
  display: block;
  background: var(--bg-elev);
}

.capsule-placeholder {
  width: 100%;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: var(--bg-elev);
}

/* refer CODE_NOTES.txt #72 */
.capsule-title {
  flex: 1;
  font-size: 10.5px;
  padding: 4px 6px 4px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

.cat-section-drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.place-popover .swatch-row {
  margin-bottom: 20px;
}

/* refer CODE_NOTES.txt #73 */
.hover-preview {
  /* refer CODE_NOTES.txt #74 */
  position: fixed;
  z-index: 60;
  width: 220px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  pointer-events: none;
}

.hover-preview-media {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: var(--bg-elev-2);
}

/* refer CODE_NOTES.txt #75 */
.detail-preview-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  margin-bottom: 12px;
  background: var(--bg-elev-2);
}

.hover-preview-placeholder {
  width: 100%;
  height: 110px;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: var(--text-dim);
  background: var(--bg-elev-2);
}

.hover-preview-body {
  padding: 10px 12px;
}

.hover-preview-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.hover-preview-url {
  font-size: 11px;
  color: var(--text-faint);
  overflow-wrap: anywhere;
}

.hover-preview-tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hover-preview-date {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-faint);
}

.place-hint-bar {
  position: fixed;
  left: 50%;
  top: calc(64px + var(--safe-top));
  transform: translateX(-50%);
  z-index: 40;
  background: var(--accent);
  color: #1a1006;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* refer CODE_NOTES.txt #76 */
.shared-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.shared-map-overlay-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + var(--safe-top)) 16px 14px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.shared-map-overlay-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-map-overlay-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}

.shared-map-overlay-banner {
  flex: 0 0 auto;
  padding: 10px 16px;
  background: var(--bg-elev-2);
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

.shared-map-overlay-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.shared-map-overlay-body canvas {
  position: absolute;
  inset: 0;
}

.shared-map-overlay-add {
  position: absolute;
  left: 16px;
  bottom: calc(16px + var(--safe-bottom));
  width: auto;
  padding: 10px 18px;
  box-shadow: var(--shadow);
}

/* refer CODE_NOTES.txt #77 */
.trash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.trash-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

.trash-count {
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-faint);
}

.trash-list {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.trash-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.trash-row:last-child {
  border-bottom: none;
}

.trash-thumb {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
}

.trash-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev-2);
  font-size: 22px;
}

.trash-row-body {
  flex: 1;
  min-width: 0;
}

.trash-row-title {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.trash-row-url {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trash-row-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.trash-row-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-faint);
}

.trash-row-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  flex: none;
}

.trash-row-actions .btn {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
}

@media (max-width: 560px) {
  .trash-row {
    flex-wrap: wrap;
  }
  .trash-row-actions {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
  }
}

/* refer CODE_NOTES.txt #78 */
.avatar-dropdown-toggle {
  display: flex;
  align-items: center;
  width: 100%;
}

.share-link-webhook-toggle {
  position: relative;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  cursor: pointer;
}

.avatar-toggle-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.avatar-toggle-text small {
  font-size: 11px;
  color: var(--text-faint);
}

.switch {
  flex: none;
  position: relative;
  width: 34px;
  height: 20px;
  margin-left: 12px;
  border-radius: 999px;
  background: var(--border);
  transition: background-color 0.18s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s ease;
}

[aria-checked="true"] > .switch {
  background: var(--accent);
}

[aria-checked="true"] > .switch::after {
  transform: translateX(14px);
}

.avatar-dropdown-toggle:disabled {
  opacity: 0.6;
  cursor: default;
}

.notify-prompt {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 70;
  width: min(440px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.notify-prompt > i {
  font-size: 18px;
  color: var(--accent);
}

.notify-prompt-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-dim);
}

.notify-prompt-text strong {
  font-size: 13px;
  color: var(--text);
}

.notify-prompt .btn {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
}

@media (max-width: 480px) {
  .notify-prompt {
    flex-wrap: wrap;
  }
  .notify-prompt-text {
    flex-basis: calc(100% - 40px);
  }
}

.share-link-edit-panel {
  margin-top: 8px;
}

/* refer CODE_NOTES.txt #79 */








.credit-pack-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.credit-pack {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
}

.credit-pack-amount {
  font-weight: 700;
  font-size: 14px;
}

.credit-pack-amount i {
  color: var(--accent);
}

.credit-pack-label {
  flex: 1;
  color: var(--text-faint);
  font-size: 12px;
}

.credit-pack-buy {
  width: auto;
  padding: 8px 16px;
}



#account-menu-mount {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* refer CODE_NOTES.txt #80 */
.history-list {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  flex-wrap: wrap;
}

.history-row:last-child {
  border-bottom: none;
}

.history-label {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.history-label-link {
  color: inherit;
  text-decoration: none;
}

.history-label-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.history-label-text {
  color: inherit;
}

.history-label i {
  color: var(--accent);
}

.history-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.history-amount.positive {
  color: var(--accent-2);
}

.history-amount.negative {
  color: var(--danger);
}

.history-balance {
  color: var(--text-faint);
  font-size: 12px;
}

.history-time {
  color: var(--text-faint);
  font-size: 12px;
  white-space: nowrap;
}

.history-status-pending {
  color: var(--text-dim);
}

.history-status-completed {
  background: rgba(52, 209, 191, 0.15);
  color: var(--accent-2);
}

.history-status-failed {
  background: rgba(255, 92, 122, 0.15);
  color: var(--danger);
}

.history-status-refunded {
  color: var(--text-faint);
}

/* refer CODE_NOTES.txt #81 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 6px 0 20px;
}

.pagination-label {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
}

.pagination .link-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* refer CODE_NOTES.txt #82 */
.capsule-jump-highlight {
  animation: capsule-jump-pulse 2.2s ease-out;
}

@keyframes capsule-jump-pulse {
  0%, 30% {
    box-shadow: 0 0 0 3px var(--accent);
  }
  100% {
    box-shadow: 0 0 0 3px transparent;
  }
}

/* site notice (admin-controlled): banner for info, full-screen lock for major */
.site-notice { position: relative; z-index: 60; display: flex; gap: 10px; align-items: center; justify-content: center; padding: 9px 44px 9px 16px; font-size: 14px; background: #1d3556; color: #d4e7ff; }
.site-notice .notice-text { display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: baseline; }
.site-notice .notice-eta { opacity: .85; }
.site-notice .notice-eta:empty, .lock-card .notice-eta:empty { display: none; }
.notice-x { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: inherit; cursor: pointer; padding: 4px 8px; font-size: 20px; line-height: 1; }
html.locked, html.locked body { overflow: hidden; }
.site-lock { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; padding: 20px; background: var(--bg); color: var(--text); }
.lock-card { max-width: 460px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.lock-card h2 { margin: 0; } .lock-card p { margin: 0; color: var(--text-dim); }
.lock-card .notice-eta { color: var(--accent-2); }

.app-version { margin-left: 6px; opacity: 0.6; font-variant-numeric: tabular-nums; }

/* Map settings: "Choose the memory map you want" gallery */
.sheet.sheet-wide {
  max-width: 640px;
}
.map-gallery {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px -6px 6px;
}
.map-gallery-track {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  padding: 6px 4px 10px;
  scrollbar-width: thin;
}
.map-gallery-arrow {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev-2);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.map-gallery-arrow:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent);
}
.map-gallery-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}
.map-card {
  position: relative;
  flex: none;
  width: 150px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 5px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev-2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s, transform 0.1s;
}
.map-card:hover {
  border-color: var(--text-faint);
}
.map-card img {
  display: block;
  width: 100%;
  aspect-ratio: 480 / 340;
  object-fit: cover;
  border-radius: 8px;
  background: #1c1a28;
}
.map-card-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 0 2px 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-card[aria-selected="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 122, 69, 0.28);
}
.map-card:focus-visible,
.map-gallery-arrow:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.map-gallery-more {
  flex: none;
  align-self: center;
  padding: 0 18px;
  color: var(--text-faint);
  font-size: 13px;
  white-space: nowrap;
}
.map-picked {
  font-size: 13px;
  color: var(--accent);
  margin: 0 0 10px;
}
.map-gen {
  display: grid;
  gap: 10px;
  margin: 8px 0 16px;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-dim);
}
.map-gen a {
  color: var(--accent);
}
.map-gen-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.map-gen-how {
  all: unset;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  text-decoration: underline;
}
.map-gen-how:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}
.map-gen-steps {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.map-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 14, 24, 0.88);
  color: var(--accent-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* A new user picks a map before any map is shown (see page-map.js) */
body.map-choosing #map-bg-layer,
body.map-choosing .map-canvas-wrap canvas {
  visibility: hidden;
}

/* Map preview (js/map-preview.js): big viewer with carousel + hover preview */
.mp { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(4, 4, 12, 0.78); backdrop-filter: blur(4px); }
.mp[hidden] { display: none; }
.mp-box { width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 16px; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); }
.mp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mp-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.mp-name { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-count { font-size: 13px; opacity: 0.65; white-space: nowrap; }
.mp-x { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.mp-stage { display: flex; align-items: center; gap: 10px; min-height: 0; }
.mp-view { position: relative; flex: 1; min-width: 0; aspect-ratio: 1414 / 1000; max-height: calc(100vh - 290px); border-radius: 14px; overflow: hidden; background: #0b0a12; }
.mp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.mp-img.is-thumb { filter: blur(0.6px); }
.mp-loading { position: absolute; left: 12px; bottom: 12px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(8, 8, 16, 0.82); color: #fff; }
.mp-nav { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.mp-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.mp-thumb { flex: none; width: 96px; padding: 3px 3px 4px; border-radius: 9px; cursor: pointer; background: none; color: inherit; font: inherit; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.mp-thumb img { display: block; width: 100%; aspect-ratio: 480 / 340; object-fit: cover; border-radius: 6px; }
.mp-thumb span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; max-width: 100%; min-height: 2.5em; font-size: 11px; font-weight: 600; line-height: 1.25; overflow: hidden; overflow-wrap: anywhere; opacity: 0.7; }
.mp-thumb[aria-selected="true"] span, .mp-thumb:hover span { opacity: 1; }
.mp-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.mp-btn { font: inherit; font-weight: 700; padding: 11px 20px; border-radius: 12px; cursor: pointer; }
.mp-tip { position: fixed; z-index: 2100; width: 300px; padding: 6px; border-radius: 14px; pointer-events: none; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
.mp-tip[hidden] { display: none; }
.mp-tip img { display: block; width: 100%; aspect-ratio: 480 / 340; object-fit: cover; border-radius: 9px; }
.mp-tip span { display: block; padding: 6px 4px 2px; font-size: 13px; font-weight: 700; }
.mp-zoom { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; pointer-events: none; opacity: 0.9; }
@media (max-width: 640px) {
  .mp { padding: 0; place-items: end center; }
  .mp-box { border-radius: 20px 20px 0 0; padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0px)); width: 100%; }
  .mp-nav { position: absolute; z-index: 2; width: 38px; height: 38px; top: 50%; margin-top: -19px; }
  .mp-stage { position: relative; }
  .mp-prev { left: 6px; } .mp-next { right: 6px; }
  .mp-view { max-height: 46vh; }
  .mp-foot .mp-btn { flex: 1; }
}
.mp-box { background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); }
.mp-x, .mp-nav { border: 1px solid var(--border); background: var(--bg-elev-2); color: var(--text); }
.mp-x:hover, .mp-nav:hover { border-color: var(--accent); }
.mp-thumb { border: 2px solid transparent; }
.mp-thumb[aria-selected="true"] { border-color: var(--accent); }
.mp-btn { border: 1px solid var(--border); background: var(--bg-elev-2); color: var(--text); }
.mp-btn.primary { background: var(--accent); border-color: var(--accent); color: #1a0f0a; }
.mp-tip { background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); }
.mp-zoom { background: rgba(16, 14, 24, 0.82); color: #fff; }
.mp :focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.map-card:hover img { filter: brightness(1.08); }

/* Pricing page + header Pricing button */




.pricing-main { max-width: 1040px; }
.pricing-hero { text-align: center; padding: 26px 0 22px; }
.pricing-hero h1 { margin: 0; font-size: 34px; letter-spacing: -.02em; background: linear-gradient(135deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pricing-hero p { margin: 8px 0 0; color: var(--text-dim); font-size: 15px; }
.plan-note { color: var(--text-faint); font-size: 13px; text-align: center; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; align-items: start; }
.plan-card { position: relative; background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev)); border: 1px solid var(--border); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); }
.plan-card.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 18px 44px -16px rgba(255, 122, 69, .45); }
.plan-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.plan-card h2 { margin: 0; font-size: 22px; }
.plan-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #1a1020; background: var(--accent); border-radius: 999px; padding: 4px 11px; }
.plan-desc { color: var(--text-dim); font-size: 14px; margin: 8px 0 0; }
.plan-valid { margin: 8px 0 0; font-size: 13.5px; color: var(--text-dim); }
.plan-valid i { color: var(--accent); margin-right: 5px; }
.plan-valid b { color: var(--text); font-weight: 700; }
.plan-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.plan-stat { background: rgba(255, 255, 255, .04); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; }
.plan-stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }
.plan-stat span i { color: var(--accent); margin-right: 3px; }
.plan-stat b { font-size: 26px; line-height: 1.1; color: var(--text); }
.plan-stat b.date { font-size: 17px; line-height: 1.5; }
.plan-stat small { font-size: 12px; color: var(--text-dim); }
.plan-sub { margin: 20px 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
.plan-costs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-costs li { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; }
.plan-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 122, 69, .14); color: var(--accent); font-size: 14px; }
.plan-what { flex: 1; min-width: 0; font-size: 14px; display: grid; }
.plan-what small { color: var(--text-faint); font-size: 12px; }
.plan-price { flex: none; text-align: right; display: grid; line-height: 1.15; }
.plan-price b { font-size: 20px; color: var(--accent); }
.plan-price small { font-size: 11px; color: var(--text-faint); }
.plan-free { display: flex; flex-wrap: wrap; gap: 7px; }
.plan-free span { font-size: 12.5px; color: var(--accent-2); background: rgba(52, 209, 191, .10); border: 1px solid rgba(52, 209, 191, .25); border-radius: 999px; padding: 4px 11px; }
.plan-free span i { margin-right: 4px; font-size: 11px; }
.plan-allfree { margin: 18px 0 0; color: var(--accent-2); font-size: 14px; }
@media (max-width: 560px) { .pricing-hero h1 { font-size: 28px; } .plan-card { padding: 18px; border-radius: 18px; } }

/* Sign-up: show/hide password, human check, terms line, "check your inbox" panel */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--text); outline: none; background: var(--bg-elev); }
.ts-box { margin: 4px 0 14px; min-height: 65px; display: flex; justify-content: center; }
.ts-box:empty { display: none; }
.ts-box.ts-fail { font-size: 13px; color: var(--danger); align-items: center; text-align: center; }
.auth-terms { font-size: 12px; color: var(--text-dim); text-align: center; margin: 12px 0 0; line-height: 1.5; }
.auth-terms a { color: var(--accent); }
.verify-panel { text-align: center; }
.verify-panel[hidden], #auth-main[hidden], #oauth-block[hidden] { display: none; }
.verify-panel h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; }
.verify-panel p { color: var(--text-dim); font-size: 14px; line-height: 1.55; margin: 0 0 16px; }
.verify-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--bg-elev); color: var(--accent); }
.verify-note { min-height: 20px; margin-top: 10px; font-size: 13px; color: var(--text-dim); }
.verify-note.ok { color: #3ecf8e; }
.verify-note.bad { color: var(--danger); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn[hidden] { display: none; }
#resend-login-btn { margin-bottom: 10px; }

.topbar > #account-menu-mount { margin-left: auto; order: 5; }
.topbar .topbar-title { order: 3; flex: 1; min-width: 0; margin: 0 12px 0 0; font-size: 15px; color: var(--text-dim); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .topbar .topbar-title { display: none; } }
@media (max-width: 480px) { .topbar > .view-switch { display: none; } .topbar .workspace-header-end { padding-left: 4px; border-left: 0; } }
