:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: #f6f5f3;
  color: #262429;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}



html {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 8% 0%, rgba(140, 35, 54, .07), transparent 34rem),
    #f6f5f3;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.sg-root {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.sg-page {
  --sg-white: oklch(100% 0 0);
  --sg-snow: oklch(0.9911 0 0);
  --sg-ink: oklch(0.2103 0.0059 285.89);
  --sg-muted: oklch(0.5517 0.0138 285.94);
  --sg-surface-2: oklch(0.9524 0.0013 286.37);
  --sg-surface-3: oklch(0.9373 0.0013 286.37);
  --sg-accent: oklch(0.6204 0.195 253.83);
  --sg-accent-fg: var(--sg-snow);
  --sg-success: oklch(0.7329 0.1935 150.81);
  --sg-warning: oklch(0.7819 0.1585 72.33);
  --sg-danger: oklch(0.6532 0.2328 25.74);
  --sg-partner: oklch(0.62 0.19 300);
  --sg-default: oklch(94% 0.001 286.375);
  --sg-border: oklch(92% 0.004 286.32);
  

  --sg-c0: var(--sg-muted);
  --sg-c0-fg: var(--sg-snow);
  --sg-c1: var(--sg-accent);
  --sg-c1-fg: var(--sg-accent-fg);
  --sg-c2: var(--sg-warning);
  --sg-c2-fg: var(--sg-ink);
  --sg-c3: var(--sg-partner);
  --sg-c3-fg: var(--sg-snow);
  --sg-c4: var(--sg-success);
  --sg-c4-fg: var(--sg-ink);
  --sg-c5: var(--sg-danger);
  --sg-c5-fg: var(--sg-snow);
  --sg-c6: oklch(0.70 0.13 195);
  --sg-c6-fg: var(--sg-ink);
  --sg-c7: oklch(0.68 0.16 350);
  --sg-c7-fg: var(--sg-snow);
  --sg-c8: oklch(0.55 0.05 265);
  --sg-c8-fg: var(--sg-snow);
  --sg-shadow: 0 2px 4px rgba(32, 28, 30, .04), 0 12px 32px rgba(32, 28, 30, .06);

  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(100%, 1600px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px;
  color: var(--sg-ink);
}

.sg-page [data-color="c0"] {
  --sg-owner-color: var(--sg-c0);
  --sg-owner-fg: var(--sg-c0-fg);
  --sg-owner-chip-fg: var(--sg-c0);
}

.sg-page [data-color="c1"] {
  --sg-owner-color: var(--sg-c1);
  --sg-owner-fg: var(--sg-c1-fg);
  --sg-owner-chip-fg: var(--sg-c1);
}

.sg-page [data-color="c2"] {
  --sg-owner-color: var(--sg-c2);
  --sg-owner-fg: var(--sg-c2-fg);
  --sg-owner-chip-fg: var(--sg-ink);
}

.sg-page [data-color="c3"] {
  --sg-owner-color: var(--sg-c3);
  --sg-owner-fg: var(--sg-c3-fg);
  --sg-owner-chip-fg: var(--sg-c3);
}

.sg-page [data-color="c4"] {
  --sg-owner-color: var(--sg-c4);
  --sg-owner-fg: var(--sg-c4-fg);
  --sg-owner-chip-fg: var(--sg-ink);
}

.sg-page [data-color="c5"] {
  --sg-owner-color: var(--sg-c5);
  --sg-owner-fg: var(--sg-c5-fg);
  --sg-owner-chip-fg: var(--sg-c5);
}

.sg-page [data-color="c6"] {
  --sg-owner-color: var(--sg-c6);
  --sg-owner-fg: var(--sg-c6-fg);
  --sg-owner-chip-fg: var(--sg-ink);
}

.sg-page [data-color="c7"] {
  --sg-owner-color: var(--sg-c7);
  --sg-owner-fg: var(--sg-c7-fg);
  --sg-owner-chip-fg: var(--sg-c7);
}

.sg-page [data-color="c8"] {
  --sg-owner-color: var(--sg-c8);
  --sg-owner-fg: var(--sg-c8-fg);
  --sg-owner-chip-fg: var(--sg-c8);
}

.sg-header,
.sg-overview,
.sg-legend,
.sg-grid-scroll,
.sg-list-group,
.sg-empty,
.sg-state-card {
  border: 1px solid var(--sg-border, #e6e3e4);
  border-radius: 12px;
  background: var(--sg-white, #fff);
  box-shadow: var(--sg-shadow, 0 12px 32px rgba(32, 28, 30, .06));
}

.sg-header {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) minmax(240px, 1.5fr) auto;
  align-items: center;
  gap: 22px;
  padding: 17px 20px;
}

.sg-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sg-brand strong {
  color: #8C2336;
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .025em;
  line-height: 1.1;
}

.sg-brand span {
  margin-top: 4px;
  color: #6f676a;
  font-size: 10px;
  letter-spacing: .08em;
}

.sg-project-copy {
  min-width: 0;
  text-align: center;
}

.sg-kicker {
  margin: 0;
  color: var(--sg-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
}

.sg-project-copy h1 {
  margin: 4px 0;
  overflow: hidden;
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-size: clamp(19px, 2.2vw, 28px);
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-project-period {
  margin: 0;
  color: var(--sg-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

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

.sg-view-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--sg-surface-2);
}

.sg-view-toggle button,
.sg-button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--sg-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.sg-view-toggle button {
  min-width: 62px;
  padding: 7px 11px;
}

.sg-view-toggle button[aria-pressed="true"] {
  background: var(--sg-white);
  color: #8c2336;
  box-shadow: 0 2px 6px rgba(32, 28, 30, .1);
}

.sg-button {
  padding: 7px 12px;
  border-color: var(--sg-border, #e6e3e4);
  background: var(--sg-white, #fff);
  color: var(--sg-ink, #262429);
}

.sg-button:hover,
.sg-view-toggle button:hover {
  border-color: rgba(140, 35, 54, .4);
  color: #8c2336;
}

.sg-button--primary {
  border-color: #8c2336;
  background: #8c2336;
  color: #fff;
}

.sg-button--primary:hover {
  background: #711b2b;
  color: #fff;
}

.sg-button:focus-visible,
.sg-view-toggle button:focus-visible {
  outline: 3px solid rgba(140, 35, 54, .25);
  outline-offset: 2px;
}

.sg-content {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  min-width: 0;
}

.sg-overview {
  padding: 14px 17px;
}

.sg-overview h2 {
  margin: 0 0 6px;
  color: #8c2336;
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-size: 14px;
}

.sg-overview p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
}

.sg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  margin-top: 10px;
  padding: 9px 11px;
}

.sg-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--sg-owner-color) 15%, transparent);
  color: var(--sg-owner-chip-fg);
  font-size: 11px;
  font-weight: 700;
}

.sg-swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--sg-owner-color);
}

.sg-grid-view,
.sg-list-view {
  min-width: 0;
  margin-top: 10px;
}

.sg-grid-view {
  overflow: hidden;
}

.sg-grid-scroll {
  position: relative;
  width: 100%;
  max-height: calc(100dvh - 270px);
  min-height: 380px;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--sg-muted) var(--sg-surface-2);
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.sg-grid-canvas {
  position: relative;
  background-color: var(--sg-white);
  background-image: repeating-linear-gradient(
    to right,
    transparent 0 calc(var(--sg-cell-w) - 1px),
    var(--sg-border) calc(var(--sg-cell-w) - 1px) var(--sg-cell-w)
  );
  background-position: var(--sg-label-w) 0;
}

.sg-date-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  width: 100%;
  height: 78px;
  background: var(--sg-white);
  box-shadow: 0 2px 6px rgba(32, 28, 30, .08);
}

.sg-grid-corner {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 24;
  display: flex;
  flex: 0 0 var(--sg-label-w);
  align-items: center;
  height: 78px;
  padding: 0 14px;
  border-right: 1px solid var(--sg-border);
  border-bottom: 1px solid var(--sg-border);
  background: var(--sg-surface-2);
  color: var(--sg-muted);
  font-size: 11px;
  font-weight: 700;
}

.sg-date-track {
  flex: none;
  height: 78px;
}

.sg-month-row,
.sg-day-row,
.sg-holiday-row {
  display: flex;
  flex-wrap: nowrap;
}

.sg-month-row {
  height: 24px;
}

.sg-day-row {
  height: 30px;
}

.sg-holiday-row {
  height: 24px;
}

.sg-month-cell,
.sg-day-cell,
.sg-holiday-cell {
  flex: none;
  overflow: hidden;
  border-right: 1px solid var(--sg-border);
  border-bottom: 1px solid var(--sg-border);
  text-align: center;
}

.sg-month-cell {
  position: relative;
  height: 24px;
  padding: 4px 6px;
  overflow: visible;
  background: var(--sg-surface-2);
  color: var(--sg-muted);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.sg-month-cell > span {
  position: sticky;
  

  left: calc(var(--sg-label-w) + 8px);
  z-index: 1;
}

.sg-day-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 30px;
  color: var(--sg-ink);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.sg-day-cell small {
  color: var(--sg-muted);
  font-size: 8px;
}

.sg-day-cell--weekend,
.sg-column-background--weekend {
  background: rgba(68, 106, 158, .07);
}

.sg-day-cell--holiday,
.sg-column-background--holiday {
  background: rgba(140, 35, 54, .09);
}

.sg-day-cell--today {
  color: #8c2336;
  font-weight: 800;
}

.sg-holiday-cell {
  height: 24px;
  background: var(--sg-white);
  color: #8c2336;
  font-size: 8px;
  line-height: 1.2;
}

.sg-holiday-cell--active {
  background: rgba(140, 35, 54, .045);
}

.sg-holiday-cell span {
  display: block;
  padding: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-column-backgrounds {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
}

.sg-column-background {
  position: absolute;
  top: 0;
  bottom: 0;
}

.sg-grid-row {
  position: relative;
  z-index: 4;
  width: 100%;
  border-bottom: 1px solid var(--sg-border);
}

.sg-grid-row--phase {
  background: rgba(246, 245, 243, .74);
}

.sg-row-label {
  position: sticky;
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 6px 13px;
  overflow: hidden;
  border-right: 1px solid var(--sg-border);
  background: var(--sg-white);
}

.sg-row-label--phase {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--sg-surface-2);
}

.sg-row-label--phase strong {
  overflow: hidden;
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-row-label--phase span {
  flex: none;
  color: var(--sg-muted);
  font-size: 10px;
}

.sg-phase-fill {
  position: absolute;
  top: 6px;
  right: 0;
  bottom: 6px;
  z-index: 2;
  border-top: 1px solid rgba(140, 35, 54, .18);
  border-bottom: 1px solid rgba(140, 35, 54, .18);
  background: rgba(140, 35, 54, .08);
}

.sg-milestone-diamond {
  position: absolute;
  top: 14px;
  z-index: 6;
  width: 10px;
  height: 10px;
  background: #8c2336;
  box-shadow: 0 1px 2px rgba(32, 28, 30, .2);
  transform: rotate(45deg);
}

.sg-row-task-title {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-row-owner,
.sg-list-owner {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.sg-row-owner {
  margin-top: 4px;
}

.sg-row-owner-person,
.sg-list-owner-person {
  overflow: hidden;
  color: var(--sg-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-owner-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 19px;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--sg-owner-color) 15%, transparent);
  color: var(--sg-owner-chip-fg);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}

.sg-task-bar {
  position: absolute;
  top: 9px;
  z-index: 6;
  display: flex;
  align-items: center;
  height: 30px;
  min-width: 8px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--sg-owner-color);
  color: var(--sg-owner-fg);
  box-shadow: 0 2px 5px color-mix(in oklab, var(--sg-owner-color) 24%, transparent);
}

.sg-task-bar--done {
  background: color-mix(in oklab, var(--sg-owner-color) 36%, var(--sg-white));
  color: var(--sg-ink);
  box-shadow: none;
}

.sg-done-mark {
  flex: none;
  margin-right: 4px;
  font-size: 12px;
  font-weight: 900;
}

.sg-task-bar-title {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-task-bar-period {
  position: absolute;
  top: 7px;
  left: calc(100% + 6px);
  width: 88px;
  color: var(--sg-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sg-today-line {
  position: absolute;
  top: 0;
  z-index: 3;
  width: 2px;
  background: rgba(140, 35, 54, .75);
  pointer-events: none;
}

.sg-today-line::before {
  position: absolute;
  top: 24px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8c2336;
  content: "";
}

.sg-grid-empty {
  display: flex;
  align-items: center;
  height: 48px;
  padding-left: calc(var(--sg-label-w) + 18px);
  color: var(--sg-muted);
  font-size: 12px;
}

.sg-list-view {
  display: grid;
  gap: 10px;
}

.sg-list-group {
  overflow: hidden;
}

.sg-list-group h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 12px 15px;
  border-bottom: 1px solid var(--sg-border);
  background: var(--sg-surface-2);
  color: var(--sg-ink);
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-size: 14px;
}

.sg-list-group h2 span {
  flex: none;
  color: #8c2336;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.sg-list-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sg-list-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(110px, auto);
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--sg-border);
}

.sg-list-task:last-child {
  border-bottom: 0;
}

.sg-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 23px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.sg-status--pending {
  background: var(--sg-default);
  color: var(--sg-muted);
}

.sg-status--active {
  background: color-mix(in oklab, var(--sg-accent) 15%, transparent);
  color: var(--sg-accent);
}

.sg-status--done {
  background: color-mix(in oklab, var(--sg-success) 18%, transparent);
  color: oklch(0.42 0.12 150);
}

.sg-list-task-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.sg-list-task-copy strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-list-period {
  color: var(--sg-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.sg-list-owner {
  justify-content: flex-end;
}

.sg-list-empty,
.sg-empty {
  margin: 0;
  padding: 18px;
  color: var(--sg-muted);
  font-size: 12px;
  text-align: center;
}

.sg-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: auto;
  padding: 10px 4px 2px;
  color: #756d70;
  font-size: 10px;
}

.sg-footer strong {
  color: #8c2336;
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-weight: 600;
}

.sg-state-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: min(100% - 32px, 720px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 32px 0;
}

.sg-brand--state {
  align-items: center;
  text-align: center;
}

.sg-brand--state strong {
  font-size: 34px;
}

.sg-state-card {
  width: 100%;
  padding: 40px 28px;
  text-align: center;
}

.sg-state-card h1 {
  margin: 0 0 12px;
  color: #8c2336;
  font-family: "Zen Old Mincho", "Yu Mincho", serif;
  font-size: 22px;
}

.sg-state-card p {
  margin: 0 auto;
  max-width: 34rem;
  color: #4f494b;
  font-size: 14px;
  line-height: 1.8;
}

.sg-state-card .sg-button {
  margin-top: 22px;
}

.sg-spinner {
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto 16px;
  border: 3px solid rgba(140, 35, 54, .14);
  border-top-color: #8c2336;
  border-radius: 50%;
  animation: sg-spin .8s linear infinite;
}

.sg-noscript {
  margin: 0;
  padding: 16px;
  color: #8c2336;
  text-align: center;
}

@keyframes sg-spin {
  to { transform: rotate(360deg); }
}




@media (min-width: 769px) {
  .sg-page .sg-header {
    position: sticky;
    top: 0;
    z-index: 60;
  }
}

@media (max-width: 900px) {
  .sg-header {
    grid-template-columns: minmax(150px, .7fr) minmax(220px, 1fr);
  }

  .sg-header-actions {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .sg-page {
    gap: 9px;
    padding: 10px;
  }

  .sg-header {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 15px;
  }

  .sg-header .sg-brand {
    align-items: center;
  }

  .sg-header .sg-brand strong {
    font-size: 24px;
  }

  .sg-project-copy h1 {
    white-space: normal;
  }

  .sg-header-actions {
    grid-column: auto;
  }

  .sg-header-actions .sg-button {
    flex: 1 1 150px;
  }

  .sg-view-toggle {
    flex: 1 1 150px;
  }

  .sg-view-toggle button {
    flex: 1;
  }

  .sg-grid-scroll {
    max-height: 66vh;
    min-height: 330px;
  }

  .sg-grid-corner,
  .sg-row-label {
    padding-right: 8px;
    padding-left: 8px;
  }

  .sg-day-cell {
    flex-direction: column;
    gap: 0;
    font-size: 7px;
    line-height: 1;
  }

  .sg-day-cell small {
    font-size: 6px;
  }

  .sg-holiday-cell span {
    padding: 1px 0;
    font-size: 6px;
    line-height: 1;
    white-space: normal;
    writing-mode: vertical-rl;
  }

  .sg-task-bar {
    padding: 0 4px;
  }

  .sg-task-bar-title,
  .sg-done-mark {
    font-size: 8px;
  }

  .sg-row-owner-person {
    display: none;
  }

  .sg-list-task {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 11px 12px;
  }

  .sg-list-owner {
    grid-column: 2;
    justify-content: flex-start;
  }

  .sg-footer {
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sg-spinner {
    animation-duration: 1.8s;
  }
}
