*,*::before,*::after{box-sizing:border-box}
:root{
    --bg:#0d0d0d;
    --panel:#141414;
    --panel-2:#1a1a1a;
    --ink:#e9e9e9;
    --muted:#a4aab1;
    --accent:#ff8c00; /* CI orange */
    --blue1:#007bff;  /* CI blue */
    --blue2:#00d4ff;  /* CI blue grad end */
    --radius:16px;
    --gap:18px;
    --gap-lg:28px;
    --shadow:0 10px 32px rgba(0,0,0,.55);
}
html,body{height:100%}
body{
    margin:0; background:var(--bg); color:var(--ink);
    font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
    display:flex; align-items:center; justify-content:center;
    padding: clamp(18px, 3vw, 36px);
}
.card{
    width:min(640px,94vw);
    background:linear-gradient(180deg,var(--panel),var(--panel-2));
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    padding: clamp(20px,4vw,36px);
    /* margin-top: auto; */
}
.head{
    display:flex; align-items:center; position: relative; margin-bottom: 1.5rem;
}
.brand{display:flex; align-items:center; gap:12px; font-weight:700}
.brand .dot{width:14px;height:14px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 5px rgba(255,140,0,.12)}
.muted{color:var(--muted)}
.link{color:var(--blue2); text-decoration:none; font-weight:600; margin-left:auto}
.link:hover{text-decoration:underline}
.stack{display:flex;flex-direction:column;gap:12px;margin-bottom:var(--gap-lg)}
textarea,input{
    width:100%; border:1px solid #232323; background:#171717; color:var(--ink);
    border-radius:14px; padding:14px 16px; font-size:16px; line-height:1.4;
    outline:none; transition:border-color .15s, box-shadow .15s;
}
textarea{min-height:160px; resize:vertical}
textarea[readonly]{opacity:1; filter:none} /* keep normal contrast when readonly */
textarea:focus,input:focus{border-color:#2b2b2b; box-shadow:0 0 0 2px rgba(0,123,255,.22)}
.row{display:grid; grid-template-columns:1fr 1fr; gap:12px}
@media (max-width:520px){ .row{grid-template-columns:1fr} }
.btn{
    appearance:none; border:none; border-radius:12px; padding:14px 16px;
    font-weight:700; color:#fff; cursor:pointer; user-select:none;
    background:linear-gradient(45deg,var(--blue1),var(--blue2));
    transition:transform .08s, filter .18s, opacity .2s;
}
.btn:hover{transform:translateY(-1px); filter:brightness(1.04)}
.btn:active{transform:none; filter:brightness(.98)}
.btn[disabled]{opacity:.6; cursor:not-allowed}
.btn-alt{background:var(--accent); color:#111}
.subrow{display:flex; justify-content:space-between; align-items:center; margin-top:-6px; margin-bottom:var(--gap-lg)}
.counter{font-size:12px; color:var(--muted)}
.status{min-height:22px; font-size:13px; color:#ff6b6b}
.status.ok{color:#7fffb0}
.hidden{display:none !important}
.shake{animation:shake .28s ease-in-out 0s 1}
@keyframes shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-6px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(4px)}}
.danger{outline:2px solid rgba(255,107,107,.55)}
.divider{height:1px;background:#232323;margin:var(--gap-lg) 0}
/* Page layout: footer pinned to bottom, content grows */
html, body { min-height: 100%; }
body {
    display: flex;
    flex-direction: column;
    min-height: 100svh; /* supports mobile UI heights */
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    height: auto;
}

/* Light “guard” against easy background save (non-DRM) */
.bg-guard {
    position: fixed; inset: 0; z-index: 0;
    background: transparent;
    pointer-events: all; user-select: none;
    -webkit-user-drag: none; -webkit-touch-callout: none;
}

/* Make content sit above the guard */
.brand, main, .site-footer { position: relative; z-index: 1; }

/* ---------- Option A: page-level brand header ---------- */
.brand {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1.25rem;
    /* Align header with main box if your main has a max-width */
    max-width: 960px; margin-inline: auto;
    position: absolute;
    left: 50%; transform: translateX(-50%);
}
.brand .logo { height: 40px; width: auto; }
.brand .brand-title { font-size: 1.1rem; font-weight: 600; opacity: .95; }

/* ---------- Option B: in-box header ---------- */
.main-header {
    display: flex; align-items: center;
    margin-right: auto;
}
.main-header .logo { height: 36px; width: auto; }
.main-header .app-title { margin: 0; font-size: 1.25rem; }

/* Footer: centered, bottom, higher contrast over dark bg */
.site-footer {
    margin-top: auto; /* pushes footer to the bottom */
    width: 100%;
    color: rgba(255,255,255,.9);
    border-top: 1px solid rgba(255,255,255,.12);
    display: flex; justify-content: center;
    padding: 1.25rem 1rem 2rem;
}
.site-footer nav { display: inline-flex; gap: .75rem; flex-wrap: wrap; }
.site-footer a {
    color: inherit; text-decoration: none;
    border-bottom: 1px dotted currentColor;
}
.site-footer a:hover { border-bottom-style: solid; }
/* One-liner text */
.how-it-works {
    margin-top: 1rem;
    font-size: 1rem;
    opacity: .9;
    text-align: center;
}

@media (max-width: 640px) {
    .head {
    display: flex;
    flex-direction: column;   /* stack */
    align-items: center;      /* center each row */
    gap: .5rem;
    }
    .brand {
    position: static;         /* cancel absolute/translate */
    transform: none;
    }
    .main-header {
    margin-right: unset;
    }
    .link {
    margin-left: unset;
    margin-top: 2rem;
    }
    .site-footer nav {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    }
    .site-footer span {
    display: none;
    }
}
.tabs {
    display: flex;
    z-index: 1;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 18px;
    width: min(640px, 94vw);
}

.tab {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    background: #1a1a1a;
    color: #a4aab1;
    border: 1px solid #232323;
    transition: all 0.15s ease;
}

.tab:hover {
    color: #fff;
    border-color: #2b2b2b;
}

.tab.active {
    background: linear-gradient(45deg, var(--blue1), var(--blue2));
    color: #fff;
    border: none;
}