:root {
  font-family: "Yu Gothic UI", "Hiragino Sans", Meiryo, system-ui, sans-serif;
  color: #182d2c;
  background: #f2f5f3;
  font-synthesis: none;
  line-height: 1.55;
  --green: #135448;
  --accent: #dcebe3;
  --line: #ccd9d3;
  --muted: #4c6661;
  --error: #993b31;
}
*, ::before, ::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 280px; margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
button, input, select, textarea { border-radius: .55rem; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #468d7b;
  outline-offset: 3px;
}
button { min-height: 2.75rem; padding: .6rem 1rem; white-space: nowrap; border: 1px solid transparent; font-weight: 700; }
input, select, textarea {
  min-width: 0;
  border: 1px solid #aebfb7;
  background: #fff;
  color: #182d2c;
  padding: .65rem .75rem;
}
textarea { resize: vertical; }
label { display: block; margin-bottom: .38rem; font-size: .9rem; font-weight: 700; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.72rem, 3vw, 2.65rem); letter-spacing: -.035em; line-height: 1.32; }
h2 { font-size: 1.3rem; line-height: 1.35; }
.muted { color: var(--muted); }
.top { background: #fff; border-bottom: 1px solid #dde5df; }
.top-inner { max-width: 76rem; min-height: 4.4rem; padding: .55rem 1.7rem; margin: auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-size: 1.06rem; font-weight: 750; }
.calendar-mark { display: inline-block; width: 1.45rem; aspect-ratio: 1; border: 1.6px solid currentColor; border-radius: .31rem; color: #267464; position: relative; flex: none; }
.calendar-mark::before { content: ""; position: absolute; left: 0; right: 0; top: 29%; border-top: 1.6px solid currentColor; }
.calendar-mark::after { content: ""; position: absolute; top: -17%; left: 25%; width: 50%; height: 30%; border: solid currentColor; border-width: 0 1.6px; }
.primary { background: var(--green); color: #fff; }
.primary:hover:not(:disabled) { background: #0e443a; }
.outline { background: #fff; border-color: #a4b9af; color: #164d42; }
.outline:hover:not(:disabled), .subtle:hover:not(:disabled) { background: #e4eee8; }
.subtle { background: transparent; color: #244a43; }
.wide { width: 100%; margin-top: .95rem; }

.login { width: min(100% - 2.2rem, 29rem); overflow: hidden; margin: clamp(2rem, 9vh, 6rem) auto 2rem; background: #fff; border: 1px solid #d3ded8; border-radius: 1.1rem; box-shadow: 0 20px 55px #1b473416; }
.login-banner { min-height: 8rem; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1rem; padding: 1.8rem 2.15rem; color: #e4f3e9; background: linear-gradient(122deg, #123e38, #1d6555); }
.login-banner p { font-size: .95rem; font-weight: 700; }
.login-calendar { width: 2rem; color: #bae2ce; }
.login-body { padding: 1.85rem 2.1rem 1.45rem; }
.login h1 { font-size: clamp(1.47rem, 5vw, 2rem); }
.login .muted { margin-top: .45rem; }
.login form { margin-top: 1.55rem; }
.login input, dialog input { width: 100%; }
.message { min-height: 1.4em; color: var(--error); font-size: .9rem; }
.login .message { margin-top: .6rem; }

.workspace { max-width: 76rem; padding: 2.75rem 1.7rem 2.35rem; margin: auto; }
.heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding: 0 0 1.25rem; }
.caption { color: var(--green); font-size: .91rem; font-weight: 750; margin-bottom: .3rem; }
.heading .muted { margin-top: .35rem; font-size: .92rem; }
.overview { display: flex; justify-content: space-between; align-items: center; gap: .4rem 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding: .88rem 0; font-size: .91rem; font-weight: 650; }
.connection { color: var(--muted); font-weight: 500; }
.connection::before { content: ""; display: inline-block; width: .52rem; height: .52rem; border-radius: 50%; background: #36856c; margin-right: .4rem; vertical-align: .08rem; }
.connection.offline::before { background: #a75d2c; }
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.day-card { border: 1px solid #cddad3; border-radius: .88rem; background: #fff; overflow: hidden; }
.day-title { padding: .85rem 1.1rem; background: #e4eee8; color: #164a3f; font-size: 1.16rem; }
.day-content { padding: .25rem 1.05rem; }
.slot { min-height: 6.75rem; padding: .75rem 0 .8rem; }
.slot + .slot { border-top: 1px solid #e0e7e2; }
.slot-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.slot-heading h3 { font-size: 1.14rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slot-count { font-size: .88rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.students { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .55rem 0 0; list-style: none; }
.students li { background: #eff4f1; color: #244e43; padding: .13rem .55rem; border-radius: .35rem; font-size: .9rem; font-weight: 650; overflow-wrap: anywhere; }
.slot-note { margin-top: .45rem; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.updated { margin-top: 1.2rem; font-size: .87rem; }
.empty { padding: 1.6rem; background: #fff; border: 1px solid var(--line); border-radius: .65rem; }

.editor-bar { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: flex-end; gap: .8rem; margin-bottom: .75rem; }
.edit-slots { margin: .95rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: .9rem; }
.edit-slot { min-width: 0; margin: 0; padding: .75rem; background: #fff; border: 1px solid #cbd8d1; border-radius: .65rem; }
.edit-slot legend { padding: 0 .4rem; font-size: .89rem; font-weight: 700; }
.field-row { display: grid; grid-template-columns: repeat(3,minmax(0, 1fr)); gap: .55rem; }
.edit-slot label { margin: 0; }
.edit-slot label input, .edit-slot label select, .edit-slot label textarea { width: 100%; display: block; margin-top: .25rem; }
.edit-slot .stack { margin-top: .7rem; }
.remove { color: #8a382e; display: block; margin: .4rem 0 0 auto; }
.save-panel { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: .9rem 0; }
.save-actions { display: flex; justify-content: flex-end; gap: .4rem; flex-wrap: wrap; }
dialog { padding: 1.45rem; border-radius: .9rem; border: 1px solid #cbd8d1; width: min(100% - 2rem, 28rem); color: #182d2c; }
dialog::backdrop { background: #142e28a0; }
dialog .muted { margin: .48rem 0 .9rem; }
dialog .message { margin: .5rem 0; }
@media (max-width: 35rem) {
  .top-inner { padding-inline: 1rem; min-height: 3.75rem; }
  .workspace { padding: 1.55rem 1rem 1.5rem; }
  .heading { align-items: flex-start; flex-direction: column; }
  .login-banner, .login-body { padding-inline: 1.3rem; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row > :first-child { grid-column: 1 / -1; }
  .save-panel { align-items: stretch; flex-direction: column; }
}
