* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #0b1120;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    margin: 0;
    color: #e2e8f0;
}

.card {
    background: #1e293b;
    max-width: 680px;
    width: 100%;
    border-radius: 2rem;
    padding: 2rem 1.8rem 1.8rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

h1 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

h1 span {
    font-size: 1.8rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.subhead {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 1.6rem;
    border-left: 4px solid #3b82f6;
    padding-left: 0.9rem;
    background: #0f172a;
    border-radius: 0 8px 8px 0;
    line-height: 1.4;
}

/* ========== LOCK SCREEN ========== */
.lock-screen {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.lock-screen.hidden {
    display: none;
}

.lock-icon {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.3));
}

.lock-screen input {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1.1rem;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 1rem;
    color: #f1f5f9;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    letter-spacing: 0.15em;
    text-align: center;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.lock-screen input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.lock-screen input::placeholder {
    color: #475569;
    letter-spacing: normal;
    font-style: italic;
}

.lock-error {
    color: #f87171;
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.2rem;
    font-weight: 500;
}

/* ========== MAIN APP ========== */
.app-content {
    display: none;
}

.app-content.unlocked {
    display: block;
}

textarea {
    width: 100%;
    min-height: 240px;
    padding: 1.2rem 1.2rem;
    font-size: 1rem;
    line-height: 1.6;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace, system-ui;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 1.4rem;
    resize: vertical;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s, background 0.2s;
    color: #e2e8f0;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

textarea:focus {
    border-color: #3b82f6;
    background: #0b1120;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

textarea::placeholder {
    color: #475569;
    font-style: italic;
    font-weight: 400;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.btn {
    border: none;
    background: #1e293b;
    padding: 0.8rem 1.5rem;
    border-radius: 60px;
    font-weight: 500;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1.5px solid #334155;
    color: #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1;
    flex: 0 0 auto;
}

.btn i {
    font-style: normal;
    font-size: 1.2rem;
    line-height: 1;
}

.btn:hover {
    background: #334155;
    border-color: #475569;
    transform: scale(0.98);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 6px 12px -6px rgba(59, 130, 246, 0.5);
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-outline-blue {
    border-color: #1e40af;
    background: #172554;
    color: #93c5fd;
}

.btn-outline-blue:hover {
    background: #1e3a8a;
    border-color: #2563eb;
}

.btn-clear {
    border-color: #7f1d1d;
    background: #450a0a;
    color: #fca5a5;
}

.btn-clear:hover {
    background: #7f1d1d;
    border-color: #b91c1c;
}

.btn-lock {
    border-color: #78350f;
    background: #451a03;
    color: #fbbf24;
}

.btn-lock:hover {
    background: #78350f;
    border-color: #d97706;
}

.status {
    font-size: 0.85rem;
    color: #94a3b8;
    background: #0f172a;
    padding: 0.5rem 1rem;
    border-radius: 40px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #334155;
    white-space: nowrap;
    font-weight: 450;
    transition: background 0.2s;
}

.status.saved {
    background: #052e16;
    border-color: #166534;
    color: #86efac;
}

.status.empty-badge {
    background: #422006;
    border-color: #854d0e;
    color: #fde047;
}

.footer-note {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #475569;
    text-align: center;
    border-top: 1px solid #1e293b;
    padding-top: 1.3rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-note span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

@media (max-width: 480px) {
    body { padding: 0.8rem; }
    .card { padding: 1.5rem 1.2rem; }
    h1 { font-size: 1.5rem; }
    .btn { padding: 0.7rem 1.1rem; font-size: 0.85rem; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .btn-group { justify-content: center; }
    .status { justify-content: center; }
}