* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f2f2f7;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ── Navigation ── */

.tabs {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid #d1d1d6;
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top);
}

.tab {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  font-size: 16px;
  cursor: pointer;
  color: #8e8e93;
  border-bottom: 3px solid transparent;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.tab.active {
  color: #000;
  border-bottom-color: #000;
  font-weight: 600;
}

/* ── Pages ── */

.page {
  display: none;
  flex: 1;
  overflow-y: auto;
}

.page.active {
  display: flex;
}

/* ── Button page ── */

#page-main {
  align-items: center;
  justify-content: center;
}

.buttons {
  display: flex;
  gap: 28px;
  padding: 32px;
}

.btn {
  width: 140px;
  height: 140px;
  border-radius: 24px;
  border: none;
  font-size: 18px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active,
.btn.pressed {
  transform: scale(0.91);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-red  { background: #e53935; }
.btn-green { background: #43a047; }

/* ── Log page ── */

#page-log {
  flex-direction: column;
  padding: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

th, td {
  padding: 13px 16px;
  text-align: left;
}

th {
  background: #f2f2f7;
  font-size: 13px;
  font-weight: 600;
  color: #6e6e73;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

td {
  border-top: 1px solid #e5e5ea;
  font-size: 15px;
}

.red-cell   { color: #e53935; font-weight: 700; }
.green-cell { color: #43a047; font-weight: 700; }

.empty {
  text-align: center;
  color: #aeaeb2;
  margin-top: 60px;
  font-size: 16px;
}

.hidden { display: none; }

/* ── Export page ── */

#page-export {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px;
}

.export-count {
  font-size: 16px;
  color: #6e6e73;
}

.export-btn {
  padding: 16px 40px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}

.export-btn:active {
  opacity: 0.7;
}
