:root { --brand:#8a1f32; --blue:#1f6fb2; --green:#15845b; --orange:#c76d1b; --cyan:#1285a8; --red:#9f2432; --bg:#f5f6f8; --text:#24262b; }
* { box-sizing: border-box; }
body { margin:0; font-family: "Yu Gothic", "Meiryo", system-ui, sans-serif; background:var(--bg); color:var(--text); }
.topbar { background:var(--brand); color:white; padding:10px 20px; display:flex; justify-content:space-between; align-items:center; gap:16px; }
.brand, .topbar a { color:white; text-decoration:none; font-weight:700; }
.topbar nav { display:flex; gap:14px; align-items:center; flex-wrap:wrap; }
.inline { display:inline; }
.inline button { background:transparent; color:white; border:1px solid #fff8; padding:6px 10px; }
.container { max-width:1160px; margin:0 auto; padding:20px 24px; }
.tablet { background:white; border:1px solid #e0e3e8; border-radius:8px; padding:16px 20px; }
.clock-panel { display:flex; justify-content:space-between; gap:20px; align-items:center; border-bottom:3px solid var(--brand); padding-bottom:10px; }
h1 { margin:0 0 8px; font-size:clamp(28px, 4vw, 44px); }
h2 { margin-top:28px; }
.tablet h1 { font-size:clamp(24px, 3.2vw, 34px); }
.clock { font-size:clamp(38px, 7vw, 64px); font-weight:800; color:var(--brand); font-variant-numeric:tabular-nums; }
.field-label { display:block; margin-top:12px; font-weight:700; font-size:18px; }
.employee-select, input, select { width:100%; min-height:48px; padding:10px 12px; border:1px solid #bfc6d1; border-radius:6px; font-size:18px; background:white; }
textarea { width:100%; padding:10px 12px; border:1px solid #bfc6d1; border-radius:6px; font-size:16px; font-family:Consolas, "Yu Gothic", "Meiryo", monospace; }
.help { color:#59616d; line-height:1.7; margin:8px 0 14px; }
.subtle { color:#69717d; font-size:16px; font-weight:400; }
.selected-employee { margin:10px 0; padding:10px 14px; border:2px solid #e4c5cc; border-left:8px solid var(--brand); border-radius:8px; background:#fff8fa; }
.selected-employee strong { display:block; margin-top:2px; color:var(--brand); font-size:clamp(32px, 5.8vw, 54px); line-height:1.05; }
.privacy-note { font-size:24px !important; }
.terminal-note { margin:10px 0 0; padding:8px 12px; background:#f7f7f8; border:1px solid #e1e4e8; border-radius:8px; color:#59616d; font-size:14px; line-height:1.45; }
.status-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:10px 0; }
.status-row > div { border:1px solid #d9dde5; border-radius:8px; padding:10px 12px; background:#fafafa; }
.status-row strong { display:block; font-size:26px; color:var(--brand); line-height:1.15; }
.muted { color:#69717d; }
.department-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(120px, 1fr)); gap:8px; margin-top:6px; }
.department-button { min-height:46px; padding:8px 10px; border:1px solid #cfd5de; background:#fff; color:var(--text); }
.department-button.active { background:var(--brand); color:white; border-color:var(--brand); }
.employee-button-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(96px, 1fr)); gap:6px; margin-top:6px; }
.employee-button { min-height:38px; padding:5px 8px; border:2px solid #d9dde5; background:white; color:var(--text); font-size:16px; line-height:1.1; white-space:normal; word-break:keep-all; overflow-wrap:anywhere; }
.employee-button.active { background:#fff8fa; color:var(--brand); border-color:var(--brand); }
.empty-selection { margin:0; padding:12px; color:#69717d; background:#f7f7f8; border:1px solid #e1e4e8; border-radius:8px; }
.button-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:10px; }
.punch, button, .button { border:0; border-radius:8px; padding:14px 18px; min-height:54px; font-size:18px; font-weight:700; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; }
.small-button { min-height:34px; padding:6px 10px; font-size:14px; margin-left:8px; }
.punch { color:white; min-height:86px; font-size:24px; line-height:1.2; }
.in { background:var(--green); } .out-temp { background:var(--orange); } .in-temp { background:var(--cyan); } .out { background:var(--red); }
button, .button, .primary { background:var(--brand); color:white; }
button:disabled { opacity:.35; cursor:not-allowed; }
.message { margin-top:10px; font-size:20px; font-weight:700; min-height:28px; }
.success, .notice.success { color:#12633f; } .error, .notice.error { color:#9f2432; }
.history ul { list-style:none; padding:0; margin:0; }
.history li { padding:12px 0; border-bottom:1px solid #e7e9ee; font-size:22px; }
.history li span { display:inline-block; min-width:90px; font-weight:700; font-variant-numeric:tabular-nums; }
dialog { border:0; border-radius:8px; padding:0; width:min(92vw, 520px); box-shadow:0 18px 60px #0004; }
.dialog { padding:24px; }
.dialog-actions { display:flex; gap:12px; justify-content:flex-end; }
.auth, .edit-form, .event-row, .filters { background:white; border:1px solid #e0e3e8; border-radius:8px; padding:18px; margin-bottom:18px; display:grid; gap:12px; }
.filters { grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); align-items:end; }
.table-wrap { overflow-x:auto; background:white; border:1px solid #e0e3e8; border-radius:8px; }
table { width:100%; border-collapse:collapse; min-width:900px; }
th, td { padding:10px 12px; border-bottom:1px solid #e6e9ef; text-align:left; white-space:nowrap; }
th { background:#f0f2f5; }
.danger { background:#7d1624; color:white; }
.event-row { grid-template-columns:120px repeat(6, 1fr); align-items:center; }
.department-table { margin-bottom:22px; }
@media (max-width: 820px) {
  .topbar { padding:8px 12px; }
  .topbar nav { gap:8px; }
  .container { padding:10px; }
  .tablet { padding:12px; }
  .clock-panel, .status-row { grid-template-columns:1fr; display:grid; }
  .clock-panel { gap:4px; }
  .field-label { margin-top:10px; }
  .department-grid { grid-template-columns:repeat(3, 1fr); gap:6px; }
  .department-button { min-height:42px; font-size:16px; }
  .employee-button-grid { grid-template-columns:repeat(3, 1fr); gap:5px; }
  .employee-button { min-height:36px; font-size:15px; padding:5px 6px; }
  .selected-employee strong { font-size:clamp(30px, 8vw, 46px); }
  .status-row { gap:8px; }
  .status-row > div { padding:8px 10px; }
  .status-row strong, .privacy-note { font-size:22px !important; }
  .button-grid { grid-template-columns:1fr 1fr; }
  .punch { min-height:76px; font-size:22px; }
  .terminal-note { display:none; }
  .filters, .event-row { grid-template-columns:1fr; }
}
