:root {
  --da-primary: #1b4d3e;
  --da-text: #1a1a1a;
  --da-bg: #fdfaf1;
  --da-bg-subtle: #f7f3e3;
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: "Noto Sans JP", "Hiragino Sans", "Inter", sans-serif;
  background: var(--da-bg);
  color: var(--da-text);
  line-height: 1.75;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
}

.da-container {
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.da-container.is-wide {
  max-width: none;
}

@media (min-width: 768px) {
  .da-container { padding: 0 2rem; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--da-bg);
  border-bottom: 1px solid #e2e8f0;
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 768px) {
  .header-inner { height: 4.5rem; }
}

.site-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.logo-text {
  font-family: Inter, sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

@media (min-width: 768px) {
  .logo-text { font-size: 1.5rem; }
}

.logo-sub {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: #64748b;
  margin-top: -0.35rem;
}

@media (min-width: 768px) {
  .logo-sub {
    font-size: 10px;
    margin-top: -0.5rem;
  }
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1.15rem;
}

.header-name {
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
}

.header-link {
  color: var(--da-primary);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.header-switch {
  position: relative;
}

.header-switch > summary {
  list-style: none;
}

.header-switch > summary::-webkit-details-marker {
  display: none;
}

.header-switch > summary::after {
  content: " ▾";
  font-size: 0.75em;
}

.header-switch-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 20;
  min-width: 11rem;
  max-height: 70vh;
  overflow-y: auto;
  padding: 0.35rem 0;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.header-switch-menu button {
  display: block;
  width: 100%;
  padding: 0.5rem 0.9rem;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.header-switch-menu button:hover {
  background: #f1f5f9;
}

.header-switch-menu hr {
  margin: 0.35rem 0;
  border: none;
  border-top: 1px solid #e2e8f0;
}

main { flex: 1; }

.section {
  padding: 1.5rem 0 3rem;
}

@media (min-width: 768px) {
  .section { padding: 2rem 0 4rem; }
}

.is-home .section {
  padding: 0.7rem 0 1.4rem;
}

@media (min-width: 768px) {
  .is-home .section { padding: 0.9rem 0 1.6rem; }
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-kicker-line {
  width: 1.5rem;
  height: 2px;
  background: var(--da-primary);
}

.section-kicker p {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--da-primary);
}

.section h1 {
  margin: 0 0 1.25rem;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  border-left: 4px solid var(--da-primary);
  padding-left: 0.75rem;
  line-height: 1.35;
}

@media (min-width: 768px) {
  .section h1 { font-size: 1.875rem; }
}

.section h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 900;
}

.lede {
  margin: 0 0 1rem;
  color: #334155;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.confirm-dates {
  display: grid;
  gap: 0.4rem;
  margin: 0.85rem 0 0;
  padding: 0;
  border: none;
}

.confirm-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
}

.confirm-date-label {
  min-width: 0;
  font-weight: 700;
}

.skin-admin .student-only {
  display: none;
}

.calc-level {
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1.2;
}

.calc-level[hidden] {
  display: none;
}

.notice {
  margin: 0.75rem 0 0;
  color: #9b1c1c;
}

main a[href^="http"] {
  color: var(--da-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dash {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.dash-card {
  display: block;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.1rem 1.15rem 1.15rem;
  box-shadow: 0 8px 24px rgba(15, 43, 35, 0.06);
}

.dash-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--da-primary);
}

.dash-value {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.4;
}

.dash-meta {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: #475569;
}

.skin-login .site-header {
  position: static;
  border-bottom: none;
}

.skin-login .header-inner {
  justify-content: center;
  height: auto;
  padding: 1.5rem 0 0;
}

.skin-login .logo-sub {
  display: none;
}

.skin-login main {
  display: flex;
  align-items: center;
  justify-content: center;
}

.skin-login .section {
  width: 100%;
  padding: 1.5rem 0;
}

.skin-login .site-footer {
  background: transparent;
  border-top: none;
}

.da-button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.375rem;
  background: var(--da-primary);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 0 0 #0f2b23;
  cursor: pointer;
}

.da-button-primary:hover { filter: brightness(1.08); }

.da-button-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 0 #0f2b23;
}

.table-action {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--da-primary);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.table-action:hover {
  text-decoration: underline;
}

.field-stack {
  display: grid;
  gap: 0.85rem;
  max-width: 22rem;
  margin: 1.25rem 0 0;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin: 1.25rem 0 0;
}

.field-row > div {
  min-width: 10rem;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

label.block input {
  margin-top: 0.35rem;
}

label.check {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.5rem 0 0;
  font-weight: 500;
}

label.check input {
  margin-top: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font: inherit;
  background: #fff;
}

.form-block {
  margin: 0 0 1.5rem;
  padding: 0 0 1.5rem;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
}

.form-block legend {
  padding: 0 0 0.35rem;
  font-weight: 900;
}

.hint {
  margin: 0 0 0.75rem;
  color: #64748b;
  font-size: 0.9rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.site-footer {
  background: var(--da-bg-subtle);
  border-top: 1px solid #e2e8f0;
  padding: 1.25rem 0;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
}

.account-home {
  margin: 0 0 1.25rem;
}

.account-home a,
.account-guide a {
  color: var(--da-primary);
  font-weight: 700;
  text-underline-offset: 2px;
}

.account-section {
  margin-top: 1.75rem;
}

.account-section:first-of-type {
  margin-top: 0;
}

.account-section > h2 {
  margin-top: 0;
}

.account-facts,
.account-rows {
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.account-facts > div,
.account-row {
  display: grid;
  gap: 0.15rem 1rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid #e2e8f0;
}

.account-facts > div:first-child,
.account-row:first-child {
  border-top: none;
}

.account-facts dt,
.account-row-label {
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 700;
}

.account-facts dd,
.account-row p {
  margin: 0;
}

.account-facts dd,
.account-row-value {
  font-weight: 700;
}

.account-row-note {
  color: #475569;
  font-size: 0.9rem;
}

.account-empty {
  margin: 0;
  padding: 1rem;
  color: #64748b;
}

.account-guide {
  margin: 0.75rem 0 0;
  color: #475569;
}

@media (min-width: 640px) {
  .account-facts > div {
    grid-template-columns: 8rem 1fr;
    align-items: baseline;
  }

  .account-row {
    grid-template-columns: 8rem minmax(0, 1fr) minmax(12rem, 1.4fr);
    align-items: baseline;
  }
}

.next-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  margin: 0 0 0.45rem;
}

.day-modal-panel > h2 {
  margin: 0;
  font-size: 1.05rem;
}

.day-history {
  margin: 0.75rem 0 0;
  padding: 0 0 0 1.15rem;
  color: #334155;
}

.day-history li + li {
  margin-top: 0.25rem;
}

.next-actions .next-absent,
.next-actions .next-invoice,
.next-actions .next-print,
.next-actions .next-card,
.next-actions .next-calc,
.next-actions .next-achievements,
.next-actions .next-roster,
.next-actions .next-join,
.next-actions .next-permit,
.confirm-actions .day-absent,
.confirm-actions .day-quiet {
  margin: 0;
}

.admin-only {
  display: none;
}

.skin-admin .admin-only {
  display: grid;
}

.cal-legend .admin-cal {
  display: none;
}

.skin-admin .cal-legend .admin-cal {
  display: flex;
}

.next-absent,
.next-invoice,
.next-print,
.next-card,
.next-calc,
.next-achievements,
.next-roster,
.next-join,
.next-permit {
  display: grid;
  box-sizing: border-box;
  width: 100%;
  height: clamp(4.5rem, 22vw, 6rem);
  padding: 0 0.2rem;
  border: 1px solid #9b1c1c;
  border-radius: 8px;
  background: #fff;
  color: #9b1c1c;
  font: inherit;
  font-size: clamp(0.85rem, 3.4vw, 1rem);
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  place-items: center;
  text-align: center;
  text-decoration: none;
}

.next-calc {
  align-content: center;
  gap: 0.15rem;
}

.next-roster,
.next-join,
.next-permit {
  border-color: var(--da-primary);
  color: var(--da-primary);
}

.skin-student .admin-only {
  display: none;
}

.next-actions button:disabled {
  border-color: #cbd5e1;
  background: #e8eaed;
  color: #94a3b8;
  cursor: not-allowed;
}

.day-quiet {
  padding: 0.55rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cal-head {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  margin: 0 0 0.45rem;
}

.cal-title-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.35rem;
}

.section h2.cal-heading,
.cal-heading {
  margin: 0 0 0.4rem;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.2;
}

.cal-head .cal-heading {
  margin: 0;
  display: flex;
  align-items: center;
}

.cal-tools-toggle {
  margin: 0;
  box-sizing: border-box;
  min-width: 1.6rem;
  padding: 0 0.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.3rem;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cal-tools-toggle[aria-expanded="true"] {
  border-color: var(--da-primary);
  color: var(--da-primary);
}

.cal-tools {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  width: 100%;
}

.cal-tools[hidden] {
  display: none;
}

.cal-layers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.cal-weeks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.cal-week {
  margin: 0;
  padding: 0.18rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}

.cal-week.is-on {
  border-color: var(--da-primary);
  background: color-mix(in srgb, var(--da-primary) 14%, #fff);
  color: var(--da-primary);
}

.cal-layer {
  margin: 0;
  padding: 0.18rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}

.cal-layer[data-layer="holiday"].is-on {
  border-color: #9b1c1c;
  background: #fde8e8;
  color: #9b1c1c;
}

.cal-layer[data-layer="school"].is-on,
.cal-layer[data-layer="hokuryo"].is-on,
.cal-layer[data-layer="kamioka_jh"].is-on,
.cal-layer[data-layer="kamioka_es"].is-on {
  border-color: var(--da-primary);
  background: #d7e6df;
  color: var(--da-primary);
}

.skin-admin .cal-layers .admin-only {
  display: inline-block;
}

.cal {
  display: grid;
  grid-template-columns: minmax(0, 17fr) minmax(0, 12fr) minmax(0, 12fr) minmax(0, 17fr) minmax(0, 17fr);
  gap: 0.22rem;
}

.cal-dow {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
  padding-bottom: 0.2rem;
}

.cal-rule {
  grid-column: 1 / -1;
  height: 0;
  border-top: 1px solid #cbd5e1;
}

.cal-cell {
  min-width: 0;
  min-height: 6.2rem;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
  font: inherit;
  color: inherit;
  text-align: center;
  width: 100%;
  cursor: pointer;
}

.cal-cell.is-closed {
  cursor: default;
}

button.cal-cell.is-closed {
  cursor: pointer;
}

.skin-admin .cal-cell.is-closed {
  cursor: pointer;
}

.cal-day {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.22rem 0.18rem;
  background: #444;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.cal-date {
  line-height: 1;
}

.cal-tag.is-mine {
  background: var(--da-primary);
  border-color: var(--da-primary);
  color: #fff;
}

.cal-tag.is-absent {
  background: #9b1c1c;
  border-color: #9b1c1c;
  color: #fff;
}

.cal-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 0;
  padding: 0.22rem 0.18rem 0.32rem;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.cal-time {
  max-width: 100%;
  min-width: 0;
  font-size: 1.2rem;
  line-height: 1.15;
}

.cal-meta > .cal-tag {
  max-width: 100%;
}

.cal-place-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  max-width: 100%;
  min-width: 0;
  font-size: 1.05rem;
}

.cal-place {
  max-width: 100%;
  min-width: 0;
  line-height: 1.2;
}

.cal-place-row > .cal-tag {
  flex: 0 0 auto;
  font-size: 1em;
  padding: 0.1em 0.4em;
}

.cal-tag {
  display: inline-block;
  padding: 0.08em 0.35em;
  border: 1px solid currentColor;
  border-radius: 0.25rem;
  font-size: 0.95em;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.cal-cell.is-open .cal-day {
  background: #444;
  color: #fff;
}

.cal-cell.is-open .cal-meta {
  background: #fff;
  color: #1a1a1a;
}

.cal-cell.is-closed {
  background: #fff;
  color: #64748b;
}

.cal-cell.is-closed .cal-day {
  background: #444;
  color: #fff;
}

.cal-cell.is-closed .cal-meta {
  background: #e6e6e6;
  color: #64748b;
}

.cal-cell.is-mine .cal-date {
  color: #fff;
}

.cal-extra {
  flex-shrink: 0;
  min-height: 1.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  padding: 0.16rem 0.12rem;
  background: #f4efe2;
  color: #6b4a1f;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
}

.cal-note {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.cal-note.is-holiday {
  color: #9b1c1c;
}

.cal-note.is-school {
  color: var(--da-primary);
}

.cal-cell.is-today {
  border: 1px solid var(--da-primary);
}

.cal-cell.is-today .cal-date {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cal-cell.is-selected {
  outline: 2px solid var(--da-primary);
  outline-offset: 1px;
}

.day-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.day-modal-confirm {
  z-index: 90;
}

.day-modal-confirm .day-modal-panel {
  width: min(26rem, 100%);
}

.day-modal-confirm .day-modal-panel > h2 {
  margin: 0 0 0.45rem;
  font-size: 1.1rem;
}

.day-modal[hidden] {
  display: none;
}

.day-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
}

.day-modal-panel {
  position: relative;
  width: min(36rem, 100%);
  max-height: min(36rem, calc(100dvh - 2.5rem));
  overflow: auto;
  padding: 1.1rem 1.15rem 1.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(15, 43, 35, 0.18);
}

.day-modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.75rem;
  padding: 0.25rem 0.5rem;
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.85rem;
  cursor: pointer;
}

.ach-panel {
  background: #1b1c1e;
  border: 1px solid #8a6a32;
  color: #efe6d4;
  box-shadow: inset 0 0 0 1px #3a3428, 0 18px 40px rgba(0, 0, 0, 0.45);
}

.ach-panel > h2 {
  margin: 0 0.5rem 0.35rem 0;
  color: #f2b544;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
}

.ach-panel .day-modal-close {
  color: #d9c7a3;
}

.ach-groups {
  display: grid;
  gap: 1rem;
}

.ach-current {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.ach-medal {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.2rem;
  width: auto;
  min-width: 0;
  padding: 0.35rem 0.15rem 0.45rem;
  border: 1px solid transparent;
  background: transparent;
  color: #d9c7a3;
  cursor: pointer;
}

.ach-medal.is-open {
  border-color: #c9862a;
  background: #241c12;
}

.ach-medal-name {
  max-width: 100%;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
}

.ach-medal .ach-stamp,
.ach-medal.is-reserved .ach-mark {
  width: min(4.25rem, 100%);
  height: auto;
  aspect-ratio: 1;
}

.ach-medal.is-reserved {
  cursor: default;
  opacity: 0.45;
}

.ach-medal.is-reserved .ach-mark {
  font-size: 0.72rem;
}

.ach-medal.is-locked .ach-stamp {
  filter: grayscale(1) brightness(0.72);
}

.ach-medal.is-locked .ach-mark {
  border-color: #4a453e;
  background: #232323;
  color: #8a8278;
}

.ach-detail > h3 {
  margin: 0 0 0.4rem;
  color: #d9c7a3;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ach-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ach-list.is-compact .ach-card {
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.4rem;
  padding: 0.45rem 0.4rem;
}

.ach-list.is-compact .ach-mark {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 0.9rem;
}

.ach-card {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  background: #121416;
  border: 1px solid #3d3830;
}

.ach-card.is-unlocked {
  border-color: #c9862a;
  background: linear-gradient(90deg, #2c2418 0%, #121416 58%);
}

.ach-card.is-locked {
  opacity: 0.72;
}

.ach-mark {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border: 2px solid #6b542f;
  background: #2a2418;
  color: #f2b544;
  font-weight: 900;
  font-size: 1.05rem;
}

.ach-mark.is-label {
  font-size: 0.72rem;
}

.ach-card.is-locked .ach-mark {
  border-color: #4a453e;
  background: #232323;
  color: #8a8278;
}

.ach-stamp {
  width: 4.75rem;
  height: 4.75rem;
  object-fit: contain;
}

.ach-card.is-locked .ach-stamp {
  filter: grayscale(1) brightness(0.72);
}

.ach-title {
  margin: 0;
  font-weight: 800;
}

.ach-condition {
  margin: 0.12rem 0 0;
  color: #8a8278;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
}

.ach-state {
  margin: 0.2rem 0 0;
  color: #b7aa96;
  font-size: 0.85rem;
}

.ach-card.is-unlocked .ach-state {
  color: #f2b544;
}

.ach-bar {
  display: block;
  height: 4px;
  margin-top: 0.35rem;
  background: #2c3138;
}

.ach-bar > span {
  display: block;
  height: 100%;
  background: #e8a317;
}

.day-absent-done {
  color: #9b1c1c;
}

.confirm-date .attend-toggle {
  width: 8.6rem;
  flex: 0 0 auto;
  margin: 0;
}

.confirm-date .attend-toggle button {
  padding: 0.42rem 0.35rem;
  font-size: 0.85rem;
}

.attend-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  margin: 1rem 0 0;
  padding: 0.22rem;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  background: #f8f9fa;
  gap: 0.22rem;
}

.attend-toggle[hidden] {
  display: none;
}

.attend-toggle button {
  margin: 0;
  padding: 0.62rem 0.4rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #495057;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.attend-toggle [data-attend="present"].is-on {
  background: var(--da-primary);
  color: #fff;
}

.attend-toggle [data-attend="absent"].is-on {
  background: #9b1c1c;
  color: #fff;
}

.day-absent:disabled {
  border-color: #cbd5e1;
  background: #e8eaed;
  color: #94a3b8;
  cursor: not-allowed;
}

.day-absent {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid #9b1c1c;
  border-radius: 6px;
  background: #fff;
  color: #9b1c1c;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.day-absent-done {
  margin: 0.75rem 0 0;
  font-weight: 700;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  color: #475569;
}

.cal-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cal-legend-row {
  flex-basis: 100%;
}

.cal-mark {
  width: 1.2rem;
  height: 1.5rem;
  border-radius: 3px;
  border: 1px solid #cbd5e1;
  background: #fff;
  flex-shrink: 0;
}

.cal-mark.open {
  background: linear-gradient(#444 36%, #fff 36%);
}

.cal-mark.closed {
  background: linear-gradient(#444 36%, #e6e6e6 36%);
}

.event-list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.event-list li {
  display: grid;
  gap: 0.15rem 1rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid #f1f5f9;
}

.event-list li:first-child { border-top: none; }

@media (min-width: 640px) {
  .event-list li {
    grid-template-columns: 7.5rem 1fr;
    align-items: center;
  }

  .event-list li:has(button) {
    grid-template-columns: 7.5rem 1fr auto;
  }

  #school-list li:has(button) {
    grid-template-columns: 12.5rem 1fr auto;
  }
}

.event-when {
  font-weight: 700;
  color: #1e293b;
}

.event-title { color: #334155; }

@media (max-width: 767px) {
  .day-modal {
    padding: 0.25rem;
  }

  .day-modal-panel {
    padding: 0.85rem 0.2rem 0.9rem;
  }

  .ach-panel {
    padding: 0.85rem 0.75rem 1rem;
  }

  .is-home .da-container {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .is-home .cal {
    gap: 0.16rem;
  }

  .is-home .cal-cell {
    min-height: 5.4rem;
  }

  .is-home .cal-day {
    padding: 0.18rem 0.06rem 0.1rem;
    font-size: 0.85rem;
  }

  .is-home .cal-extra {
    min-height: 1.15rem;
    padding: 0.1rem 0.04rem;
    font-size: 0.5rem;
  }

  .is-home .cal-meta {
    padding: 0.12rem 0.04rem 0.16rem;
    font-size: 0.68rem;
    gap: 0.18rem;
  }

  .is-home .cal-time {
    font-size: 0.78rem;
  }

  .is-home .cal-place-row {
    font-size: 0.82rem;
    gap: 0.2rem;
  }

  .is-home .cal-cell .cal-tag {
    padding: 0.06em 0.22em;
    font-size: 0.95em;
  }

  .skin-admin .header-nav {
    gap: 0.45rem 0.7rem;
  }

  .skin-admin .header-link {
    font-size: 0.8rem;
  }

  .skin-admin .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .skin-admin .field-row > div {
    min-width: 0;
    width: 100%;
  }
}

.day-back-row {
  margin: 0 0 0.75rem;
}

.day-back {
  color: var(--da-primary);
  font-weight: 700;
  text-decoration: none;
}

.day-holiday,
.day-school {
  margin: 0.35rem 0 0;
  font-weight: 700;
}

.day-holiday {
  color: #9b1c1c;
}

.day-school {
  color: var(--da-primary);
}

.day-board {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.day-board h2 {
  margin: 0;
  font-size: 1.05rem;
}

.day-place {
  margin: 0.25rem 0 0;
  color: #475569;
  font-size: 0.9rem;
}

.day-closed,
.day-off {
  margin: 0.75rem 0 0;
  color: #475569;
}

.day-schedule {
  display: grid;
  grid-template-columns: max-content repeat(6, minmax(0, 1fr));
  width: 100%;
  margin: 0.85rem auto 0;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
}

.day-schedule-row {
  display: contents;
}

.day-schedule-time,
.day-schedule-seat {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  box-sizing: border-box;
  text-align: center;
}

.day-schedule-time {
  padding: 0.2rem 0.22rem;
  background: rgba(27, 77, 62, 0.15);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.03em;
}

.day-schedule-seat {
  height: 3.6rem;
  padding: 0.18rem 0.04rem;
  background: #fff;
  color: #1a1a1a;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.day-schedule-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  max-width: 100%;
  min-width: 0;
}

.day-schedule-name {
  max-width: 100%;
  white-space: nowrap;
}

.day-schedule-seat .cal-tag {
  padding: 0.12em 0.4em;
  font-size: 1.15rem;
  line-height: 1.1;
}

.day-legend {
  justify-content: center;
  margin-top: 0.7rem;
}

.day-ops {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  margin: 1rem 0 0;
}

.day-op {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: clamp(4.5rem, 22vw, 6rem);
  margin: 0;
  padding: 0 0.2rem;
  border: 1px solid var(--da-primary);
  border-radius: 8px;
  background: #fff;
  color: var(--da-primary);
  font: inherit;
  font-size: clamp(0.85rem, 3.4vw, 1rem);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}

.day-op-panel[hidden] {
  display: none;
}

.day-op-modal .day-opening,
.day-op-modal .day-closure,
.day-op-modal .day-school-events {
  margin: 0;
  padding: 0;
  border-top: none;
}

.day-op-modal .day-closure-heading,
.day-op-modal .day-school-events > h3 {
  padding-right: 3.5rem;
}

.day-op-modal .day-opening select,
.day-op-modal .day-closure select,
.day-op-modal .day-school-item input[type="text"],
.day-op-modal .day-school-item input[type="date"],
.day-op-modal .day-school-add select,
.day-op-modal .day-school-add input[type="text"],
.day-op-modal .day-school-add input[type="date"] {
  max-width: none;
}

.day-closure {
  display: grid;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid #ccc;
}

.day-closure-heading {
  margin: 0;
  font-size: 1rem;
}

.day-closure-note {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
}

.day-closure-label {
  font-weight: 700;
}

.day-closure select {
  width: 100%;
  max-width: 20rem;
  padding: 0.4rem 0.5rem;
}

.day-closure .notice {
  margin: 0;
}

.day-closure .da-button-primary {
  justify-self: start;
}

.day-closure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.day-school-events {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid #ccc;
}

.day-school-events > h3 {
  margin: 0;
  font-size: 1rem;
}

.day-school-events .notice {
  margin: 0;
}

.day-school-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.day-school-item {
  display: grid;
  gap: 0.4rem;
  padding: 0.65rem 0 0;
  border-top: 1px solid #e2e8f0;
}

.day-school-item:first-child {
  border-top: none;
  padding-top: 0;
}

.day-school-meta {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
}

.day-school-item input[type="text"],
.day-school-item input[type="date"],
.day-school-add select,
.day-school-add input[type="text"],
.day-school-add input[type="date"] {
  width: 100%;
  max-width: 20rem;
  padding: 0.4rem 0.5rem;
}

.day-school-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.day-school-add {
  display: grid;
  gap: 0.5rem;
}

.day-school-add .da-button-primary {
  justify-self: start;
}

.day-opening {
  display: grid;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid #ccc;
}

.day-opening select {
  width: 100%;
  max-width: 20rem;
  padding: 0.4rem 0.5rem;
}

.day-opening .da-button-primary {
  justify-self: start;
}

@media (max-width: 767px) {
  .day-schedule-time {
    padding: 0.15rem 0.1rem;
    font-size: 0.68rem;
  }
}

.qr-toolbar {
  margin: 0.85rem 0 0;
}

.qr-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.qr-card {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  break-inside: avoid;
}

.qr-card img {
  width: 8rem;
  height: 8rem;
}

.qr-card p {
  margin: 0;
  font-weight: 700;
  text-align: center;
}

@media print {
  body:has(.qr-sheet) .site-header,
  body:has(.qr-sheet) .site-footer,
  body:has(.qr-sheet) .section-kicker,
  body:has(.qr-sheet) .qr-toolbar,
  body:has(.qr-sheet) .lede {
    display: none;
  }
}

.login-box {
  width: min(22rem, 100%);
  margin: 0 auto;
  text-align: center;
}

.section h1.login-title {
  margin: 0 0 1.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
  border: none;
  padding: 0;
  text-align: center;
}

.login-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 1.25rem;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #fff;
  color: #1a1a1a;
  font-weight: 700;
  letter-spacing: 0;
}

.login-google:hover {
  background: #f8fafc;
}

.login-google-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.login-line {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: #06c755;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.login-line:hover {
  background: #05b34c;
}

a.login-alt {
  display: block;
  text-decoration: none;
}

.login-fact {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  text-align: left;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.login-copy,
.login-reload {
  width: 100%;
  box-sizing: border-box;
}

.login-copy {
  margin-top: 1rem;
  font: inherit;
}

.login-reload {
  margin-top: 1.5rem;
  text-decoration: none;
}

.login-alt {
  margin: 1.35rem 0 0;
  padding: 0.35rem 0.5rem;
  border: none;
  background: none;
  color: #64748b;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.login-alt[hidden] {
  display: none;
}

.login-password {
  margin-top: 1.35rem;
  text-align: left;
  display: grid;
  gap: 0.85rem;
}

.login-password[hidden] {
  display: none;
}

.login-password label {
  display: block;
  margin: 0 0 0.3rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
}

.login-password input {
  min-height: 48px;
  border-radius: 0.75rem;
}

.login-password .da-button-primary {
  width: 100%;
  max-width: none;
  justify-self: stretch;
  margin-top: 0.25rem;
  border-radius: 999px;
  box-shadow: none;
  letter-spacing: 0;
}

.login-password .da-button-primary:active {
  transform: none;
  box-shadow: none;
}

.login-local {
  margin-top: 2.5rem;
}

.login-quiet {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: #94a3b8;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.login-quiet:hover {
  color: #64748b;
}

.login-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.login-list[hidden] {
  display: none;
}

.login-list .login-quiet {
  font-size: 0.85rem;
}

.data-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 43, 35, 0.06);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  white-space: nowrap;
}

.data-table th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #64748b;
  background: var(--da-bg-subtle);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.roster-home {
  cursor: pointer;
  color: var(--da-primary);
}

.roster-sync {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.roster-graph {
  display: block;
  width: 100%;
  max-width: 32.5rem;
  height: auto;
  margin-top: 1rem;
}

.roster-graph .edge {
  fill: none;
  stroke: #cbd5e1;
  stroke-width: 2;
}

.roster-graph marker path {
  fill: #cbd5e1;
}

.roster-graph .node .outer {
  fill: #e2e8f0;
}

.roster-graph .node .label {
  fill: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.roster-graph .node.is-box .outer {
  fill: #fff;
  stroke: #cbd5e1;
  stroke-width: 3;
}

.roster-graph .node .label.is-inner {
  font-size: 11px;
}

.roster-graph .node.is-current .outer {
  fill: var(--da-primary);
  stroke: rgba(27, 77, 62, 0.18);
  stroke-width: 8;
  paint-order: stroke;
}

.roster-graph .node.is-current.is-box .outer {
  fill: #fff;
  stroke: var(--da-primary);
  stroke-width: 8;
  paint-order: stroke;
}

.roster-graph .node.is-current .label {
  fill: #0f172a;
}

.roster-graph .node.is-done .outer {
  fill: #b7cfc5;
}

.roster-graph .node.is-done.is-box .outer {
  fill: #fff;
  stroke: #b7cfc5;
  stroke-width: 3;
}

.roster-graph .node.is-missing.is-box .outer {
  fill: #fff;
  stroke: #9b1c1c;
  stroke-width: 3;
}

.roster-status {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.roster-graph .node.is-done .label {
  fill: var(--da-primary);
}

.roster-graph .node.is-missing .outer {
  fill: #9b1c1c;
}

.roster-graph .node.is-missing .label {
  fill: #9b1c1c;
}

.roster-incomplete {
  color: #9b1c1c;
  font-weight: 700;
}

.review {
  margin: 0.25rem 0 0;
}

.review dt {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--da-primary);
}

.review dd {
  margin: 0.2rem 0 0;
  font-weight: 700;
}

.billing-steps {
  display: flex;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.billing-steps li {
  position: relative;
  flex: 1;
  padding-top: 1.9rem;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  counter-increment: step;
}

.billing-steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.75rem;
  transform: translateX(-50%);
}

.billing-steps li + li::after {
  content: "";
  position: absolute;
  top: 0.7rem;
  right: 50%;
  width: 100%;
  height: 3px;
  background: #e2e8f0;
}

.billing-steps li.is-done,
.billing-steps li.is-current {
  color: var(--da-primary);
}

.billing-steps li.is-done::before {
  content: "✓";
  background: #dce8e3;
  color: var(--da-primary);
}

.billing-steps li.is-done::after {
  background: #b7cfc5;
}

.billing-steps li.is-current {
  color: #0f172a;
}

.billing-steps li.is-current::before {
  background: var(--da-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(27, 77, 62, 0.18);
}

.billing-steps li.is-current::after {
  background: var(--da-primary);
}

.billing-steps li.is-current.is-final::before {
  content: "✓";
}
