:root {
  --bg: #000000;
  --surface: #ffffff;
  --border: #dfe1e6;
  --text: #172b4d;
  --muted: #5e6c84;
  --accent: #0052cc;
  --accent-hover: #0747a6;
  --danger: #de350b;
  --column-bg: #ebecf0;
  --shadow: 0 1px 2px rgba(9, 30, 66, 0.15);
  --radius: 8px;
  --font: "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
}

.subtitle {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav__link {
  text-decoration: none;
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.nav__link:hover {
  background: #f4f5f7;
  color: var(--text);
}

.nav__link--active {
  background: #deebff;
  color: #0747a6;
  font-weight: 600;
}

.topbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn:hover {
  background: #f7f8f9;
}

.btn--sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  align-self: flex-end;
}

.btn--ghost:hover {
  background: #deebff;
  border-color: transparent;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--danger {
  color: var(--danger);
  border-color: #ffbdad;
}

.btn--danger-fill {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn--danger-fill:hover {
  background: #de350b;
  border-color: #de350b;
}

.btn--warning {
  color: #974f0c;
  border-color: #ffe380;
  background: #fffae6;
}

.btn--warning:hover {
  background: #fff0b3;
}

.page {
  padding: 1rem 1.25rem 2rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.panel__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.panel__count {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel__hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.panel__subhead {
  margin: 1.25rem 0 0.5rem;
  font-size: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.form-grid__full {
  grid-column: 1 / -1;
}

.dept-color {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 0.35rem;
  border: 1px solid var(--border);
}

.dept-color--blue { background: #3b82f6; }
.dept-color--green { background: #22c55e; }
.dept-color--yellow { background: #eab308; }
.dept-color--orange { background: #f97316; }
.dept-color--red { background: #ef4444; }
.dept-color--purple { background: #a855f7; }
.dept-color--sky { background: #0ea5e9; }
.dept-color--black { background: #1f2937; }

.filter {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.filter-hint {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  color: #974f0c;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: var(--radius);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.6rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  font-size: 0.8rem;
  color: var(--muted);
  background: #fafbfc;
}

.data-table tbody tr:hover {
  background: #f7f9fc;
}

.data-table .actions {
  white-space: nowrap;
  display: flex;
  gap: 0.35rem;
}

.row--inactive {
  opacity: 0.65;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.empty {
  margin: 1rem 0 0;
  color: var(--muted);
  text-align: center;
}

.error {
  color: var(--danger);
}

.badge {
  background: #deebff;
  color: #0747a6;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.badge--due {
  background: #fff0b3;
  color: #7a5c00;
}

.badge--due-soon {
  background: #fffae6;
  color: #974f0c;
  border: 1px solid #f2d600;
}

.badge--due-overdue {
  background: #ffebe6;
  color: #ae2e24;
  border: 1px solid #eb5a46;
}

.badge--stage {
  background: #e3fcef;
  color: #006644;
}

.badge--muted {
  background: #ebecf0;
  color: var(--muted);
}

/* 案件ボード画面: ボードエリアだけ横スクロール */
body.page-board {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.page-board .topbar,
body.page-board .property-banner {
  flex-shrink: 0;
}

.board-scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
}

.board-scroll.is-panning {
  cursor: grabbing;
  user-select: none;
}

.board-scroll.is-panning .column__header {
  cursor: grabbing;
}

.board-scroll--phased {
  overflow-x: hidden;
  overflow-y: auto;
}

.board.board--phased {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 100%;
  flex: 0 0 auto;
  padding: 1rem;
  box-sizing: border-box;
  align-items: stretch;
}

.board-phase {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem 0.75rem;
}

.board-phase__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  padding: 0 0.15rem;
}

.board-phase__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.board-phase__meta {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.board-phase__scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.board-phase__columns {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  width: max-content;
  min-width: 100%;
  padding-bottom: 0.25rem;
}

.board--phased .column {
  height: 380px;
  max-height: 380px;
}

.board--phased .column--add {
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  height: auto;
  max-height: none;
  margin-top: 0.25rem;
}

.board {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem 1rem;
  align-items: stretch;
  width: max-content;
  min-width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  flex: 1;
}

.column--done {
  background: #f4f5f7;
  border-color: #dfe1e6;
  opacity: 0.95;
}

.column--done .column__title-text,
.column--done .column__hint,
.column--done .column__deadline,
.column--done .column__count {
  color: #97a0af;
}

.column--done .column-add-task {
  color: #97a0af;
}

.column--active {
  box-shadow: 0 0 0 2px #0052cc;
}

.column__done-badge {
  margin-left: 0.25rem;
  font-size: 0.65rem;
  vertical-align: middle;
}

.column--locked {
  background: #f4f5f7;
  border-color: #dfe1e6;
  position: relative;
}

.column--locked .column__cards {
  opacity: 0.55;
  filter: grayscale(0.3);
}

.column--locked .column__title-text,
.column--locked .column__count,
.column--locked .column__hint {
  color: #97a0af;
}

.column--locked .column-add-task {
  color: #97a0af;
}

.column__lock-badge {
  margin-left: 0.25rem;
  font-size: 0.65rem;
  vertical-align: middle;
}

.column__lock-hint {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: #97a0af;
}

.property-banner--done {
  background: #f4f5f7;
  border-color: #dfe1e6;
}

.property-banner--done .property-banner__title,
.property-banner--done .property-banner__meta {
  color: #97a0af;
}

.column {
  flex: 0 0 280px;
  width: 280px;
  background: var(--column-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem;
  /* 親(.board)の高さに合わせる。100vh固定だと物件バナー分で下端が切れる */
  height: auto;
  max-height: 100%;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.column__header {
  padding: 0.35rem 0.4rem 0.6rem;
  cursor: grab;
  flex-shrink: 0;
}

.column__title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

.column__edit {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.column__edit:hover {
  background: rgba(9, 30, 66, 0.08);
  color: var(--text);
}

.column--add {
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: flex-start;
  align-self: flex-start;
  height: auto;
  max-height: none;
  padding-top: 0.35rem;
}

.column-add-btn {
  width: 100%;
  min-height: 44px;
  border: 2px dashed var(--border);
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.column-add-btn:hover {
  background: var(--surface);
  border-color: #b3d4ff;
  color: var(--accent);
}

.card__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}

.dialog--detail {
  width: min(720px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}

.detail {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.1rem 1.25rem 1rem;
  gap: 0.85rem;
}

.detail__header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.detail__title {
  flex: 1;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  background: transparent;
}

.detail__title:focus {
  outline: 2px solid #b3d4ff;
  background: #fafbfc;
}

.detail__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0.1rem 0.35rem;
}

.detail__updated {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.detail__section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.detail__label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.detail__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.detail__full {
  grid-column: 1 / -1;
}

.detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.detail__comments {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 220px;
  overflow-y: auto;
}

.detail__empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.detail__comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.detail__footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.comment {
  background: #f7f8f9;
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
}

.comment__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.comment__body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.label-chip {
  border: none;
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  font-size: 0.78rem;
  cursor: pointer;
  opacity: 0.45;
  color: #fff;
}

.label-chip.is-on {
  opacity: 1;
}

.label-chip--mini {
  cursor: default;
  padding: 0.1rem 0.35rem;
  font-size: 0.72rem;
}

.label-chip--green { background: #61bd4f; }
.label-chip--yellow { background: #f2d600; color: #3d3800; }
.label-chip--orange { background: #ff9f1a; }
.label-chip--red { background: #eb5a46; }
.label-chip--purple { background: #c377e0; }
.label-chip--blue { background: #0079bf; }
.label-chip--sky { background: #00c2e0; color: #003840; }
.label-chip--lime { background: #51e898; color: #094a2a; }
.label-chip--pink { background: #ff78cb; color: #5a0036; }
.label-chip--black { background: #344563; }

.tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0 1.25rem;
  margin-bottom: 0.75rem;
}

.tabs__btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.tabs__btn--active {
  background: #deebff;
  border-color: #b3d4ff;
  color: #0747a6;
  font-weight: 600;
}

.column__header:active {
  cursor: grabbing;
}

.column__title {
  margin: 0;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.column__count {
  background: rgba(9, 30, 66, 0.08);
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  color: var(--muted);
}

.column__hint {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.column__cards {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  scrollbar-gutter: stable;
}

.column__footer {
  flex-shrink: 0;
  padding-top: 0.35rem;
  background: var(--column-bg);
}

.column-add-task {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  text-align: left;
  padding: 0.35rem 0.4rem;
  border-radius: 4px;
}

.column-add-task:hover {
  background: rgba(9, 30, 66, 0.06);
  color: var(--text);
}

.column-quick-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.column-quick-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
}

.column-quick-actions {
  display: flex;
  gap: 0.35rem;
}

.card {
  background: var(--surface);
  border-radius: 6px;
  padding: 0.65rem 0.7rem;
  box-shadow: var(--shadow);
  cursor: grab;
  border: 1px solid transparent;
}

.card:hover {
  border-color: #b3d4ff;
}

.card--due-soon {
  background: #fffae6;
  border-color: #f2d600;
  box-shadow: 0 0 0 1px #f2d600 inset;
}

.card--due-overdue {
  background: #ffebe6;
  border-color: #eb5a46;
  box-shadow: 0 0 0 1px #eb5a46 inset;
}

.card:active {
  cursor: grabbing;
}

.card__title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.card__memo {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__address {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.link-maps {
  color: var(--accent);
  text-decoration: none;
}

.link-maps:hover {
  text-decoration: underline;
}

.sortable-ghost {
  opacity: 0.45;
}

.dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: min(480px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  box-shadow: 0 8px 24px rgba(9, 30, 66, 0.25);
}

.dialog::backdrop {
  background: rgba(9, 30, 66, 0.45);
}

.dialog form {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.dialog h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.dialog__hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.req {
  color: var(--danger);
}

input,
select,
textarea {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
}

textarea {
  resize: vertical;
}

.dialog__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.dialog__actions--property {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.dialog__actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dialog__actions-group .btn {
  white-space: nowrap;
}

.dialog__actions-group--secondary .btn--warning {
  min-width: 8.5rem;
}

.spacer {
  flex: 1;
}

.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: #172b4d;
  color: #fff;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  z-index: 20;
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .column {
    flex: 0 0 260px;
    width: 260px;
  }

  .detail__grid {
    grid-template-columns: 1fr;
  }

  .panel__count {
    margin-left: 0;
  }
}

/* Board selector */
.board-select {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.board-select select {
  min-width: 10rem;
}

/* Column drag handle */
.column__drag {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: grab;
  padding: 0.15rem 0.25rem;
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 4px;
}

.column__drag:hover {
  background: rgba(9, 30, 66, 0.08);
}

.column.sortable-ghost {
  opacity: 0.5;
}

/* Card cover on kanban */
.card__cover {
  height: 2rem;
  border-radius: 4px 4px 0 0;
  margin: -0.55rem -0.55rem 0.4rem;
  background-size: cover;
  background-position: center;
}

.card__cover--image {
  height: 4rem;
}

.card__cover--green { background: #61bd4f; }
.card__cover--yellow { background: #f2d600; }
.card__cover--orange { background: #ff9f1a; }
.card__cover--red { background: #eb5a46; }
.card__cover--purple { background: #c377e0; }
.card__cover--blue { background: #0079bf; }
.card__cover--sky { background: #00c2e0; }
.card__cover--black { background: #344563; }

/* Card detail cover */
.detail__cover {
  height: 6rem;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  margin-bottom: 0.5rem;
}

.detail__cover--green { background-color: #61bd4f; }
.detail__cover--yellow { background-color: #f2d600; }
.detail__cover--orange { background-color: #ff9f1a; }
.detail__cover--red { background-color: #eb5a46; }
.detail__cover--purple { background-color: #c377e0; }
.detail__cover--blue { background-color: #0079bf; }
.detail__cover--sky { background-color: #00c2e0; }
.detail__cover--black { background-color: #344563; }

.cover-swatch {
  width: 2rem;
  height: 1.5rem;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}

.cover-swatch.is-on {
  border-color: #172b4d;
  box-shadow: 0 0 0 2px #fff inset;
}

.cover-swatch--green { background: #61bd4f; }
.cover-swatch--yellow { background: #f2d600; }
.cover-swatch--orange { background: #ff9f1a; }
.cover-swatch--red { background: #eb5a46; }
.cover-swatch--purple { background: #c377e0; }
.cover-swatch--blue { background: #0079bf; }
.cover-swatch--sky { background: #00c2e0; }
.cover-swatch--black { background: #344563; }

.detail__cover-actions {
  margin-top: 0.35rem;
}

.detail__inline-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.detail__inline-form input {
  flex: 1;
}

.detail__upload input[type="file"] {
  margin-top: 0.35rem;
  font-size: 0.8rem;
}

/* Checklists */
.checklist {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem;
  margin-bottom: 0.5rem;
}

.checklist__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.checklist__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist__items li {
  margin: 0.25rem 0;
}

.checklist__items label {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

/* Attachments */
.attachment-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.attachment-row a {
  flex: 1;
  color: var(--primary);
}

/* Property banner on kanban */
.property-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  background: #f4f5f7;
  border-bottom: 1px solid var(--border);
}

.property-banner__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.property-banner__meta {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.property-banner__active {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: #fff;
  border: 1px solid #b3d4ff;
  border-radius: 6px;
  border-left: 4px solid #0052cc;
}

.property-banner__active-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0052cc;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.property-banner__active-title {
  font-size: 0.95rem;
  color: #172b4d;
}

.property-banner__active-meta {
  flex: 1 1 100%;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.property-banner--done .property-banner__active {
  border-color: #dfe1e6;
  border-left-color: #36b37e;
  background: #f4f5f7;
}

.property-banner--done .property-banner__active-label {
  color: #36b37e;
}

.property-banner--archived {
  background: #fffae6;
  border-bottom-color: #ffe380;
}

.property-banner--archived .property-banner__title::after {
  content: "（アーカイブ・参照のみ）";
  margin-left: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #974f0c;
}

.dialog__hint--sm {
  font-size: 0.8rem;
  margin: -0.15rem 0 0.5rem;
  color: var(--muted);
}

.template-col {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
}

.template-col h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.template-col ul {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
}

.badge--assignee {
  background: #e3fcef;
  color: #006644;
}

/* My tasks */
.my-tasks-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.summary-chip {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  background: #ebecf0;
  color: var(--text);
}

.summary-chip--overdue {
  background: #ffebe6;
  color: #ae2e24;
  border: 1px solid #eb5a46;
}

.summary-chip--soon {
  background: #fffae6;
  color: #974f0c;
  border: 1px solid #f2d600;
}

.summary-chip--urgent {
  background: #ffebe6;
  color: #ae2e24;
}

.data-table tr.row--due-soon td {
  background: #fffae6;
}

.data-table tr.row--due-overdue td {
  background: #ffebe6;
}

.data-table tr.row--done td {
  color: #97a0af;
  background: #f4f5f7;
}

.data-table tr.row--done strong {
  color: #97a0af;
  font-weight: 500;
}

.data-table tr.row--archived td {
  background: #fafbfc;
}

.property-banner__aside {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.switch-field--banner {
  padding: 0.35rem 0.55rem;
  margin: 0;
  max-width: 11rem;
}

.switch-field--banner .switch-field__text strong {
  font-size: 0.8rem;
}

.switch-field--banner .switch-field__text small {
  font-size: 0.68rem;
}

.property-banner__notes {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text);
}

.property-banner__notes ul {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
}

.badge--status {
  background: #deebff;
  color: #0747a6;
}

.badge--checklist {
  background: #e3fcef;
  color: #006644;
}

.badge--task {
  background: #deebff;
  color: #0747a6;
}

.badge--done {
  background: #e3fcef;
  color: #006644;
}

.badge--confirmed {
  background: #fff0b3;
  color: #974f0c;
}

.badge--deviation {
  background: #ffebe6;
  color: #ae2e24;
}

.badge--locked {
  background: #ebecf0;
  color: #626f86;
}

.switch-field {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: #f4f5f7;
  border: 1px solid #dfe1e6;
  border-radius: 6px;
  cursor: pointer;
}

.switch-field input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}

.switch-field__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.switch-field__text small {
  color: #626f86;
  font-size: 0.75rem;
  line-height: 1.35;
}

.badge--decided {
  background: #ffebe6;
  color: #ae2e24;
}

.column__deadline {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0747a6;
}

.card--deviation {
  border-left: 3px solid #eb5a46;
  background: #fff8f6;
}

.card--done {
  background: #f4f5f7;
  border-color: #dfe1e6;
  box-shadow: none;
  cursor: grab;
}

.card--done:hover {
  border-color: #c1c7d0;
}

.card--done .card__title,
.card--done .card__memo {
  color: #97a0af;
  font-weight: 500;
  text-decoration: none;
}

.card--done .card__meta {
  color: #97a0af;
}

.card--done .card__meta .badge:not(.badge--done-pill) {
  background: #ebecf0;
  color: #97a0af;
  border-color: transparent;
}

.card--done .label-chip {
  opacity: 0.45;
}

.badge--done-pill {
  background: #36b37e;
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.task-status-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.status-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.status-btn.is-on {
  background: #0052cc;
  color: #fff;
  border-color: #0052cc;
}

.detail__status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
}

.detail__checker {
  margin-top: 0.5rem;
}

.detail__material-select {
  display: block;
  margin: 0.35rem 0;
  max-width: 12rem;
}

.detail__checkbox {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

/* ===== ダッシュボード（12指標） ===== */
body.page-dashboard {
  background: #eef1f5;
}

.page--dashboard {
  max-width: 1400px;
}

.bj-searchbar {
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.bj-searchbar__lbl {
  font-size: 13px;
  color: #667;
}

.bj-searchbar__select {
  flex: 1;
  max-width: 320px;
  padding: 7px 10px;
  border: 1px solid #cdd6e0;
  border-radius: 6px;
  font-size: 14px;
}

.bj-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 1400px) {
  .bj-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1000px) {
  .bj-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bj-card-link {
  display: block;
  text-decoration: none;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
}

.bj-card {
  --bj-bar: #4a90d9;
  --bj-accent-dark: #23415f;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  border: 2px solid transparent;
  transition: box-shadow 0.15s, border-color 0.15s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.bj-card-link:hover .bj-card {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.bj-card.selected {
  border-color: #2b5b8c;
}

.bj-card__head {
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  padding: 9px 14px;
}

.bj-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}

.bj-card__icon {
  font-size: 34px;
  line-height: 1;
}

.bj-card__num {
  font-size: 34px;
  font-weight: bold;
  color: #222;
}

.bj-card__desc {
  font-size: 12px;
  color: #556;
  padding: 0 14px 14px;
  line-height: 1.5;
  margin-top: auto;
}

.bj-card.tone-neutral .bj-card__head {
  background: var(--bj-bar);
}

.bj-card.tone-warn .bj-card__head,
.bj-card.tone-danger .bj-card__head {
  background: var(--bj-accent-dark);
}

.bj-card.tone-warn {
  background: linear-gradient(180deg, #fdf1c4 0%, #ffffff 55%);
}

.bj-card.tone-warn .bj-card__num {
  color: #d98a00;
}

.bj-card.tone-danger {
  background: linear-gradient(180deg, #fbdcdc 0%, #ffffff 55%);
}

.bj-card.tone-danger .bj-card__num {
  color: #d9534f;
}

.bj-card.zero {
  background: linear-gradient(180deg, #e9ecef 0%, #ffffff 60%);
}

.bj-card.zero .bj-card__num {
  color: #aab2bd;
}

.bj-filter-note {
  background: #eef4ff;
  border-radius: 8px;
  padding: 8px 14px;
  margin: 0 0 12px;
  font-size: 13.5px;
}

.bj-clear-filter {
  border: none;
  background: transparent;
  color: #2b5b8c;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}

.bj-section-title {
  font-size: 16px;
  margin: 20px 0 10px;
  font-weight: 700;
}

.bj-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.bj-table th,
.bj-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f5;
  font-size: 13.5px;
}

.bj-table th {
  background: #e9eff6;
  color: #445;
  font-weight: 600;
}

.bj-table tr:hover td {
  background: #fafcff;
}

.bj-link {
  color: #2b5b8c;
  text-decoration: none;
  font-weight: 600;
}

.bj-link:hover {
  text-decoration: underline;
}

.bj-muted {
  color: #889;
  font-size: 13px;
}

.bj-pct-bar {
  background: #e6ebf1;
  border-radius: 6px;
  height: 8px;
  width: 90px;
  display: inline-block;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}

.bj-pct-fill {
  background: #2b7a3b;
  height: 100%;
  display: block;
}

.btn--approve {
  background: #ffb300;
  color: #222;
  font-weight: 700;
  border: none;
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  background: #fff3cd;
  border-bottom: 1px solid #ffecb5;
  color: #664d03;
  font-size: 0.85rem;
  flex-shrink: 0;
}



/* --- 画面が小さいときにボードが丸ごと消える問題（2026-08-01 修正） ---
   body.page-board は height:100dvh + overflow:hidden、.board-scroll は flex:1 / min-height:0。
   そのため画面が狭い・低いと、ヘッダーと物件バナーだけで高さを使い切り、
   .board-scroll が 0px に潰れて **タスクが1件も表示されない**。
   body が overflow:hidden なのでスクロールして探すこともできず、
   エラーも出ないため「アプリが壊れた」ようにしか見えない。
   スマホ実機サイズ 375x812 で再現（ヘッダー239px + バナー579px = 818px > 812px）。

   小さい画面のときだけページ全体を縦スクロールさせ、ボードに最低限の高さを与える。
   デスクトップ（幅901px以上かつ高さ621px以上）の見え方は一切変わらない。 */
@media (max-width: 900px), (max-height: 620px) {
  body.page-board {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
  }

  .board-scroll {
    min-height: 60vh;
  }

  /* バナーの「次：…」が長文だと画面を埋め尽くすため、小さい画面では3行で打ち切る */
  .property-banner__active-meta {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }
}

/* ダイアログの入力欄に添える補足文 */
.field-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.5;
}

/* 承認の記録（誰が・いつ通したか）。承認は取り消せないので目立たせる */
.column__approved {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #216e4e;
}

.approve-warn {
  margin: 0.5rem 0;
  padding: 0.5rem 0.7rem;
  background: #fff7e6;
  border: 1px solid #f5c26b;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #664d03;
  line-height: 1.6;
}

/* 承認者（複数可）のチェックボックス一覧 */
.approvers-field {
  margin: 0 0 0.85rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.approvers-field legend {
  padding: 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.approvers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  max-height: 9rem;
  overflow-y: auto;
}

.approvers-list label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
}

.approvers-list input[type="checkbox"] {
  margin: 0;
}

.column__approver-tag {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* 「不要」＝この案件では対象外のタスク */
.card--skipped {
  opacity: 0.55;
}

.card--skipped .card__title {
  text-decoration: line-through;
  text-decoration-color: #97a0af;
}

.badge--skip {
  background: #dfe1e6;
  color: #5e6c84;
  font-weight: 600;
}
