/* Per-view styles. Sections follow the order of the dock. */

/* Auth splash -------------------------------------------------------------- */
.auth {
  position: relative;
  height: 100%;
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 440px);
  align-items: center;
  gap: 40px;
  padding: 40px clamp(20px, 6vw, 90px);
}
.auth-floaters { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.floater { position: absolute; animation: float 7s ease-in-out infinite; animation-delay: calc(var(--i) * -0.9s); opacity: 0.9; }
@keyframes float { 50% { transform: translateY(-18px) rotate(6deg); } }
.auth-hero, .auth-card { position: relative; z-index: 2; }
.auth-brand { display: flex; align-items: center; gap: 18px; }
.logo-orb.big { width: 92px; height: 92px; }
.logo-orb.big::before { top: 6px; }
.wordmark {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #d9f4ff 48%, #7fd0ff 50%, #e8f8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 0 rgba(0, 60, 140, 0.35)) drop-shadow(0 8px 18px rgba(0, 60, 140, 0.35));
}
.tagline { font-size: 1.2rem; font-weight: 800; margin: 6px 0 0; color: #fff; text-shadow: 0 1px 3px rgba(0, 50, 120, 0.5); }
.auth-pip { display: flex; align-items: flex-end; gap: 10px; margin: 26px 0 18px; }
.auth-pip .pip { cursor: pointer; animation: pip-bob 2.6s ease-in-out infinite; flex: none; }
.pip.boing { animation: boing 0.7s var(--spring) !important; }
@keyframes boing { 30% { transform: scale(1.2, 0.8); } 60% { transform: scale(0.9, 1.15) translateY(-12px); } }
.speech { padding: 12px 16px; border-radius: 22px 22px 22px 6px; font-weight: 800; max-width: 280px; margin-bottom: 70px; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 18px; }
.feature-list li { display: flex; gap: 12px; align-items: center; }
.feature-list li .muted { color: rgba(var(--ink-rgb), 0.78); }
.auth-card { padding: 24px; border-radius: 34px; display: flex; flex-direction: column; gap: 16px; --glass-a: calc(var(--glass-a-base, 0.34) + 0.22); }
.auth-tabs { align-self: center; }
.auth-form .field { font-size: 1rem; }
.starter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.starter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), 0.12);
  transition: transform 0.3s var(--spring);
}
.starter.on { box-shadow: inset 0 0 0 2px var(--sc), 0 4px 12px -4px var(--sc); background: rgba(255, 255, 255, 0.7); }
.starter:hover { transform: scale(1.04); }
.starter-dot { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2), 0 0 0 2px #fff; }
.scene-sky { background: linear-gradient(#1a7ee0, #9fdcff); }
.scene-meadow { background: linear-gradient(#6cc4ff 45%, #5fcf3a 46%); }
.scene-ocean { background: linear-gradient(#46d7ff, #0763a8); }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; gap: 20px; padding: 24px 14px 40px; }
  .auth-pip { display: none; }
  .feature-list { display: none; }
  .auth-brand { justify-content: center; }
}

/* Posts ----------------------------------------------------------------- */
.post { padding: 16px 18px 12px; display: flex; flex-direction: column; gap: 10px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-who { flex: 1; min-width: 0; }
.post-text { font-size: 1.02rem; }
.post-art, .post-sticker { display: flex; }
.post-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; }
.react-emoji { font-size: 1rem; text-shadow: none; }
.react-add { padding: 0.3em 0.55em; gap: 2px; }
.react-picker { display: flex; gap: 4px; }
.react-pick { font-size: 1.5rem; border: 0; background: none; cursor: pointer; border-radius: 12px; padding: 4px 6px; transition: transform 0.3s var(--spring); }
.react-pick:hover { transform: scale(1.3) translateY(-3px); background: rgba(255, 255, 255, 0.4); }
.pod-chip { --pc: var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 25%, white), color-mix(in srgb, var(--pc) 12%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 40%, transparent); }
.post-replies:empty { display: none; }
.post-replies { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; border-top: 1px solid var(--hair); }
.reply-list { display: flex; flex-direction: column; gap: 8px; }
.reply { display: flex; gap: 10px; align-items: flex-start; }
.reply-bubble { background: rgba(255, 255, 255, 0.35); border-radius: 6px 18px 18px 18px; padding: 8px 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7); min-width: 0; }
[data-ink='light'] .reply-bubble { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }

.composer { display: flex; gap: 12px; align-items: flex-start; }
.composer.card { padding: 14px 16px; }
textarea.composer-text { resize: none; min-height: 2.8em; }
.composer-actions { gap: 4px; }
.composer-attach { display: flex; gap: 10px; flex-wrap: wrap; }
.composer-attach:empty { display: none; }
.attach-item { position: relative; }
.attach-x { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); color: #0b2540; }

/* Pickers --------------------------------------------------------------- */
.sticker-picker { display: flex; flex-direction: column; gap: 8px; }
.sticker-tabs { display: flex; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--hair); }
.sticker-tab { border: 0; background: none; padding: 4px; border-radius: 12px; cursor: pointer; }
.sticker-tab.on { background: rgba(var(--accent-rgb), 0.18); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.4); }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.sticker-cell { border: 0; background: none; cursor: pointer; border-radius: 14px; padding: 4px; transition: transform 0.3s var(--spring); display: grid; place-items: center; }
.sticker-cell:hover { transform: scale(1.12) rotate(-4deg); background: rgba(255, 255, 255, 0.35); }
.sticker-cell.locked { filter: grayscale(0.9) opacity(0.45); cursor: not-allowed; }
.sticker-lock { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-cell { border: 0; background: none; font-size: 1.4rem; padding: 4px; border-radius: 10px; cursor: pointer; }
.emoji-cell:hover { background: rgba(255, 255, 255, 0.45); transform: scale(1.15); }

.search-results { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.search-row { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 8px; border-radius: 14px; cursor: pointer; text-align: left; color: var(--ink); }
.search-row:hover { background: rgba(var(--accent-rgb), 0.15); }
.pod-mini {
  --pc: var(--accent);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: none;
  font-size: 1.05rem;
  text-shadow: none;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--pc) 45%, white), var(--pc) 70%, color-mix(in srgb, var(--pc) 70%, black));
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2), inset 0 2px 2px rgba(255, 255, 255, 0.5);
}

.notif-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.notif-row { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px; border-radius: 14px; cursor: pointer; text-align: left; color: var(--ink); width: 100%; }
.notif-row:hover { background: rgba(var(--accent-rgb), 0.13); }
.notif-row.unread { background: rgba(var(--accent-rgb), 0.1); box-shadow: inset 3px 0 0 var(--accent); }
.notif-text { font-weight: 700; font-size: 0.92rem; }

.signin-toast {
  position: fixed;
  z-index: 65;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 12px 12px;
  border-radius: 22px;
  animation: signin-in 0.6s var(--spring);
  --glass-a: calc(var(--glass-a-base, 0.34) + 0.3);
}
.signin-toast.out { animation: signin-out 0.45s ease forwards; }
@keyframes signin-in { from { transform: translateY(120%); } }
@keyframes signin-out { to { transform: translateY(140%); } }
@media (max-width: 820px) { .signin-toast { bottom: 96px; right: 10px; } }

.party #wallpaper { animation: party-hue 2.4s linear infinite; }
@keyframes party-hue { to { filter: hue-rotate(360deg) saturate(1.4); } }
.party-layer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* Pixel pad ----------------------------------------------------------------- */
.pad { display: grid; grid-template-columns: auto minmax(0, 1fr) 230px; gap: 14px; align-items: start; outline: none; }
.pad.compact { grid-template-columns: 1fr; gap: 10px; }
.pad-tools { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 20px; background: rgba(255, 255, 255, 0.3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 0 0 1px rgba(var(--ink-rgb), 0.08); }
[data-ink='light'] .pad-tools { background: rgba(255, 255, 255, 0.07); }
.pad.compact .pad-tools { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.pad-tool {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.3s var(--spring), background 0.2s;
}
.pad-tool:hover { background: rgba(255, 255, 255, 0.4); transform: scale(1.06); }
.pad-tool.on { color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 65%, white), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 3px 8px -2px rgba(var(--accent-rgb), 0.7); }
.pad-sep { width: 60%; height: 1px; background: var(--hair); margin: 4px auto; }
.pad.compact .pad-sep { width: 1px; height: 28px; margin: 6px 2px; }
.pad-stage {
  position: relative;
  width: min(520px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 16px;
  overflow: hidden;
  touch-action: none;
  background: repeating-conic-gradient(#e7eef6 0 25%, #ffffff 0 50%) 0 0 / 24px 24px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7), 0 10px 30px -10px rgba(0, 30, 70, 0.5), inset 0 0 0 1px rgba(0, 30, 60, 0.1);
}
.pad.compact .pad-stage { width: min(340px, 100%); }
.pad-art, .pad-overlay { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.pad-overlay { cursor: crosshair; }
.pad-side { display: flex; flex-direction: column; gap: 12px; }
.pad.compact .pad-side { flex-direction: column; }
.pad-current { width: 42px; height: 42px; border-radius: 12px; flex: none; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85), 0 3px 8px rgba(0, 20, 50, 0.3); }
.pad-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.pad-swatch { aspect-ratio: 1; border: 0; border-radius: 8px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15), inset 0 6px 6px -4px rgba(255, 255, 255, 0.55); transition: transform 0.25s var(--spring); }
.pad-swatch:hover { transform: scale(1.15); }
.pad-swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent), inset 0 6px 6px -4px rgba(255, 255, 255, 0.55); transform: scale(1.08); }
.doodle-modal { width: min(560px, 100%); }
@media (max-width: 980px) {
  .pad { grid-template-columns: 1fr; }
  .pad-tools { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .pad-sep { width: 1px; height: 28px; margin: 6px 2px; }
}

.bubble-amount { display: inline-flex; align-items: center; gap: 6px; }
.aurora-chip { color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3); background: linear-gradient(110deg, #22d3a6, #3aa0ff 50%, #9b6bff); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6); }

/* Plaza --------------------------------------------------------------------- */
.plaza-hello h3 { font-size: 1.15rem; }
.feed { display: flex; flex-direction: column; gap: var(--gap); }
.new-pill { position: sticky; top: 6px; z-index: 3; }
.new-pill[hidden] { display: none; }
.streak-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.streak-flame { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; color: #ff7a00; background: linear-gradient(180deg, #fff7d6, #ffe0a3); box-shadow: inset 0 1px 0 #fff, 0 3px 10px -4px rgba(255, 120, 0, 0.6); text-shadow: none; }
.streak-flame b { font-size: 1.35rem; color: #c24e00; }
.daily-card .btn + .btn { margin-top: 8px; }
.online-list, .pod-suggest { display: flex; flex-direction: column; gap: 2px; }

/* Chat ----------------------------------------------------------------------- */
.chat-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: var(--gap); height: 100%; min-height: 0; }
.chat-list { display: flex; flex-direction: column; min-height: 0; padding: 14px 10px; }
.chat-list-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 10px; }
.chat-convs { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.list-sep { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); padding: 12px 10px 4px; }
.conv .meta b { font-weight: 800; }
.typing-text { color: var(--accent); font-weight: 800; }
.group-av { position: relative; width: var(--size); height: var(--size); flex: none; }
.group-av .avatar:first-child { position: absolute; top: 0; left: 0; }
.group-av .avatar:last-child:not(:first-child) { position: absolute; right: 0; bottom: 0; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9); border-radius: 50%; }
.chat-window { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-empty { flex: 1; display: grid; place-items: center; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--hair); background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)); }
[data-ink='light'] .chat-head { background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)); }
.chat-title { font-size: 1.15rem; }
.chat-back { display: none; }
.msg-scroll { flex: 1; overflow-y: auto; padding: 14px 18px 6px; min-height: 0; display: flex; flex-direction: column; }
.older-btn { align-self: center; margin-bottom: 10px; }
.msg-stream { display: flex; flex-direction: column; gap: 3px; }
.msg-day { align-self: center; font-size: 0.75rem; font-weight: 800; color: var(--ink-3); padding: 12px 0 6px; }
.msg { position: relative; display: flex; align-items: flex-end; gap: 8px; max-width: min(78%, 640px); margin-top: 8px; }
.msg.grouped { margin-top: 1px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-av-space { width: 34px; flex: none; }
.msg-col { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.msg.mine .msg-col { align-items: flex-end; }
.msg-name { font-size: 0.8rem; margin-left: 6px; }
.msg-bubble {
  padding: 9px 14px;
  border-radius: 20px 20px 20px 6px;
  font-size: 0.98rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72));
  color: #0b2540;
  text-shadow: none;
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(0, 40, 80, 0.06), 0 3px 10px -4px rgba(0, 30, 70, 0.35);
}
.msg.grouped:not(.mine) .msg-bubble { border-top-left-radius: 8px; }
.msg.mine .msg-bubble {
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  border-radius: 20px 20px 6px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.1) 48%, rgba(255, 255, 255, 0) 50%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 70%, white), var(--accent) 60%, color-mix(in srgb, var(--accent) 80%, black));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, black), 0 4px 12px -4px rgba(var(--accent-rgb), 0.7);
}
.msg.mine.grouped .msg-bubble { border-top-right-radius: 8px; }
.msg-bubble.doodle { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.msg-sticker { animation: sticker-in 0.5s var(--spring); }
@keyframes sticker-in { from { transform: scale(0.4) rotate(-20deg); } }
.msg-meta { padding: 0 6px; height: 0; overflow: hidden; transition: height 0.2s; }
.msg:hover .msg-meta { height: 16px; }
.msg-reacts { display: flex; gap: 4px; margin-top: 2px; }
.msg-react { border: 0; cursor: pointer; font-size: 0.85rem; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.75); box-shadow: 0 1px 4px rgba(0, 30, 60, 0.2); color: #0b2540; text-shadow: none; display: inline-flex; gap: 3px; }
.msg-react.mine { box-shadow: 0 0 0 2px var(--accent); }
.msg-tools { display: none; align-self: center; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); box-shadow: 0 3px 10px rgba(0, 30, 70, 0.25); }
.msg:hover .msg-tools { display: flex; }
.msg-tool { border: 0; background: none; cursor: pointer; font-size: 1rem; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #0b2540; }
.msg-tool:hover { background: rgba(var(--accent-rgb), 0.15); transform: scale(1.15); }
.msg-system { align-self: center; margin: 10px 0 4px; font-size: 0.8rem; font-weight: 800; color: var(--ink-2); padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.28); display: inline-flex; gap: 6px; align-items: center; }
[data-ink='light'] .msg-system { background: rgba(255, 255, 255, 0.08); }
.msg-system.nudge { color: #b35c00; background: linear-gradient(180deg, #fff6d0, #ffe29a); text-shadow: none; box-shadow: 0 2px 8px -2px rgba(255, 150, 0, 0.5); }
.typing-row { min-height: 26px; padding-top: 4px; }
.typing { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 800; color: var(--ink-2); }
.dots { display: inline-flex; gap: 3px; padding: 7px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 30% { transform: translateY(-5px); opacity: 0.6; } }
.chat-compose { display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px 12px; border-top: 1px solid var(--hair); }
textarea.chat-input { resize: none; min-height: 44px; max-height: 160px; border-radius: 22px; padding: 0.62em 1.1em; }
.send-btn { width: 44px; height: 44px; flex: none; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 45vh; overflow-y: auto; }
.pick input { width: 18px; height: 18px; accent-color: var(--accent); }

@media (max-width: 820px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout.has-active .chat-list { display: none; }
  .chat-layout:not(.has-active) .chat-window { display: none; }
  .chat-back { display: inline-grid; }
  .msg { max-width: 88%; }
  .msg-tools { display: none !important; }
}

/* Letters -------------------------------------------------------------------- */
.letters-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: var(--gap); height: 100%; min-height: 0; }
.mailbox { display: flex; flex-direction: column; gap: 10px; padding: 14px 10px; min-height: 0; }
.write-btn { margin: 0 4px 4px; width: auto; }
.box-nav { display: flex; flex-direction: column; gap: 2px; }
.box-ico { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, 0.4); box-shadow: inset 0 1px 0 #fff; }
[data-ink='light'] .box-ico { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
.letter-list { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px solid var(--hair); }
.letter-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; transition: background 0.2s, transform 0.3s var(--spring); }
.letter-item:hover { background: rgba(255, 255, 255, 0.3); transform: translateX(3px); }
.letter-item.active { background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.35)); box-shadow: inset 0 1px 0 #fff, 0 3px 10px -4px rgba(0, 30, 70, 0.3); }
[data-ink='light'] .letter-item.active { background: rgba(255, 255, 255, 0.12); }
.letter-item.unread .letter-subject { font-weight: 900; }
.letter-item.unread .envelope { box-shadow: 0 0 0 2px #ffd23f, 0 0 14px rgba(255, 210, 63, 0.8); }
.letter-subject { font-size: 0.9rem; }
.star-on { color: #f0b400; flex: none; }
.pad-y { padding: 20px 8px; }
.envelope { position: relative; width: 52px; height: 36px; flex: none; border-radius: 5px; overflow: hidden; box-shadow: 0 2px 6px rgba(0, 30, 60, 0.3), inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.env-flap { position: absolute; inset: 0 0 45% 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(0, 0, 0, 0.06)); clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.15)); }
.env-seal { position: absolute; left: 50%; top: 42%; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--s) 50%, white), var(--s) 60%, color-mix(in srgb, var(--s) 60%, black)); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

/* Time capsules */
.env-clock { position: absolute; right: 2px; bottom: 2px; width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; color: #6a4300; background: radial-gradient(circle at 35% 30%, #fff6c9, #ffc93c 60%, #d68f00); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.letter-item.sealed .letter-subject { font-style: italic; }
.capsule-note { color: var(--accent); font-weight: 700; }
.capsule-link { margin: 6px 0 2px; }
.when-select { width: auto; min-width: 170px; }
.when-hint:empty { display: none; }
.when-hint { margin-top: -4px; }
.compose-paper.is-capsule::after {
  content: '⏳ TIME CAPSULE';
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 3px 10px;
  border: 2px solid rgba(200, 60, 40, 0.6);
  border-radius: 6px;
  color: rgba(200, 60, 40, 0.75);
  font: 900 0.72rem/1.4 var(--font);
  letter-spacing: 0.12em;
  transform: rotate(6deg);
  pointer-events: none;
}
.capsule-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; max-width: 460px; margin: 34px auto 0; }
.capsule-jar {
  position: relative;
  width: 150px;
  height: 176px;
  display: grid;
  place-items: center;
  border-radius: 34px 34px 40px 40px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.08) 30%, rgba(255, 255, 255, 0.05) 70%, rgba(255, 255, 255, 0.35)), radial-gradient(ellipse at 50% 110%, rgba(120, 220, 255, 0.45), transparent 60%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75), inset 0 -10px 24px rgba(80, 180, 255, 0.3), 0 16px 30px -14px rgba(0, 30, 70, 0.55);
}
.capsule-jar .envelope { transform: scale(1.7) rotate(-8deg); animation: capsule-bob 4s ease-in-out infinite; }
.capsule-glass { position: absolute; left: 18px; top: 26px; width: 12px; height: 110px; border-radius: 8px; background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0)); }
.capsule-lid { position: absolute; left: 14px; right: 14px; top: -14px; height: 24px; border-radius: 9px; background: linear-gradient(#ffe38a, #e0a100 55%, #a86f00); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 3px 6px rgba(80, 40, 0, 0.35); }
@keyframes capsule-bob { 50% { transform: scale(1.7) rotate(-2deg) translateY(-4px); } }
.capsule-card { width: 100%; padding: 22px; }
.capsule-count { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.capsule-count b { font-size: 2.8rem; line-height: 1; font-weight: 900; color: var(--accent); }
.capsule-count span { font-weight: 700; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .capsule-jar .envelope { animation: none; } }

.letter-pane { min-height: 0; display: flex; flex-direction: column; }
.letter-empty { flex: 1; display: grid; place-items: center; }
.letter-read { display: flex; flex-direction: column; gap: 12px; min-height: 0; height: 100%; }
.letter-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; flex-wrap: wrap; }
.letter-back { display: none; }
.letter-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 6px 30px; }
.letter-stage { position: relative; max-width: 660px; margin: 20px auto 0; perspective: 1200px; }
.big-envelope {
  position: absolute;
  left: 50%;
  top: 30px;
  width: min(420px, 90%);
  aspect-ratio: 1.6;
  transform: translateX(-50%);
  border-radius: 10px;
  background: linear-gradient(160deg, #fffaf0, #f1e2c6);
  box-shadow: 0 20px 40px -12px rgba(0, 30, 60, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  z-index: 3;
  transition: transform 0.7s var(--ease), opacity 0.4s 0.6s;
}
.big-flap { position: absolute; inset: 0 0 40% 0; background: linear-gradient(180deg, #fff6e2, #e8d3ad); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform 0.6s var(--ease); filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.15)); z-index: 2; }
.big-seal { position: absolute; left: 50%; top: 60%; transform: translate(-50%, -50%); z-index: 3; transition: transform 0.4s var(--spring), opacity 0.3s; }
.letter-stage.open .big-seal { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
.letter-stage.open .big-flap { transform: rotateX(180deg); }
.letter-stage.open .big-envelope { transform: translateX(-50%) translateY(60%); opacity: 0; }
.letter-stage.done .big-envelope { display: none; }
.letter-stage .letter-paper { transform: translateY(40px) scale(0.92); opacity: 0; transition: transform 0.7s 0.35s var(--spring), opacity 0.4s 0.35s; }
.letter-stage.open .letter-paper { transform: none; opacity: 1; }

.letter-paper { position: relative; min-height: 520px; padding: 46px 48px 70px 60px; font-family: 'Patrick Hand', 'Comic Sans MS', var(--font); font-size: 1.22rem; line-height: 30px; }
.paper-inner { position: relative; z-index: 1; }
.paper-head { display: flex; justify-content: flex-end; font-size: 0.95rem; opacity: 0.7; }
.paper-subject { font-family: inherit; font-size: 1.6rem; font-weight: 700; margin: 6px 0 14px; line-height: 1.2; }
.paper-body { min-height: 180px; }
.paper-art { position: relative; display: inline-block; margin-top: 16px; }
.paper-sign { margin-top: 26px; text-align: right; font-size: 1.3rem; }
.sticker-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.sticker-layer.editing { pointer-events: auto; }
.sticker-layer.editing:not(:has(.placed)) { pointer-events: none; }
.placed { position: absolute; transform-origin: center; }
.placed.drag { cursor: grab; touch-action: none; transition: filter 0.2s; }
.placed.drag:active { cursor: grabbing; }
.placed.selected { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.9)); }
.sticker-controls { position: absolute; transform: translateX(-50%); display: flex; gap: 2px; padding: 3px; z-index: 5; --glass-a: 0.8; color: var(--ink); font-weight: 900; }
.paper-seal { position: absolute; right: 26px; bottom: 20px; z-index: 3; transform: rotate(-8deg); }
.compose { display: flex; flex-direction: column; gap: 12px; min-height: 0; height: 100%; }
.compose-bar { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.compose-pickers { align-items: flex-end; }
.bottle-quote { padding: 8px 12px; border-radius: 12px; background: rgba(255, 244, 214, 0.75); color: #5a4214; text-shadow: none; }
.compose-stage { max-width: 660px; margin: 6px auto 0; }
.compose-paper { min-height: 560px; }
.paper-textarea { display: block; width: 100%; min-height: 330px; border: 0; outline: 0; resize: vertical; background: transparent; font: inherit; color: inherit; line-height: 30px; padding: 0; }
.paper-textarea::placeholder { color: currentColor; opacity: 0.4; }
.compose-foot { display: flex; align-items: center; gap: 12px; padding: 0 6px 4px; }
.fly-away { animation: fly-away 0.9s var(--ease) forwards; }
@keyframes fly-away {
  30% { transform: scale(0.6) rotate(-6deg); }
  100% { transform: translate(60vw, -80vh) scale(0.1) rotate(40deg); opacity: 0; }
}
.swatch-row { display: flex; gap: 6px; flex-wrap: wrap; }
.paper-swatch { position: relative; width: 36px; height: 36px; border: 0; border-radius: 10px; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 2px 5px rgba(0, 30, 60, 0.2); display: grid; place-items: center; color: #0b2540; transition: transform 0.3s var(--spring); }
.paper-swatch:hover { transform: scale(1.1) rotate(-3deg); }
.paper-swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.paper-swatch.locked, .seal-pick.locked { opacity: 0.55; }
.seal-pick { border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; transition: transform 0.3s var(--spring); }
.seal-pick:hover { transform: scale(1.12) rotate(8deg); }
.seal-pick.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }

.shore { display: flex; flex-direction: column; gap: var(--gap); overflow-y: auto; min-height: 0; padding-bottom: 30px; }
.shore-hero { position: relative; overflow: hidden; min-height: 280px; display: flex; align-items: flex-end; padding: 0; border-radius: var(--r-xl); }
.shore-scene { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; z-index: 0; }
.shore-copy { position: relative; z-index: 1; padding: 26px; color: #fff; text-shadow: 0 1px 3px rgba(0, 40, 90, 0.6); display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.shore-copy .chip { color: #0b2540; }
.shore-counters { display: flex; gap: 8px; flex-wrap: wrap; }
.bottle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.bottle-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.parchment { padding: 12px 14px; border-radius: 6px; font-family: 'Patrick Hand', var(--font); font-size: 1.08rem; color: #4a3514; text-shadow: none; background: radial-gradient(circle at 20% 20%, #fffaf0, #f3e2bd 70%, #e6cd97); box-shadow: inset 0 0 18px rgba(160, 110, 40, 0.3), 0 4px 10px -4px rgba(0, 0, 0, 0.35); }
.bottle-reveal:empty { display: none; }
.walking { padding: 20px; text-align: center; font-weight: 800; }
.footprints { display: inline-block; animation: steps 0.6s steps(2) infinite; margin-right: 8px; }
@keyframes steps { 50% { transform: translateX(6px); } }
.found-bottle { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.found-note { max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.found-note p { margin: 0; }
.pop-in { animation: pop-note 0.7s var(--spring); }
@keyframes pop-note { from { transform: translateX(-60px) scale(0.3) rotate(-20deg); opacity: 0; } }
.bottle-art { display: inline-block; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(0, 40, 80, 0.35)); }
@keyframes bob { 50% { transform: translateY(-8px) rotate(4deg); } }
.bottle-fly { position: absolute; left: 20%; bottom: 20%; z-index: 3; animation: bottle-arc 1.5s var(--ease) forwards; }
@keyframes bottle-arc {
  0% { transform: translate(0, 0) rotate(0) scale(1); }
  50% { transform: translate(35vw, -120px) rotate(200deg) scale(0.7); }
  100% { transform: translate(55vw, 40px) rotate(380deg) scale(0.2); opacity: 0; }
}

@media (max-width: 900px) {
  .letters-layout { grid-template-columns: 1fr; }
  .letters-layout.has-pane .mailbox { display: none; }
  .letters-layout:not(.has-pane) .letter-pane { display: none; }
  .letter-back { display: inline-grid; }
  .letter-paper { padding: 34px 22px 70px 26px; font-size: 1.1rem; }
}

.chat-away { color: #b87400; font-weight: 700; }
[data-ink='light'] .chat-away { color: #ffd36b; }

/* Email sign-in bits */
.auth-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: rgba(255, 210, 63, 0.22); box-shadow: inset 0 0 0 1px rgba(255, 176, 0, 0.45); }
.auth-sub { margin: 0; }
.link-btn { align-self: flex-start; border: 0; background: none; padding: 2px 0; color: var(--ink); font: inherit; font-size: 0.88rem; font-weight: 700; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(var(--accent-rgb), 0.8); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.link-btn:hover { color: var(--accent); }
.link-btn.center { display: block; margin: 4px auto 0; }
.forgot-link { align-self: flex-end; margin-top: -6px; }
.inbox-check { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 4px; }
.inbox-check h2 { margin: 4px 0 0; }
.inbox-check p { margin: 0; max-width: 34ch; }
.inbox-envelope { animation: inbox-bob 3s ease-in-out infinite; filter: drop-shadow(0 10px 16px rgba(0, 40, 90, 0.35)); }
@keyframes inbox-bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.ok-chip { color: #1d6b12; background: rgba(107, 220, 79, 0.25); gap: 3px; }
.warn-chip { color: #8a5a00; background: rgba(255, 176, 0, 0.25); }
.reset-page { display: grid; place-items: center; min-height: 70%; }
.reset-card { width: min(420px, 100%); gap: 12px; padding: 24px; }
@media (prefers-reduced-motion: reduce) { .inbox-envelope { animation: none; } }
