:root {
  --bg: #f4f8fc;
  --card: #ffffff;
  --text: #1a3a5c;
  --muted: rgba(26, 58, 92, 0.62);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.14);
  --border: rgba(37, 99, 235, 0.22);
  --field-bg: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}

.screen[hidden] {
  display: none !important;
}

.brand h1 {
  margin: 0 0 0.25rem;
}

.brand-center {
  text-align: center;
  margin: 0.5rem 0 1rem;
}

.brand-home {
  margin-bottom: 0.35rem;
}

.brand-home h1 {
  font-size: 1.35rem;
  margin: 0 0 0.2rem;
}

.topbar-home {
  margin-bottom: 0.25rem;
}

.brand-mascot {
  width: min(200px, 52vw);
  height: auto;
  margin: 0 auto 0.75rem;
  display: block;
  border-radius: 16px;
  object-fit: contain;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.foot {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 1rem;
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(26, 58, 92, 0.06);
}

label {
  display: block;
  margin: 0.5rem 0;
  font-size: 0.92rem;
}

.time-wheel-wrap,
.date-wheel-wrap {
  margin-top: 0.35rem;
}

.shutter-date-wheel-label {
  display: block;
  margin-bottom: 0.25rem;
}

.time-wheel-frame--day {
  justify-content: center;
}

.time-wheel-day {
  width: 6.5rem;
}

.time-wheel-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  position: relative;
  background: #eef4fb;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 0.75rem;
}

.time-wheel-frame::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  border-top: 1px solid rgba(37, 99, 235, 0.45);
  border-bottom: 1px solid rgba(37, 99, 235, 0.45);
  pointer-events: none;
  z-index: 1;
}

.time-wheel-col {
  height: 120px;
  width: 4.25rem;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  z-index: 0;
}

.time-wheel-col::-webkit-scrollbar {
  display: none;
}

.time-wheel-item {
  height: 40px;
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  color: rgba(26, 58, 92, 0.38);
}

.time-wheel-col:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.time-wheel-pad {
  height: 40px;
  flex-shrink: 0;
}

.time-colon {
  font-size: 1.35rem;
  opacity: 0.85;
  z-index: 2;
}

.time-wheel-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

input:not([type="checkbox"]),
textarea {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--field-bg);
  color: var(--text);
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 4rem;
}

.shutter-date-line {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.shutter-touch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.shutter-touch-label {
  font-size: 0.92rem;
  flex: 1;
}

.shutter-touch-btn {
  min-width: 4.5rem;
  min-height: 3rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: #f8fbff;
  color: var(--text);
  font-size: 1.35rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.shutter-touch-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.shutter-mark {
  display: block;
  line-height: 1.2;
}

.shutter-autosave-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  width: 100%;
  margin-top: 0.5rem;
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.topbar-daily {
  gap: 0.5rem;
}

.btn-back {
  width: auto;
  flex-shrink: 0;
  padding: 0.5rem 0.65rem;
  font-size: 0.92rem;
}

.user-label-compact {
  font-size: 0.85rem;
  text-align: right;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.app-menu-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
  width: min(100%, 15.5rem);
  min-height: 7.5rem;
  padding: 1.25rem 1.25rem 1.25rem 1rem;
  text-align: right;
  border: 2px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(26, 58, 92, 0.08);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  color: var(--text);
}

.app-menu-tile:active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.app-menu-tile-label {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.app-menu-tile-desc {
  font-size: 0.88rem;
  color: var(--muted);
}

.error {
  color: #c62828;
}

.shutter-day-form-first {
  margin-top: 0.25rem;
}

.shutter-day-list-label {
  margin: 1rem 0 0.35rem;
  font-size: 0.88rem;
}

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

.shutter-day-item {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
}

.shutter-day-item.active {
  outline: 2px solid var(--accent);
}

.shutter-alc {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}

.shutter-admin-list {
  list-style: none;
  padding: 0;
}

.shutter-admin-row {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.shutter-admin-detail {
  max-height: 40vh;
  overflow: auto;
  font-size: 0.75rem;
  background: #eef4fb;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}
