@layer components {
  .day-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
  }

  .day-header__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .day-header__title {
    font-size: 1.25rem;
    font-weight: 500;
    text-align: center;
    flex: 1;
  }

  .day-header__actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
  }

  .day {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .day-footer {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
  }

  .day-footer__form { margin: 0; }

  .day__item turbo-frame {
    display: block;
  }

  .day-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-cell);
    padding: 1rem;
  }

  .day-row__name {
    display: inline-block;
    font-weight: 500;
    margin-bottom: 0.625rem;
    text-decoration: none;
    color: var(--text);
  }

  .day-row__name:hover {
    text-decoration: underline;
  }

  .day-row__form {
    margin: 0;
  }

  .day-row__choices {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
  }

  .day-row__hint {
    color: var(--text-muted);
    font-size: 0.875rem;
  }

  .day-row__time {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }

  .day-row__time-field {
    flex: 1 1 auto;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-cell);
    background: var(--bg);
    color: var(--text);
    font: inherit;
  }

  .day-row__photo {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
  }

  .day-row__photo-thumb {
    width: 3.5rem;
    height: 3.5rem;
    object-fit: cover;
    border-radius: var(--radius-cell);
    border: 1px solid var(--border);
  }

  .day-row__photo-label {
    display: inline-flex;
  }

  .day-row__photo-label input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  .day-row__photo-label:hover .button {
    transform: translateY(-1px);
  }

  .day-row__textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-cell);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    resize: vertical;
  }

  .tap-chip {
    flex: 1 1 4rem;
    min-height: 2.75rem;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-cell);
    border: 3px solid transparent;
    background: var(--c-gray);
    color: #fff;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    line-height: 1.2;
    transition: transform 0.08s ease, border-color 0.08s ease;
  }

  .tap-chip:hover  { transform: translateY(-1px); }
  .tap-chip:active { transform: scale(0.96); }

  .tap-chip--selected {
    border-color: var(--text);
    animation: tap-chip-pop 0.18s ease-out;
  }

  @keyframes tap-chip-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.04); }
    100% { transform: scale(1); }
  }

  @media (prefers-reduced-motion: reduce) {
    .tap-chip            { transition: none; }
    .tap-chip:hover,
    .tap-chip:active     { transform: none; }
    .tap-chip--selected  { animation: none; }
  }
}
