

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: min(92vw, 34rem);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.55rem 0.9rem;
  border: 1px solid #333;
  border-radius: 999px;
  background: #1a1a1a;
  color: #f0f0f0;
  font-size: 0.85rem;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 8px 24px rgb(0 0 0 / 35%);
  pointer-events: auto;
  animation: shared-toast-in 0.15s ease-out;
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.toast.leaving {
  opacity: 0;
  transform: translateY(6px);
}

.toast-action {
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid #555;
  border-radius: 999px;
  background: #252525;
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.toast-action:hover {
  background: #333;
  border-color: #777;
}

.toast-action:focus-visible {
  outline: 2px solid #e0e0e0;
  outline-offset: 2px;
}

@keyframes shared-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 420px) {
  .toast {
    width: 100%;
    justify-content: space-between;
    border-radius: 12px;
  }
}

.auth-button,
.settings-btn,
.settings-account button {
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 1px solid #333;
  border-radius: 6px;
  background: #1a1a1a;
  color: #e0e0e0;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background 0.2s var(--ease-standard),
    border-color 0.2s var(--ease-standard),
    color 0.2s var(--ease-standard),
    transform 0.15s var(--ease-standard);
}

.auth-button:active,
.settings-btn:active,
.settings-account button:active {
  transform: scale(0.97);
}

.auth-password {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-button:hover,
.settings-btn:hover,
.settings-account button:hover {
  background: #252525;
  border-color: #555;
}

.auth-button.secondary,
.settings-btn.secondary,
.settings-account button[hidden] {
  background: transparent;
  color: #999;
}

.auth-button.secondary:hover,
.settings-btn.secondary:hover {
  background: #1a1a1a;
  color: #e0e0e0;
}

.auth-button:disabled,
.settings-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Open Runde font faces (moved from shared/open-runde.css) ---- */

@font-face {
  font-family: 'Open Runde';
  src: url('fonts/OpenRunde-Regular.woff2') format('woff2'),
       url('fonts/OpenRunde-Regular.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Runde';
  src: url('fonts/OpenRunde-Regular.woff2') format('woff2'),
       url('fonts/OpenRunde-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Runde';
  src: url('fonts/OpenRunde-Medium.woff2') format('woff2'),
       url('fonts/OpenRunde-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Runde';
  src: url('fonts/OpenRunde-Semibold.woff2') format('woff2'),
       url('fonts/OpenRunde-Semibold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Open Runde';
  src: url('fonts/OpenRunde-Bold.woff2') format('woff2'),
       url('fonts/OpenRunde-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Shared reset (was duplicated in microtask, microhabit, microchat, */
/* ---- microssh, microstream, microtune) ---- */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid #e0e0e0;
  outline-offset: 2px;
  border-radius: 4px;
}

body {
  font-family:
    "Open Runde", -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "SF Pro Display", system-ui, sans-serif;
  background: #000;
  color: #e0e0e0;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #0a0a0a inset !important;
  -webkit-text-fill-color: #e0e0e0 !important;
  caret-color: #e0e0e0;
  transition: background-color 5000s ease-in-out 0s;
}

input,
textarea,
select {
  -webkit-appearance: none;
  appearance: none;
  font-size: 16px;
}

img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

[hidden] {
  display: none !important;
}

/* ---- Shared overlay (was duplicated in microtask, micronote, */
/* ---- microhabit, microshare) ---- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

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

.settings-overlay.visible .settings-box {
  transform: scale(1);
}

.auth-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ---- Shared settings icon (was duplicated in microtask, micronote, */
/* ---- microhabit, microshare) ---- */

.settings-icon {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  right: 1rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #000;
  border: 1px solid #333;
  color: #e0e0e0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1;
  touch-action: manipulation;
}

.settings-icon:hover {
  background: #252525;
  transform: scale(1.05) rotate(45deg);
}

.settings-icon:active {
  transform: scale(0.95) rotate(90deg);
}

.settings-icon svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Shared add button (was duplicated in microtask, microhabit, */
/* ---- microshare) ---- */

.add-button {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  right: 1rem;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #e0e0e0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  touch-action: manipulation;
  z-index: 1;
}

.add-button:hover {
  background: #252525;
  transform: scale(1.05) rotate(90deg);
}

.add-button:active {
  transform: scale(0.95) rotate(180deg);
}

.add-button svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Shared disclosure arrow (was duplicated in microtask, */
/* ---- microshare) ---- */

.arrow-icon {
  transition: transform 0.3s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.archived-header.collapsed .arrow-icon {
  transform: rotate(-90deg);
}

/* ---- Shared entrance keyframes (slide was duplicated in microtask, */
/* ---- micronote, microhabit, microshare; fade in microshare, */
/* ---- microchat) ---- */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (display-mode: standalone) {
  .settings-icon {
    top: calc(1.25rem + env(safe-area-inset-top, 0px));
  }
  .add-button {
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ---- Shared settings toggle (was duplicated in microchat, */
/* ---- microstream) ---- */

.settings-option-row input:checked {
  background: #e0e0e0;
  border-color: #e0e0e0;
}

.settings-option-row input:checked::after {
  transform: translateX(16px);
  background: #000;
}

/* ---- Install prompt (moved from shared/install-prompt.css) ---- */

.install-prompt {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.install-prompt[hidden] {
  display: none;
}

.install-prompt-card {
  width: 100%;
  max-width: 340px;
  padding: 32px 24px 24px;
  border-radius: 20px;
  background: #1c1c1e;
  color: #f2f2f7;
  text-align: center;
}

.install-prompt-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: #3a3a3c;
  color: #f2f2f7;
}

.install-prompt-icon svg {
  width: 40px;
  height: 40px;
}

.install-prompt-title {
  margin: 0 0 8px;
  color: #f2f2f7;
  font-size: 20px;
  font-weight: 600;
}

.install-prompt-text {
  margin: 0 0 24px;
  color: #aeaeb2;
  font-size: 15px;
  line-height: 1.5;
}

.install-prompt-close {
  min-height: 44px;
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #f2f2f7;
  border-radius: 10px;
  background: #f2f2f7;
  color: #1c1c1e;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 100ms ease-out,
    opacity 100ms ease-out;
}

.install-prompt-close:hover {
  opacity: 0.86;
}

.install-prompt-close:active {
  transform: scale(0.97);
  opacity: 0.72;
}

.install-prompt-close:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.4);
  outline-offset: 3px;
}

.install-prompt-share-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: -3px;
}

@media (orientation: landscape) {
  .install-prompt {
    padding-right: calc(24px + env(safe-area-inset-right, 0px));
    padding-left: calc(24px + env(safe-area-inset-left, 0px));
  }
}

.install-prompt-close {
  transition: none;
}
