/* ==============================================
   Memory — Apple iOS Design Standard
   ============================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

:root {
    /* ========== iOS Dynamic Colors (Dark Mode) ========== */
    --bg-base: #000000;
    --bg-elevated: #1c1c1e;
    --bg-grouped: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-quaternary: #3a3a3c;

    --fill-primary: rgba(120, 120, 128, 0.36);
    --fill-secondary: rgba(120, 120, 128, 0.32);
    --fill-tertiary: rgba(118, 118, 128, 0.24);
    --fill-quaternary: rgba(116, 116, 128, 0.18);

    --label-primary: #ffffff;
    --label-secondary: rgba(235, 235, 245, 0.6);
    --label-tertiary: rgba(235, 235, 245, 0.3);
    --label-quaternary: rgba(235, 235, 245, 0.16);

    --separator-opaque: #38383a;
    --separator: rgba(84, 84, 88, 0.65);

    --blue: #0a84ff;
    --blue-pressed: #006edc;
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --yellow: #ffd60a;
    --pink: #ff375f;
    --purple: #bf5af2;
    --indigo: #5e5ce6;
    --teal: #64d2ff;
    --mint: #66d4cf;

    --tint-blue: rgba(10, 132, 255, 0.15);
    --tint-red: rgba(255, 69, 58, 0.15);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 32px;

    /* Radius */
    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 16px;
    --r-2xl: 20px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    --text-large-title: 34px;
    --text-title-1: 28px;
    --text-title-2: 22px;
    --text-title-3: 20px;
    --text-headline: 17px;
    --text-body: 17px;
    --text-callout: 16px;
    --text-subhead: 15px;
    --text-footnote: 13px;
    --text-caption-1: 12px;
    --text-caption-2: 11px;

    /* Animation */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --dur-fast: 200ms;
    --dur-base: 300ms;
}

/* ========== Base ========== */

html, body {
    background: var(--bg-base);
    color: var(--label-primary);
    font-family: var(--font-family);
    font-size: var(--text-body);
    line-height: 1.3;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
    letter-spacing: -0.022em;
}

input, textarea, [contenteditable] {
    user-select: text;
    -webkit-user-select: text;
}

button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    letter-spacing: inherit;
}

img {
    display: block;
    max-width: 100%;
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#app {
    width: 100vw;
    min-height: 100vh;
    position: relative;
    background: var(--bg-base);
}

/* ========== Screens ========== */

.screen {
    display: none;
    min-height: 100vh;
    padding-bottom: 80px;
}

.screen.active {
    display: block;
    animation: screenEnter 350ms var(--ease-out-expo);
}

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

/* ========== Loading ========== */

#loading {
    display: none;
    align-items: center;
    justify-content: center;
    height: 100vh;
    flex-direction: column;
}

#loading.active {
    display: flex;
}

.loader-content {
    text-align: center;
    animation: fadeIn 200ms var(--ease-out);
}

.logo-circle {
    width: 48px;
    height: 48px;
    border: 2.5px solid var(--blue);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 800ms linear infinite;
    margin: 0 auto var(--space-lg);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.loader-content p {
    font-size: var(--text-subhead);
    color: var(--label-secondary);
    font-weight: 500;
}

/* ========== Navigation Header ========== */

.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid transparent;
    transition: border-color 200ms ease;
}

.nav-bar.scrolled {
    border-bottom-color: var(--separator-opaque);
}

.nav-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    min-height: 44px;
}

.nav-title {
    flex: 1;
    text-align: center;
    font-size: var(--text-headline);
    font-weight: 600;
    letter-spacing: -0.4px;
}

.nav-btn {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    font-size: 17px;
    font-weight: 400;
    transition: opacity 150ms;
    gap: 4px;
    padding: 0 6px;
    border-radius: 22px;
}

.nav-btn:active {
    opacity: 0.4;
}

.nav-btn .icon {
    width: 22px;
    height: 22px;
}

.nav-btn-back {
    justify-content: flex-start;
}

/* Large Title */
.large-title-section {
    padding: 8px 16px 16px;
}

.large-title {
    font-size: var(--text-large-title);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.large-title-subtitle {
    margin-top: 4px;
    font-size: var(--text-subhead);
    color: var(--label-secondary);
}

/* ========== Sections ========== */

.section {
    margin-top: 24px;
}

.section-header {
    padding: 0 32px 6px;
    font-size: var(--text-footnote);
    font-weight: 400;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: -0.08px;
}

/* ========== Category Cards ========== */

.categories {
    padding: 0 16px;
    display: grid;
    gap: 10px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-elevated);
    padding: 14px 16px;
    border-radius: var(--r-xl);
    width: 100%;
    text-align: left;
    transition: transform 100ms var(--ease-out), background 150ms;
    position: relative;
}

.category-card::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='12' viewBox='0 0 7 12' fill='none'%3E%3Cpath d='M1 1L6 6L1 11' stroke='%23636366' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
}

.category-card:active {
    background: var(--bg-tertiary);
    transform: scale(0.985);
}

.cat-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cat-icon-wrap svg {
    width: 22px;
    height: 22px;
    color: white;
    stroke: white;
    fill: none;
}

.cat-icon-wrap.tint-blue { background: var(--blue); }
.cat-icon-wrap.tint-orange { background: var(--orange); }
.cat-icon-wrap.tint-purple { background: var(--purple); }
.cat-icon-wrap.tint-green { background: var(--green); }
.cat-icon-wrap.tint-pink { background: var(--pink); }
.cat-icon-wrap.tint-indigo { background: var(--indigo); }
.cat-icon-wrap.tint-red { background: var(--red); }
.cat-icon-wrap.tint-mint { background: var(--mint); }

.cat-info {
    flex: 1;
    min-width: 0;
    margin-right: 20px;
}

.cat-title {
    font-size: var(--text-body);
    font-weight: 400;
    color: var(--label-primary);
    letter-spacing: -0.4px;
}

.cat-count {
    font-size: var(--text-subhead);
    color: var(--label-secondary);
    margin-top: 1px;
}

/* ========== List Items ========== */

.list-standalone {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-elevated);
    padding: 11px 14px;
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: background 100ms, transform 100ms;
    min-height: 44px;
    width: 100%;
    text-align: left;
}

.list-item:active {
    background: var(--bg-tertiary);
    transform: scale(0.985);
}

.list-item.with-chevron::after {
    content: '';
    margin-left: auto;
    width: 7px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='12' viewBox='0 0 7 12' fill='none'%3E%3Cpath d='M1 1L6 6L1 11' stroke='%23636366' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.list-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

.list-item-avatar.square {
    border-radius: 10px;
}

.list-item-avatar svg {
    width: 20px;
    height: 20px;
    color: white;
    fill: none;
    stroke: white;
    stroke-width: 2;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: var(--text-body);
    font-weight: 400;
    letter-spacing: -0.4px;
    color: var(--label-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-subtitle {
    font-size: var(--text-subhead);
    color: var(--label-secondary);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.24px;
}

.list-item-meta {
    font-size: var(--text-subhead);
    color: var(--label-secondary);
    flex-shrink: 0;
    margin-left: 8px;
}

/* ========== Empty State ========== */

.empty-state {
    text-align: center;
    padding: 60px 32px;
    color: var(--label-secondary);
    animation: fadeIn 300ms var(--ease-out);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--label-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.empty-state-title {
    font-size: var(--text-title-3);
    font-weight: 600;
    color: var(--label-primary);
    margin-bottom: 6px;
    letter-spacing: -0.45px;
}

.empty-state-text {
    font-size: var(--text-subhead);
    color: var(--label-secondary);
    max-width: 260px;
    margin: 0 auto;
    line-height: 1.35;
}

/* ========== Detail Pages ========== */

.detail-hero {
    text-align: center;
    padding: 16px 16px 24px;
}

.avatar-hero {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    color: white;
    letter-spacing: -1px;
}

.avatar-hero.square {
    border-radius: 22px;
}

.avatar-hero svg {
    width: 44px;
    height: 44px;
    color: white;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.detail-title {
    font-size: var(--text-title-1);
    font-weight: 700;
    letter-spacing: -0.6px;
    line-height: 1.15;
}

.detail-subtitle {
    margin-top: 4px;
    font-size: var(--text-subhead);
    color: var(--label-secondary);
}

.detail-context {
    margin: 0 16px 24px;
    background: var(--bg-elevated);
    padding: 14px 16px;
    border-radius: var(--r-xl);
    font-size: var(--text-body);
    color: var(--label-primary);
    line-height: 1.4;
    letter-spacing: -0.4px;
}

.detail-section-title {
    padding: 0 32px 6px;
    font-size: var(--text-footnote);
    font-weight: 400;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: -0.08px;
}

.detail-meta-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
    color: var(--label-secondary);
    font-size: var(--text-subhead);
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-meta-item svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* ========== Notes ========== */

.note-item {
    background: var(--bg-elevated);
    padding: 12px 14px;
    border-radius: var(--r-lg);
    font-size: var(--text-body);
    line-height: 1.4;
    letter-spacing: -0.4px;
    transition: background 150ms;
}

.note-item:active {
    background: var(--bg-tertiary);
}

.note-meta {
    font-size: var(--text-caption-1);
    color: var(--label-secondary);
    margin-top: 6px;
}

/* ========== Inline Add ========== */

.btn-add-inline {
    background: transparent;
    color: var(--blue);
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--r-lg);
    font-size: var(--text-body);
    font-weight: 400;
    transition: opacity 150ms;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    letter-spacing: -0.4px;
}

.btn-add-inline:active {
    opacity: 0.5;
}

.btn-add-inline svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* ========== Photo grid ========== */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    margin: 0 16px 24px;
}

.photo-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--r-md);
    cursor: pointer;
    transition: transform 200ms var(--ease-spring);
}

.photo-grid img:active {
    transform: scale(0.95);
}

/* ========== Timeline ========== */

.timeline {
    position: relative;
    padding: 0 16px 0 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 23px;
    top: 8px;
    bottom: 8px;
    width: 1.5px;
    background: var(--separator-opaque);
}

.timeline-item {
    position: relative;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border-radius: var(--r-lg);
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 150ms, transform 100ms;
}

.timeline-item:active {
    background: var(--bg-tertiary);
    transform: scale(0.985);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 18px;
    width: 12px;
    height: 12px;
    background: var(--blue);
    border-radius: 50%;
    border: 3px solid var(--bg-base);
    box-shadow: 0 0 0 1.5px var(--blue);
}

.timeline-item-date {
    font-size: var(--text-caption-1);
    color: var(--label-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
}

.timeline-item-title {
    font-size: var(--text-headline);
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.4px;
}

.timeline-item-desc {
    font-size: var(--text-subhead);
    color: var(--label-secondary);
    line-height: 1.35;
}

/* ========== Destructive ========== */

.btn-destructive {
    width: calc(100% - 32px);
    background: var(--bg-elevated);
    color: var(--red);
    padding: 13px;
    border-radius: var(--r-xl);
    font-size: var(--text-body);
    font-weight: 400;
    margin: 24px 16px;
    transition: opacity 150ms, background 150ms;
    letter-spacing: -0.4px;
}

.btn-destructive:active {
    background: var(--bg-tertiary);
    opacity: 0.7;
}

/* ========== FAB ========== */

.fab {
    position: fixed;
    bottom: 24px;
    right: 16px;
    width: 56px;
    height: 56px;
    background: var(--blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 16px rgba(10, 132, 255, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 200ms var(--ease-spring);
    z-index: 50;
}

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

.fab svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: white;
    stroke-width: 2.5;
}

/* ========== Modal (iOS Sheet) ========== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
}

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

.modal.hidden { display: none; }

.modal-content {
    background: var(--bg-elevated);
    width: 100%;
    max-width: 500px;
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 400ms var(--ease-out-expo);
}

.modal.visible .modal-content {
    transform: translateY(0);
}

.sheet-handle {
    width: 36px;
    height: 5px;
    background: var(--bg-quaternary);
    border-radius: 3px;
    margin: 8px auto 0;
    flex-shrink: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 8px;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: var(--text-headline);
    font-weight: 600;
    letter-spacing: -0.4px;
}

.modal-body {
    padding: 8px 16px 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px 20px;
    border-top: 0.5px solid var(--separator);
    flex-shrink: 0;
}

/* ========== Buttons ========== */

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 14px;
    border-radius: var(--r-md);
    font-size: var(--text-body);
    font-weight: 600;
    transition: opacity 150ms, transform 100ms, background 150ms;
    letter-spacing: -0.4px;
    min-height: 50px;
}

.btn-primary {
    background: var(--blue);
    color: white;
}

.btn-primary:active {
    background: var(--blue-pressed);
    transform: scale(0.97);
}

.btn-primary:disabled {
    opacity: 0.5;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--blue);
}

.btn-secondary:active {
    background: var(--bg-quaternary);
    transform: scale(0.97);
}

/* ========== Form ========== */

.form-field {
    margin-bottom: 14px;
}

.form-field label {
    display: block;
    font-size: var(--text-footnote);
    color: var(--label-secondary);
    margin: 0 4px 6px;
    text-transform: uppercase;
    letter-spacing: 0.06px;
    font-weight: 500;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    background: var(--bg-tertiary);
    border: none;
    padding: 13px 14px;
    border-radius: var(--r-md);
    color: var(--label-primary);
    font-size: var(--text-body);
    font-family: inherit;
    outline: none;
    letter-spacing: -0.4px;
    transition: background 150ms;
    -webkit-appearance: none;
    appearance: none;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    background: var(--bg-quaternary);
}

.form-field textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.4;
}

.form-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23636366' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

/* ========== Search ========== */

.search-bar {
    margin: 8px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--r-md);
    padding: 7px 8px 7px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-bar svg {
    width: 16px;
    height: 16px;
    color: var(--label-secondary);
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--label-primary);
    font-size: var(--text-body);
    outline: none;
    font-family: inherit;
    letter-spacing: -0.4px;
}

.search-bar input::placeholder {
    color: var(--label-secondary);
}

.search-result {
    background: var(--bg-elevated);
    padding: 12px 14px;
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: background 100ms, transform 100ms;
}

.search-result:active {
    background: var(--bg-tertiary);
    transform: scale(0.985);
}

.search-result-type {
    font-size: var(--text-caption-2);
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 3px;
}

.search-result-title {
    font-size: var(--text-headline);
    font-weight: 600;
    margin-bottom: 3px;
    letter-spacing: -0.4px;
}

.search-result-snippet {
    font-size: var(--text-subhead);
    color: var(--label-secondary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.24px;
}

.search-result mark {
    background: var(--tint-blue);
    color: var(--blue);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}

/* ========== Avatar Colors ========== */
.avatar-c-0 { background: linear-gradient(135deg, #FF6B6B 0%, #EE5A52 100%); }
.avatar-c-1 { background: linear-gradient(135deg, #4ECDC4 0%, #44A3AA 100%); }
.avatar-c-2 { background: linear-gradient(135deg, #FFD93D 0%, #F6A623 100%); }
.avatar-c-3 { background: linear-gradient(135deg, #6C5CE7 0%, #5F3DC4 100%); }
.avatar-c-4 { background: linear-gradient(135deg, #FD79A8 0%, #E84393 100%); }
.avatar-c-5 { background: linear-gradient(135deg, #74B9FF 0%, #0984E3 100%); }
.avatar-c-6 { background: linear-gradient(135deg, #00B894 0%, #00CEC9 100%); }
.avatar-c-7 { background: linear-gradient(135deg, #FAB1A0 0%, #E17055 100%); }
.avatar-c-8 { background: linear-gradient(135deg, #A29BFE 0%, #6C5CE7 100%); }
.avatar-c-9 { background: linear-gradient(135deg, #FFBE76 0%, #F0932B 100%); }

/* ========== Toast ========== */

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(44, 44, 46, 0.95);
    color: var(--label-primary);
    padding: 12px 20px;
    border-radius: 24px;
    font-size: var(--text-subhead);
    font-weight: 500;
    z-index: 300;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    max-width: 80%;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms, transform 350ms var(--ease-spring);
    letter-spacing: -0.24px;
    border: 0.5px solid var(--separator-opaque);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.hidden { display: none; }

/* ========== Badge ========== */

.category-badge {
    display: inline-block;
    font-size: var(--text-caption-2);
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--fill-quaternary);
    color: var(--label-secondary);
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0;
}

/* ========== Action Sheet ========== */

.action-sheet-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary);
    padding: 14px;
    border-radius: var(--r-lg);
    width: 100%;
    text-align: left;
    transition: background 150ms, transform 100ms;
}

.action-sheet-item:active {
    background: var(--bg-quaternary);
    transform: scale(0.985);
}

.action-sheet-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-sheet-item-icon svg {
    width: 20px;
    height: 20px;
    color: white;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.action-sheet-item-text {
    flex: 1;
}

.action-sheet-item-title {
    font-size: var(--text-body);
    font-weight: 500;
    letter-spacing: -0.4px;
}

.action-sheet-item-subtitle {
    font-size: var(--text-footnote);
    color: var(--label-secondary);
    margin-top: 1px;
}

/* ========== Safe Areas ========== */

@supports (padding: env(safe-area-inset-top)) {
    .nav-bar {
        padding-top: env(safe-area-inset-top);
    }
    .fab {
        bottom: calc(24px + env(safe-area-inset-bottom));
    }
}
