:root {
  color-scheme: dark;
  font:
    16px/1.5 "Segoe UI",
    system-ui,
    sans-serif;
  background: #091720;
  color: #f0f7f8;
  --line: #365360;
  --accent: #69e2df;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at top right, #153e4a, transparent 65%);
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  cursor: pointer;
}
button,
.btn {
  color: #e7f4f6;
  background: #19333f;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
}
button:hover,
.btn:hover {
  border-color: #63bfca;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary,
.active {
  background: #77dfdf;
  color: #062531;
  border-color: transparent;
  font-weight: 650;
}
.danger {
  color: #ffb7b2;
}
input,
textarea,
select {
  display: block;
  background: #0b1d27;
  color: white;
  width: 100%;
  border: 1px solid #43606e;
  border-radius: 8px;
  padding: 0.62rem;
  margin-top: 4px;
}
input[type="checkbox"] {
  display: inline;
  width: auto;
}
textarea {
  min-height: 6em;
  resize: vertical;
}
label {
  display: block;
  margin: 0.7rem 0;
  color: #c9dce0;
  font-size: 0.91rem;
}
small,
.muted {
  color: #aac2c9;
}
.glass,
dialog {
  background: #122b36ed;
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: 0 12px 40px #00101948;
  backdrop-filter: blur(16px);
}
.login {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 5vw;
  background:
    linear-gradient(90deg, #071824e8, #07182464),
    url(/driveway.jpg) center/cover;
}
.signin {
  max-width: 410px;
  padding: 2rem;
}
.logo {
  width: 76px;
  border-radius: 12px;
}
.top {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem max(1.5rem, calc((100% - 1200px) / 2 + 1.5rem));
  background: #0c202be8;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.top img {
  width: 42px;
  border-radius: 8px;
}
.top strong {
  margin-right: auto;
}
.wrap {
  max-width: 1200px;
  margin: auto;
  padding: 1.5rem;
}
.nav,
.row,
.actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}
.nav {
  justify-content: center;
  margin-bottom: 1.5rem;
}
.hero {
  text-align: center;
  padding: 2rem;
  border-radius: 18px;
  background:
    linear-gradient(90deg, #0c2632fa, #0d273be0, #0b233972),
    url(/lobby.png) center 48% / cover;
}
.hero h1 {
  margin: 0.3rem 0;
}
.cards,
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.card,
.block {
  padding: 1.25rem;
}
.card {
  text-align: left;
}
.card b {
  display: block;
  font-size: 2rem;
}
.list {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  width: 100%;
}
.item small {
  display: block;
}
.grow {
  flex: 1;
}
.tag {
  color: var(--accent);
  font-size: 0.84rem;
}
.actions {
  margin: 1rem 0;
}
.note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.file {
  display: inline-grid;
  gap: 4px;
  max-width: 160px;
  margin: 0.4rem;
  vertical-align: top;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.file img {
  max-width: 150px;
  height: 100px;
  object-fit: contain;
  background: #081923;
  border-radius: 7px;
}
dialog {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  padding: 1.4rem;
  width: min(590px, 100%);
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100vw;
  border-radius: 16px 0 0 16px;
  color: inherit;
  overflow: auto;
}
dialog::backdrop {
  background: #04101bc7;
}
dialog h2 {
  margin: 0.3rem 0;
}
.meta {
  font-size: 0.83rem;
  color: #a9c2c9;
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
  margin-top: 0.8rem;
}
.thumb {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  background: #071924;
  border-radius: 9px;
}
.error {
  color: #ffc7b9;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  background: #153941;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  z-index: 10;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 9px;
}
fieldset label {
  display: inline-block;
  margin: 0.4em;
}
details {
  margin: 0.8rem 0;
}
summary {
  cursor: pointer;
}
h1 {
  letter-spacing: -0.035em;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
}
@media (max-width: 600px) {
  .wrap {
    padding: 0.8rem;
  }
  .nav button {
    padding: 0.4rem 0.6rem;
  }
  .hero {
    padding: 1.3rem;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
  }
  .top {
    padding-inline: .8rem;
    gap: 0.4rem;
  }
}

.record-row {display:flex; align-items:center; gap:.5rem; padding-right:.7rem}
.record-open {flex:1; min-width:0; border:0; background:transparent; text-align:left}
.copy {padding:.2rem .55rem; font-size:.8rem; border-radius:6px; color:var(--accent)}
.copy-buffer {position:fixed; left:-9999px; top:0}

.dnr-row, dialog.dnr-panel { border: 1px solid #b9505b; }
.dnr-row:hover { border-color: #ee7d86; }
dialog.dnr-panel:has(.dnr-details) { width: min(850px, 100%); }
.dnr-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
.dnr-photos .file { display: grid; max-width: 100%; margin: 0 0 .75rem; }
.dnr-photos .file img { width: 100%; max-width: 100%; height: auto; }
@media (max-width: 600px) {
  .dnr-details { grid-template-columns: 1fr; }
  .dnr-photos { grid-row: 1; }
}

.dnr-portrait { width: 72px; height: 90px; flex: none; border-radius: 6px; }
.dnr-row .record-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#portraitSettings .dnr-portrait { width: 120px; height: 150px; }
canvas.dnr-portrait { background: #e5e5e5 url("/no-portrait.png") center / contain no-repeat; }
img.no-portrait { object-fit: contain; background: #e5e5e5; }
.book-head,.book-section,.book-entry header,.book-entry footer,.book-tools {display:flex;align-items:center;gap:.65rem}
.book-head,.book-section {justify-content:space-between}
.book-layout {display:grid;grid-template-columns:minmax(210px,260px) minmax(0,1fr);gap:1rem;align-items:start}
.book-side,.book-page {padding:1.1rem}
.book-side {max-height:76vh;overflow:auto}
.book-side input {width:100%}
.book-section {margin-top:1.2rem}
.book-section h2 {font-size:.84rem;letter-spacing:.06em;text-transform:uppercase;color:#b1c9d1}
.book-side button,.book-page button[data-day],.book-page button[data-general-id] {display:block;text-align:left;background:transparent;border:0;padding:.45rem .65rem}
.book-side details {margin:.3rem 0 .3rem .6rem}
.book-side summary {padding:.3rem}
.book-side [aria-current=page],.book-side button:hover {background:#164758;color:white;border-radius:6px}
.book-page {min-height:23rem;padding:clamp(1rem,3vw,2rem)}
.book-page>h2 {margin:.4rem 0 1rem}
.book-entry {margin-top:1.4rem;border-top:1px solid var(--line);padding-top:1rem}
.book-entry header {flex-wrap:wrap}.book-entry header span,.book-staff {color:#abdbdf}
.book-entry small {display:block;font-size:.76rem;color:#aec4ca;margin-top:.2rem}
.book-text {white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;margin:.85rem 0}
.book-entry > .book-text {border-top:1px solid var(--line);padding-top:1rem;margin-top:1rem}
.book-entry footer button,.book-tools button {font-size:.84rem;padding:.32rem .6rem}
@media(max-width:740px){.book-layout{grid-template-columns:1fr}.book-side{max-height:33vh}.book-head h1{font-size:1.6rem}}
.rich-toolbar {position:sticky;top:0;z-index:2;max-height:45dvh;overflow-y:auto;display:flex;align-items:center;gap:.25rem;flex-wrap:wrap;border:1px solid var(--line);border-radius:.65rem .65rem 0 0;padding:.45rem;background:#0a202b}
.rich-toolbar button,.rich-toolbar select,.rich-toolbar label {width:auto;margin:0;font-size:.8rem;padding:.24rem .35rem}
.rich-toolbar label {display:inline-flex;align-items:center;gap:.2rem}
.rich-toolbar input[type=color] {width:1.5rem;height:1.45rem;padding:0;margin:0}
.rich-toolbar .bold{font-weight:bold}.rich-toolbar .italic{font-style:italic}.rich-toolbar .underline{text-decoration:underline}.rich-toolbar .strikeThrough{text-decoration:line-through}
.rich-editor {background:#0a1c26;border:1px solid var(--line);border-radius:0 0 .65rem .65rem;min-height:12rem;padding:.8rem;overflow-wrap:anywhere;white-space:pre-wrap}
.rich-editor:focus{outline:2px solid var(--accent)}
.rich-editor img,.book-text img,.note img{max-width:100%;max-height:30rem;object-fit:contain}
:is(.rich-editor,.book-text,.note) blockquote{margin:.5rem 0;padding-left:1rem;border-left:3px solid var(--accent)}
:is(.rich-editor,.book-text,.note) pre{white-space:pre-wrap;background:#071923;padding:.6rem}
.note-copy{font-size:.7rem;line-height:1.3;padding:.08rem .35rem;margin-right:.38rem;vertical-align:middle;color:var(--accent)}
.record-field{margin:1em 0}
.rich-toolbar input[hidden],textarea[hidden]{display:none}

.rich-editor .note-unshaded { background-color:#0a1c26; }
.book-text .note-unshaded,.note .note-unshaded { background-color:#122b36; }

:is(.rich-editor,.book-text,.note) .note-shade-full {margin-block:0;min-height:1lh}
:is(.rich-editor,.book-text,.note) .note-shade-separate {margin-block:.2em;min-height:1lh}
:is(.rich-editor,.book-text,.note) :is(div,p).note-unshaded {min-height:1lh}

#homeNotebook h2 {font-size:1.15rem;margin:0 0 .8rem}
.handoff-days {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.4rem}
.handoff-days article+article {border-left:1px solid var(--line);padding-left:1.4rem}
.handoff-days h3 {margin:0 0 .75rem;font-size:1rem}
.handoff-days small {display:block;color:#a9c2c9;font-size:.78rem;font-weight:400}
.handoff-entry {margin:.75rem 0}
.handoff-entry p {white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:.2rem 0}
@media(max-width:700px){.handoff-days{grid-template-columns:1fr}.handoff-days article+article{border-left:0;border-top:1px solid var(--line);padding:1rem 0 0}}
#myProfile,.profile-title{display:flex;align-items:center;gap:.6rem}
.staff-face,.top img.staff-face{width:44px;height:44px;border-radius:50%;object-fit:cover;flex:none}
#myProfile .staff-face{width:25px;height:25px}
.staff-face.initials{display:inline-grid;place-items:center;background:#165767;color:#b8f4ed;font-weight:700}
.profile-banner{margin-top:1rem;height:4rem;border-radius:12px;background:linear-gradient(110deg,#034064,#007f89)}
.profile-title{margin:.8rem 0 1rem}
.profile-title .staff-face{width:64px;height:64px;font-size:1.5rem}
.directory-heading {margin:1rem 0 .2rem;font-size:1.1rem}
.employee-row .record-open,.employee-account {display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:1rem;text-align:left}
.employee-row .record-text,.employee-account>span {text-align:left;overflow-wrap:anywhere}
.employee-account {padding:.7rem 1rem}
.employee-account small {display:block}
.chat-head,.chat-post header{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap}
.chat-head h1{margin-right:auto}
.chat-grid{display:grid;grid-template-columns:minmax(170px,28%) minmax(0,1fr);gap:1rem}
.chat-grid aside button{display:block;width:100%;text-align:left;margin-bottom:.45rem}
.chat-log{max-height:44vh;overflow:auto;overscroll-behavior:contain}
.chat-post{border-top:1px solid var(--line);padding:.65rem 0}
.chat-post small{color:#acc8cc}.chat-post p{white-space:pre-wrap;overflow-wrap:anywhere;margin:.25rem 0}
.chat-post button{font-size:.78rem;padding:.15rem .45rem}
.chat-alert{position:fixed;bottom:1rem;right:1rem;z-index:8;background:#154856;border:1px solid var(--accent)}
@media(max-width:650px){.chat-grid{grid-template-columns:1fr}.chat-grid aside{max-height:25vh;overflow:auto}}
