body {
  margin: 0;
  min-height: 100vh;
}

a {
  text-decoration: none;
}

.os-page {
  width: min(100%, 1240px);
  margin-inline: auto;
  padding: 18px clamp(12px, 2vw, 24px) 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.os-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 96px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 26px;
  background: var(--sll-admin-card);
  box-shadow: var(--sll-admin-shadow);
  backdrop-filter: blur(18px);
}

.os-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.os-mark {
  width: 190px;
  height: 64px;
  min-width: 190px;
  border-radius: 0;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 0;
  font-weight: 900;
  letter-spacing: 0;
  background: transparent;
  box-shadow: none;
}

.os-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.os-eyebrow {
  color: var(--sll-admin-primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.os-title {
  margin: 3px 0 0;
  color: var(--sll-admin-text);
  font-size: clamp(20px, 1.8vw, 27px);
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: 0;
}

.os-subtitle {
  margin: 7px 0 0;
  max-width: 840px;
  color: var(--sll-admin-muted);
  font-size: 12px;
  line-height: 1.7;
}

.os-user {
  min-width: 220px;
  max-width: 360px;
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--sll-admin-muted);
  font-size: 12px;
}

.os-user strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--sll-admin-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.os-quick-nav {
  border: 1px solid var(--sll-admin-line);
  border-radius: var(--sll-admin-radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--sll-admin-shadow);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.os-quick-nav-label {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  color: var(--sll-admin-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-inline: 4px;
}

.os-btn,
.os-chip,
.os-status-btn {
  min-height: 34px;
  border: 1px solid var(--sll-admin-line);
  border-radius: 999px;
  background: #fff;
  color: var(--sll-admin-text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  box-shadow: 0 8px 18px rgba(138, 151, 205, 0.1);
}

.os-btn.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--sll-admin-primary), var(--sll-admin-accent));
}

.os-btn.danger {
  border-color: #ffd0dc;
  color: #c7214d;
  background: #fff0f4;
}

.os-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 10px;
  color: var(--sll-admin-primary);
  background: #f8f5ff;
  box-shadow: none;
}

.os-message {
  display: none;
  padding: 11px 13px;
  border: 1px solid #d9e3ff;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--sll-admin-muted);
  font-size: 12px;
  font-weight: 700;
}

.os-message.visible {
  display: block;
}

.os-message.danger {
  border-color: #ffc4ce;
  background: #fff0f3;
  color: #d63855;
}

.os-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.os-stat {
  min-height: 104px;
  padding: 15px 16px;
  border: 1px solid var(--sll-admin-line);
  border-radius: var(--sll-admin-radius);
  background: var(--sll-admin-card);
  box-shadow: var(--sll-admin-shadow);
}

.os-stat-label {
  color: var(--sll-admin-muted);
  font-size: 11px;
  font-weight: 800;
}

.os-stat-value {
  margin-top: 7px;
  color: var(--sll-admin-text);
  font-size: 25px;
  line-height: 1.2;
  font-weight: 950;
}

.os-stat-note {
  margin-top: 5px;
  color: var(--sll-admin-muted);
  font-size: 11px;
  line-height: 1.45;
}

.os-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.38fr);
  gap: 14px;
  align-items: start;
}

.os-panel {
  border: 1px solid var(--sll-admin-line);
  border-radius: var(--sll-admin-radius);
  background: var(--sll-admin-card);
  box-shadow: var(--sll-admin-shadow);
  overflow: hidden;
}

/* 右サイド(#osAction)の出勤中パネル＋クイック作成パネルは、隙間を空けると影が溜まって
   グレー帯（背景ズレ）に、密着させると角丸の重なりで白がはみ出す。どちらも避けるため
   「1枚のカード内を区切り線で分割」する見せ方に統一：継ぎ目の角は直角・密着、間は1本の境界線。 */
#osAction > .os-panel:not(:last-child) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
#osAction > .os-panel:not(:last-child) + .os-panel {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 0;
  margin-top: 0;
}

.os-menu-category-panel {
  display: block;
}

.os-menu-category-summary,
.os-menu-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.os-menu-category-summary::-webkit-details-marker,
.os-menu-section-summary::-webkit-details-marker {
  display: none;
}

.os-menu-category-summary {
  min-height: 58px;
  padding: 16px 18px;
  color: var(--sll-admin-text);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 950;
}

.os-menu-category-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.os-menu-category-title::before,
.os-menu-section-summary::before {
  content: "+";
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--sll-admin-primary);
  background: rgba(156, 120, 255, 0.12);
  font-size: 13px;
  font-weight: 950;
}

.os-menu-category-panel[open] > .os-menu-category-summary .os-menu-category-title::before,
.os-menu-section[open] > .os-menu-section-summary::before {
  content: "-";
}

.os-menu-section-stack {
  padding-top: 0;
}

.os-menu-section {
  border: 1px solid rgba(227, 231, 247, 0.92);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
}

.os-menu-section-summary {
  min-height: 46px;
  padding: 11px 12px;
  color: var(--sll-admin-text);
  font-size: 13px;
  font-weight: 950;
}

.os-menu-section-count {
  min-width: 24px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(156, 120, 255, 0.2);
  border-radius: 999px;
  color: var(--sll-admin-primary);
  background: #f7f4ff;
  font-size: 11px;
  font-weight: 950;
}

.os-menu-section .os-card-grid {
  padding: 0 12px 12px;
}

.os-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 8px;
}

.os-panel-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 900;
}

.os-panel-desc {
  margin: 5px 0 0;
  color: var(--sll-admin-muted);
  font-size: 12px;
  line-height: 1.6;
}

.os-panel-body {
  padding: 12px 18px 18px;
  display: grid;
  gap: 12px;
}

.os-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.os-module-card,
.os-task-card,
.os-alert-card,
.os-list-row {
  border: 1px solid var(--sll-admin-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 13px;
}

.os-module-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.os-module-top,
.os-task-top,
.os-list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.os-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--sll-admin-primary), var(--sll-admin-blue));
}

.os-icon svg {
  width: 20px;
  height: 20px;
}

.os-module-title,
.os-task-title,
.os-list-title {
  margin: 0;
  color: var(--sll-admin-text);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 900;
}

.os-module-desc,
.os-task-meta,
.os-list-meta,
.os-empty {
  color: var(--sll-admin-muted);
  font-size: 12px;
  line-height: 1.6;
}

.os-module-open {
  margin-top: auto;
  color: var(--sll-admin-primary);
  font-size: 12px;
  font-weight: 900;
}

.os-task-list {
  display: grid;
  gap: 10px;
}

.os-task-card {
  display: grid;
  gap: 9px;
}

.os-task-card.compact {
  padding: 11px;
}

.os-task-badges,
.os-task-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.os-task-desc {
  max-height: 92px;
  overflow: hidden;
  color: var(--sll-admin-muted);
  font-size: 12px;
  line-height: 1.65;
}

.os-task-foot {
  color: var(--sll-admin-muted);
  font-size: 11px;
  font-weight: 800;
}

.os-tag {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #dce6f8;
  border-radius: 999px;
  background: #f7fbff;
  color: #315174;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
}

.os-task-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.os-status-btn {
  cursor: pointer;
  box-shadow: none;
}

.os-status-btn.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--sll-admin-primary), var(--sll-admin-accent));
}

.os-status-done,
.os-status-closed {
  color: #24724f;
  background: #ebfff5;
  border-color: #c8f0d8;
}

.os-status-blocked {
  color: #c7214d;
  background: #fff0f4;
  border-color: #ffd0dc;
}

.os-status-review,
.os-status-waiting {
  color: #8a6100;
  background: #fff7dd;
  border-color: #ffe8a0;
}

.os-workspace-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(118px, 0.7fr)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--sll-admin-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.os-search-field {
  min-width: 0;
}

.os-view-switch {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.os-toolbar-count {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--sll-admin-muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.os-kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.os-kanban-col {
  min-width: 0;
  border: 1px solid var(--sll-admin-line);
  border-radius: 8px;
  background: rgba(248, 250, 255, 0.86);
  overflow: hidden;
}

.os-kanban-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--sll-admin-line);
  color: var(--sll-admin-text);
  font-size: 12px;
  font-weight: 900;
}

.os-kanban-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  min-height: 56px;
}

/* drag-and-drop kanban */
.os-task-card[draggable="true"] { cursor: grab; }
.os-task-card[draggable="true"]:active { cursor: grabbing; }
.os-task-card.is-dragging { opacity: 0.45; }
.os-kanban-col.is-drop-target {
  outline: 2px dashed var(--sll-admin-primary, #9c78ff);
  outline-offset: -2px;
  background: rgba(156, 120, 255, 0.08);
}
.os-kanban-head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.os-col-add {
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid var(--sll-admin-line);
  background: #fff;
  color: var(--sll-admin-primary, #9c78ff);
  font-weight: 900;
  cursor: pointer;
}
.os-col-add:hover {
  background: var(--sll-admin-primary, #9c78ff);
  color: #fff;
  border-color: transparent;
}
.os-drag-hint {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(156, 120, 255, 0.12);
  color: var(--sll-admin-primary, #9c78ff);
  font-size: 11px;
  font-weight: 800;
}

.os-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--sll-admin-line);
  border-radius: 8px;
  background: #fff;
}

.os-task-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 12px;
}

.os-task-table th,
.os-task-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sll-admin-line);
  text-align: left;
  vertical-align: top;
}

.os-task-table th {
  color: var(--sll-admin-muted);
  font-size: 11px;
  font-weight: 900;
}

.os-task-table td strong,
.os-task-table td span {
  display: block;
}

.os-task-table td span {
  margin-top: 3px;
  color: var(--sll-admin-muted);
}

.os-focus-grid,
.os-template-list,
.os-mini-queue {
  display: grid;
  gap: 8px;
}

.os-mini-task,
.os-template-btn {
  width: 100%;
  border: 1px solid var(--sll-admin-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--sll-admin-text);
  font: inherit;
  text-align: left;
  padding: 10px 11px;
  cursor: pointer;
}

.os-mini-task span,
.os-template-btn span {
  display: block;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
}

.os-mini-task small,
.os-template-btn small {
  display: block;
  margin-top: 3px;
  color: var(--sll-admin-muted);
  font-size: 11px;
  font-weight: 800;
}

.os-priority-high,
.os-priority-urgent,
.os-alert-high,
.os-alert-critical {
  color: #c7214d;
  background: #fff0f4;
  border-color: #ffd0dc;
}

.os-priority-medium,
.os-alert-medium {
  color: #8a6100;
  background: #fff7dd;
  border-color: #ffe8a0;
}

.os-priority-low,
.os-alert-low {
  color: #2f6a77;
  background: #ecfbff;
  border-color: #cceefa;
}

.os-form {
  display: grid;
  gap: 10px;
}

.os-field {
  display: grid;
  gap: 5px;
}

.os-field label {
  color: var(--sll-admin-muted);
  font-size: 11px;
  font-weight: 900;
}

.os-field input,
.os-field select,
.os-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  font-size: 13px;
}

.os-field textarea {
  min-height: 92px;
  resize: vertical;
}

.os-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.os-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.os-empty {
  padding: 18px;
  border: 1px dashed var(--sll-admin-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.os-empty.small {
  padding: 10px;
  font-size: 11px;
}

.os-loading {
  color: var(--sll-admin-muted);
  font-size: 12px;
  font-weight: 700;
}

.os-drawer-open {
  overflow: hidden;
}

.os-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(22, 28, 48, 0.42);
  backdrop-filter: blur(5px);
}

.os-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 81;
  width: min(720px, 100%);
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border-left: 1px solid var(--sll-admin-line);
  background: #fbfcff;
  box-shadow: -18px 0 42px rgba(70, 83, 125, 0.18);
}

.os-drawer-head,
.os-drawer-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.os-edit-form,
.os-drawer-section {
  padding: 14px;
  border: 1px solid var(--sll-admin-line);
  border-radius: 8px;
  background: #fff;
}

.os-comment-list,
.os-attachment-list {
  display: grid;
  gap: 8px;
}

.os-comment {
  border: 1px solid var(--sll-admin-line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(248, 250, 255, 0.9);
}

.os-comment strong,
.os-comment time {
  display: inline-block;
  margin-right: 8px;
  font-size: 11px;
}

.os-comment time {
  color: var(--sll-admin-muted);
}

.os-comment p {
  margin: 6px 0 0;
  color: var(--sll-admin-muted);
  font-size: 12px;
  line-height: 1.6;
}

.os-attachment {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid var(--sll-admin-line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--sll-admin-primary);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 920px) {
  .os-header,
  .os-layout,
  .os-stat-grid,
  .os-two,
  .os-three,
  .os-workspace-toolbar,
  .os-kanban {
    grid-template-columns: 1fr;
  }

  .os-user {
    justify-items: start;
    min-width: 0;
  }

  .os-toolbar {
    justify-content: flex-start;
  }

  .os-mark {
    width: 160px;
    height: 54px;
    min-width: 160px;
  }

  .os-quick-nav {
    align-items: stretch;
  }

  .os-quick-nav .os-btn {
    flex: 1 1 138px;
    text-align: center;
  }

  .os-view-switch,
  .os-toolbar-count {
    justify-content: flex-start;
  }
}

/* タスクUX改善: カンバンの「次へ進める」ボタン＆クリック可能タイトル */
.os-status-btn.os-advance {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--sll-admin-primary), var(--sll-admin-accent));
  font-weight: 800;
}
.os-task-title[role="button"] {
  cursor: pointer;
}
.os-task-title[role="button"]:hover {
  color: var(--sll-admin-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* タスクUXバグ修正: ツールバー右端の崩れ（固定グリッド→折返しフレックス） */
.os-workspace-toolbar {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.os-workspace-toolbar .os-search-field { flex: 1 1 240px; }
.os-workspace-toolbar .os-field { flex: 0 1 150px; min-width: 122px; }
.os-workspace-toolbar .os-view-switch { flex: 0 0 auto; flex-wrap: wrap; }
.os-workspace-toolbar .os-toolbar-count { flex: 1 0 auto; }

/* 一覧ビュー: 状態チップが縦積みになっていたのを横並びに */
.os-task-table td .os-chip {
  display: inline-flex !important;
  margin-top: 0 !important;
  margin-right: 4px;
}
.os-task-table td:nth-child(3) { white-space: nowrap; }

/* ===== スマホ密度改善 (2026-07-02): ヘッダー圧縮 + タイル2列 + 余白削減 ===== */
/* 目的: スマホで「開いてすぐ目的に届く」。ヘッダーchrome/巨大タイルの縦占有を削減し、*/
/* 1画面あたりの項目数を増やしてスクロール量を減らす。max-width:600px でスマホのみ。 */
@media (max-width: 600px) {
  .os-page { padding: 10px 10px 22px; gap: 12px; }

  /* ヘッダー: ロゴ小 / タイトル小 / 長い説明文は非表示 */
  .os-header { min-height: 0; padding: 12px 14px; border-radius: 18px; gap: 8px; }
  .os-mark { width: 116px; height: 38px; min-width: 116px; }
  .os-title { font-size: 18px; line-height: 1.25; margin-top: 2px; }
  .os-subtitle { display: none; }
  .os-user { min-width: 0; }

  /* タイル: 2列 / 低め / 余白詰め → 1画面に多く見せる */
  .os-card-grid,
  .os-menu-section .os-card-grid,
  .os-focus-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .os-module-card { min-height: 0; padding: 10px; border-radius: 12px; gap: 4px; }
  .os-module-card .os-module-desc { display: none; }
  .os-module-card .os-module-open { margin-top: 4px; }
  .os-icon { width: 30px; height: 30px; min-width: 30px; }
  .os-module-title { font-size: 13px; line-height: 1.35; }

  /* 統計・パネルも詰める */
  .os-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .os-panel-body { padding: 10px 12px 12px; gap: 10px; }

  /* 統計カード: メールアドレス等の長い文字列を折り返し（はみ出し防止） */
  .os-stat { min-width: 0; }
  .os-stat-value, .os-stat-note { overflow-wrap: anywhere; word-break: break-word; }
  .os-stat-note { font-size: 10.5px; }

  /* 「ダッシュボード / 表示カスタマイズ」バー: 説明文を隠して1行に収める */
  .os-dash-bar-title { white-space: nowrap; }
  .os-dash-bar-desc { display: none; }

  /* ヘッダーの My Work(a) と ログアウト(button) の高さ/縦位置を統一 */
  .os-user .os-toolbar .os-btn {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 18px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
  }

  /* タイルの二重ラベル解消 (2026-07-13): 「Open」バッジと「開く→」を隠して
     アイコン+名前の横1行に。タイル全体が<a>なのでタップ範囲は変わらない */
  .os-module-card .os-chip { display: none; }
  .os-module-card .os-module-open { display: none; }
  .os-module-card {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-height: 54px;
  }
  .os-module-card .os-module-top { flex: 0 0 auto; }
  .os-module-card .os-module-title { margin: 0; }
}
