:root {
    --bg: #fbfbfd;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f5f7;
    --bg-elevated: rgba(255, 255, 255, 0.85);
    --separator: rgba(0, 0, 0, 0.08);
    --separator-opaque: #d2d2d7;
    --label: #1d1d1f;
    --label-secondary: #6e6e73;
    --label-tertiary: #86868b;
    --label-quaternary: #c7c7cc;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --green: #00873e;
    --red: #d70015;
    --orange: #ca6700;
    --indigo: #5e5ce6;
    --purple: #bf5af2;
    --pink: #d6336c;
    --teal: #0091ad;

    --bg-color: var(--bg);
    --card-bg: var(--bg-secondary);
    --primary: var(--accent);
    --primary-glow: rgba(0, 113, 227, 0.18);
    --secondary: var(--indigo);
    --text-color: var(--label);
    --text-muted: var(--label-secondary);
    --border: var(--separator-opaque);
    --success: var(--green);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Outfit", "Segoe UI", system-ui, sans-serif;
    background-color: var(--bg);
    background-image: none;
    color: var(--label);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 15px;
    line-height: 1.47;
    letter-spacing: -0.01em;
}

header {
    padding: 0.95rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--separator);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    background: rgba(251, 251, 253, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title-group {
    text-align: left;
}

h1 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--label);
    letter-spacing: -0.022em;
    margin-bottom: 0;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
}

.subtitle {
    color: var(--label-secondary);
    font-size: 0.78rem;
    letter-spacing: 0;
    margin-top: 0.1rem;
}

main {
    max-width: 980px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    flex-grow: 1;
}

.tabs {
    display: inline-flex;
    background: rgba(120, 120, 128, 0.12);
    border-radius: 10px;
    padding: 2px;
    gap: 0;
    margin-bottom: 2.5rem;
    border: none;
    width: auto;
    align-self: flex-start;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.45rem 0.95rem;
    border-radius: 8px;
    color: var(--label);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    letter-spacing: -0.005em;
}

.tab-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.04);
}

.tab-btn.active {
    background: #ffffff;
    color: var(--label);
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.04), 0 3px 8px rgba(0, 0, 0, 0.12);
}

.tab-content {
    display: none;
    animation: fadeIn 0.22s ease forwards;
}

.tab-content.active {
    display: block;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--separator);
    border-radius: 18px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    backdrop-filter: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--label);
    letter-spacing: -0.018em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--label-secondary);
    font-size: 0.82rem;
    font-weight: 400;
}

input, select, textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--separator-opaque);
    padding: 0.65rem 0.95rem;
    border-radius: 10px;
    color: var(--label);
    font-family: inherit;
    font-size: 0.93rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
    color: var(--label-tertiary);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

.btn {
    background: var(--accent);
    border: none;
    padding: 0.55rem 1.25rem;
    color: #ffffff;
    border-radius: 980px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.06s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    letter-spacing: -0.005em;
}

.btn:hover {
    background: var(--accent-hover);
    transform: none;
    box-shadow: none;
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 400;
}

.btn-outline:hover {
    background: var(--accent);
    color: #ffffff;
}

.btn-danger {
    background: var(--red);
    width: 100%;
    margin-top: 0.5rem;
    color: white;
}

.btn-danger:hover {
    background: #ea1426;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

th, td {
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--separator);
}

th {
    color: var(--label-secondary);
    font-weight: 500;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

.rank-badge {
    background: rgba(0, 113, 227, 0.1);
    color: var(--accent);
    padding: 0.18rem 0.6rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.82rem;
}

.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: rgba(29, 29, 31, 0.96);
    color: #ffffff;
    padding: 0.85rem 1.2rem;
    border-radius: 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.75rem);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    z-index: 1000;
    font-weight: 500;
    font-size: 0.9rem;
    max-width: 420px;
}

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

.toast.error {
    background: rgba(215, 0, 21, 0.95);
}

.log-box {
    background: #1d1d1f;
    border: 1px solid var(--separator);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    font-family: "SF Mono", ui-monospace, monospace;
    font-size: 0.8rem;
    max-height: 280px;
    overflow-y: auto;
    color: #34d399;
    margin-top: 0.5rem;
}

.log-entry {
    margin-bottom: 0.2rem;
    line-height: 1.5;
}

.user-widget {
    position: relative;
    cursor: pointer;
}

.user-badge {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--label);
    transition: background 0.15s ease;
}

.user-badge:hover {
    background: rgba(0, 0, 0, 0.08);
}

.user-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--label-tertiary);
}

.user-status-dot.active {
    background: var(--green);
    box-shadow: none;
}

.user-overlay {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--separator);
    border-radius: 14px;
    padding: 1rem;
    width: 260px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    transform: translateY(-6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 1000;
}

.user-overlay.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.user-overlay-title {
    font-size: 0.7rem;
    color: var(--label-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.user-overlay-uid {
    font-size: 0.88rem;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 0.85rem;
    word-break: break-all;
    color: var(--label);
}

.user-overlay .btn,
.user-overlay .btn-outline,
.user-overlay .btn-danger {
    width: 100%;
    padding: 0.55rem 0.95rem;
    font-size: 0.86rem;
}

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

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

th.sortable:hover {
    color: var(--label);
}

.hero-icon-container {
    width: 30px;
    height: 30px;
    overflow: hidden;
    position: relative;
    border-radius: 7px;
    background: var(--bg-tertiary);
    border: 1px solid var(--separator);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-icon-img {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    max-width: 100%;
    max-height: 100%;
}

.ios-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    flex-shrink: 0;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #e9e9eb;
    border-radius: 31px;
    transition: background 0.2s ease;
}

.ios-slider::before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    top: 2px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 3px 1px rgba(0, 0, 0, 0.06);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.ios-switch input:checked + .ios-slider {
    background: #34c759;
}

.ios-switch input:checked + .ios-slider::before {
    transform: translateX(20px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-top: 3.25rem;
    margin-bottom: 0.85rem;
    padding: 0 0.25rem;
}

.section-header:first-of-type {
    margin-top: 0;
}

.section-label {
    display: block;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--label-secondary);
    padding: 0;
    margin: 0;
}

.list-group {
    background: var(--bg-secondary);
    border: 1px solid var(--separator);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.list-group > * + * {
    border-top: 1px solid var(--separator);
}

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 0.95rem 1.25rem;
    min-height: 56px;
}

.list-row-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1.25rem;
    color: var(--label-secondary);
    font-size: 0.9rem;
    text-align: center;
    min-height: 56px;
}

.list-row-stack {
    display: block;
    padding: 0.95rem 1.25rem;
}

.list-row-title {
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--label);
    margin-bottom: 0.15rem;
    letter-spacing: -0.005em;
}

.list-row-meta {
    font-size: 0.8rem;
    color: var(--label-secondary);
}

.list-row-meta-right {
    font-size: 0.85rem;
    color: var(--label-secondary);
    text-align: right;
    white-space: nowrap;
}

.section-footnote {
    font-size: 0.76rem;
    color: var(--label-secondary);
    padding: 0.75rem 0.5rem 0;
    line-height: 1.45;
}

.loot-bar-row {
    padding: 1rem 1.25rem;
}

.loot-bar-row .loot-bar-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.loot-bar-row .loot-bar-title {
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: -0.005em;
    color: var(--label);
}

.loot-bar-row .loot-bar-value {
    font-size: 0.82rem;
    color: var(--label-secondary);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.loot-bar-row .loot-bar-track {
    height: 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.loot-bar-row .loot-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease, background 0.2s ease;
}

.loot-bar-row .loot-bar-foot {
    margin-top: 0.5rem;
    font-size: 0.76rem;
    color: var(--label-secondary);
    display: flex;
    justify-content: space-between;
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
    align-items: center;
}

.toolbar-actions .btn,
.toolbar-actions .btn-outline {
    padding: 0.35rem 0.95rem;
    font-size: 0.82rem;
}

.automation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 0.95rem 1.25rem;
}

.automation-info {
    flex: 1;
    min-width: 0;
}

.automation-title {
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--label);
    margin-bottom: 0.15rem;
}

.automation-meta {
    font-size: 0.8rem;
    color: var(--label-secondary);
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 2rem;
    border-bottom: 1px solid var(--separator);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    background: rgba(251, 251, 253, 0.78);
    position: sticky;
    top: 0;
    z-index: 50;
}

.landing-nav-brand {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.018em;
    color: var(--label);
}

.landing-nav-cta {
    padding: 0.45rem 1.1rem;
    font-size: 0.85rem;
}

.landing-hero {
    text-align: center;
    padding: 6rem 1.5rem 5rem;
    max-width: 820px;
    margin: 0 auto;
}

.landing-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
}

.landing-title {
    font-size: 3.4rem;
    line-height: 1.06;
    font-weight: 700;
    letter-spacing: -0.028em;
    color: var(--label);
    margin: 0 0 1.25rem;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
}

.landing-subtitle {
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--label-secondary);
    margin: 0 auto 2rem;
    max-width: 640px;
    letter-spacing: -0.012em;
}

.landing-cta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.landing-cta {
    padding: 0.75rem 1.6rem;
    font-size: 0.95rem;
}

.landing-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: -0.005em;
    transition: color 0.15s ease;
}

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

.landing-features {
    max-width: 1100px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.landing-feature {
    background: var(--bg-secondary);
    border: 1px solid var(--separator);
    border-radius: 22px;
    padding: 2rem 1.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.landing-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.landing-feature h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--label);
    letter-spacing: -0.015em;
    margin: 0 0 0.55rem;
}

.landing-feature p {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--label-secondary);
    margin: 0;
}

.landing-auth {
    display: flex;
    justify-content: center;
    padding: 4rem 1.5rem 5rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--separator);
    border-bottom: 1px solid var(--separator);
}

.landing-auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--separator);
    border-radius: 22px;
    padding: 2.5rem 2.5rem 2rem;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.landing-auth-title {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0.5rem 0 1.75rem;
    color: var(--label);
}

.landing-disclaimer {
    font-size: 0.78rem;
    color: var(--label-secondary);
    margin-top: 1.25rem;
    line-height: 1.5;
}

.landing-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.5rem 2rem;
    font-size: 0.78rem;
    color: var(--label-tertiary);
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 640px) {
    .landing-title { font-size: 2.4rem; }
    .landing-subtitle { font-size: 1rem; }
    .landing-hero { padding: 4rem 1.25rem 3rem; }
    .landing-features { padding: 2rem 1.25rem 3rem; gap: 1.25rem; }
    .landing-feature { padding: 1.5rem 1.25rem; }
    .landing-auth-card { padding: 1.75rem 1.5rem; }
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease forwards;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--separator);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.25s cubic-bezier(0.1, 0.76, 0.55, 0.94) forwards;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--separator);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--label-secondary);
    padding: 0;
    transition: color 0.15s ease;
}

.btn-close:hover {
    color: var(--label);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--label);
}

.modal-body p {
    margin-bottom: 1rem;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    gap: 1rem;
    animation: fadeIn 0.15s ease forwards;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}






