* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background: #f2f5f9;
  color: #1c2733;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 40px; }
.wrap.wide { max-width: 1100px; }

/* section */
.clock { text-align: center; margin: 8px 0 20px; }
.clock .date { font-size: 24px; color: #52606d; }
.clock .time { font-size: 72px; font-weight: 700; letter-spacing: 2px; line-height: 1.1; }
.card { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.08); margin-bottom: 18px; }
.card h2 { margin: 0 0 12px; font-size: 20px; }
.names { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.names input { position: absolute; opacity: 0; pointer-events: none; }
.names span {
  display: block; text-align: center; padding: 26px 0; font-size: 34px; font-weight: 700;
  border: 4px solid #cbd2d9; border-radius: 16px; background: #fff; cursor: pointer;
}
.names input:checked + span { border-color: #1f6feb; background: #e7f0ff; color: #0b4cc0; }
.actions { display: flex; gap: 14px; }
.actions button {
  flex: 1; padding: 34px 0; font-size: 36px; font-weight: 700; color: #fff; border: 0; border-radius: 16px; cursor: pointer;
}
.btn-in { background: #1a9e5a; }
.btn-out { background: #d9534f; }
.msg { padding: 16px; border-radius: 12px; font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 18px; }
.msg.ok { background: #d8f3e3; color: #0d6b3b; }
.msg.err { background: #fde2e1; color: #a12622; }
.status { display: flex; flex-wrap: wrap; gap: 14px; }
.status div { flex: 1 1 180px; text-align: center; font-size: 20px; padding: 12px; border-radius: 12px; background: #f2f5f9; }
.status b { display: block; font-size: 24px; }
.working { color: #1a9e5a; font-weight: 700; }

/* section */
header.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
header.top h1 { font-size: 22px; margin: 0; }
a.link, .link-btn { color: #1f6feb; text-decoration: none; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a {
  padding: 10px 16px; border-radius: 10px; background: #e4e9f0; color: #1c2733;
  text-decoration: none; font-weight: 700; font-size: 15px;
}
.tabs a.on { background: #1f6feb; color: #fff; }
.menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 22px; }
.menu a {
  display: block; background: #fff; border-radius: 14px; padding: 20px; text-decoration: none; color: #1c2733;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.menu a b { display: block; font-size: 20px; margin-bottom: 6px; color: #0b4cc0; }
.menu a span { font-size: 14px; color: #52606d; }
.month { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.month a, .month select, .month button, .month input { font-size: 16px; padding: 8px 14px; border-radius: 8px; border: 1px solid #cbd2d9; background: #fff; color: #1c2733; text-decoration: none; }
.month strong { font-size: 20px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; margin-bottom: 8px; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e4e7eb; text-align: left; font-size: 15px; }
th { background: #e9eef5; font-size: 14px; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.open td { background: #fff8e1; }
tr.total td { font-weight: 700; background: #f5f9ff; }
.sum td { font-size: 17px; }
.sum tr:last-child td { font-weight: 700; background: #f5f9ff; }
input[type=datetime-local], input[type=date], select, input[type=password] { font-size: 15px; padding: 6px; border: 1px solid #cbd2d9; border-radius: 6px; }
input[type=password] { font-size: 18px; padding: 12px; width: 100%; }
.small-btn { font-size: 14px; padding: 9px 14px; border: 0; border-radius: 8px; color: #fff; background: #1f6feb; cursor: pointer; }
.small-btn.del { background: #d9534f; }
.login { max-width: 380px; margin: 60px auto; }
.login button { width: 100%; margin-top: 14px; padding: 14px; font-size: 18px; border: 0; border-radius: 10px; background: #1f6feb; color: #fff; }
.warn { background: #fff3cd; color: #7a5b00; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.note { color: #52606d; font-size: 13px; margin-top: 8px; }

/* section */
table.cal { table-layout: fixed; }
table.cal th { text-align: center; }
table.cal th.sun { color: #c0392b; }
table.cal th.sat { color: #1f6feb; }
table.cal td { height: 92px; padding: 0; vertical-align: top; border: 1px solid #e4e7eb; }
table.cal td.blank { background: #f7f9fb; }
table.cal td a { display: block; height: 100%; padding: 4px; color: inherit; text-decoration: none; }
table.cal td.today { background: #fffbe6; }
table.cal td.sel { outline: 3px solid #1f6feb; outline-offset: -3px; }
.dnum { display: block; font-size: 13px; color: #52606d; margin-bottom: 2px; }
.tag { display: block; font-size: 12px; padding: 2px 4px; margin-top: 2px; border-radius: 4px; white-space: nowrap; overflow: hidden; }
.tag.n0 { background: #dbe9ff; color: #0b4cc0; }
.tag.n1 { background: #ffe8cc; color: #9a4b00; }
.tag.open { background: #fff1b8; color: #7a5b00; }

/* section */
.paycard h2 { font-size: 20px; }
.paycard .sum td:first-child { white-space: nowrap; }
details.detail summary { cursor: pointer; font-weight: 700; margin: 10px 0; }
.card.grand { background: #e7f0ff; }
.card.grand h2 { margin: 0; font-size: 24px; }

@media (max-width: 700px) {
  .clock .time { font-size: 54px; }
  .names span { font-size: 28px; padding: 20px 0; }
  .actions button { font-size: 28px; padding: 26px 0; }
  table.cal td { height: 70px; }
  .tag { font-size: 10px; }
  th, td { padding: 6px; font-size: 13px; }
  .sum td { font-size: 14px; }
  .card { padding: 14px; }
}

@media print {
  body { background: #fff; }
  .noprint { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  .wrap.wide { max-width: none; padding: 0; }
}

/* section */
table.form th { width: 30%; background: #f5f7fa; vertical-align: top; white-space: nowrap; }
table.form td input[type=text], table.form td input[type=email], table.form td input[type=number], table.form td textarea, table.form td input[type=date] {
  font-size: 16px; padding: 8px; border: 1px solid #cbd2d9; border-radius: 6px; width: 100%; max-width: 420px; font-family: inherit;
}
table.form td input[type=number], table.form td input.short { width: auto; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.badge.draft { background: #fff1b8; color: #7a5b00; }
.badge.confirmed { background: #dbe9ff; color: #0b4cc0; }
.badge.sent { background: #d8f3e3; color: #0d6b3b; }
.badge.none { background: #e4e9f0; color: #52606d; }
.slip { border: 1px solid #cbd2d9; border-radius: 8px; padding: 14px; background: #fff; }
.slip pre { white-space: pre-wrap; font-family: "Meiryo", monospace; font-size: 14px; margin: 0; }
textarea.copybox { width: 100%; height: 360px; font-size: 14px; font-family: monospace; padding: 10px; border: 1px solid #cbd2d9; border-radius: 8px; }
@media (max-width: 700px) { table.form th { white-space: normal; width: 34%; } }
.sum td:first-child { min-width: 4.5em; }
