:root {
  color-scheme: dark;

  --background: #14171b;
  --panel: #20262e;
  --card: #191e25;
  --border: #3d4856;
  --border-light: #718499;
  --text: #f0f2f4;
  --secondary: #b7c0cc;
  --accent: #526c87;
  --nav-background: #1a2028;

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    sans-serif;

  background: var(--background);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(
      ellipse at top,
      #252d37,
      var(--background) 70%
    );
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #b7cee8;
  outline-offset: 4px;
}

.app-shell {
  width: 100%;
  max-width: 640px;
  min-height: 100vh;
  margin-inline: auto;
  padding:
    10px 12px
    calc(112px + env(safe-area-inset-bottom, 0px));
}

/* ヘッダー */

.header {
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #202832;
}

.header-image {
  display: block;
  width: 100%;
  height: auto;
}

.header-date {
  display: block;
  padding: 10px 10px;
  background: #1c222a;
  color: #c4cbd4;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.06em;
}

/* 全体の配置 */

#main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

#main > section {
  min-width: 0;
}

.panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    linear-gradient(
      120deg,
      #242c36,
      #1b2129
    );
  box-shadow: 0 5px 18px rgb(0 0 0 / 10%);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.heading-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.heading-group > div {
  min-width: 0;
}

h1,
h2 {
  margin: 0;
  font-size: clamp(20px, 4.5vw, 25px);
  font-weight: 600;
  line-height: 1.4;
}

.description {
  display: block;
  margin: 0;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
}

.heading-group .description {
  margin-top: 3px;
}

/* アイコン */

.icon-box {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: #181e26;
  color: #c2cfdf;
  font-size: 26px;
  line-height: 1;
}

.heading-group > .icon-box {
  border: 1px solid var(--border);
}

.icon-box-accent {
  background: #3c526d;
  color: #edf2f8;
}

/* お客様管理 */

.customer-count {
  display: grid;
  flex-shrink: 0;
  gap: 3px;
  min-width: 76px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #181e26;
  text-align: center;
}

.customer-count strong {
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
}

.customer-count > span {
  color: var(--secondary);
  font-size: 11px;
  font-weight: 400;
}

.customer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.action-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  min-height: 108px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  text-align: left;
}

.action-tile-primary {
  border-color: #718499;
  background:
    linear-gradient(
      120deg,
      #48627f,
      #34465d
    );
}

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.tile-icon {
  color: var(--text);
  font-size: 29px;
  line-height: 1;
}

.diagonal-arrow {
  color: #c1cfdf;
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
}

.action-tile > strong {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.tile-description {
  color: #c4cdd9;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

/* 横長のボタン */

.row-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--card);
  text-align: left;
}

.action-copy {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-width: 0;
}

.action-copy > strong {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}

.open-indicator {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 7px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.chevron {
  font-size: 27px;
  line-height: 1;
}

/* 今日の記録 */

.status-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #b8c6d7;
  color: #1b222b;
  font-size: 12px;
  font-weight: 600;
}

.daily-action {
  min-height: 96px;
  border-color: #718499;
  background:
    linear-gradient(
      110deg,
      #35495f,
      #232b35
    );
}

.daily-action > .icon-box {
  flex-basis: 48px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #425974;
  font-size: 28px;
}

.daily-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}


.stat-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.stat-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stat-card .description {
  font-size: 11px;
}

.stat-icon {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: #304156;
  color: #c5d3e4;
  font-size: 19px;
}

.stat-card strong {
  display: block;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.history-action {
  min-height: 48px;
  gap: 8px;
  padding: 6px 10px;
}

.history-icon {
  flex-shrink: 0;
  color: var(--secondary);
  font-size: 24px;
}

.history-action .action-copy > strong {
  color: var(--secondary);
  font-size: 15px;
}

/* 今月の集計 */

.month-action {
  min-height: 88px;
  padding: 14px;
  border-color: #718499;
  border-radius: 22px;
  background:
    linear-gradient(
      110deg,
      #252d37,
      #354352
    );
}

.month-action > .icon-box {
  flex-basis: 50px;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  font-size: 29px;
}

.card-heading {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
}

.month-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.month-total strong {
  font-size: 18px;
  font-weight: 500;
}

/* バックアップ */

.backup-action {
  min-height: 78px;
  padding: 12px;
  border-radius: 20px;
}

/* フッター */

.footer {
  padding: 12px 4px 16px;
  text-align: center;
}

.footer-message {
  margin: 0;
  color: #a7b6c7;
  font-size: 13px;
  line-height: 1.6;
}

.footer-message > span {
  display: block;
}

.footer-rule {
  width: 120px;
  height: 1px;
  margin: 10px auto 8px;
  background: var(--border);
}

.footer-heart {
  display: block;
  color: var(--secondary);
  font-size: 18px;
}

/* 下のメニュー */

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  padding:
    9px 8px
    calc(9px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--nav-background);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 50px;
  margin: 0;
  padding: 4px 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9eafc3;
  text-align: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 400;
}

.nav-item[aria-current="page"] {
  color: #d2e1f2;
}

.nav-icon {
  font-size: 27px;
  line-height: 1.1;
}

/* お知らせ */

#notice-dialog {
  width: min(90vw, 380px);
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: #202832;
  color: var(--text);
}

#notice-dialog::backdrop {
  background: rgb(0 0 0 / 70%);
}

#notice-title {
  margin: 0 0 8px;
  font-size: 22px;
}

#notice-message {
  margin: 0;
  color: var(--secondary);
  font-size: 15px;
  line-height: 1.6;
}

#notice-dialog form {
  margin-top: 12px;
}

.dialog-close {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: #3c526d;
  color: var(--text);
  font-weight: 500;
}

/* 小さい画面 */

@media (max-width: 380px) {
  .app-shell {
    padding:
      10px 10px
      calc(108px + env(safe-area-inset-bottom, 0px));
  }

  #main {
    gap: 8px;
  }

  .panel {
    padding: 10px;
    border-radius: 19px;
  }

  .heading-group {
    gap: 8px;
  }

  .heading-group > .icon-box {
    flex-basis: 36px;
    width: 36px;
    height: 38px;
    font-size: 23px;
  }

  .customer-count {
    min-width: 65px;
    padding: 8px;
  }

  .customer-count strong {
    font-size: 22px;
  }

  .customer-actions {
    gap: 8px;
  }

  .action-tile {
    min-height: 108px;
    padding: 10px;
  }

  .action-tile > strong {
    font-size: 16px;
  }

  .tile-description {
    font-size: 11px;
  }

  .row-action {
    gap: 8px;
    padding: 10px;
  
    min-height: 64px;
  }

  .action-copy > strong {
    font-size: 15px;
  }

  .action-copy .description {
    font-size: 11px;
  }

  .icon-box {
    flex-basis: 36px;
    width: 36px;
    height: 40px;
    font-size: 23px;
  }

  .daily-action > .icon-box,
  .month-action > .icon-box {
    flex-basis: 40px;
    width: 40px;
    height: 44px;
    font-size: 25px;
  }

  .open-indicator {
    gap: 4px;
    font-size: 11px;
  }

  .daily-summary {
    gap: 8px;
  }

  .stat-card {
    gap: 7px;
    padding: 8px;
  }

  .stat-icon {
    flex-basis: 28px;
    width: 28px;
    height: 32px;
    font-size: 19px;
  }

  .stat-card strong {
    font-size: 18px;
  }

  .card-heading {
    font-size: 20px;
  }

  .month-total {
    font-size: 13px;
  }

  .nav-item {
    font-size: 10px;
  }
}
[hidden] { display: none !important; }

/* 数値入力は直接入力のみ：ブラウザー標準の上下スピナーを非表示 */
input[type="number"] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  display: none !important;
}
