﻿:root {
  --bg: #faf7ff;
  --surface: #ffffff;
  --surface-soft: #f3eeff;
  --surface-accent: #efe6ff;
  --text: #372f4f;
  --muted: #6f658d;
  --line: #ddd3f3;
  --accent: #b79cff;
  --accent-strong: #8b68f0;
  --danger: #b44e82;
  --shadow: 0 18px 40px rgba(129, 105, 214, 0.18);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --max-width: 720px;
  --safe-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(183, 156, 255, 0.32), transparent 28%),
    radial-gradient(circle at left 20%, rgba(139, 104, 240, 0.16), transparent 30%),
    var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body.is-pressing-action,
body.is-pressing-action * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body,
button,
input,
summary {
  font: inherit;
}

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

button {
  cursor: pointer;
  border: none;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

input {
  border: 1px solid var(--line);
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.app-shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 24px 16px var(--safe-bottom);
}

.hero {
  padding: 4px 0 10px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-accent);
  color: #6047a7;
  font-size: 0.92rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1.1;
}

.hero-copy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.hero-banner {
  display: block;
}

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

.card-stack {
  display: grid;
  gap: 16px;
}

.panel {
  background: #fdfbff;
  background: color-mix(in srgb, var(--surface) 94%, #f1ebff 6%);
  border: 1px solid rgba(221, 211, 243, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.panel-heading h2,
.quick-add-summary-title {
  margin: 0;
  font-size: 1.05rem;
}

.feedback,
.empty-state p,
.dialog-body p,
.dialog-body ol,
.share-note,
.app-footer-copy,
.app-footer-version,
.app-footer-sub,
.app-footer-credit {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.list-panel-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  width: 100%;
}

.list-panel-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.list-heading-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.list-panel-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}

.edit-mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(221, 211, 243, 0.95);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1;
}

.edit-mode-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.edit-mode-button.is-active {
  border-color: rgba(139, 104, 240, 0.6);
  background: linear-gradient(180deg, rgba(139, 104, 240, 0.34), rgba(183, 156, 255, 0.16));
  color: var(--accent-strong);
}

.add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

#item-input {
  min-width: 0;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 1rem;
}

#item-input:focus-visible,
button:focus-visible,
.item-checkbox:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(183, 156, 255, 0.42);
  outline-offset: 2px;
}

.primary-button,
.secondary-button,
.ghost-button,
.chip-button,
.icon-button,
.quick-tab-button,
.text-option-button,
.drag-handle {
  min-height: 48px;
  border-radius: var(--radius-md);
  transition: transform 0.18s ease, background-color 0.18s ease, opacity 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.primary-button {
  padding: 0 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 700;
}

.secondary-button,
.ghost-button {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 700;
}

.ghost-button {
  background: #fff;
}

.danger-button {
  color: var(--danger);
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.chip-button:active,
.icon-button:active,
.quick-tab-button:active,
.text-option-button:active,
.drag-handle:active {
  transform: scale(0.98);
}

.quick-add {
  margin-top: 12px;
  background: transparent;
}

.quick-add-summary {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 2px 0 0;
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.quick-add-summary::-webkit-details-marker {
  display: none;
}

.quick-add-summary:hover {
  color: var(--accent-strong);
}

.quick-add-summary-icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.quick-add-summary-icon::before,
.quick-add-summary-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-strong);
  transform: translate(-50%, -50%);
}

.quick-add-summary-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  transition: transform 0.18s ease;
}

.quick-add[open] .quick-add-summary-icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.quick-add-body {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0;
  opacity: 0;
  transition: grid-template-rows 0.28s ease, opacity 0.22s ease, margin-top 0.22s ease;
}

.quick-add[open] .quick-add-body {
  grid-template-rows: 1fr;
  margin-top: 12px;
  opacity: 1;
}

.quick-add-body-inner {
  min-height: 0;
  overflow: hidden;
  padding: 14px 14px 12px;
  border: 1px solid rgba(221, 211, 243, 0.92);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 240, 255, 0.92));
  box-shadow: 0 10px 24px rgba(139, 104, 240, 0.08);
}

.quick-tabs {
  display: flex;
  gap: 4px;
  margin-top: 0;
  padding: 0;
  border-bottom: 1px solid rgba(221, 211, 243, 0.95);
}

.quick-tab-button {
  position: relative;
  flex: 1 1 0;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.quick-tab-button::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: -5px;
  left: 12px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
}

.quick-tab-button.is-active {
  color: var(--accent-strong);
  background: linear-gradient(180deg, rgba(183, 156, 255, 0.18), rgba(183, 156, 255, 0.04));
}

.quick-tab-button.is-active::after {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.quick-tab-panel {
  margin-top: 14px;
}

.quick-tab-panel[hidden] {
  display: none;
}

.chip-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chip-button {
  min-height: 48px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
  font-weight: 600;
  text-align: center;
  word-break: keep-all;
}

.chip-button.is-added {
  animation: quick-add-pop 0.52s ease;
  border-color: rgba(139, 104, 240, 0.52);
  background: linear-gradient(180deg, rgba(239, 230, 255, 0.95), rgba(255, 255, 255, 1));
  color: var(--accent-strong);
}

.action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.action-row-bottom {
  margin-top: 14px;
}

.status-inline {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: right;
  white-space: nowrap;
  flex: 0 0 auto;
}

.status-inline.is-all-done {
  color: #2f9a63;
  font-weight: 800;
}

.list-stage {
  position: relative;
  min-height: 286px;
  margin-top: 14px;
  padding-bottom: 8px;
}

.mitchie-character {
  position: absolute;
  right: 34px;
  top: 64px;
  z-index: 2;
  padding: 0;
  border: none;
  width: 210px;
  opacity: 0.12;
  transform: scale(1);
  transform-origin: bottom right;
  transition: opacity 0.24s ease, transform 0.28s ease, right 0.28s ease, top 0.28s ease, width 0.28s ease;
  pointer-events: auto;
  background: transparent;
}

.list-stage.is-empty .mitchie-character {
  opacity: 1;
  transform: scale(1);
}

.list-stage.has-message:not(.is-empty) .mitchie-character {
  opacity: 0.7;
}

.list-stage.is-edit-mode .mitchie-character {
  pointer-events: none;
}

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

.mitchie-character:focus-visible {
  outline: 3px solid rgba(183, 156, 255, 0.36);
  outline-offset: 4px;
}

.shopping-list {
  display: grid;
  gap: 0;
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(221, 211, 243, 0.9);
  background: transparent;
}

.list-stage.is-empty .shopping-list {
  border-top: none;
}

.shopping-list > .shopping-item {
  transition: transform 0.34s ease, box-shadow 0.34s ease, opacity 0.34s ease;
  will-change: transform;
}

.shopping-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 2px 7px 0;
  border-bottom: 1px solid rgba(221, 211, 243, 0.9);
  background: transparent;
}

.shopping-item.is-done {
  opacity: 0.82;
}

.shopping-item.is-done .item-text {
  color: var(--muted);
  text-decoration: line-through;
}

.shopping-item.is-dragging {
  opacity: 0.96;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 40px rgba(55, 47, 79, 0.18);
}

.shopping-item-placeholder {
  margin: 4px 0;
  border-top: 1px dashed rgba(139, 104, 240, 0.45);
  border-bottom: 1px dashed rgba(139, 104, 240, 0.45);
  border-style: dashed;
  border-color: rgba(139, 104, 240, 0.45);
  border-left: none;
  border-right: none;
  background: rgba(239, 230, 255, 0.35);
}

.shopping-item-placeholder,
.shopping-item.is-dragging {
  transition: none;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 14px;
  padding: 0;
  background: transparent;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.drag-handle-lines {
  width: 12px;
  height: 12px;
  background-image:
    linear-gradient(var(--muted), var(--muted)),
    linear-gradient(var(--muted), var(--muted)),
    linear-gradient(var(--muted), var(--muted));
  background-repeat: no-repeat;
  background-size: 12px 2px;
  background-position: center 1px, center 5px, center 9px;
}

.drag-handle.is-armed .drag-handle-lines,
.drag-handle.is-dragging .drag-handle-lines {
  background-image:
    linear-gradient(var(--accent-strong), var(--accent-strong)),
    linear-gradient(var(--accent-strong), var(--accent-strong)),
    linear-gradient(var(--accent-strong), var(--accent-strong));
}

.item-main {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.item-body {
  display: grid;
  align-items: center;
  min-width: 0;
}

.item-checkbox {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.item-text-button {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.item-text-button[aria-disabled="true"] {
  cursor: default;
}

.list-stage.is-edit-mode .item-text-button {
  padding: 6px 10px;
  border-color: rgba(139, 104, 240, 0.48);
  background: rgba(239, 230, 255, 0.9);
}

.item-edit-form {
  grid-area: 1 / 1;
  margin: 0;
}

.item-text-button[hidden],
.item-edit-form[hidden] {
  display: none !important;
}

.item-edit-input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(183, 156, 255, 0.5);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.item-edit-input:focus-visible {
  outline: 3px solid rgba(183, 156, 255, 0.42);
  outline-offset: 2px;
}

.item-text {
  word-break: break-word;
  line-height: 1.28;
  font-size: 0.95rem;
  font-weight: 700;
}

.icon-button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-width: 56px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(221, 211, 243, 0.9);
  border-radius: 999px;
  background: #fff;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 700;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.ghost-button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.icon-button::before,
.ghost-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

.icon-button::before {
  background: linear-gradient(90deg, #c75687, #a13a71);
}

.ghost-button::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.icon-button.is-holding,
.ghost-button.is-holding {
  color: #ffffff;
  border-color: transparent;
}

.icon-button.is-holding::before,
.ghost-button.is-holding::before {
  animation: hold-progress var(--hold-duration, 700ms) linear forwards;
}

.share-block {
  display: grid;
  gap: 8px;
}

.share-block-bottom {
  margin-top: 18px;
}

.share-main-button {
  min-height: 54px;
  background: linear-gradient(135deg, rgba(183, 156, 255, 0.22), rgba(139, 104, 240, 0.12));
  border-color: rgba(139, 104, 240, 0.28);
  color: var(--accent-strong);
}

.share-note {
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

.empty-state {
  position: absolute;
  top: -12px;
  right: 10px;
  z-index: 3;
  max-width: min(220px, calc(100% - 126px));
  padding: 12px 14px;
  border: 1px solid rgba(221, 211, 243, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(139, 104, 240, 0.08);
}

.empty-state[hidden] {
  display: none;
}

.list-stage:not(.is-empty):not(.has-message) .empty-state {
  display: none;
}

.empty-state::after {
  content: "";
  position: absolute;
  right: calc(50% - 9px);
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-right: 1px solid rgba(221, 211, 243, 0.92);
  border-bottom: 1px solid rgba(221, 211, 243, 0.92);
  background: rgba(255, 255, 255, 0.96);
  transform: rotate(45deg);
}

.empty-state-title {
  font-weight: 700;
  color: var(--text);
}

.install-option {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.usage-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(221, 211, 243, 0.72);
}

.usage-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.usage-list {
  margin: 0;
  padding-left: 1.3em;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.notice-block {
  margin-top: 14px;
}

.notice-list {
  margin: 0;
  padding-left: 1.3em;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.text-option-button {
  min-height: 36px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.app-footer {
  margin-top: 18px;
  padding-top: 14px;
  text-align: center;
}

.app-footer-version {
  font-size: 0.8rem;
}

.app-footer-divider {
  height: 1px;
  margin: 10px 0 12px;
  background: rgba(221, 211, 243, 0.95);
}

.app-footer-copy {
  font-size: 0.95rem;
}

.app-footer-sub,
.app-footer-credit {
  font-size: 0.92rem;
}

.install-dialog {
  width: min(92vw, 360px);
  border: none;
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 24px 60px rgba(55, 47, 79, 0.18);
}

.install-dialog::backdrop {
  background: rgba(55, 47, 79, 0.28);
}

.dialog-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.dialog-card h2 {
  margin: 0;
}

.dialog-body ol {
  padding-left: 1.4em;
}

.dialog-close {
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 640px) {
  .app-shell {
    padding-left: 20px;
    padding-right: 20px;
  }

  .panel {
    padding: 22px;
  }
}

@keyframes hold-progress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes quick-add-pop {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(139, 104, 240, 0);
  }

  35% {
    transform: scale(0.96);
    box-shadow: 0 0 0 rgba(139, 104, 240, 0);
  }

  65% {
    transform: scale(1.04);
    box-shadow: 0 10px 18px rgba(139, 104, 240, 0.14);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(139, 104, 240, 0);
  }
}



.version-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
}

.page-footer-divider {
  height: 1px;
  margin: 10px 0 12px;
  background: rgba(221, 211, 243, 0.95);
}

.page-footer {
  text-align: center;
}

.page-footer p {
  margin: 0;
  color: rgba(111, 101, 141, 0.72);
  font-size: 0.8rem;
  line-height: 1.55;
}

.page-footer a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
  opacity: 0.92;
}

