:root {
  --primary: #bee853;
  --text: #000;
  --bg: #000;
  --header-bg: #000;
  --header-text: #bee853;
  --reset-bg: #bee853;
  --reset-text: #000;
  --counter-bg: #000;
  --counter-text: #fff;
  --tab-active-bg: #bee853;
  --tab-inactive-bg: #000;
  --tab-active-text: #000;
  --tab-inactive-text: #bee853;
  --card-bg: #000;
  --card-text: #fff;
  --settings-bg: #bee853;
  --settings-panel: #fff;
  --chip-inactive-bg: #fff;
  --chip-inactive-border: #000;
  --add-bg: #000;
  --add-icon: #fff;
  --content-max: 400px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body,
#app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.app {
  min-height: 100dvh;
  background: var(--bg);
}

.header {
  height: 48px;
  padding: env(safe-area-inset-top) 24px 0;
  min-height: calc(48px + env(safe-area-inset-top));
  background: var(--header-bg);
  color: var(--header-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.date {
  min-width: 0;
  white-space: nowrap;
  font-weight: 600;
}

.date .big {
  font-size: 22px;
}

.date .unit {
  font-size: 18px;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.gear {
  width: 30px;
  height: 30px;
  opacity: 0.45;
}

.tabs {
  height: 48px;
  display: flex;
  background: var(--header-bg);
}

.task-screen.black-yellow .header,
.task-screen.black-yellow .tabs,
.task-screen.black-yellow .reset-band,
.task-screen.black-yellow .task-list {
  width: min(100%, var(--content-max));
  margin-inline: auto;
}

.tab {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  background: var(--tab-inactive-bg);
  color: var(--tab-inactive-text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.theme-blue .tab {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.tab:last-child {
  border-right: 0;
}

.tab.active {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
  border-bottom-width: 0;
  font-size: 20px;
}

.settings-screen .tab.active {
  border-bottom-width: 2px;
}

.badge {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--tab-active-text);
  font-size: 16px;
  font-weight: 700;
}

.theme-blue .badge {
  color: #fff;
}

.reset-band {
  position: relative;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 8px 24px;
  background: var(--reset-bg);
  color: var(--reset-text);
}

.theme-blackYellow .reset-band {
  height: 46px;
  padding-block: 0;
}

.reset-button {
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.refresh-icon {
  width: 24px;
  height: 24px;
}

.remaining-pill {
  position: absolute;
  right: 0;
  top: 8px;
  height: 46px;
  min-width: 132px;
  border-top-left-radius: 9999px;
  border-bottom-left-radius: 9999px;
  padding: 2px 18px 2px 14px;
  background: var(--counter-bg);
  color: var(--counter-text);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.black-remaining {
  position: absolute;
  right: 0;
  top: 0;
  height: 46px;
  display: flex;
  align-items: stretch;
  flex: none;
  z-index: 2;
}

.remaining-wedge {
  width: 52px;
  height: 46px;
  margin-right: -14px;
  background: #000;
  transform: skewX(-30deg);
}

.remaining-body {
  height: 46px;
  min-width: 136px;
  padding: 2px 22px 2px 2px;
  background: var(--counter-bg);
  color: var(--counter-text);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.remaining-label {
  font-size: 20px;
  line-height: 25px;
  font-weight: 600;
  margin-bottom: 2px;
}

.remaining-number {
  font-size: 32px;
  line-height: 32px;
  font-weight: 700;
  margin-bottom: -3px;
}

.wave {
  height: 11px;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
}

.wave img {
  display: block;
  width: 100%;
  height: 11px;
}

.task-list {
  min-height: calc(100dvh - 159px);
  padding: 16px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
}

.theme-blackYellow .task-list {
  gap: 24px;
}

.task-card {
  width: 100%;
  min-height: 72px;
  border: 2px solid var(--primary);
  border-radius: 16px;
  background: var(--card-bg);
  color: var(--card-text);
  box-shadow: 0 4px 0 var(--primary);
  display: flex;
  align-items: center;
  padding: 14px 24px;
  font-size: 24px;
  font-weight: 600;
  overflow: visible;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  will-change: transform, opacity;
}

.theme-blackYellow .task-card {
  border-width: 1px;
  border-radius: 0;
}

.task-card.completing {
  pointer-events: none;
}

.empty-state {
  flex: 1;
  min-height: 360px;
  display: grid;
  place-items: center;
}

.complete-logo {
  width: 132px;
  height: 180px;
  object-fit: contain;
}

.settings-screen {
  min-height: 100dvh;
  background: var(--settings-bg);
}

.settings-header {
  width: 100%;
  height: 48px;
  padding: env(safe-area-inset-top) 24px 0;
  min-height: calc(48px + env(safe-area-inset-top));
  background: var(--header-bg);
  color: var(--header-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-button,
.header-spacer {
  width: 72px;
}

.back-button {
  height: 40px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
}

.settings-title {
  font-size: 20px;
  font-weight: 800;
}

.settings-frame {
  flex: 1;
}

.theme-blackYellow .settings-frame {
  padding: 8px;
}

.settings-scroll {
  background: var(--settings-panel);
}

.setting-row,
.setting-block,
.item-card {
  background: var(--settings-panel);
  border-bottom: 1px solid var(--primary);
}

.theme-blackYellow .setting-row,
.theme-blackYellow .setting-block,
.theme-blackYellow .item-card {
  border-bottom-width: 2px;
}

.setting-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
}

.setting-row.between {
  justify-content: space-between;
}

.setting-label {
  font-size: 16px;
  font-weight: 600;
}

.time-input {
  width: 74px;
  height: 40px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 0 12px;
  text-align: center;
  font-size: 16px;
}

.theme-blackYellow .time-input {
  border-color: #000;
}

.period-row {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
}

.swatches {
  display: flex;
  gap: 12px;
}

.swatch-button {
  width: 48px;
  height: 48px;
  border: 3px solid transparent;
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.swatch-button.selected {
  border-color: #fff;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.25));
}

.swatch {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: #00b4ca;
}

.swatch.black-yellow {
  position: relative;
  background: #bee853;
}

.swatch.black-yellow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #000 0 50%, transparent 50% 100%);
}

.switch {
  width: 52px;
  height: 32px;
  padding: 3px;
  border-radius: 999px;
  background: var(--chip-inactive-bg);
  border: 1px solid var(--chip-inactive-border);
  display: flex;
  justify-content: flex-start;
}

.switch.on {
  justify-content: flex-end;
  background: var(--primary);
}

.switch-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
}

.credit {
  min-height: 48px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.72;
}

.items-wrap {
  position: relative;
  min-height: calc(100dvh - 96px);
}

.items-list {
  padding-bottom: 120px;
  background: var(--settings-panel);
}

.item-card {
  padding: 8px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.item-title-wrap {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.item-title {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}

.title-input {
  min-width: 0;
  flex: 1;
  height: 36px;
  border: 0;
  padding: 0;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.pencil {
  width: 26px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--primary);
}

.pencil-icon {
  width: 18px;
  height: 18px;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.delete-button {
  font-size: 16px;
  font-weight: 600;
}

.order-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
}

.order-button {
  width: 34px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--text);
}

.order-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.order-button:disabled {
  opacity: 0.22;
}

.schedule-matrix {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.schedule-row,
.schedule-header {
  display: grid;
  grid-template-columns: 20px repeat(7, minmax(0, 1fr));
  gap: 2px;
  align-items: center;
}

.period-label,
.day-label {
  text-align: center;
  font-weight: 700;
}

.period-label {
  font-size: 16px;
}

.day-label {
  font-size: 14px;
}

.matrix-cell {
  height: 36px;
  border-radius: 8px;
  border: 1px dashed var(--chip-inactive-border);
  display: grid;
  place-items: center;
  background: var(--chip-inactive-bg);
  font-size: 20px;
  font-weight: 800;
}

.matrix-cell.active {
  border-style: solid;
  border-color: var(--chip-inactive-border);
  background: var(--primary);
  color: var(--chip-active-text, #000);
}

.theme-blue .matrix-cell.active {
  border-width: 0;
  color: var(--bg);
}

.add-button {
  position: fixed;
  left: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--add-bg);
  color: var(--add-icon);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24);
}

.add-icon {
  width: 46px;
  height: 46px;
  display: block;
}

.hidden {
  display: none !important;
}

@media (min-width: 768px) {
  .header {
    height: 56px;
    min-height: calc(56px + env(safe-area-inset-top));
  }

  .date .big {
    font-size: 30px;
  }

  .date .unit {
    font-size: 26px;
  }

  .tabs {
    height: 56px;
  }

  .tab {
    font-size: 20px;
  }

  .tab.active {
    font-size: 24px;
  }

  .badge {
    width: 28px;
    height: 28px;
    font-size: 20px;
  }

  .reset-band {
    height: 76px;
    padding-block: 12px;
  }

  .theme-blackYellow .reset-band {
    height: 60px;
    padding-block: 0;
  }

  .remaining-pill {
    top: 8px;
    height: 60px;
    min-width: 186px;
    padding: 4px 26px 4px 19px;
  }

  .black-remaining,
  .remaining-wedge,
  .remaining-body {
    height: 60px;
  }

  .remaining-wedge {
    width: 68px;
    margin-right: -18px;
  }

  .remaining-body {
    min-width: 188px;
    padding: 4px 28px 4px 4px;
  }

  .remaining-label {
    font-size: 30px;
    line-height: 36px;
    margin-bottom: 4px;
  }

  .remaining-number {
    font-size: 48px;
    line-height: 48px;
    margin-bottom: -4px;
  }

  .task-screen.black-yellow .header,
  .task-screen.black-yellow .tabs,
  .task-screen.black-yellow .reset-band,
  .task-screen.black-yellow .task-list {
    width: 100%;
    max-width: none;
  }

  .task-list {
    padding: 40px 80px;
    gap: 16px;
  }

  .theme-blackYellow .task-list {
    gap: 24px;
  }

  .task-card {
    min-height: 88px;
    font-size: 28px;
  }

  .complete-logo {
    width: 180px;
    height: 245px;
  }

  .settings-header {
    height: 56px;
    min-height: calc(56px + env(safe-area-inset-top));
  }

  .items-list {
    padding-bottom: 168px;
  }

  .add-button {
    width: 104px;
    height: 104px;
  }

  .add-icon {
    width: 64px;
    height: 64px;
  }
}
