/* INK navigation system. */
:root {
    --bg: #f0f4ff;
    --card: #ffffff;
    --border: #d6e2ff;
    --accent: #3b6ef5;
    --accent-hover: #2a5be0;
    --accent-light: #eef2ff;
    --text: #1a2340;
    --muted: #7a8baa;
    --radius: 0.625rem;
    --shadow: 0 0.25rem 1.5rem rgba(59, 110, 245, 0.08);
}

html {
    width: 100%;
    overflow-x: clip;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

body {
    width: 100%;
    overflow-x: clip;
}

a, button, input, select, textarea, [role="button"] {
    -webkit-tap-highlight-color: transparent;
}

@media (pointer: coarse) {
    a:focus:not(:focus-visible),
    button:focus:not(:focus-visible),
    [role="button"]:focus:not(:focus-visible) {
        outline: none;
        box-shadow: none;
    }
}

.ink-rail-nav {
    position: fixed;
    left: 1.375rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    pointer-events: none;

}

.ink-rail-pill {
    pointer-events: auto;
    width: 3.625rem;
    height: 3.625rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #7a8baa;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(0.75rem);
    -webkit-backdrop-filter: blur(0.75rem);
    box-shadow: 0 0.625rem 1.875rem rgba(25, 35, 64, 0.16);
    transition: transform .2s, box-shadow .2s, color .2s, border-color .2s;
    position: relative;
}

.ink-rail-pill:hover {
    transform: translateX(0.3125rem) scale(1.06);
    color: #3b6ef5;
    border-color: rgba(59, 110, 245, 0.45);
    box-shadow: 0 0.875rem 2.1875rem rgba(59, 110, 245, 0.2);
}

.ink-rail-pill.active {
    color: #fff;
    background: linear-gradient(135deg, #5f89ff 0%, #355fdf 100%);
    border-color: #5f89ff;
    box-shadow: 0 1rem 2.25rem rgba(59, 110, 245, 0.34);
}

.ink-rail-pill svg {
    width: 1.25rem;
    height: 1.25rem;
}

  .ink-rail-brand {
    pointer-events: auto;
    width: 4.125rem;
    height: 4.125rem;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
  }

.ink-rail-brand::after {
    content: '';
    position: absolute;
    width: 112%;
    height: 112%;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, .36);
    animation: inkRailSpin 10s linear infinite;
}

.ink-rail-tip {
    position: absolute;
    left: calc(100% + 0.625rem);
    top: 50%;
    transform: translateY(-50%);
    padding: 0.375rem 0.625rem;
    border-radius: 62.4375rem;
    background: #1a2340;
    color: #fff;
    white-space: nowrap;
    font-size: .72rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s;
}

.ink-rail-pill:hover .ink-rail-tip { opacity: 1; }

@keyframes inkRailSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 64rem) {
    .ink-rail-nav { display: none; }
}

/* Mobile bottom navigation */
.ink-mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 4.375rem;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #d6e2ff;
    backdrop-filter: blur(0.625rem);
    -webkit-backdrop-filter: blur(0.625rem);
    z-index: 100100;
    display: none;
    align-items: center;
    justify-content: space-around;
    padding: 0.375rem max(0.75rem, env(safe-area-inset-right)) max(0.375rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    box-shadow: 0 -8px 1.5rem rgba(26, 35, 64, 0.08);
}

.ink-mobile-link {
    flex: 1;
    max-width: 6.875rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    color: #7a8baa;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1875rem;
    position: relative;
    transition: color .18s, background .18s, transform .18s;
}

.ink-mobile-link svg {
    width: 1.125rem;
    height: 1.125rem;
}

.ink-mobile-link .ink-mobile-label {
    font-size: 0.69rem;
    font-weight: 600;
    line-height: 1;
}

.ink-mobile-link.active {
    color: #3b6ef5;
    background: #eef2ff;
}

.ink-mobile-link:active {
    transform: scale(0.96);
}

.ink-mobile-notif {
    background: none;
    border: none;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.ink-mobile-badge {
    position: absolute;
    top: 0.5rem;
    right: 26%;
    min-width: 1rem;
    height: 1rem;
    border-radius: 62.4375rem;
    background: #e03e3e;
    color: #fff;
    border: 0.125rem solid #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
}

.ink-rail-badge {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    min-width: 1.125rem;
    height: 1.125rem;
    border-radius: 62.4375rem;
    background: #e03e3e;
    color: #fff;
    border: 0.125rem solid #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.3125rem;
    box-shadow: 0 0.125rem 0.5rem rgba(224, 62, 62, 0.35);
}

.scroll-doom-popup {
    display: none;
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 100120;
    background: #1a2340;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    max-width: 18.75rem;
    box-shadow: 0 0.625rem 1.875rem rgba(26, 35, 64, 0.3);
    animation: slideIn .3s ease;
}
.scroll-doom-popup.show { display: block; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 64rem) {
    body {
        padding-bottom: calc(5.125rem + env(safe-area-inset-bottom)) !important;
    }
    .ink-mobile-nav {
        display: flex;
    }
}

.ink-notif-dropdown {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    width: 20rem;
    max-height: 26.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 100110;
    display: none;
    flex-direction: column;
    font-family: 'DM Sans', sans-serif;
}
.ink-notif-dropdown.open {
    display: flex;
}

/* Centered digital-wellbeing reminder. Kept last to override the legacy toast. */
.scroll-doom-popup {
    position: fixed;
    inset: 0;
    width: auto;
    max-width: none;
    max-height: none;
    padding: 1.25rem;
    background: rgba(17, 27, 50, .46);
    backdrop-filter: blur(0.4375rem);
    -webkit-backdrop-filter: blur(0.4375rem);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--text);
    align-items: center;
    justify-content: center;
    animation: none;
}
.scroll-doom-popup.show { display: flex; }
.scroll-doom-card {
    position: relative;
    width: min(26.875rem, 100%);
    padding: 1.9375rem 1.875rem 1.5625rem;
    border: 1px solid rgba(214, 226, 255, .9);
    border-radius: 1.5rem;
    background: linear-gradient(160deg, #ffffff 0%, #f7f9ff 100%);
    box-shadow: 0 1.75rem 5rem rgba(18, 33, 68, .28);
    text-align: center;
    animation: wellbeingIn .28s ease-out;
}
@keyframes wellbeingIn {
    from { opacity: 0; transform: translateY(0.875rem) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.scroll-doom-close {
    position: absolute;
    top: 0.875rem;
    right: 0.9375rem;
    width: 2.125rem;
    height: 2.125rem;
    border: 0;
    border-radius: 50%;
    background: #eef3ff;
    color: #64738f;
    font-size: 1.375rem;
    line-height: 1;
    cursor: pointer;
}
.scroll-doom-icon {
    width: 3.875rem;
    height: 3.875rem;
    margin: 0 auto 0.9375rem;
    border-radius: 1.25rem;
    display: grid;
    place-items: center;
    color: #315fdb;
    background: linear-gradient(145deg, #edf3ff, #dfe9ff);
    box-shadow: inset 0 0 0 1px rgba(49, 95, 219, .12), 0 0.625rem 1.5625rem rgba(49, 95, 219, .13);
}
.scroll-doom-icon svg { width: 1.9375rem; height: 1.9375rem; }
.scroll-doom-kicker {
    color: #315fdb;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.scroll-doom-card h2 {
    margin: 0.5rem 1.5625rem 0.625rem;
    color: #17213a;
    font-size: clamp(1.25rem, 4vw, 1.5625rem);
    line-height: 1.2;
}
.scroll-doom-message {
    margin: 0 auto;
    max-width: 21.875rem;
    color: #60708c;
    font-size: 0.875rem;
    line-height: 1.65;
}
.scroll-doom-actions {
    display: flex;
    gap: 0.625rem;
    margin-top: 1.4375rem;
}
.scroll-doom-actions button {
    flex: 1;
    min-height: 2.875rem;
    padding: 0.625rem 0.9375rem;
    border-radius: 0.8125rem;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}
.scroll-doom-primary {
    border: 1px solid #3b6ef5;
    background: linear-gradient(135deg, #4c79f6, #315fdb);
    color: #fff;
    box-shadow: 0 0.5625rem 1.375rem rgba(49, 95, 219, .22);
}
.scroll-doom-secondary {
    border: 1px solid #dbe4f5;
    background: #fff;
    color: #5d6c87;
}
.scroll-doom-note {
    margin: 0.875rem 0 0;
    color: #929db1;
    font-size: 0.6875rem;
}
@media (max-width: 30rem) {
    .scroll-doom-popup { padding: 1rem; }
    .scroll-doom-card { padding: 1.6875rem 1.25rem 1.3125rem; border-radius: 1.3125rem; }
    .scroll-doom-actions { flex-direction: column; }
}

@media (max-width: 64rem) {
    .ink-notif-dropdown {
        top: auto;
        right: 0.75rem;
        bottom: calc(5.125rem + env(safe-area-inset-bottom));
        width: min(22.5rem, calc(100vw - 1.5rem));
        max-height: min(32.5rem, calc(100dvh - 6.875rem));
    }
}
.ink-notif-head {
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
}
.ink-notif-clear {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent);
    background: none;
    border: none;
    border-radius: 0.375rem;
    padding: 0.25rem 0.625rem;
    cursor: pointer;
    transition: color .15s;
}
.ink-notif-clear:hover {
    color: var(--accent-hover);
}
.ink-notif-list {
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem;
}
.ink-notif-item {
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: background .12s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.ink-notif-item:hover {
    background: var(--accent-light);
}
.ink-notif-item.unread {
    background: #eef2ff;
}
.ink-notif-item .notif-msg {
    font-size: 0.8125rem;
    color: var(--text);
    line-height: 1.4;
}
.ink-notif-item .notif-time {
    font-size: 0.6875rem;
    color: var(--muted);
    margin-top: 0.25rem;
}
.ink-notif-empty {
    padding: 1.25rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.8125rem;
}

.share-modal-card {
    max-width: 26.25rem;
    width: 90%;
    text-align: center;
    padding: 1.5rem 1.25rem 1.75rem;
}

.share-modal-title {
    margin: 0 0 1.25rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.share-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
}

.share-option:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 0.5rem 1.5rem rgba(59, 110, 245, 0.12);
}

.share-option:active {
    transform: scale(0.97);
}

.share-icon {
    font-size: 1.625rem;
    line-height: 1;
}

.share-option:hover .fa-whatsapp { color: #25d366; }
.share-option:hover .fa-x-twitter,
.share-option:hover .fa-twitter { color: #000; }
.share-option:hover .fa-facebook { color: #1877f2; }
.share-option:hover .fa-telegram { color: #0088cc; }
.share-option:hover .fa-instagram { color: #e4405f; }
.share-option:hover .fa-link { color: var(--accent); }
.ink-mobile-logout-form {
    display: contents;
}

.ink-mobile-logout-form .ink-mobile-link {
    border: 0;
    font: inherit;
    cursor: pointer;
}

.ink-nav-logout {
    color: #c14c5a;
}

.ink-mobile-link.ink-nav-logout {
    background: transparent;
}

.ink-nav-logout:hover {
    color: #e03e4f;
    border-color: rgba(224, 62, 79, 0.42);
}

/* Dark navigation surfaces remain distinct without looking disabled. */
:root[data-theme="dark"] .ink-rail-pill {
    color: #9caaca;
    background: rgba(19, 24, 36, 0.92);
    border-color: #303a50;
    box-shadow: 0 0.75rem 1.875rem rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .ink-rail-pill:hover {
    color: #86a5ff;
    background: #1a2131;
    border-color: #526da9;
}

:root[data-theme="dark"] .ink-rail-pill.active {
    color: #fff;
    background: #416fe8;
    border-color: #6e94ff;
    box-shadow: 0 0.875rem 2.125rem rgba(48, 91, 211, 0.34);
}

:root[data-theme="dark"] .ink-rail-brand {
    background: #111622;
    border-color: #303a50;
    box-shadow: 0 0.75rem 1.875rem rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .ink-mobile-nav {
    background: rgba(12, 16, 25, 0.96);
    border-top-color: #283247;
    box-shadow: 0 -10px 1.875rem rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .ink-mobile-link {
    color: #8f9dbc;
    background: transparent;
}

:root[data-theme="dark"] .ink-mobile-link:hover {
    color: #b8c8ec;
    background: #171d2b;
}

:root[data-theme="dark"] .ink-mobile-link.active {
    color: #7fa0ff;
    background: #1b263f;
}

:root[data-theme="dark"] .ink-rail-pill.ink-nav-logout,
:root[data-theme="dark"] .ink-mobile-link.ink-nav-logout {
    color: #ff8993;
    background: transparent;
}

:root[data-theme="dark"] .ink-mobile-badge,
:root[data-theme="dark"] .ink-rail-badge {
    border-color: #111622;
}
