.hasami-app {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-height: 100%;
  color: var(--hasami-text, #181511);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hasami-app *,
.hasami-app *::before,
.hasami-app *::after {
  box-sizing: border-box;
}

.hasami-checkin {
  min-height: 720px;
  padding: 32px;
  background: var(--hasami-bg, #f7f4ed);
}

.hasami-screen {
  display: none;
  min-height: 640px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  text-align: center;
}

.hasami-screen.is-active {
  display: flex;
}

.hasami-brand {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
}

.hasami-app h1 {
  margin: 0;
  font-size: 46px;
  line-height: 1.2;
}

.hasami-app h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.25;
}

.hasami-lead {
  margin: 0;
  font-size: 25px;
}

.hasami-note,
.hasami-muted {
  color: var(--hasami-muted, #625c52);
}

.hasami-connection {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  border: 1px solid var(--hasami-line, #d8d0c1);
  border-radius: 999px;
  padding: 5px 10px;
  background: color-mix(in srgb, var(--hasami-panel, #fff) 88%, transparent);
  color: var(--hasami-muted, #625c52);
  font-size: 12px;
  font-weight: 700;
}

.hasami-connection.is-offline {
  background: #fff7df;
  color: #7b5b12;
}

.hasami-message,
.hasami-sync-note {
  margin: 8px 0 0;
  color: var(--hasami-muted, #625c52);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
}

.hasami-message.is-error {
  color: #9d2f26;
  font-weight: 700;
}

.hasami-progress {
  color: var(--hasami-accent, #9f7a2e);
  font-weight: 700;
}

.hasami-button,
.hasami-choice-button {
  min-height: 64px;
  border: 0;
  border-radius: 8px;
  padding: 18px 28px;
  background: var(--hasami-button, #17140f);
  color: var(--hasami-button-text, #fff);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.hasami-button-large {
  min-width: 360px;
  min-height: 86px;
  font-size: 27px;
}

.hasami-secondary {
  background: var(--hasami-secondary, #d9d2c3);
  color: var(--hasami-text, #181511);
}

.hasami-danger {
  background: #9d2f26;
  color: #fff;
}

.hasami-menu-grid {
  display: grid;
  width: min(1040px, 100%);
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 14px;
}

.hasami-choice {
  display: flex;
  min-height: 118px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--hasami-line, #d8d0c1);
  border-radius: 8px;
  background: var(--hasami-panel, #fff);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.hasami-choice input {
  position: absolute;
  opacity: 0;
}

.hasami-choice:has(input:checked),
.hasami-choice-button.is-selected {
  border-color: var(--hasami-accent, #9f7a2e);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--hasami-accent, #9f7a2e) 24%, transparent);
}

.hasami-actions,
.hasami-wait-grid,
.hasami-admin-tools,
.hasami-admin-status,
.hasami-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.hasami-wait-grid {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.hasami-wait-box,
.hasami-outside-panel,
.hasami-card,
.hasami-empty,
.hasami-alert {
  width: min(760px, 100%);
  border-radius: 8px;
  padding: 20px;
  background: var(--hasami-panel, #fff);
}

.hasami-alert {
  background: #fff2ef;
  color: #8b2d22;
}

.hasami-outside-panel label,
.hasami-memo,
.hasami-login label {
  display: grid;
  gap: 8px;
  width: min(760px, 100%);
  text-align: left;
  font-weight: 700;
}

.hasami-app input,
.hasami-app textarea,
.hasami-app select {
  width: 100%;
  border: 1px solid var(--hasami-line, #d8d0c1);
  border-radius: 8px;
  padding: 14px;
  font-size: 18px;
}

.hasami-ticket {
  min-width: 220px;
  border: 6px solid var(--hasami-accent, #9f7a2e);
  border-radius: 8px;
  padding: 18px 30px;
  background: var(--hasami-panel, #fff);
  font-size: 74px;
  font-weight: 900;
  line-height: 1;
}

.hasami-admin {
  padding: 20px;
  background: var(--hasami-bg, #f7f4ed);
}

.hasami-admin-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hasami-mini-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--hasami-secondary, #d9d2c3);
  color: var(--hasami-text, #181511);
  font-weight: 700;
  cursor: pointer;
}

.hasami-admin-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.hasami-admin-row {
  display: grid;
  grid-template-columns: 90px minmax(160px, 1fr) 110px minmax(180px, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--hasami-line, #d8d0c1);
  border-radius: 8px;
  padding: 14px;
  background: var(--hasami-panel, #fff);
}

.hasami-code {
  border-radius: 8px;
  padding: 14px;
  background: var(--hasami-button, #17140f);
  color: var(--hasami-button-text, #fff);
  font-size: 30px;
  font-weight: 900;
  text-align: center;
}

.hasami-row-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.hasami-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 12px;
  background: #e6e0d4;
  font-weight: 800;
}

.hasami-badge.called,
.hasami-badge.serving {
  background: #f5d36c;
}

.hasami-badge.outside {
  background: #cfe4f8;
}

.hasami-badge.absent {
  background: #f2c5bd;
}

.hasami-display {
  min-height: 540px;
  padding: 32px;
  background: var(--hasami-bg, #f7f4ed);
  text-align: center;
}

.hasami-display-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.hasami-display-grid section,
.hasami-public-grid {
  border-radius: 8px;
  padding: 24px;
  background: var(--hasami-panel, #fff);
}

.hasami-display-grid p {
  margin: 0 0 10px;
  color: var(--hasami-muted, #625c52);
  font-size: 20px;
}

.hasami-display-grid strong {
  font-size: 46px;
}

.hasami-public-status {
  padding: 24px;
  background: var(--hasami-bg, #f7f4ed);
}

.hasami-public-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

@media (max-width: 860px) {
  .hasami-checkin {
    min-height: 640px;
    padding: 18px;
  }

  .hasami-menu-grid,
  .hasami-display-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hasami-admin-row {
    grid-template-columns: 80px 1fr;
  }
}
