:root {
  --oz-primary: #1f5fa8;
  --oz-primary-dark: #174a84;
  --oz-text: #222;
  --oz-muted: #6b7280;
  --oz-border: #dde3ea;
  --oz-bg: #f4f6f9;
  --oz-card: #fff;
  --oz-ok: #1a7f4b;
  --oz-warn: #a86400;
  --oz-ng: #b42318;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--oz-bg); color: var(--oz-text);
  font-family: "UD Digi Kyokasho N", "UD デジタル 教科書体 N", "UD Digi Kyokasho N-R", "UD デジタル 教科書体 N-R", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 15px; line-height: 1.7;
}
a { color: var(--oz-primary); }
.oz-wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.oz-header { background: #fff; border-bottom: 1px solid var(--oz-border); position: sticky; top: 0; z-index: 10; }
.oz-header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 64px; }
.oz-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--oz-text); font-weight: bold; }
.oz-brand img { height: 36px; }
.oz-nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.oz-nav a { text-decoration: none; }
.oz-nav-user { color: var(--oz-muted); }
.oz-main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.oz-footer { border-top: 1px solid var(--oz-border); background: #fff; padding: 16px 0; font-size: 13px; color: var(--oz-muted); }
.oz-footer .oz-wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.oz-card { background: var(--oz-card); border: 1px solid var(--oz-border); border-radius: 8px; padding: 24px; margin-bottom: 20px; }
.oz-narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
hr { border: 0; border-top: 1px solid var(--oz-border); margin: 20px 0; }
.oz-muted { color: var(--oz-muted); }
.oz-small { font-size: 13px; }
.oz-mono, code, .oz-code { font-family: Consolas, "Courier New", monospace; }
.oz-code { background: #f1f3f6; border: 1px solid var(--oz-border); border-radius: 6px; padding: 12px; white-space: pre-wrap; word-break: break-all; }
.oz-log { max-height: 360px; overflow: auto; font-size: 12px; }

.oz-form label { display: block; margin-bottom: 14px; font-weight: bold; font-size: 14px; }
.oz-form input[type=text], .oz-form input[type=email], .oz-form input[type=password],
.oz-form input[type=date], .oz-form input[type=number] {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font-size: 15px;
  border: 1px solid #c5cdd8; border-radius: 6px; font-weight: normal; background: #fff;
}
.oz-form input:focus { outline: 2px solid var(--oz-primary); outline-offset: 0; border-color: var(--oz-primary); }
.oz-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.oz-inline input[type=text] { flex: 1; min-width: 240px; margin: 0; padding: 10px 12px; border: 1px solid #c5cdd8; border-radius: 6px; font-size: 15px; }
.oz-inline input[type=date] { padding: 4px 6px; }
.oz-narrow-form { max-width: 420px; }
.oz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; align-items: end; }
.oz-grid > div { margin-bottom: 14px; }

.btn {
  display: inline-block; padding: 8px 16px; border: 1px solid #c5cdd8; border-radius: 6px; background: #fff;
  color: var(--oz-text); text-decoration: none; font-size: 14px; cursor: pointer; line-height: 1.5; white-space: nowrap;
}
.btn:hover { background: #f1f3f6; }
.btn-primary { background: var(--oz-primary); border-color: var(--oz-primary); color: #fff; }
.btn-primary:hover { background: var(--oz-primary-dark); }
.btn-block { display: block; width: 100%; padding: 12px; font-size: 16px; }
.btn-small { padding: 2px 10px; font-size: 12px; }
.btn-danger { color: var(--oz-ng); border-color: #f5c2bd; }
.btn-danger:hover { background: #fdecea; }
.btn:disabled, .btn:disabled:hover { color: #b0b7c0; border-color: #e1e5ea; background: #f5f6f8; cursor: not-allowed; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; border: 1px solid; }
.alert-error { background: #fdecea; border-color: #f5c2bd; color: var(--oz-ng); }
.alert-success { background: #e7f6ee; border-color: #b6e2c8; color: var(--oz-ok); }
.alert-warn { background: #fff4e0; border-color: #f3d39b; color: var(--oz-warn); }

.oz-status { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; border: 1px solid; background: #fff; }
.oz-status.ok { border-color: #b6e2c8; }
.oz-status.warn { border-color: #f3d39b; background: #fff8eb; }
.oz-status.ng { border-color: #f5c2bd; background: #fdecea; color: var(--oz-ng); }
@media (min-width: 700px) {
  .oz-status { position: sticky; top: 77px; z-index: 9; box-shadow: 0 0 0 12px var(--oz-bg); }
}

.oz-files { list-style: none; margin: 0; padding: 0; }
.oz-files li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--oz-border); flex-wrap: wrap; }
.oz-files li:first-child { border-top: 0; }
.oz-file-info { display: flex; gap: 12px; align-items: flex-start; min-width: 0; flex: 1; }
.oz-file-title { font-weight: bold; word-break: break-all; }
.oz-ext { flex: none; display: inline-block; min-width: 48px; text-align: center; font-size: 11px; font-weight: bold; padding: 2px 6px; border-radius: 4px; background: #e8eef7; color: var(--oz-primary); margin-top: 3px; }
.oz-file-actions { display: flex; gap: 8px; }
.oz-player { width: 100%; max-height: 70vh; background: #000; border-radius: 6px; }

.oz-video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-bottom: 8px; }
.oz-video-card { display: flex; flex-direction: column; gap: 8px; }
.oz-preview { position: relative; display: block; aspect-ratio: 16 / 9; background: #111; border-radius: 6px; overflow: hidden; }
.oz-preview video { width: 100%; height: 100%; object-fit: contain; display: block; }
.oz-preview-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; padding-left: 3px;
  transition: opacity .2s;
}
.oz-preview.is-playing .oz-preview-play { opacity: 0; }
.oz-preview:hover .oz-preview-play { opacity: 1; }
.oz-preview-time:not(:empty) {
  position: absolute; right: 6px; bottom: 6px; padding: 0 6px; border-radius: 3px;
  background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; line-height: 1.6;
}
.oz-video-meta { min-width: 0; }
.oz-video-card .oz-file-actions .btn { flex: 1; text-align: center; }
.oz-video-grid + .oz-files { margin-top: 16px; border-top: 1px solid var(--oz-border); }

.oz-table { width: 100%; border-collapse: collapse; }
.oz-table th, .oz-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--oz-border); vertical-align: top; }
.oz-table th { background: #f7f9fb; white-space: nowrap; }
.oz-scroll { overflow-x: auto; }
.oz-dim td { color: #9aa3ae; }
.ok { color: var(--oz-ok); font-weight: bold; }
.ng { color: var(--oz-ng); font-weight: bold; }

@media (max-width: 600px) {
  .oz-card { padding: 16px; }
  .oz-file-actions { width: 100%; }
  .oz-file-actions .btn { flex: 1; text-align: center; }
}

button, input, select, textarea { font-family: inherit; }
*, *::before, *::after { font-weight: 400 !important; }
