:root {
  --ink: #343044;
  --muted: #777186;
  --line: #e9e3ed;
  --surface: #fffefc;
  --canvas: #fbf8f3;
  --primary: #6255c4;
  --primary-dark: #5043aa;
  --danger: #a73546;
  --focus-ring: #5043aa;
  --priority-high-text: #a73546;
  --priority-medium-text: #725019;
  --priority-low-text: #32694e;
  --primary-shadow: rgba(98, 85, 196, 0.28);
  --shadow: 0 12px 30px rgba(91, 76, 120, 0.1);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(242, 232, 255, 0.46), transparent 26%),
    radial-gradient(circle at 88% 4%, rgba(255, 238, 205, 0.38), transparent 24%),
    var(--canvas);
  color: var(--ink);
  font-family: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="tab"]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.app-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(20px, 4vw, 64px) 26px;
  background: rgba(255, 254, 252, 0.86);
  border-bottom: 1px solid #eee5df;
  backdrop-filter: blur(10px);
}

.add-task-button {
  position: absolute;
  top: 38px;
  right: clamp(20px, 4vw, 64px);
  z-index: 3;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 2px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  color: #6559c5;
  letter-spacing: -0.04em;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.brand-title {
  line-height: 1;
}

.brand-logo {
  display: block;
  width: 250px;
  max-width: 100%;
  height: auto;
}

.app-header .eyebrow {
  display: none;
}

.subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.help-button {
  position: absolute;
  top: 38px;
  right: calc(clamp(20px, 4vw, 64px) + 138px);
  gap: 6px;
}

.help-button span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #eee9ff;
  color: var(--primary-dark);
  font-weight: 900;
}

main {
  padding: 24px clamp(16px, 4vw, 64px) 48px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.productivity-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: -4px 0 16px;
}

.mobile-controls {
  display: none;
}

.quick-add-form {
  display: flex;
  flex: 1 1 330px;
  gap: 8px;
}

.quick-add-form input {
  min-width: 0;
  min-height: 44px;
  flex: 1;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
}

.compact-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.compact-filter select {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.completed-actions {
  display: flex;
  gap: 8px;
}

.search-field {
  display: flex;
  flex: 1 1 300px;
  align-items: center;
  gap: 8px;
  max-width: 480px;
  min-height: 44px;
  padding: 0 13px;
  background: rgba(255, 254, 252, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
}

.search-field:focus-within,
.filter-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 18%, transparent);
}

.search-field input {
  width: 100%;
  border: 0;
  background: transparent;
}

.filter-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  background: rgba(255, 254, 252, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.filter-field select {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.data-actions {
  display: flex;
  gap: 8px;
}

.data-management {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.data-management > summary {
  display: none;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 254, 252, 0.94);
  color: #514b61;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.data-management > summary::-webkit-details-marker {
  display: none;
}

.button,
.icon-button,
.text-button {
  border: 0;
  font-weight: 700;
  transition: 160ms ease;
}

.status-tabs {
  display: none;
}

.button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 13px;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.button-primary {
  background: linear-gradient(135deg, #6759ca, #5043aa);
  color: #fff;
  box-shadow: 0 8px 18px var(--primary-shadow);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  background: rgba(255, 254, 252, 0.94);
  border: 1px solid var(--line);
  color: #445069;
}

.button-secondary:hover {
  border-color: #cec4df;
  background: #faf7ff;
}

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

.board-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 28px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.recovery-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #e8c572;
  border-radius: 12px;
  background: #fff9e9;
  color: #654d14;
}

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

.recovery-panel p {
  margin-top: 3px;
  font-size: 0.8rem;
}

.recovery-mode .board {
  opacity: 0.72;
}

.recovery-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.text-button {
  padding: 2px;
  background: transparent;
  color: var(--primary);
  text-decoration: underline;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 16px;
}

.board-column {
  min-width: 250px;
  min-height: 420px;
  padding: 12px;
  background: color-mix(in srgb, var(--column-color) 10%, #fffdf9);
  border: 1px solid color-mix(in srgb, var(--column-color) 25%, var(--line));
  border-radius: var(--radius);
  transition: 160ms ease;
}

.board-column.drag-over {
  background: color-mix(in srgb, var(--column-color) 17%, #fffdf9);
  border-color: var(--primary);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 5px 15px;
}

.column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.column-dot {
  width: 11px;
  height: 11px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--column-color) 13%, transparent);
  border-radius: 50%;
  background: var(--column-color);
}

.task-count {
  min-width: 25px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
}

.task-list {
  display: grid;
  gap: 10px;
  min-height: 350px;
}

.task-card {
  position: relative;
  overflow: hidden;
  padding: 17px 15px 15px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--status-color) 15%, var(--line));
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(91, 76, 120, 0.06);
  cursor: default;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--status-color) 35%, var(--line));
  box-shadow: 0 12px 26px rgba(91, 76, 120, 0.11);
}

.task-card.dragging {
  opacity: 0.45;
}

.task-card.drop-before {
  box-shadow: 0 -4px 0 var(--primary), 0 4px 14px rgba(91, 76, 120, 0.06);
}

.task-card.just-completed {
  animation: completed-pop 820ms cubic-bezier(0.2, 0.9, 0.35, 1);
}

.task-card.just-completed::after {
  position: absolute;
  inset: -35%;
  background:
    radial-gradient(circle at 22% 36%, rgba(255, 185, 210, 0.72) 0 4%, transparent 18%),
    radial-gradient(circle at 52% 18%, rgba(255, 226, 133, 0.76) 0 5%, transparent 20%),
    radial-gradient(circle at 78% 58%, rgba(157, 222, 255, 0.72) 0 4%, transparent 19%),
    radial-gradient(circle at 48% 52%, rgba(255, 255, 255, 0.9) 0 8%, transparent 36%);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: scale(0.72);
  animation: completed-pastel-glow 760ms ease-out forwards;
}

@keyframes completed-pop {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  38% {
    transform: translateY(-3px) scale(1.012);
    border-color: rgba(255, 185, 210, 0.68);
    box-shadow:
      0 0 0 4px rgba(255, 226, 133, 0.14),
      0 10px 25px rgba(157, 222, 255, 0.2);
  }

  68% {
    transform: translateY(1px) scale(0.998);
  }
}

@keyframes completed-pastel-glow {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }

  38% {
    opacity: 0.82;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

.priority-line {
  position: absolute;
  inset: 0 auto auto 14px;
  width: 30px;
  height: 6px;
  border-radius: 0 0 999px 999px;
  background: var(--status-color);
}

.card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  overflow-wrap: anywhere;
  font-size: 0.96rem;
  line-height: 1.45;
}

.card-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.drag-handle,
.edit-button,
.card-delete-button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.drag-handle {
  cursor: grab;
  font-size: 1rem;
  letter-spacing: -0.08em;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.drag-handle:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.drag-handle:hover,
.edit-button:hover {
  background: var(--canvas);
  color: var(--ink);
}

.card-delete-button {
  width: auto;
  padding: 0 10px;
  background: #fff0f2;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 800;
}

.card-delete-button:hover {
  background: #ffe2e7;
}

.card-memo {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 11px;
}

.tag {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1edff;
  color: #6255ba;
  font-size: 0.66rem;
  font-weight: 800;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px solid #eee8f0;
  color: var(--muted);
  font-size: 0.68rem;
}

.updated-at {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.64rem;
  text-align: right;
}

.due-date {
  font-weight: 700;
}

.due-date.overdue {
  color: var(--danger);
}

.priority-label {
  color: var(--priority-text);
  font-weight: 800;
}

.mobile-status {
  display: none;
  margin-top: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}

.mobile-status-button {
  min-width: 0;
  min-height: 44px;
  padding: 5px 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf8fc;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.mobile-status-button:hover {
  border-color: var(--status-color);
}

.mobile-status-button[aria-pressed="true"] {
  border-color: var(--status-color);
  background: color-mix(in srgb, var(--status-color) 12%, white);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--status-color);
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 110px;
  padding: 20px;
  border: 1px dashed #d5cbe0;
  border-radius: 14px;
  color: #9299a9;
  text-align: center;
}

.empty-state span {
  font-size: 1.25rem;
}

.empty-state p {
  margin-top: 4px;
  font-size: 0.75rem;
}

.task-dialog {
  width: min(660px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(72, 55, 94, 0.22);
}

.task-dialog::backdrop,
.help-dialog::backdrop {
  background: rgba(52, 48, 68, 0.46);
  backdrop-filter: blur(2px);
}

.help-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(72, 55, 94, 0.22);
}

.help-dialog-inner {
  padding: 24px;
}

.help-content {
  display: grid;
  gap: 14px;
  max-height: min(58vh, 560px);
  overflow-y: auto;
  padding-right: 5px;
}

.help-content section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fffdfb;
}

.help-content h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1rem;
}

.help-content ul,
.help-content ol {
  display: grid;
  gap: 6px;
  padding-left: 1.35rem;
  color: #514b61;
  font-size: 0.86rem;
  line-height: 1.65;
}

.help-content code {
  color: var(--primary-dark);
  font-weight: 800;
}

.help-section-text {
  margin-bottom: 12px;
  color: #514b61;
  font-size: 0.86rem;
  line-height: 1.65;
}

.document-links {
  display: grid;
  gap: 10px;
}

.document-link {
  display: grid;
  gap: 3px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid #ded4ee;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff 0%, #faf7ff 100%);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(91, 76, 120, 0.06);
}

.document-link:hover {
  border-color: #c9b9e9;
  background: linear-gradient(135deg, #fffdfb 0%, #f3eeff 100%);
  transform: translateY(-1px);
}

.document-link-title {
  color: var(--primary-dark);
  font-size: 0.92rem;
  font-weight: 800;
}

.document-link-description {
  color: #514b61;
  font-size: 0.8rem;
  line-height: 1.5;
}

.help-notice {
  background: #fff9e9 !important;
  border-color: #eadbb3 !important;
}

.help-notice p {
  margin-top: 10px;
  color: #684d24;
  font-size: 0.84rem;
  line-height: 1.6;
}

.help-dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.confirm-dialog {
  width: min(420px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(72, 55, 94, 0.22);
}

.confirm-dialog::backdrop {
  background: rgba(52, 48, 68, 0.52);
  backdrop-filter: blur(2px);
}

.confirm-dialog > div {
  padding: 24px;
}

.confirm-dialog h2 {
  margin: 4px 0 8px;
  font-size: 1.2rem;
}

.confirm-dialog p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.88rem;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

.task-dialog form {
  padding: 24px;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-timestamps {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.task-timestamps div {
  display: flex;
  gap: 5px;
}

.task-timestamps dt {
  font-weight: 800;
}

.task-timestamps dd {
  margin: 0;
}

.dialog-header {
  justify-content: space-between;
  margin-bottom: 22px;
}

.dialog-header h2 {
  margin-top: 3px;
  font-size: 1.35rem;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--canvas);
  color: var(--muted);
  font-size: 1.4rem;
}

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

.field {
  display: grid;
  gap: 6px;
  color: #4b556b;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.status-field legend {
  margin-bottom: 6px;
  padding: 0;
}

.status-radio-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.status-radio {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid #dce1ea;
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  text-align: center;
  transition: 160ms ease;
}

.status-radio::before {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--status-color);
  content: "";
}

.status-radio:hover {
  border-color: #bfc6d4;
  background: var(--canvas);
}

.status-radio:has(input:checked) {
  border-color: var(--status-color);
  background: color-mix(in srgb, var(--status-color) 11%, white);
  color: var(--ink);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--status-color) 16%, transparent);
}

.status-radio:has(input:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.status-radio input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.field-wide {
  grid-column: 1 / -1;
}

.field strong {
  color: var(--danger);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid #dce1ea;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-weight: 500;
}

.field textarea {
  resize: vertical;
}

.field small {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 500;
}

.dialog-actions {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.action-spacer {
  flex: 1;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(360px, calc(100% - 44px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

.toast-action {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 800;
}

.toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

@media (max-width: 1050px) {
  .toolbar {
    flex-wrap: wrap;
  }

  .search-field {
    max-width: none;
  }

  .data-management {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 148px;
  }

  .app-header {
    align-items: flex-start;
    padding-top: 22px;
  }

  .brand-logo {
    width: min(200px, calc(100vw - 140px));
  }

  .help-button {
    top: 22px;
    right: 16px;
    min-width: 88px;
    padding-inline: 11px;
    font-size: 0.78rem;
  }

  .subtitle {
    display: block;
    max-width: 260px;
    margin-top: 5px;
    font-size: 0.72rem;
    line-height: 1.5;
  }

  .add-task-button {
    position: fixed;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    top: auto;
    z-index: 8;
    min-width: 142px;
    border-radius: 999px;
    box-shadow: 0 10px 28px var(--primary-shadow);
  }

  main {
    padding-top: 16px;
  }

  .toolbar {
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
  }

  .productivity-toolbar {
    display: none;
  }

  .mobile-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.58fr);
    gap: 8px;
    margin-bottom: 10px;
  }

  .mobile-control-menu {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
  }

  .mobile-control-menu[open] {
    grid-column: 1 / -1;
  }

  .mobile-control-menu > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 10px;
    color: #514b61;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
  }

  .mobile-control-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-control-menu > summary::after {
    content: "＋";
    margin-left: auto;
    color: var(--muted);
    font-size: 0.92rem;
  }

  .mobile-control-menu[open] > summary::after {
    content: "−";
  }

  .mobile-filter-count {
    min-width: 32px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.66rem;
    text-align: center;
    white-space: nowrap;
  }

  .mobile-control-content {
    display: grid;
    gap: 8px;
    padding: 0 8px 8px;
  }

  .mobile-control-content .filter-field,
  .mobile-control-content .compact-filter,
  .mobile-control-content .button {
    width: 100%;
  }

  .mobile-control-content .compact-filter {
    justify-content: space-between;
    min-width: 0;
    padding-inline: 9px;
  }

  .mobile-control-content .compact-filter select {
    min-width: 0;
    flex: 1;
    text-align: right;
  }

  .mobile-control-content .button {
    padding-inline: 8px;
  }

  .mobile-reset-settings {
    border-style: dashed;
  }

  .board-summary.is-redundant {
    display: none;
  }

  .search-field {
    flex: 1 1 100%;
    max-width: none;
  }

  .mobile-control-content .filter-field select {
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .data-management {
    display: block;
    flex: 1 1 100%;
    width: 100%;
    border: 0;
    background: transparent;
  }

  .data-management > summary {
    display: none;
  }

  .data-management > summary::-webkit-details-marker {
    display: none;
  }

  .data-management > summary::after {
    content: "＋";
    font-size: 1rem;
  }

  .data-management[open] > summary::after {
    content: "−";
  }

  .data-actions {
    display: grid;
    gap: 6px;
    padding: 0;
  }

  .data-actions .button {
    width: 100%;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .status-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 16px;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
    margin: 0 -16px 14px;
    padding: 8px 16px 11px;
    background: rgba(247, 248, 251, 0.96);
    border-bottom: 1px solid var(--line);
    scrollbar-color: color-mix(in srgb, var(--primary) 42%, transparent) transparent;
    scrollbar-width: thin;
  }

  .status-tabs::-webkit-scrollbar {
    height: 4px;
  }

  .status-tabs::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 42%, transparent);
  }

  .status-tab {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-weight: 800;
    scroll-snap-align: center;
  }

  .status-tab:focus,
  .status-tab.keyboard-focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
  }

  .status-tab[aria-selected="true"] {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 5px 14px color-mix(in srgb, var(--primary) 28%, transparent);
  }

  .status-tab-count {
    min-width: 20px;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(104, 113, 134, 0.12);
    font-size: 0.7rem;
    text-align: center;
  }

  .status-tab[aria-selected="true"] .status-tab-count {
    background: rgba(255, 255, 255, 0.2);
  }

  .board {
    grid-template-columns: 1fr;
    gap: 0;
    overflow: visible;
    padding-bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .mobile-task-list {
    gap: 9px;
    min-height: 90px;
  }

  .task-card {
    padding: 12px 13px;
    cursor: default;
  }

  .card-title {
    font-size: 0.9rem;
  }

  .card-memo {
    font-size: 0.74rem;
    -webkit-line-clamp: 2;
  }

  .card-footer {
    margin-top: 10px;
    padding-top: 8px;
  }

  .updated-at {
    display: none;
  }

  .drag-handle {
    display: none;
  }

  .edit-button {
    width: 44px;
    height: 44px;
  }

  .card-delete-button {
    min-height: 44px;
  }

  .mobile-status {
    display: grid;
  }

  .toast {
    right: 16px;
    bottom: 78px;
    left: 16px;
    max-width: none;
    text-align: center;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .status-radio-group {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .status-radio {
    min-width: 0;
    padding-inline: 4px;
    font-size: 0.84rem;
  }

  .status-radio::before {
    display: none;
  }

  .field-wide {
    grid-column: auto;
  }

  .task-dialog form {
    padding: 20px 16px;
  }

  .help-dialog {
    max-height: calc(100vh - 24px);
  }

  .help-dialog-inner {
    padding: 20px 16px 16px;
  }

  .help-content {
    max-height: calc(100vh - 210px);
  }

  .help-content section {
    padding: 13px;
  }

  .help-dialog-actions .button {
    width: 100%;
  }

  .task-dialog .field input,
  .task-dialog .field select,
  .task-dialog .field textarea {
    min-height: 44px;
    font-size: 1rem;
  }

  .dialog-actions {
    flex-wrap: wrap;
  }

  .dialog-actions .button:not(.button-danger) {
    flex: 1;
  }

  .recovery-panel,
  .recovery-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .task-card.just-completed,
  .task-card.just-completed::after {
    animation: none;
  }
}
