@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: dark;
    --bg: #0d1110;
    --panel: #131a17;
    --panel-raised: #19231e;
    --line: #28352e;
    --muted: #91a197;
    --text: #e8eee9;
    --accent: #10b981;
    --accent-bright: #37d7a1;
    --danger: #f08080;
    --mono: "DM Mono", monospace;
    --sans: "Manrope", sans-serif;
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(ellipse at 12% 8%, rgba(16, 185, 129, .13), transparent 34rem),
        linear-gradient(140deg, #0d1110 0%, #101714 52%, #0b100e 100%);
    font-family: var(--sans);
}

button, input { font: inherit; }

.shell { width: min(1060px, calc(100% - 36px)); margin: 0 auto; padding: 44px 0 32px; }
.masthead { display: flex; align-items: center; gap: 16px; position: relative; margin-bottom: 38px; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; color: #05120d; background: var(--accent); border-radius: 14px 14px 14px 4px; font-size: 22px; font-weight: 800; box-shadow: 0 0 36px rgba(16, 185, 129, .22); }
.eyebrow { margin: 0 0 8px; color: var(--accent-bright); font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -.045em; }
h1 span { color: var(--accent-bright); font-weight: 500; }
h2 { margin-bottom: 0; font-size: clamp(19px, 2.5vw, 26px); letter-spacing: -.04em; }
.logout-form { margin-left: auto; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }
.button-primary { min-height: 42px; padding: 0 18px; color: #062017; background: var(--accent); }
.button-primary:hover { background: var(--accent-bright); }
.button-large { min-height: 49px; padding: 0 22px; font-size: 13px; }
.button-quiet { padding: 10px 13px; color: #b1beb5; border-color: var(--line); background: rgba(255,255,255,.02); }
.button-quiet:hover, .button-download:hover { border-color: #547263; color: var(--text); }
.button-download { min-height: 36px; padding: 0 13px; color: var(--accent-bright); border-color: #315440; background: rgba(16,185,129,.07); white-space: nowrap; }
+.button-danger { min-height: 36px; padding: 0 13px; color: #ffb4b4; border-color: #6b3535; background: rgba(190,60,60,.08); white-space: nowrap; }
+.button-danger:hover { border-color: #9a4a4a; color: #ffd4d4; }
+.inline-form { margin: 0; }
+.snapshot-actions { display: flex; align-items: center; gap: 8px; }
.hero-panel { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; padding: 30px; border: 1px solid #315441; border-radius: 18px; background: linear-gradient(110deg, rgba(16,185,129,.09), transparent 62%), var(--panel); box-shadow: 0 22px 65px rgba(0,0,0,.2); }
.hero-panel h2 { max-width: 540px; margin-bottom: 10px; }
.copy { margin: 0; color: var(--muted); font-size: 12px; }
.backup-form { display: grid; justify-items: end; gap: 10px; }
.button-caption { max-width: 260px; color: #9aa69e; font-size: 10px; text-align: right; }
.snapshot-section { margin-top: 32px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.count-pill { padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; color: #bdc9c0; font: 11px var(--mono); }
.snapshot-list { border: 1px solid var(--line); border-radius: 15px; background: rgba(19,26,23,.9); overflow: hidden; }
.snapshot-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 15px; min-height: 77px; padding: 12px 18px; border-bottom: 1px solid rgba(40,53,46,.78); }
.snapshot-row:last-child { border-bottom: 0; }
.snapshot-index { color: #506259; font: 12px var(--mono); }
.snapshot-details { display: grid; gap: 5px; min-width: 0; }
.snapshot-details strong { font-size: 13px; font-weight: 700; }
.snapshot-details span { overflow: hidden; color: var(--muted); font: 10px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.empty-state { display: grid; justify-items: center; padding: 54px 20px; border: 1px dashed #304138; border-radius: 15px; background: rgba(19,26,23,.66); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 15px; border-radius: 50%; color: var(--accent); background: rgba(16,185,129,.1); font: 20px var(--mono); }
.empty-state h3 { margin-bottom: 7px; font-size: 15px; }
.empty-state p { max-width: 360px; margin: 0; color: var(--muted); font-size: 12px; }
.notice { margin-bottom: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }
.notice-error { color: #ffc0c0; border-color: #643939; background: rgba(120, 37, 37, .2); }
.notice-success { color: #b7f5d9; border-color: #285641; background: rgba(16, 185, 129, .08); }
.download-note { display: flex; align-items: start; gap: 12px; margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: #a5b2a9; background: rgba(19,26,23,.6); }
.download-note p { margin: 0; font-size: 11px; line-height: 1.65; }
.download-note code { color: var(--accent-bright); font: 11px var(--mono); }
.download-note a { color: var(--accent-bright); text-decoration-color: #527a65; text-underline-offset: 3px; }
.note-mark { display: grid; place-items: center; flex: 0 0 20px; height: 20px; border: 1px solid #466453; border-radius: 50%; color: var(--accent-bright); font: 11px var(--mono); }
.login-panel { width: min(440px, 100%); margin: 10vh auto 0; padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 30px 80px rgba(0,0,0,.32); }
.login-panel h2 { margin-bottom: 24px; }
.login-form { display: grid; gap: 15px; }
.login-form label { display: grid; gap: 7px; color: #abb8af; font-size: 11px; font-weight: 700; }
.login-form input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #34443b; border-radius: 9px; color: var(--text); background: #0c1210; }
.login-form .button { margin-top: 5px; }
.footer-line { display: flex; justify-content: space-between; gap: 14px; margin-top: 24px; color: #69786f; font: 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; }

@media (max-width: 700px) {
    .shell { width: min(100% - 24px, 600px); padding-top: 26px; }
    .masthead { margin-bottom: 24px; }
    .hero-panel { grid-template-columns: 1fr; padding: 22px; }
    .backup-form { justify-items: stretch; }
    .button-caption { max-width: none; text-align: left; }
    .snapshot-row { grid-template-columns: 26px 1fr; gap: 10px; padding: 14px 12px; }
    .snapshot-actions { grid-column: 2; justify-self: start; flex-wrap: wrap; }
    .heading-actions { align-items: end; flex-direction: column; }
    .footer-line { flex-direction: column; }
}
