:root {
    --bg-primary: #171923;
    --bg-secondary: #222632;
    --bg-card: rgba(35, 38, 50, 0.86);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #d6a000;
    --accent-hover: #b98400;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #8c6900;
    --accent-hover: #6f5200;
    --border: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

[hidden] { display: none !important; }

body {
    background: radial-gradient(ellipse at 50% 38%, #242635 0%, #1b1d29 45%, #14161f 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    position: relative;
}

#weatherCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
}

.brand span {
    color: var(--text-primary);
    font-weight: 400;
    font-size: 1rem;
}

.controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

button, select, input, textarea {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

button {
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

button.primary {
    background: var(--accent);
    color: #211900;
    border: none;
}

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

button.danger {
    background: var(--danger);
    color: #fff;
    border: none;
}

nav {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    flex-wrap: wrap;
}

.main-nav { position: relative; z-index: 40; justify-content: flex-start; align-items: center; padding: .75rem 1rem; }
.quick-tab { border-radius: 12px; }
.home-tab { margin-left: auto; }
.category-menu { position: relative; }
.category-menu summary { list-style: none; cursor: pointer; background: var(--bg-card); border: 1px solid var(--border); padding: .65rem 1rem; border-radius: 12px; font-weight: 650; }
.category-menu summary::-webkit-details-marker { display: none; }
.category-menu[open] summary { color: var(--accent); border-color: var(--accent); }
.category-options { position: absolute; z-index: 50; top: calc(100% + .5rem); right: 0; width: min(340px, calc(100vw - 2rem)); max-height: 65vh; overflow: auto; padding: .5rem; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-secondary); box-shadow: 0 18px 40px #0006; display: grid; gap: .25rem; pointer-events: auto; }
.category-options button { text-align: left; border: 0; background: transparent; }
.category-options button:hover { background: var(--bg-card); }

.home-dashboard { max-width: 1500px; min-height: 70vh; padding: 2rem 1.5rem 3rem; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2.5rem; }
.clock-panel { display: flex; align-items: center; justify-content: center; gap: clamp(1.5rem, 5vw, 4rem); margin: auto 0; }
#homeClock { font-size: clamp(6rem, 19vw, 15rem); font-weight: 300; line-height: .95; letter-spacing: -.06em; font-variant-numeric: tabular-nums; text-shadow: 0 10px 45px #0003; }
.clock-divider { height: clamp(100px, 14vw, 190px); width: 1px; background: var(--border); }
.date-panel { display: flex; flex-direction: column; gap: .35rem; text-transform: capitalize; }
.date-panel strong { font-size: clamp(4rem, 9vw, 7rem); line-height: 1; font-weight: 400; }
.date-panel span { color: var(--accent); font-size: clamp(1.2rem, 2.5vw, 2rem); font-weight: 650; }
.date-panel small { color: var(--text-secondary); letter-spacing: .25em; font-size: .9rem; }
.home-dock { position: relative; width: min(100%, 1100px); padding: 1.2rem 3.5rem; border: 1px solid var(--border); border-radius: 28px; background: var(--bg-card); backdrop-filter: blur(16px); box-shadow: 0 20px 55px #0003; }
.dock-label { color: var(--text-secondary); font-size: .72rem; letter-spacing: .18em; margin: 0 .4rem .8rem; }
.dock-heading { display: flex; align-items: center; justify-content: space-between; min-height: 34px; }
.dock-heading .dock-label { margin-bottom: .8rem; }
.dock-heading-actions { display: flex; align-items: center; gap: .35rem; }
.dock-scroll-controls { position: absolute; z-index: 2; top: 50%; left: .55rem; right: .55rem; transform: translateY(-50%); display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.dock-scroll-controls button { width: 38px; height: 46px; padding: 0; border-radius: 14px; color: #211900; background: var(--accent); border: 0; font-size: 1.7rem; line-height: 1; box-shadow: 0 4px 14px #0004; pointer-events: auto; }
.dock-scroll-controls button:hover { background: var(--accent-hover); }
.dock-scroll-controls button:disabled { opacity: .35; cursor: default; transform: none; }
.info-button { width: 30px; height: 30px; padding: 0; margin: 0 .2rem .6rem 0; border-radius: 50%; color: var(--text-secondary); background: transparent; font-size: 1.15rem; }
.info-button:hover { color: var(--accent); }
.theme-icon { width: 44px; height: 42px; padding: .4rem; display: grid; place-items: center; font-size: 1.2rem; }
.info-dialog { position: relative; width: min(530px, calc(100vw - 2rem)); max-height: min(88vh, 760px); margin: auto; padding: 0; overflow: hidden; color: var(--text-primary); background: var(--bg-secondary); border: 1px solid color-mix(in srgb,var(--accent) 28%,var(--border)); border-radius: 26px; box-shadow: 0 24px 80px #0009; }
.info-dialog::backdrop { background: #101116c9; backdrop-filter: blur(3px); }
.info-dialog-content { max-height: min(calc(88vh - 2px), 758px); overflow-y: auto; scrollbar-width: none; padding: 1.75rem 3.25rem 1.5rem 1.6rem; text-align: center; }
.info-dialog-content::-webkit-scrollbar { display: none; }
.info-scroll-button { position: absolute; z-index: 3; right: .65rem; width: 32px; height: 32px; padding: 0; border-radius: 50%; color: #122033; background: #d6a000; border: 0; font-size: 1.15rem; }
.info-scroll-button:hover { background: #f0bd27; }
.info-scroll-up { top: .65rem; }
.info-scroll-down { bottom: .65rem; }
.info-mark { color: var(--accent); font-size: 1.7rem; margin-bottom: .25rem; }
.info-dialog h2 { display: block; margin: .3rem 0 .45rem; font-size: 1.45rem; }
.info-intro { color: var(--text-secondary); font-size: .9rem; margin-bottom: 1.3rem; }
.info-sections { display: grid; gap: .35rem; text-align: left; }
.info-sections details { border-bottom: 1px solid var(--border); }
.info-sections summary { list-style: none; cursor: pointer; padding: .85rem .5rem; font-size: 1rem; font-weight: 600; }
.info-sections summary::-webkit-details-marker { display: none; }
.info-sections summary::after { content: '›'; float: right; color: var(--text-secondary); font-size: 1.3rem; line-height: 1rem; }
.info-sections details[open] summary::after { content: '⌄'; }
.info-item-icon { display: inline-block; min-width: 1.7rem; color: var(--accent); font-weight: 800; }
.info-sections p { color: var(--text-secondary); font-size: .87rem; line-height: 1.55; padding: 0 .5rem 1rem; }
.info-email { display: block; margin: 1.2rem 0 .8rem; padding: .8rem; border-radius: 10px; background: color-mix(in srgb,var(--accent) 12%,var(--bg-primary)); color: var(--text-primary); text-decoration: none; font-size: .9rem; }
.info-done { min-width: 150px; color: #211900; border: 0; border-radius: 99px; background: var(--accent); }
.info-done:hover { background: var(--accent-hover); }
.dock-tools { display: flex; justify-content: center; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.dock-tools::-webkit-scrollbar { display: none; }
.dock-tool { flex: 1 0 105px; display: flex; flex-direction: column; align-items: center; gap: .45rem; border: 0; background: transparent; padding: .5rem .25rem; font-size: .78rem; }
.dock-tool span { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 20px; color: var(--accent); font-size: 1.65rem; background: color-mix(in srgb, var(--accent) 18%, var(--bg-secondary)); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.dock-tool span svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dock-tool:hover span { background: var(--accent); color: #211900; }
.dock-tool b { max-width: 125px; }
.all-tools-button { position: fixed; right: max(1.5rem, calc((100vw - 1500px)/2)); bottom: 1.5rem; z-index: 15; display: flex; align-items: center; gap: .6rem; background: var(--accent); color: #211900; border: 0; border-radius: 18px; padding: 1rem 1.4rem; font-size: 1.2rem; box-shadow: 0 10px 35px #0004; }
.tool-categories { width: min(100%, 1000px); padding-top: .5rem; }
.tool-categories h2 { justify-content: center; }
.category-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.category-cards button { padding: 1.25rem; text-align: left; font-size: 1.1rem; border-radius: 16px; }
.category-cards small { display: block; color: var(--text-secondary); margin-top: .5rem; font-size: .85rem; }
.whiteboard-tools { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
#whiteboardCanvas { display: block; width: 100%; height: min(62vh, 650px); min-height: 360px; background: #fff; border-radius: 12px; border: 1px solid var(--border); touch-action: none; }
.scoreboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.score-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 1.5rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 18px; }
.score-name { width: 100%; text-align: center; font-weight: 700; }
.score-card strong { font-size: 4rem; color: var(--accent); }
.score-card div { display: flex; gap: .5rem; }
.score-remove { position: absolute; top: .4rem; right: .4rem; padding: .25rem .55rem; }
.wheel-stage { display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.wheel-pointer { color: var(--warning); font-size: 2rem; line-height: .7; z-index: 1; }
.wheel-disc { width: min(72vw, 340px); aspect-ratio: 1; position: relative; border-radius: 50%; border: 8px solid #e2e8f0; box-shadow: 0 8px 24px #0004; overflow: hidden; transition: transform 3.2s cubic-bezier(.12,.72,.16,1); }
.wheel-disc span { position: absolute; left: 50%; top: 50%; width: 48%; text-align: right; transform: rotate(calc(var(--i) * var(--slice) + var(--slice) / 2)) translateY(-50%); transform-origin: left center; color: white; font-size: clamp(.65rem, 2vw, .9rem); font-weight: 700; text-shadow: 0 1px 3px #000; overflow: hidden; white-space: nowrap; }
#wheelWinner { min-height: 2rem; font-size: 1.25rem; font-weight: 750; color: var(--accent); }

/* Full-screen class scoreboard */
body.scoreboard-mode { overflow: hidden; }
body.scoreboard-mode > header, body.scoreboard-mode > nav, body.scoreboard-mode > footer { display: none; }
body.scoreboard-mode #moduleContainer { position: fixed; inset: 0; z-index: 50; width: 100%; max-width: none; margin: 0; padding: 0; }
.scoreboard-screen { position: absolute; inset: 0; overflow: hidden; background: #171a2b; color: #f8fafc; }
.scoreboard-screen .scoreboard-topbar { position: absolute; z-index: 3; inset: 0 0 auto; height: 62px; padding: .45rem 1rem; display: flex; align-items: center; gap: .8rem; background: transparent; border: 0; backdrop-filter: none; }
.scoreboard-topbar button { min-width: 44px; height: 44px; padding: .35rem .7rem; border: 1px solid #ffffff20; border-radius: 12px; color: white; background: #ffffff13; font-size: 1.3rem; }
.scoreboard-topbar strong { font-size: 1.2rem; }
.scoreboard-top-spacer { flex: 1; }
.scoreboard-arena { position: absolute; inset: 0; display: grid; }
.scoreboard-arena.team-count-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.scoreboard-arena.team-count-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.scoreboard-arena.team-count-4 { grid-template-columns: repeat(2,minmax(0,1fr)); grid-template-rows: repeat(2,minmax(0,1fr)); }
.scoreboard-arena.team-count-5, .scoreboard-arena.team-count-6 { grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: repeat(2,minmax(0,1fr)); }
.scoreboard-team { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 4rem .6rem 2.5rem; background: color-mix(in srgb,var(--team-color) 12%,#171a2b); border-right: 1px solid color-mix(in srgb,var(--team-color) 16%,transparent); border-bottom: 1px solid color-mix(in srgb,var(--team-color) 16%,transparent); }
.team-count-2 .scoreboard-team:first-child { background: linear-gradient(145deg,#1c2945,#1a2037); }
.team-count-2 .scoreboard-team:last-child { background: linear-gradient(145deg,#33212f,#241d2d); }
.score-adjust { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); width: 62px; height: 44px; padding: 0; border: 0; color: color-mix(in srgb,var(--team-color) 65%,white); background: transparent; font-size: 2.6rem; line-height: 1; }
.score-adjust:hover { transform: translateX(-50%) scale(1.16); color: white; }
.score-up { top: 4%; }
.score-down { bottom: 3%; }
.score-team-name { max-width: 90%; padding: .4rem 1.1rem; color: #f1f5f9; border: 1px solid color-mix(in srgb,var(--team-color) 58%,transparent); border-radius: 13px; background: color-mix(in srgb,var(--team-color) 17%,transparent); font-size: clamp(1rem,2.1vw,1.8rem); font-weight: 700; letter-spacing: .04em; text-align: center; text-transform: uppercase; overflow-wrap: anywhere; }
.score-value { color: var(--team-color); font-size: clamp(7rem,23vw,13rem); font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; text-shadow: 0 8px 38px color-mix(in srgb,var(--team-color) 28%,transparent); }
.team-count-3 .score-value, .team-count-4 .score-value, .team-count-5 .score-value, .team-count-6 .score-value { font-size: clamp(4rem,12vw,8rem); }
.scoreboard-center-mark { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 86px; height: 86px; display: grid; place-items: center; color: #e5e7eb; background: #171a2b; border: 5px solid #343447; border-radius: 50%; font-size: 1.4rem; font-style: italic; font-weight: 800; }
.team-count-3 ~ .scoreboard-center-mark, .team-count-4 ~ .scoreboard-center-mark, .team-count-5 ~ .scoreboard-center-mark, .team-count-6 ~ .scoreboard-center-mark { display: none; }
.scoreboard-reset { position: absolute; z-index: 3; left: 50%; bottom: 3%; transform: translateX(-50%); width: 90px; height: 90px; padding: 0; color: white; background: #ffffff1a; border: 1px solid #ffffff20; border-radius: 50%; font-size: 2.6rem; }
.scoreboard-reset:hover { transform: translateX(-50%) rotate(-20deg); background: #ffffff30; }
.score-settings { width: min(500px,calc(100vw - 2rem)); max-height: min(88vh,760px); margin: auto; padding: 1.6rem 1.8rem; color: #f8fafc; background: #1a1a31; border: 1px solid #ffffff12; border-radius: 24px; box-shadow: 0 24px 80px #0009; }
.score-settings::backdrop { background: #060713bd; backdrop-filter: blur(4px); }
.score-settings h2 { display: block; text-align: center; margin-bottom: 1rem; }
.team-count-label { display: block; color: #c4c7d0; text-align: center; margin-bottom: .6rem; }
.team-count-choices { display: flex; justify-content: center; gap: .7rem; padding-bottom: 1.2rem; border-bottom: 1px solid #ffffff17; }
.team-count-choice { width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%; background: #303047; color: white; font-weight: 700; font-size: 1.2rem; }
.team-count-choice.selected { background: #fff; color: #111827; outline: 2px solid #4385f5; outline-offset: 1px; }
.team-name-fields { display: grid; gap: .65rem; margin: 1rem 0 1.4rem; max-height: 44vh; overflow-y: auto; }
.team-name-fields label { display: grid; gap: .2rem; color: var(--team-color); }
.team-name-fields input { width: 100%; padding: .75rem .9rem; border-color: color-mix(in srgb,var(--team-color) 55%,transparent); background: #29293d; font-size: 1rem; }
.score-settings-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.score-settings-actions button { min-width: 100px; border-radius: 99px; }
.score-settings-actions button:not(.primary) { color: #b4b4c0; background: transparent; border: 0; }
.number-result-box { cursor: pointer; user-select: none; transition: border-color .2s, transform .2s; }
.number-result-box:hover { border-color: var(--accent); transform: translateY(-2px); }
.number-result-box:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 700px) {
    .scoreboard-arena.team-count-3, .scoreboard-arena.team-count-5, .scoreboard-arena.team-count-6 { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .scoreboard-arena.team-count-3 { grid-template-rows: repeat(2,minmax(0,1fr)); }
    .score-value, .team-count-3 .score-value, .team-count-4 .score-value, .team-count-5 .score-value, .team-count-6 .score-value { font-size: clamp(3.4rem,16vw,6rem); }
    .score-adjust { width: 44px; height: 38px; font-size: 2rem; }
    .scoreboard-reset { width: 58px; height: 58px; font-size: 1.8rem; }
    .scoreboard-center-mark { width: 56px; height: 56px; font-size: .95rem; }
}

/* Focused, presentation-sized digital whiteboard */
body.whiteboard-mode { overflow: hidden; background: #fff9e9; color: #f8fafc; }
body.whiteboard-mode > header, body.whiteboard-mode > nav, body.whiteboard-mode > footer { display: none; }
body.whiteboard-mode #moduleContainer { position: fixed; inset: 0; z-index: 50; width: 100%; max-width: none; margin: 0; padding: 0; }
.whiteboard-screen { position: absolute; inset: 0; overflow: hidden; background: #fff9e9; color: #172033; }
body[data-theme="light"]:not(.whiteboard-mode) { background: var(--bg-primary); }
.whiteboard-topbar { position: absolute; z-index: 3; inset: 0 0 auto; height: 58px; display: flex; align-items: center; gap: .8rem; padding: .5rem 1.25rem; background: linear-gradient(#fff9e9e8, #fff9e900); }
.whiteboard-topbar button { color: #1e293b; background: #ffffffb8; border: 1px solid #d8d4c8; }
.whiteboard-title { font-size: 1.05rem; font-weight: 650; color: #283247; }
.whiteboard-spacer { flex: 1; }
.whiteboard-stage { position: absolute; inset: 0; }
#whiteboardCanvas { display: block; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; background: #fff9e9; touch-action: none; cursor: crosshair; }
.whiteboard-palette, .whiteboard-toolbar { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: .55rem; padding: .65rem .9rem; background: #fff; border: 1px solid #eee9dd; border-radius: 22px; box-shadow: 0 8px 30px #25304720; }
.whiteboard-palette { bottom: 112px; }
.whiteboard-toolbar { bottom: 24px; gap: .35rem; padding: .55rem .75rem; background: #19192d; border-color: #28283e; border-radius: 26px; }
.whiteboard-screen button { transition: transform .15s, background .15s, color .15s; }
.whiteboard-screen button:hover { transform: translateY(-2px); }
.wb-color { width: 34px; height: 34px; padding: 0; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #d5d9e0; }
.wb-color.selected { box-shadow: 0 0 0 2px #4296f5; }
.wb-size { width: 28px; height: 34px; padding: 0; border: 0; display: grid; place-items: center; background: transparent; }
.wb-size i { display: block; border-radius: 50%; background: #222; }
.wb-tool { min-width: 42px; height: 42px; padding: .45rem; border: 0; background: transparent; color: #a7a7b3; font-size: 1.2rem; }
.wb-tool.selected { color: #fff; background: #4385f5; border-radius: 13px; }
.wb-tool:hover { color: #fff; }
.wb-separator { height: 27px; border-left: 1px solid #454555; margin: 0 .2rem; }
.wb-danger { color: #fa4c5c; }
.wb-file { display: none; }
@media (max-width: 700px) {
    .whiteboard-palette { bottom: 100px; gap: .25rem; padding: .45rem .6rem; border-radius: 18px; }
    .whiteboard-toolbar { bottom: 12px; width: calc(100% - 1rem); justify-content: space-around; gap: 0; padding: .4rem; border-radius: 20px; }
    .wb-tool { min-width: 34px; height: 38px; padding: .3rem; font-size: 1rem; }
    .wb-color { width: 29px; height: 29px; }
    .whiteboard-topbar { padding: .4rem .65rem; }
}

@media (max-width: 700px) {
    .home-dashboard { min-height: 72vh; padding: 1.5rem .75rem 5rem; justify-content: center; }
    .clock-panel { gap: 1rem; }
    #homeClock { font-size: clamp(5rem, 22vw, 9rem); }
    .date-panel strong { font-size: 3.4rem; }
    .date-panel span { font-size: 1rem; }
    .date-panel small { letter-spacing: .12em; font-size: .7rem; }
    .home-dock { padding: .85rem 2.8rem; }
    .dock-tools { justify-content: flex-start; }
    .dock-tool { flex-basis: 92px; }
    .dock-tool span { width: 52px; height: 52px; }
    .all-tools-button { position: static; margin: 0 auto 1.5rem; }
    .category-cards { grid-template-columns: 1fr; }
    .main-nav { justify-content: center; }
    .home-tab { margin-left: 0; }
    .info-dialog-content { padding: 1.35rem 3rem 1.1rem 1rem; }
}

.tab-btn {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    padding: 0.6rem 1.1rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.9rem;
}

.tab-btn.active {
    background: var(--accent);
    color: #211900;
    border-color: var(--accent);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--accent) 38%, transparent);
}

main {
    position: relative;
    z-index: 10;
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0.5rem 1rem 2rem;
}

.tool-section {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
}

textarea {
    width: 100%;
    height: 220px;
    resize: vertical;
    line-height: 1.6;
}

.result-box {
    background: var(--bg-primary);
    border: 1px dashed var(--accent);
    border-radius: 14px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media print {
    body * { visibility: hidden; }
    #moduleContainer, #moduleContainer * { visibility: visible; }
    #moduleContainer {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .tool-section {
        background: white !important;
        color: black !important;
        border: none !important;
        box-shadow: none !important;
    }
    header, nav, footer, canvas, .no-print { display: none !important; }
}
