html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    min-width: 100vw;
    background: var(--bg);
    color: var(--fg);
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    margin: 0;
}

.site-title-block {
  width: 100%;
  margin: 32px auto 32px auto;
  text-align: center;
  display: block;
}
.site-title-text {
  font-size: 2.2em;
  font-weight: bold;
  color: var(--accent);
  display: block;
  margin: 0 auto;
  letter-spacing: -1px;
}

:root {
    --bg: #f6f8fa;
    --container-bg: #fff;
    --fg: #23272f;
    --input-bg: #f1f8ff;
    --input-fg: #23272f;
    --border: #e3e6f0;
    --accent: #0066db;
    --accent2: #2b82f6;
    --nav-bg: #eaf4ff;
    --shadow: 0 4px 24px rgba(40,70,120,0.08);
    --radius: 16px;
    --footer-fg: #8ca1b6;
}

[data-theme="dark"] {
    --bg: #1a1f2b;
    --container-bg: #232736;
    --fg: #e3e9f3;
    --input-bg: #23273c;
    --input-fg: #e3e9f3;
    --border: #31344a;
    --accent: #7bb9ff;
    --accent2: #5b93d3;
    --nav-bg: #23273c;
    --shadow: 0 4px 24px rgba(0,0,0,0.16);
    --footer-fg: #7b8aa0;
}

.main-container {
    max-width: 700px;
    width: 100%;
    background: var(--container-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.2em 2em 1.5em 2em;
    margin: 32px auto 0 auto;
}

header.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.3em;
}

.logo {
    font-weight: bold;
    font-size: 1.4em;
    color: var(--accent);
    letter-spacing: -1px;
}

.navbar {
    display: flex;
    gap: 10px;
    background: var(--nav-bg);
    border-radius: 8px;
    padding: 10px 0 10px 10px;
    margin-bottom: 1.5em;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-btn {
    background: none;
    border: none;
    font-size: 1.07em;
    color: var(--accent);
    cursor: pointer;
    padding: 6px 18px;
    border-radius: 7px;
    transition: background 0.15s;
    text-decoration: none;
    outline: none;
    min-width: 90px;
    display: inline-block;
}

.nav-btn.active, .nav-btn:hover {
    background: var(--accent2);
    color: #fff !important;
}

input, select, button, textarea {
    font-size: 1em;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--input-fg);
    padding: 10px;
    margin-bottom: 10px;
    outline: none;
    box-sizing: border-box;
    transition: border .2s, background .2s, color .2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
}

button, .btn {
    background: var(--accent2);
    color: #fff;
    border: none;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 22px;
    margin-bottom: 0;
    transition: background .18s;
}

button:hover, .btn:hover {
    background: var(--accent);
}

footer.site-footer {
    color: var(--footer-fg);
    text-align: center;
    font-size: 1em;
    margin-top: 46px;
    padding-bottom: 1.2em;
    width: 100vw;
    letter-spacing: 0.01em;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; background: var(--bg);}
::-webkit-scrollbar-thumb { background: var(--border);border-radius:6px;}

.result-box, .output-section, pre.code-output {
    background: var(--nav-bg);
    color: var(--fg);
    border-radius: 9px;
    padding: 1.2em 1em 1em 1em;
    margin: 1.5em 0 0.5em 0;
    box-shadow: 0 2px 8px rgba(13,110,253,0.07);
    border: 1px solid var(--border);
    font-size: 1.08em;
    word-break: break-all;
    position: relative;
    max-height: 60vh;
    overflow-y: auto;
}

.copy-btn, .copy-email-btn, .copy-all-btn {
    background: var(--accent2);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 6px 18px;
    font-size: 1em;
    cursor: pointer;
    transition: background .19s;
    margin-left: 8px;
}

.copy-btn:hover, .copy-email-btn:hover, .copy-all-btn:hover { background: var(--accent); }

.copy-email-btn {
    font-size: 0.96em;
    padding: 4px 12px;
}

.copy-all-btn {
    font-size: 1em;
    padding: 6px 16px;
}

label { font-weight: 500; }
h1, h2, h3 { color: var(--accent); margin-bottom: 0.7em;}

.email-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--input-bg);
    margin-bottom: 8px;
    border-radius: 6px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    font-size: 1.08rem;
}

@media (max-width: 600px) {
    .main-container {padding: 1.2em 0.4em;}
}
@media (max-width: 420px){
    .main-container{padding:0.5em 0.1em;}
    .copy-btn, .copy-email-btn, .copy-all-btn { right:0.3em; top:0.3em; padding:4px 12px;}
    .result-box, .output-section, pre.code-output { font-size:1em;padding:0.7em;}
}

textarea {
    width: 100%;
}

#input-string {
    width: 100%;
    min-width: 200px;
    max-width: 100%;
}

#cardgen-output {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.13em;
    margin-top: 1em;
    background: var(--input-bg, #f8f8f8);
    border-radius: 6px;
    padding: 1em;
    border: 1px solid var(--border, #ccc);
    max-height: 320px;
    overflow-y: auto;
}
.result-box button {
    margin-left: 5px;
    margin-bottom: 4px;
}

/* --- Offcanvas sidebar styles --- */
.offcanvas-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 240px;
    height: 100vh;
    background: #f7f7fb;
    border-right: 1px solid #e0e0e0;
    box-shadow: 2px 0 16px rgba(0,0,0,0.04);
    z-index: 1200;
    padding: 20px 12px 20px 18px;
    box-sizing: border-box;
    transform: translateX(-110%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
}
.offcanvas-sidebar.show {
    transform: translateX(0);
}
.sidebar-backdrop {
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.19);
    z-index: 1199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}
.sidebar-menu h3 {
    margin-top: 0;
    margin-bottom: 13px;
    font-size: 1.13em;
    color: #444;
    font-weight: bold;
    letter-spacing: 1px;
}
.sidebar-menu ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.sidebar-menu ul li {
    margin: 0 0 10px 0;
}
.sidebar-menu ul li a {
    color: #1976d2;
    text-decoration: none;
    font-size: 1.05em;
    transition: color 0.2s;
    display: block;
    padding: 4px 6px;
    border-radius: 5px;
}
.sidebar-menu ul li a:hover {
    background: #e3eaff;
    color: #0056b3;
}
.sidebar-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: none;
    background: none;
    font-size: 2em;
    line-height: 1em;
    color: #888;
    cursor: pointer;
}
.sidebar-toggle-btn {
    position: fixed;
    left: 12px;
    top: 24px;
    z-index: 1250;
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 18px 7px 13px;
    font-size: 1.23em;
    box-shadow: 1px 1px 8px #0001;
    cursor: pointer;
    transition: background 0.2s;
}
.sidebar-toggle-btn:hover {
    background: #1453a5;
}
@media (max-width: 700px) {
    .offcanvas-sidebar { width: 90vw; min-width: 0; }
    .sidebar-toggle-btn { left: 8px; top: 10px; }
}
body.sidebar-open .sidebar-toggle-btn {
    display: none !important;
}

.alert-success {
    background: linear-gradient(90deg,#e4ffe1 0,#e1fff5 100%);
    color: #267d4a;
    border: 1px solid #b6eec6;
    font-weight: 500;
}
/* --- End Offcanvas sidebar styles --- */