:root {
    --bg: #f4efe7;
    --panel: rgba(255, 251, 245, 0.84);
    --panel-strong: #fffaf2;
    --ink: #11242b;
    --muted: #5f6e72;
    --line: rgba(17, 36, 43, 0.12);
    --accent: #046c62;
    --accent-strong: #024c45;
    --danger: #b44934;
    --shadow: 0 24px 60px rgba(17, 36, 43, 0.12);
    --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(4, 108, 98, 0.18), transparent 35%),
        radial-gradient(circle at bottom right, rgba(180, 73, 52, 0.12), transparent 30%),
        linear-gradient(180deg, #f7f2ea 0%, #efe7db 100%);
    font-family: "Aptos", "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.page-shell { max-width: 1400px; margin: 0 auto; padding: 28px; }
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 250, 242, 0.78);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #0f8c7f);
    color: white;
    font-weight: 800;
}
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy span, .muted { color: var(--muted); }

.topbar-user { display: flex; align-items: center; gap: 14px; }
.user-copy { display: flex; flex-direction: column; text-align: right; gap: 2px; }
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.85);
}

.main-shell { margin-top: 28px; }
.landing-grid, .security-grid, .grid-two, .vault-layout, .app-shell {
    display: grid;
    gap: 22px;
}

.landing-grid { grid-template-columns: 1.45fr 0.95fr; }
.hero-panel, .feature-panel, .panel-card, .status-card, .section-panel, .error-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.hero-panel, .status-card, .section-panel, .error-panel { padding: 34px; }
.feature-panel, .settings-stack, .entry-list, .entry-editor { padding: 22px; }
.feature-panel, .settings-stack { display: grid; gap: 18px; }
.feature-card, .security-card, .inline-notice, .config-warning, .loading-card, .secret-box, .entry-card, .inline-item {
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
}

.feature-card, .security-card, .loading-card, .secret-box, .inline-item, .config-warning { padding: 18px; }
.eyebrow {
    display: inline-flex;
    margin-bottom: 14px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(4, 108, 98, 0.12);
    color: var(--accent-strong);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1, h2, h3 { margin: 0 0 14px; font-family: "Bahnschrift", "Aptos Display", sans-serif; }
h1 { font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: 0.95; max-width: 10ch; }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
h3 { font-size: 1.15rem; }
p, small, span { line-height: 1.55; }
.lede { max-width: 54ch; font-size: 1.05rem; color: var(--muted); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: linear-gradient(135deg, var(--accent), #0f8c7f); color: white; }
.button.ghost { border-color: var(--line); background: rgba(255, 255, 255, 0.4); color: var(--ink); }
.button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }

.flash-stack { display: grid; gap: 10px; margin-top: 18px; }
.flash, .inline-notice { padding: 14px 16px; }
.flash-success, .inline-notice.success { border-color: rgba(4, 108, 98, 0.25); background: rgba(4, 108, 98, 0.1); }
.flash-error, .inline-notice.error { border-color: rgba(180, 73, 52, 0.25); background: rgba(180, 73, 52, 0.12); }

.security-section { margin-top: 32px; }
.security-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.security-card span { display: block; margin-bottom: 12px; color: var(--accent-strong); font-weight: 700; }

.app-shell { grid-template-columns: 220px 1fr; align-items: start; }
.app-sidebar {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255, 250, 242, 0.8);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}
.nav-button {
    width: 100%;
    padding: 14px 16px;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
}
.nav-button.is-active { background: linear-gradient(135deg, var(--accent), #0f8c7f); color: white; border-color: transparent; }

.screen-stack, .section-panel, .settings-stack, .stack, .entry-list { display: grid; gap: 18px; }
.section-copy { margin-top: -6px; color: var(--muted); }
.panel-card { padding: 22px; }
.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vault-layout { grid-template-columns: 340px minmax(0, 1fr); }

.entry-list-head, .inline-item, .password-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.entry-card {
    display: grid;
    width: 100%;
    padding: 16px;
    text-align: left;
    cursor: pointer;
}
.entry-card.is-selected { outline: 2px solid rgba(4, 108, 98, 0.25); }

.input, .textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
}
.textarea { min-height: 160px; resize: vertical; }

.secret-box code, .secret-box small { display: block; margin-top: 10px; word-break: break-all; }
.recovery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.recovery-grid code {
    display: block;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.74);
    text-align: center;
    font-size: 0.95rem;
}

@media (max-width: 1080px) {
    .landing-grid, .app-shell, .vault-layout, .security-grid, .grid-two { grid-template-columns: 1fr; }
    .topbar { border-radius: 28px; }
    .topbar-user { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 720px) {
    .page-shell { padding: 16px; }
    .topbar { padding: 18px; border-radius: 24px; }
    h1 { font-size: 2.4rem; }
    .hero-actions, .topbar-user, .entry-list-head, .password-row, .inline-item { flex-direction: column; align-items: stretch; }
}
