:root {
  --brand: #1E50A2;
  --brand-dark: #163d7d;
  --gold: #F5B301;
}

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
}

/* スマホ風コンテナ */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f1f5f9;
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,.08);
}

/* カード */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* 星 */
.star {
  cursor: pointer;
  transition: transform .1s ease, color .1s ease;
  font-size: 1.5rem;
  line-height: 1;
}
.star:active { transform: scale(1.2); }
.star.on { color: var(--gold); }
.star.off { color: #d1d5db; }
.star.readonly { cursor: default; }

/* テキストエリア */
.field-input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  resize: none;
  outline: none;
  transition: border-color .15s;
}
.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30,80,162,.1);
}

/* ボタン */
.btn-primary {
  background: var(--brand);
  color: #fff;
  transition: background .15s;
}
.btn-primary:active { background: var(--brand-dark); }

/* FAB（フローティング追加ボタン）
   app-shell(relative・max-width:480px)を基準に右下へ配置。
   画面が広い場合もコンテナ右端に追従し、画面幅に依存してはみ出さない。
   iOSのセーフエリア（ホームバー）も考慮。 */
.fab {
  box-shadow: 0 6px 16px rgba(30,80,162,.45);
}
.fab-anchored {
  position: fixed;
  right: max(1rem, calc(50vw - 240px + 1rem));
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

/* スライドアップ表示 */
.slide-up { animation: slideUp .25s ease; }
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fade-in { animation: fadeIn .2s ease; }
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-right { animation: slideRight .22s ease; }
@keyframes slideRight {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 14px 20px;
  font-size: 15px;
  color: #334155;
  font-weight: 600;
}
.menu-item:active { background: #f1f5f9; }

/* カレンダー */
.cal-cell {
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
}
.cal-cell.has-entry { font-weight: 700; color: var(--brand); }
.cal-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); margin-top: 2px;
}
.cal-cell.selected { background: var(--brand); color: #fff !important; }
.cal-cell.selected .cal-dot { background: #fff; }
.cal-cell.today { outline: 2px solid var(--brand); }
.cal-cell.empty { cursor: default; }
