/* デザインは 地方ホームページメーカーLP（chihou-hp-maker-lp.pages.dev）に合わせる */
:root {
  --navy: #2b0d4f;
  --pink: #ec1f7a;
  --pink-d: #d0105f;
  --yellow: #ffd60a;
  --teal: #20c4c9;
  --purple: #6a2bd2;
  --cream: #fdf8f1;
  --cream2: #fbf3e8;
  --pinkbg: #fdeaf1;
  --lav: #f1ebfb;
  --mint: #e3f7f7;
  --text: #3a2a4a;
  --sub: #8a7c96;
  --line: #efe6f3;
  --card: #ffffff;
  --done: #b9adc4;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(80, 30, 90, .10);
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  background-image:
    radial-gradient(circle at 92% 6%, var(--pinkbg) 0 140px, transparent 141px),
    radial-gradient(circle at 4% 96%, var(--lav) 0 120px, transparent 121px);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.7;
}
.app { max-width: 680px; margin: 0 auto; padding: 56px 16px 48px; }

/* 見出し */
.app__head { position: relative; margin-bottom: 28px; }
.app__head::before {
  content: "";
  position: absolute; left: -6px; top: -22px;
  width: 26px; height: 26px;
  background:
    linear-gradient(var(--yellow), var(--yellow)) 50% 0 / 4px 10px no-repeat,
    linear-gradient(var(--yellow), var(--yellow)) 0 60% / 10px 4px no-repeat,
    linear-gradient(var(--yellow), var(--yellow)) 100% 60% / 10px 4px no-repeat;
  transform: rotate(-20deg);
}
.ribbon {
  display: inline-block; margin: 0 0 14px; padding: 6px 18px;
  background: var(--yellow); color: var(--navy);
  font-weight: 900; font-size: 15px;
  transform: rotate(-3deg);
  box-shadow: 4px 4px 0 rgba(43, 13, 79, .12);
}
h1 { margin: 0; color: var(--navy); font-size: clamp(40px, 9vw, 60px); font-weight: 900; line-height: 1.2; letter-spacing: .02em; }
.pink { color: var(--pink); }
.lead { margin: 10px 0 0; font-weight: 700; }
.mark { background: linear-gradient(transparent 62%, var(--yellow) 62%); }

/* 登録フォーム */
.card-form {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 24px 20px;
  margin-bottom: 28px;
  border: 3px solid transparent;
  scroll-margin-top: 16px;
}
.card-form.is-editing { border-color: var(--pink); }
.card-form__title { margin: 0 0 14px; font-weight: 900; color: var(--navy); font-size: 18px; }
.card-form__title::before { content: "✎ "; color: var(--pink); }
/* そろそろ連絡のお知らせ */
.notice {
  position: relative;
  background: var(--yellow);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  margin-bottom: 24px;
  box-shadow: 6px 6px 0 var(--navy);
  color: var(--navy);
}
.notice[hidden] { display: none; }
.notice__title { margin: 0 0 10px; font-weight: 900; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.notice__bell { display: inline-block; font-size: 22px; animation: ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
@keyframes ring {
  0%, 70%, 100% { transform: rotate(0); }
  75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); }
  85% { transform: rotate(8deg); } 90% { transform: rotate(-5deg); }
}
@media (prefers-reduced-motion: reduce) { .notice__bell { animation: none; } }
.notice__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.notice__item {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px; border: 0; border-radius: 14px; background: #fff;
  font: inherit; color: var(--navy); text-align: left; cursor: pointer;
}
.notice__item:hover { background: var(--cream); }
.notice__item:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.notice__who strong { font-weight: 900; font-size: 16px; }
.notice__who small { margin-left: 8px; color: var(--sub); font-weight: 700; font-size: 12px; }
.notice__when { flex: none; font-size: 12px; font-weight: 800; background: var(--lav); color: var(--purple); padding: 2px 10px; border-radius: 999px; }
.notice__when.is-over { background: var(--pink); color: #fff; }

/* 次に連絡する日 */
.field > span small { display: block; font-size: 11px; font-weight: 700; color: var(--sub); }
.next-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.next-pick input { width: auto; flex: 0 1 190px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 13px; font-weight: 800;
  padding: 5px 14px; border-radius: 999px;
  border: 2px solid var(--pink); background: #fff; color: var(--pink); cursor: pointer;
}
.chip:hover { background: var(--pinkbg); }
.chip.is-active { background: var(--pink); color: #fff; }
.chip--ghost { border-color: var(--line); color: var(--sub); }
.chip--ghost.is-active { background: var(--sub); border-color: var(--sub); color: #fff; }

/* 名刺の写真 */
.photo-field { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 16px; }
.photo-field__preview { position: relative; flex: none; }
.photo-field__preview[hidden] { display: none; }
.photo-field__preview img {
  display: block; width: 180px; height: 112px; object-fit: cover;
  border-radius: 12px; box-shadow: 0 6px 16px rgba(80, 30, 90, .18);
  transform: rotate(-2deg);
}
.photo-field__remove {
  position: absolute; top: -10px; right: -10px;
  width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff;
  background: var(--navy); color: #fff; font: inherit; font-weight: 800; font-size: 16px; line-height: 1;
  cursor: pointer;
}
.photo-field__remove:hover { background: var(--pink); }
.photo-field__pick {
  flex: 1 1 220px; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border: 2px dashed var(--pink); border-radius: 16px;
  background: var(--pinkbg); cursor: pointer; color: var(--navy);
  transition: background .15s;
}
.photo-field__pick:hover { background: #fbdbe8; }
.photo-field__pick:focus-within { outline: 3px solid var(--yellow); outline-offset: 2px; }
.photo-field__pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-field__icon { font-size: 26px; }
.photo-field__pick strong { display: block; font-weight: 900; }
.photo-field__pick small { display: block; font-size: 12px; color: var(--sub); font-weight: 700; }

.card-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field > span { font-size: 13px; font-weight: 800; color: var(--navy); }
.field em { font-style: normal; font-size: 11px; background: var(--pink); color: #fff; border-radius: 999px; padding: 0 8px; margin-left: 6px; vertical-align: 1px; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; font-weight: 700; color: var(--navy);
  padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--cream);
  resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: var(--sub); font-weight: 500; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--pink); background: #fff; }
.card-form__actions { display: flex; justify-content: flex-end; align-items: center; gap: 18px; margin-top: 18px; }
.btn {
  font: inherit; font-size: 15px; font-weight: 800;
  padding: 12px 34px; border: 0; border-radius: 999px;
  background: linear-gradient(90deg, #f0287f, #e8146c); color: #fff; cursor: pointer;
  box-shadow: 0 5px 0 #b00e52, 0 12px 24px rgba(236, 31, 122, .25);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b00e52; }

/* 切り替え・検索 */
.tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.filters { display: flex; gap: 8px; }
.filters button {
  font: inherit; font-size: 14px; font-weight: 800;
  padding: 6px 16px; border-radius: 999px;
  border: 2px solid var(--navy); background: transparent; color: var(--navy); cursor: pointer;
}
.filters button:hover { background: var(--lav); }
.filters button.is-active { background: var(--navy); color: #fff; }
.search {
  flex: 1 1 200px; max-width: 260px;
  font: inherit; font-size: 15px; font-weight: 700; color: var(--navy);
  padding: 8px 16px; border: 2px solid var(--line); border-radius: 999px; background: var(--card);
}
.search:focus { outline: none; border-color: var(--pink); }

/* 名刺の一覧 */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.list:empty { display: none; }
.item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 18px 18px 20px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 6px solid var(--yellow);
}
.item.is-done { border-left-color: var(--pink); }
.item.is-due { border-left-color: var(--yellow); box-shadow: 0 0 0 3px var(--yellow), var(--shadow); }
.item.is-flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 40% { background: #fff6c2; } 100% { background: var(--card); } }
.item__contact { margin-top: 8px !important; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; font-weight: 800; }
.due { background: var(--lav); color: var(--purple); padding: 2px 10px; border-radius: 999px; }
.due--now { background: var(--yellow); color: var(--navy); }
.last { background: var(--cream2); color: var(--sub); padding: 2px 10px; border-radius: 999px; }
.contacted {
  margin-top: 10px;
  font: inherit; font-size: 14px; font-weight: 800;
  padding: 8px 20px; border: 0; border-radius: 999px;
  background: var(--navy); color: #fff; cursor: pointer;
  box-shadow: 0 4px 0 #14052a;
}
.contacted:hover { background: var(--purple); }
.contacted:active { transform: translateY(3px); box-shadow: 0 1px 0 #14052a; }
.ask-next {
  margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--lav);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.ask-next__q { font-size: 13px; font-weight: 900; color: var(--navy); margin-right: 4px; }
.item input[type="checkbox"] {
  appearance: none; flex: none; margin: 10px 0 0;
  width: 26px; height: 26px;
  border: 3px solid var(--navy); border-radius: 50%;
  cursor: pointer; display: grid; place-items: center;
}
.item input[type="checkbox"]:hover { background: var(--pinkbg); }
.item input[type="checkbox"]:checked { background: var(--pink); border-color: var(--pink); }
.item input[type="checkbox"]:checked::after {
  content: ""; width: 6px; height: 11px; margin-top: -3px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.item input[type="checkbox"]:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.avatar {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--lav); color: var(--purple);
  font-weight: 900; font-size: 20px;
}
.item.is-done .avatar { background: var(--pinkbg); color: var(--pink); }
.thumb {
  flex: none; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: 10px; box-shadow: 0 4px 12px rgba(80, 30, 90, .18);
  transition: transform .15s;
}
.thumb:hover { transform: rotate(-3deg) scale(1.04); }
.thumb:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.thumb img { display: block; width: 88px; height: 55px; object-fit: cover; border-radius: 10px; }

/* 写真を大きく見る */
.viewer {
  border: 0; padding: 20px; border-radius: var(--radius);
  max-width: min(92vw, 760px); background: var(--card); color: var(--navy);
  box-shadow: 0 20px 60px rgba(43, 13, 79, .35); text-align: center;
}
.viewer::backdrop { background: rgba(43, 13, 79, .6); }
.viewer img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 12px; }
.viewer p { margin: 12px 0 14px; font-weight: 900; }
.viewer form { margin: 0; }
.item__body { flex: 1; min-width: 0; }
.item__body p { margin: 0; overflow-wrap: anywhere; }
.item__name { color: var(--navy); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.item__name strong { font-size: 18px; font-weight: 900; }
.san { font-size: 13px; font-weight: 700; color: var(--sub); }
.tag { font-size: 11px; font-weight: 800; background: var(--pink); color: #fff; border-radius: 999px; padding: 1px 10px; }
.item__company { font-weight: 800; color: var(--text); }
.item__meta { font-size: 13px; color: var(--sub); font-weight: 700; }
.item__meta::before { content: "📍 "; }
.item__memo {
  margin-top: 8px !important; padding: 8px 12px;
  background: var(--cream2); border-radius: 12px;
  font-size: 14px; white-space: pre-wrap;
}
.item__actions { flex: none; display: flex; align-items: center; gap: 4px; }
.item__edit {
  font: inherit; font-size: 13px; font-weight: 800;
  padding: 4px 12px; border-radius: 999px; border: 2px solid var(--line);
  background: transparent; color: var(--navy); cursor: pointer;
}
.item__edit:hover { border-color: var(--navy); background: var(--lav); }
.item__del {
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--sub); font: inherit; font-size: 20px; font-weight: 800;
  cursor: pointer;
}
.item__del:hover { background: var(--pinkbg); color: var(--pink); }

.empty {
  text-align: center; color: var(--sub); font-weight: 700;
  padding: 40px 16px; margin: 0;
  background: var(--card); border-radius: var(--radius); border: 2px dashed var(--line);
}
.empty[hidden] { display: none; }
.app__foot { margin-top: 14px; font-size: 14px; font-weight: 700; color: var(--navy); }
#count:not(:empty) { display: inline-block; background: var(--lav); padding: 4px 14px; border-radius: 999px; }
.link { font: inherit; font-size: 14px; font-weight: 700; background: none; border: 0; color: var(--sub); cursor: pointer; text-decoration: underline; padding: 0; }
.link:hover { color: var(--pink); }
.link[hidden] { display: none; }
.hint { color: var(--sub); font-size: 12px; text-align: center; margin-top: 36px; }

@media (max-width: 560px) {
  .app { padding-top: 40px; }
  .card-form { padding: 20px 16px 18px; }
  .card-form__grid { grid-template-columns: 1fr; }
  .card-form__actions .btn { flex: 1; }
  .search { max-width: none; flex-basis: 100%; }
  .item { flex-wrap: wrap; padding: 16px; gap: 12px; }
  .avatar { width: 40px; height: 40px; font-size: 17px; }
  .thumb img { width: 72px; height: 45px; }
  .notice__who small { display: block; margin-left: 0; }
  .photo-field__preview { margin: 0 auto; }
  .item__body { flex-basis: calc(100% - 130px); }
  .item__actions { width: 100%; justify-content: flex-end; border-top: 2px dashed var(--line); padding-top: 8px; }
}
