* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif;
  background: #f5f7f6;
  color: #202124;
}

.app {
  max-width: 680px;
  margin: 0 auto;
  min-height: 100vh;
  background: #f5f7f6;
  display: flex;
  flex-direction: column;
}

.empty {
  color: #777;
  font-size: 14px;
}

header a {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #222;
  color: white;
  text-decoration: none;
  font-size: 14px;
}

header a:hover {
  opacity: 0.9;
}

.task-page {
  flex: 1;
  border-top: none;
}

/* =========================
   Task List Page
========================= */

.task-page {
  flex: 1;
  border-top: none;
  padding: 16px;
  background: #f5f7f6;
}

#taskList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;

  min-height: 88px;
  padding: 14px 16px;

  background: #fff;
  border: 1px solid #e5e7e6;
  border-radius: 14px;

  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.05);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.task-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.task-title {
  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: #202124;

  overflow-wrap: anywhere;
}

.priority-icon {
  flex-shrink: 0;
  font-size: 13px;
}

.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;

  margin-top: 7px;
}

.task-date {
  font-size: 13px;
  color: #6b7280;
}

.task-category {
  display: inline-block;
  padding: 3px 9px;

  border-radius: 999px;

  background: #f0f1f2;
  color: #666;

  font-size: 12px;
  font-weight: 600;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.task-actions button {
  height: 36px;

  border: 1px solid #d9dcda;
  border-radius: 10px;

  background: #fff;
  color: #333;

  cursor: pointer;
}

.complete-button {
  min-width: 58px;
  padding: 0 14px;
  font-size: 14px;
}

.delete-button {
  width: 40px;
  padding: 0;
  font-size: 18px;
}

.task-actions button:hover {
  background: #f3f4f4;
}

@media (max-width: 480px) {
  .task-card {
    min-height: 82px;
    padding: 12px 14px;
    gap: 8px;
  }

  .task-title {
    font-size: 17px;
  }

  .task-meta {
    gap: 8px;
    margin-top: 6px;
  }

  .complete-button {
    min-width: 54px;
    padding: 0 12px;
  }

  .delete-button {
    width: 38px;
  }
}

/* 読み込み・空状態・エラー */

.task-status,
.empty-state,
.error-state {
  padding: 32px 20px;
  text-align: center;
  color: #6b7280;
}

.empty-title {
  margin: 0;
  color: #303432;
  font-size: 16px;
  font-weight: 700;
}

.empty-message {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.7;
}

.error-state p {
  margin: 0 0 12px;
}

.error-state button {
  padding: 9px 16px;

  border: none;
  border-radius: 999px;

  background: #222;
  color: #fff;

  font-size: 14px;
  cursor: pointer;
}

/* スマートフォン */

@media (max-width: 480px) {
  .task-page {
    padding: 12px;
  }

  .task-card {
    padding: 14px;
    gap: 8px;
  }

  .task-title {
    font-size: 16px;
  }

  .task-actions {
    gap: 2px;
  }

  .task-actions button {
    width: 36px;
    height: 36px;
  }
}

/* =========================
   Task List Layout Fix
========================= */

.task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;

  padding: 18px;
  border-bottom: 1px solid #ddd;
}

.task-header-text {
  min-width: 0;
}

.task-header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;

  margin-left: auto;
}

.task-header-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  min-height: 38px;
  padding: 7px 12px;

  border: 1px solid #d7d9d8;
  border-radius: 9px;

  background: #fff;
  color: #333;

  font-size: 13px;
  cursor: pointer;
}

.task-header-actions button:hover {
  background: #f1f2f2;
}

/* タスクカード */

#taskList {
  gap: 9px;
}

.task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  min-height: 78px;
  padding: 12px 14px;

  border-radius: 13px;
}

.task-info {
  flex: 1;
  min-width: 0;
}

.task-title {
  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.priority-icon {
  margin-top: 0;
  font-size: 13px;
}

.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;

  margin-top: 6px;
}

.task-date {
  margin: 0;
  white-space: nowrap;

  color: #6b7280;
  font-size: 13px;
}

.task-category {
  margin: 0;
  padding: 3px 9px;

  white-space: nowrap;

  background: #f0f1f2;
  color: #666;

  font-size: 12px;
}

/* 完了・削除 */

.task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.task-actions button {
  height: 32px;
  min-height: 32px;

  border: 1px solid #d7d9d8;
  border-radius: 8px;

  background: #fff;
}

.complete-button {
  width: auto;
  min-width: 48px;
  padding: 0 10px;

  font-size: 13px;
}

.delete-button {
  width: 34px;
  padding: 0;

  font-size: 15px;
}

/* スマートフォン */

@media (max-width: 600px) {
  .task-header {
    flex-direction: column;
    gap: 10px;
  }

  .task-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .task-header-actions button {
    padding: 7px 9px;
  }

  .task-card {
    min-height: 74px;
    padding: 11px 12px;
  }

  .task-title {
    font-size: 17px;
  }

  .task-actions {
    gap: 4px;
  }

  .complete-button {
    min-width: 46px;
    padding: 0 8px;
  }

  .delete-button {
    width: 32px;
  }
}

/* =========================
   Completed Tasks
========================= */

.completed-section {
  padding: 4px 16px 20px;
}

.completed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  margin: 12px 0 8px;
}

.completed-header h2 {
  margin: 0;
  font-size: 16px;
  color: #202124;
}

.completed-header a {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  color: #444;
  text-decoration: none;
  font-size: 13px;
}

.completed-header a:hover {
  text-decoration: underline;
}

#completedTaskList {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.completed-task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  min-height: 66px;
  padding: 10px 12px;

  background: #fff;
  border: 1px solid #e2e4e3;
  border-radius: 11px;
}

.completed-task-info {
  flex: 1;
  min-width: 0;
}

.completed-task-title {
  display: flex;
  align-items: center;
  gap: 8px;

  color: #555;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.completed-task-title > span:last-child {
  text-decoration: line-through;
}

.completed-task-meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 9px;

  margin-top: 5px;

  color: #7a7f7c;
  font-size: 12px;
}

.restore-button {
  flex-shrink: 0;

  height: 32px;
  padding: 0 12px;

  border: 1px solid #d7d9d8;
  border-radius: 8px;

  background: #fff;
  color: #333;

  font-size: 13px;
  cursor: pointer;
}

.restore-button:hover {
  background: #f2f3f3;
}

.restore-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.completed-empty {
  margin: 0;
  padding: 18px 12px;

  text-align: center;
  color: #777;
  font-size: 13px;
}

@media (max-width: 480px) {
  .completed-section {
    padding: 4px 12px 18px;
  }

  .completed-task-card {
    min-height: 62px;
    padding: 9px 10px;
  }

  .completed-task-title {
    font-size: 14px;
  }
}

/* =========================
   Task Detail Page
========================= */

.task-detail-header {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 20px 20px;
  box-sizing: border-box;

  background: #e8f1ef;
  border-bottom: 1px solid #d5e2df;
}

.task-detail-header-row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
}

.task-detail-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;
  padding: 0;

  color: #202124;
  font-size: 26px;
  font-weight: 500;
  text-decoration: none;

  background: transparent;
  border: none;
  border-radius: 50%;
}

.task-detail-back:visited {
  color: #202124;
}

.task-detail-back:hover {
  background: rgba(47, 111, 104, 0.08);
  text-decoration: none;
}

.task-detail-heading {
  margin: 0;

  color: #0f2f66;
  font-size: 21px;
  font-weight: 700;
  text-align: center;
}

.task-detail-header-spacer {
  width: 44px;
  height: 44px;
}

.task-detail-subtitle {
  margin: -10px 0 0;

  color: #687a77;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.task-detail-section {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.task-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* タスク／予定 切り替え */

.task-type-option input:focus-visible + span {
  outline: 2px solid #4c8f86;
  outline-offset: 2px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  color: #202124;
  font-size: 16px;
  font-weight: 700;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* タスク名 */

.notification-button {
  width: 64px;
  height: 64px;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #d7d9d8;
  border-radius: 12px;

  background: #fff;
  color: #202124;

  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.notification-button:hover {
  background: #f1f2f2;
}

/* 共通入力 */

.field-control {
  width: 100%;
  height: 56px;
  min-height: 56px;
  padding: 0 16px;

  border: 1px solid #d7d9d8;
  border-radius: 12px;

  background: #fff;
  color: #202124;

  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: normal;
}

select.field-control {
  padding-top: 0;
  padding-bottom: 0;
}

/* 優先度 */

.priority-select {
  font-size: 15px;
  line-height: normal;
}

/* フォーカス */

.field-control:focus {
  outline: 2px solid rgba(80, 130, 255, 0.25);
  outline-offset: 1px;
}

/* スマートフォン */

@media (max-width: 640px) {
  .task-detail-header {
  padding: 16px 16px 10px;
}

  .task-detail-section {
    padding: 20px 16px 40px;
  }

  .task-form {
    gap: 22px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .notification-button {
    width: 48px;
    height: 48px;
    font-size: 21px;
  }
}

.completed-link-area {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding: 0;
  box-sizing: border-box;
}

.completed-link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  color: #666;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.completed-link-button:hover {
  text-decoration: underline;
}

.chat {
  padding: 16px;
  padding-bottom: 110px;
}

/* =========================
   Bottom Sheet
========================= */

.sheet-overlay {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.35);

  z-index: 999;
}

.sheet-modal {
  position: fixed;
  left: 50%;
  top: 50%;

  transform: translate(-50%, -50%);

  width: calc(100% - 32px);
  max-width: 560px;
  max-height: calc(100vh - 120px);

  overflow-y: auto;

  background: #fff;
  border-radius: 20px;

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);

  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 18px;
}

.sheet-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

#closeSheetButton {
  width: 36px;
  height: 36px;

  border: none;
  border-radius: 999px;

  background: #f3f4f4;

  cursor: pointer;

  font-size: 18px;
}

#closeSheetButton:hover {
  background: #e7e8e8;
}

.sheet-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  width: 100%;

  padding: 14px 16px;

  border: 1px solid #e5e7e6;
  border-radius: 12px;

  background: #fff;

  font-size: 15px;

  cursor: pointer;
}

.sheet-item:hover {
  background: #f5f6f6;
}

.sheet-item.is-selected {
  font-weight: 700;
}

.sheet-item.is-selected::after {
  content: "✓";
}

[hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  .sheet-modal {
    width: calc(100% - 24px);
    max-height: calc(100vh - 140px);
    padding: 18px;
    border-radius: 18px;
  }
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-item {
  padding: 16px;

  border: 1px solid #e5e7e6;
  border-radius: 12px;

  background: #fafafa;
}

.settings-title {
  font-size: 15px;
  font-weight: 700;
  color: #202124;
}

.settings-description {
  margin-top: 6px;

  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.task-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.task-add-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  padding: 4px 10px;

  color: #20aaa5;
  background: #ffffff;
  border: 1px solid #dbe6e3;
  border-radius: 8px;

  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.task-progress-text {
  margin: 0;

  color: #12376e;
  font-size: 0.95rem;
  font-weight: 500;
}

.task-progress-text strong {
  font-size: 1rem;
  font-weight: 700;
}

.task-header {
  display: block;
}

.task-header-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;

  width: 100%;
  margin-top: 18px;
}

.task-header-actions button {
  width: auto;
  min-height: 34px;
  padding: 6px 12px;

  color: #66758c;
  background: #ffffff;
  border: 1px solid #dbe6e3;
  border-radius: 999px;

  font-size: 0.78rem;
  font-weight: 500;
}

/* =========================
   Task Date Groups
========================= */

#taskList {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.task-date-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-date-group-title {
  margin: 0;

  color: #202326;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
}

.task-date-group-count {
  color: #202326;
  font-size: 1rem;
  font-weight: 500;
}

.task-date-group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card .priority-icon:empty {
  display: none;
}

.task-card--important .priority-icon {
  color: #e56b67;
  font-size: 0.72rem;
  line-height: 1;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 34px;
  height: 34px;
  padding: 5px;

  background: transparent;
  border: 0;
  border-radius: 8px;

  cursor: pointer;
}

.task-icon-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.task-icon-button:hover {
  background: #f2f7f6;
}

/* ===== Task Create Form ===== */

.task-create-form {
  display: grid;
  gap: 20px;
  padding: 4px 0 12px;
}

.task-create-form .task-form-field {
  display: grid;
  gap: 8px;
}

.task-create-form .task-form-field > span,
.task-important-field > span {
  color: #3f5350;
  font-size: 0.84rem;
  font-weight: 700;
}

.task-create-form input[type="text"],
.task-create-form input[type="date"],
.task-create-form input[type="time"],
.task-create-form select {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;

  color: #253936;
  font: inherit;

  background: #f7faf9;
  border: 1px solid #d8e3e1;
  border-radius: 12px;

  outline: none;
  box-sizing: border-box;
}

.task-create-form input:focus,
.task-create-form select:focus {
  background: #ffffff;
  border-color: #6ca99f;
  box-shadow:
    0 0 0 3px
    rgba(108, 169, 159, 0.14);
}

.task-important-field {
  display: flex;
  align-items: center;
  gap: 10px;

  min-height: 48px;
  padding: 0 14px;

  background: #f7faf9;
  border: 1px solid #d8e3e1;
  border-radius: 12px;

  cursor: pointer;
}

.task-important-field input {
  width: 18px;
  height: 18px;
  margin: 0;

  accent-color: #df6e68;
}

.task-create-error {
  margin: -4px 0 0;
  color: #c85550;
  font-size: 0.84rem;
}

.task-create-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 4px;

  color: #ffffff;
  font: inherit;
  font-weight: 700;

  background: #2FA99D;
  border: 0;
  border-radius: 14px;

  cursor: pointer;
}

.task-create-submit:hover {
  background: #447f77;
}

.task-create-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.task-progress-text {
  display: flex;
  align-items: baseline;
  gap: 10px;

  margin: 0;
  color: #20282a;
  font-size: 1rem;
  font-weight: 400;
}

#taskProgressCount {
  color: #2FA99D;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
}

.task-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  min-height: 40px;
  padding: 0 18px;

  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;

  background: #2FA99D;
  border: 1px solid #2FA99D;
  border-radius: 10px;

  box-shadow:
    0 2px 6px
    rgba(42, 167, 155, 0.18);

  cursor: pointer;
}

.task-add-button > span:first-child {
  font-size: 1.25rem;
  line-height: 1;
}

.task-add-button:hover {
  background: #238f85;
  border-color: #238f85;
}

.task-add-button {
  border-radius: 999px;
}

.task-app {
  padding-top: 0;
}

.task-app .task-header {
  padding: 10px 18px 18px;
}

.task-app .task-header-actions {
  margin-top: 8px;
}

/* ===== Task Date Header ===== */

.task-date-group-header {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.task-date-group-title {
  margin: 0;

  color: #283432;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.4;
}

.task-date-group-count {
  margin: 0;

  color: #98a29f;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

/* ===== Overdue Task Date ===== */

.task-date--overdue {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  color: #e58a45;
  font-weight: 600;
}

.task-date-calendar-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 分類のグレー枠を削除 */

.task-category {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

/* 完了・削除アイコンの枠を完全に削除 */

.task-actions button.task-icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 5px;

  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;

  appearance: none;
  -webkit-appearance: none;
}

.task-actions button.task-icon-button:hover {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* ===== Compact Task Cards ===== */

#taskList .task-card {
  min-height: 0;
  padding: 10px 14px;
}

#taskList .task-title {
  line-height: 1.3;
}

#taskList .task-meta {
  margin-top: 4px;
  line-height: 1.2;
}

.task-date-group-list {
  gap: 0px;
}

.task-actions button.task-icon-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 4px;
}

/* 日付見出しと最初のカードを詰める */

.task-date-group {
  gap: 3px;
}

.task-date-group-header {
  margin-bottom: 0;
}

.task-date-group-list {
  margin-top: 0;
}

/* ===== Task Group Icons ===== */

.task-date-group-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

.task-date-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 23px;
  height: 23px;
  flex: 0 0 23px;

  color: #345653;
}

.task-date-group-icon svg {
  display: block;
  width: 100%;
  height: 100%;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-date-group-icon--overdue {
  color: #e58a45;
}

.task-date-group-icon--today {
  color: #2aa79b;
}

.task-date-group-icon--unscheduled svg {
  fill: currentColor;
  stroke: none;
}

.task-group-icon-dot {
  fill: currentColor;
  stroke: none;
}

.task-date-group-count {
  margin-left: 1px;
}

/* 各期日グループの間隔を狭くする */

#taskList {
  gap: 14px;
}

#taskList .task-date-group {
  margin-top: 0;
  margin-bottom: 0;
}

/* ===== Collapsible Task Groups ===== */

#taskList .task-date-group-toggle {
  display: flex;
  align-items: center;
  gap: 6px;

  width: 100%;
  padding: 0;

  color: inherit;
  font: inherit;
  text-align: left;

  background: transparent;
  border: 0;
  box-shadow: none;

  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.task-date-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 22px;
  height: 22px;
  margin-left: auto;

  color: #71817f;
  transition: transform 0.2s ease;
}

.task-date-group-chevron svg {
  width: 18px;
  height: 18px;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-date-group--collapsed
.task-date-group-chevron {
  transform: rotate(-90deg);
}

.task-date-group-list[hidden] {
  display: none;
}

.task-date-group-toggle:focus-visible {
  outline: 2px solid #2aa79b;
  outline-offset: 4px;
  border-radius: 4px;
}

/* ===== Task Page Fixed Header ===== */

html,
body.tasks-page {
  height: 100%;
}

body.tasks-page {
  display: flex;
  flex-direction: column;

  min-height: 100dvh;
  overflow: hidden;
}

body.tasks-page > .chat-header {
  position: relative;
  flex-shrink: 0;
  z-index: 30;
}

body.tasks-page .task-app {
  display: flex;
  flex: 1;
  flex-direction: column;

  min-height: 0;
  height: auto;
  overflow: hidden;
}

body.tasks-page .task-header {
  position: relative;
  flex-shrink: 0;
  z-index: 20;

  background: #F6F8F6;
}

body.tasks-page .task-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;

  padding-bottom:
    calc(96px + env(safe-area-inset-bottom, 0px));
}

/* ===== Task Notification Toggle ===== */

.task-notification-toggle {
  display: flex;
  align-items: center;
  gap: 14px;

  width: 100%;
  min-height: 72px;
  padding: 0 20px;

  background: #f8fbfa;
  border: 1px solid #cbdedb;
  border-radius: 18px;

  color: #344b49;
  font: inherit;
  font-weight: 700;
  text-align: left;

  cursor: pointer;
  appearance: none;
}

.task-notification-icon {
  flex: 0 0 34px;

  width: 34px;
  height: 34px;

  object-fit: contain;
}

.task-notification-toggle[aria-pressed="true"] {
  background: #eef9f7;
  border-color: #2fa99d;
  color: #237d75;
}

/* ===== Task Create Form Balance ===== */

/* 分類 */
.task-create-form .task-form-field select {
  width: 100%;
  height: 52px;
  min-height: 52px;
  padding: 0 44px 0 16px;

  background: #f8fbfa;
  border: 1px solid #cbdedb;
  border-radius: 18px;

  color: #344b49;
  font: inherit;
  font-size: 16px;

  appearance: auto;
}

/* 通知を小さくする */
.task-create-form .task-notification-toggle {
  height: 60px;
  min-height: 60px;
  padding: 0 16px;
  border-radius: 14px;
}

/* ゴングも少し小さくする */
.task-create-form .task-notification-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
}

/* 重要タスク */
.task-create-form label:has(
  input[name="important"]
) {
  min-height: 60px;
  padding: 0 20px;
  border-radius: 18px;

}

.task-create-form label:has(
  input[name="important"]
) span {
  font-size: 16px;
  font-weight: 700;
}

.notification-button svg {
  width: 26px;
  height: 26px;

  fill: none;
  stroke: #667572;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-button[aria-pressed="true"] svg {
  stroke: #2f6f68;
}

/* スマホで新規タスクフォームが横にはみ出す問題を修正 */
.sheet-modal .sheet-content,
.sheet-modal .task-create-form,
.sheet-modal .task-form-field {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.task-create-form input[type="text"],
.task-create-form input[type="date"],
.task-create-form input[type="time"],
.task-create-form select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Safariの日時入力が横にはみ出す問題を修正 */
.task-create-form input[type="date"],
.task-create-form input[type="time"] {
  -webkit-appearance: none;
  appearance: none;

  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;

  overflow: hidden;
  font-size: 16px;
}