* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --ink: #1c2430; --muted: #526170; --line: #dbe2e8; --surface: #fff;
  --canvas: #f2f5f7; --night: #152233; --accent: #ffbb48; --focus: #155ecc;
  font: 100%/1.55 "Segoe UI", system-ui, sans-serif;
  color: var(--ink); background: var(--canvas);
}
body { margin: 0; }
a { color: #194b75; font-weight: 600; text-underline-offset: .18em; }
a:hover { color: #101f32; }
:focus-visible { outline: .18rem solid var(--focus); outline-offset: .18rem; }
h1, h2, h3 { line-height: 1.18; }
h1 { margin: .2rem 0 1.25rem; font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.045em; }
h2 { font-size: 1.3rem; margin: 0 0 .8rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; margin: 0 0 .6rem; }
p { margin: .6rem 0 1rem; }
form { margin: 0; }
button, input, select, textarea { font: inherit; }
button { border: 1px solid #c5cfd8; border-radius: .55rem; padding: .55rem .85rem; background: var(--surface); color: var(--ink); font-weight: 650; cursor: pointer; }
button:hover { background: #edf2f6; }
button.primary { background: var(--accent); border-color: #c27600; color: #322101; }
button.primary:hover { background: #ffcc6d; }
button.danger { color: #9d2b39; }
label { display: block; font-weight: 600; }
label input, label select, label textarea { display: block; width: 100%; margin-top: .32rem; }
input:not([type=checkbox]), textarea, select { border: 1px solid #a5b3c0; border-radius: .5rem; padding: .55rem .65rem; background: var(--surface); color: var(--ink); min-width: 0; }
select { appearance: none; padding-right: 2.1rem; background: linear-gradient(45deg, transparent 50%, #536475 50%) right 1rem center / .32rem .32rem no-repeat, linear-gradient(135deg, #536475 50%, transparent 50%) right .68rem center / .32rem .32rem no-repeat, var(--surface); }
.topbar { background: var(--night); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: .9rem clamp(1rem, 5vw, 3.5rem); gap: 1rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: inherit; font-size: 1.1rem; font-weight: 750; letter-spacing: -.02em; }
.brand:hover { color: inherit; }
.brand-mark { display: grid; place-items: center; background: var(--accent); color: #332301; width: 2rem; height: 2rem; border-radius: .5rem; font-weight: 800; }
.account, .row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .85rem; }
.account { font-size: .875rem; color: #e3e9f1; }
.account button { background: transparent; color: #fff; border-color: #64758b; }
.account button:hover { background: #263a51; }
.content { max-width: 76rem; margin: 1.8rem auto 3rem; padding: 0 clamp(1rem, 4vw, 2.2rem); }
.narrow { max-width: 54rem; }
.entry { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background: linear-gradient(150deg,#152233,#223a55 55%,#314d66); }
.entry-card { background: var(--surface); border-radius: 1rem; padding: clamp(1.3rem, 5vw, 2.3rem); width: min(100%, 29rem); box-shadow: 0 1rem 2.8rem #0b14275c; }
.entry-card h1 { margin-top: 1.3rem; }
.entry-card input { width: 100%; }
.panel { padding: clamp(1rem, 3vw, 1.55rem); margin: 1rem 0; background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; scroll-margin-top: 1rem; }
.alarm-panel { border-top: .25rem solid #e09a24; }
.notice { background: #fff5d9; border: 1px solid #d7b65e; border-radius: .55rem; margin: 1rem 0; padding: .65rem .9rem; }
.notice p { margin: .15rem 0; }
.notice input { width: min(100%, 30rem); }
.muted { color: var(--muted); }
.sections { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: .7rem 0; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .4rem 1rem; }
.stack { display: grid; gap: .65rem; justify-items: start; }
.form-grid, .access-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .9rem 1.3rem; align-items: end; }
.access-grid { align-items: start; }
.form-grid button { justify-self: start; }
.wide { grid-column: 1 / -1; }
.inline-form { display: flex; flex-wrap: wrap; gap: .45rem .65rem; align-items: end; margin-top: .8rem; }
.inline-form label { flex: 1 1 12rem; max-width: 29rem; }
.record-list { list-style: none; padding: 0; margin: 0; }
.record-list li { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .85rem; padding: .65rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.record-list li a, .record-list li > span:first-child { margin-right: auto; }
.pill { display: inline-block; padding: .12rem .48rem; border-radius: .35rem; background: #eef2f5; color: #34485b; font-size: .875rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; text-align: left; border-collapse: collapse; }
th, td { padding: .65rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .875rem; }
.check { display: flex; align-items: center; gap: .6rem; }
.check input { width: auto; margin: 0; inline-size: 1.1rem; block-size: 1.1rem; }
.details { display: flex; flex-wrap: wrap; gap: 1rem 2rem; }
.details dt { font-weight: 650; }
.details dd { margin: 0; }
.alarm-text { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 42rem) {
  .form-grid, .access-grid { grid-template-columns: 1fr; }
  .account { width: 100%; justify-content: space-between; }
}
