:root {
    color-scheme: light;
    font-family: system-ui, -apple-system, sans-serif;
    color: #1d2830;
    background: #f3f5f5;
    --muted: #52636a;
    --line: #d6dfe1;
    --accent: #235449;
    --accent-hover: #163d34;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, p, dl, dd { margin: 0; }
h1 { margin-block-end: 1.5rem; font-size: clamp(2rem, 4vw, 2.65rem); line-height: 1.1; letter-spacing: -.045em; }
h2 { font-size: 1.15rem; line-height: 1.4; letter-spacing: -.02em; overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #46867a; outline-offset: 2px; }

.shell { width: min(100% - 2rem, 68rem); margin-inline: auto; }
main.shell { padding-block: clamp(2rem, 6vw, 4rem); }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner, nav { display: flex; align-items: center; gap: 1rem; }
.topbar-inner { min-height: 4.25rem; justify-content: space-between; flex-wrap: wrap; padding-block: .5rem; }
.brand { color: #1d2830; font-weight: 760; font-size: 1.12rem; letter-spacing: -.035em; text-decoration: none; }
nav a, .sign-out { color: var(--muted); font-size: .9rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
nav a:hover, .sign-out:hover, nav a[aria-current="page"] { color: var(--accent-hover); text-decoration: underline; }

.panel { min-width: 0; padding: clamp(1.15rem, 3vw, 1.65rem); border: 1px solid var(--line); border-radius: .8rem; background: #fff; }
.guest-layout { display: grid; justify-content: center; grid-template-columns: min(100%, 27rem); }
.auth-panel { padding: clamp(1.3rem, 4vw, 2rem); }
.auth-panel h1 { font-size: clamp(1.65rem, 5vw, 2.2rem); }
.auth-switch { padding-block-start: 1.25rem; color: var(--muted); font-size: .93rem; }
.miners-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.miner-list { display: grid; gap: 1rem; }
.miner-details { display: flex; flex-wrap: wrap; gap: .8rem 1.75rem; margin-block: .8rem 1.2rem; font-size: .9rem; }
.miner-details div { min-width: 0; }
.miner-details dt { color: var(--muted); }
.miner-details dd { font-family: ui-monospace, SFMono-Regular, monospace; overflow-wrap: anywhere; }
.empty-state p { margin-top: .4rem; color: var(--muted); }
.add-miner h2 { margin-block-end: 1rem; }
.pool-form { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: .65rem; align-items: start; }
.pool-form button { margin-top: 1.55rem; }

.fields, .field { display: grid; }
.fields { gap: 1rem; justify-items: start; }
.field { width: 100%; min-width: 0; gap: .3rem; }
label { font-weight: 670; font-size: .88rem; }
input { width: 100%; min-height: 2.65rem; padding: .5rem .65rem; border: 1px solid #aebec2; border-radius: .38rem; background: #fff; color: inherit; font: inherit; }
input::placeholder { color: #627277; }
button { min-height: 2.65rem; padding: .48rem .9rem; border: 1px solid transparent; border-radius: .38rem; color: #fff; background: var(--accent); font: inherit; font-size: .9rem; font-weight: 670; cursor: pointer; }
button:hover { background: var(--accent-hover); }
.button-secondary { border-color: #9eb9b2; background: #fff; color: var(--accent-hover); }
.button-secondary:hover { background: #eff7f4; }
.sign-out, .sign-out:hover { padding-inline: 0; border: 0; background: transparent; }
.hint, .error { line-height: 1.4; font-size: .85rem; overflow-wrap: anywhere; }
.hint { color: var(--muted); }
.error { color: #982b25; }
.notice { margin-block-end: 1.1rem; padding: .75rem 1rem; border: 1px solid #b6d3c8; border-radius: .45rem; background: #e9f4ee; color: #204b3f; }

.profile-panel { max-width: 33rem; }
.profile-header { display: flex; align-items: center; gap: 1rem; margin-block-end: 1.4rem; overflow-wrap: anywhere; }
.avatar { flex: 0 0 auto; width: 5rem; height: 5rem; border-radius: 50%; object-fit: cover; }
.placeholder-avatar { display: grid; place-items: center; background: #e5efeb; color: var(--accent); font-size: 1.8rem; font-weight: 670; }

@media (max-width: 46rem) {
    .miners-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 28rem) {
    nav { gap: .65rem; }
    .pool-form { grid-template-columns: minmax(0, 1fr); justify-items: start; }
    .pool-form button { margin-top: 0; }
}
