:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --panel: #ffffff;
  --ink: #1f2528;
  --muted: #65717a;
  --line: #d9ded8;
  --accent: #1f6f68;
  --accent-2: #b75a37;
  --soft: #edf5f2;
  --warn: #fff3dd;
  --shadow: rgba(31, 52, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Sans", system-ui, sans-serif;
}

.hidden {
  display: none !important;
}

.loginView {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 20px;
}

.loginPanel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 40px var(--shadow);
  display: grid;
  gap: 14px;
  margin: 0 auto;
  max-width: 420px;
  padding: 24px;
  width: 100%;
}

.loginLead,
.status,
.empty,
.item p {
  color: var(--muted);
}

.topbar {
  align-items: center;
  background: #19332f;
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px clamp(14px, 4vw, 36px);
}

.headerActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.appNav {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1040px;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.navButton {
  background: #eef2ef;
  color: var(--ink);
}

.navButton.active {
  background: var(--accent);
  color: #fff;
}

.eyebrow {
  color: #b7d8d1;
  font-size: 12px;
  margin: 0 0 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.25;
  margin-bottom: 0;
}

h2 {
  font-size: 17px;
  margin-bottom: 0;
}

.layout {
  display: block;
  margin: 14px auto 40px;
  max-width: 980px;
  padding: 0 16px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 22px var(--shadow);
  padding: 16px;
}

details.panel {
  padding-top: 12px;
}

summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  color: var(--muted);
  content: "開く";
  float: right;
  font-size: 12px;
  font-weight: 400;
}

details[open] summary {
  margin-bottom: 14px;
}

details[open] summary::after {
  content: "閉じる";
}

.sectionHeader {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.badge {
  background: var(--soft);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  padding: 5px 10px;
  white-space: nowrap;
}

textarea,
input {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  width: 100%;
}

textarea {
  min-height: 156px;
  padding: 13px;
  resize: vertical;
}

input {
  min-height: 42px;
  padding: 0 12px;
}

.actions,
.workActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.compactActions button {
  flex: 1 1 170px;
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 42px;
  padding: 0 15px;
}

button.secondary {
  background: var(--accent-2);
}

.headerButton {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.35);
  min-height: 40px;
  white-space: nowrap;
}

.secondaryHeader {
  background: rgba(255, 255, 255, 0.05);
}

.status {
  margin: 10px 0 0;
  min-height: 22px;
}

.stack,
.notes {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.item h3 {
  font-size: 15px;
  line-height: 1.4;
  margin: 0 0 8px;
}

.item p {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 0;
}

.workHeader {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.workHeader h3 {
  margin-bottom: 0;
}

.closedItem {
  opacity: 0.62;
}

.issueUpdate {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  margin-top: 12px;
}

.history {
  border-left: 3px solid var(--line);
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-left: 10px;
}

.history time {
  color: var(--muted);
  display: inline-block;
  font-size: 12px;
  margin-right: 6px;
}

.miniBlock {
  background: #f8faf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 8px;
  padding: 10px;
}

.miniBlock strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

.miniList {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 4px;
  line-height: 1.5;
  margin: 0;
  padding-left: 18px;
}

.example,
.templateText,
.nextAction {
  background: var(--soft);
  border-radius: 8px;
  color: var(--accent);
  margin-top: 8px !important;
  padding: 8px;
  white-space: pre-wrap;
}

.meta,
.metricRow {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.metricRow span,
.pill {
  background: var(--warn);
  border-radius: 999px;
  color: #8d4a1b;
  font-size: 12px;
  padding: 4px 8px;
}

.note {
  border-left: 4px solid var(--accent);
  padding: 6px 0 6px 12px;
  white-space: pre-wrap;
}

.note time {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.empty {
  font-size: 14px;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    gap: 10px;
    min-height: 64px;
    padding: 10px 12px;
  }

  h1 {
    font-size: 19px;
  }

  h2 {
    font-size: 16px;
  }

  .headerActions {
    flex-direction: column;
  }

  .headerButton {
    min-height: 36px;
    padding: 0 10px;
  }

  .layout {
    margin-top: 12px;
    padding: 0 10px 28px;
  }

  .appNav {
    padding: 8px 10px;
  }

  .navButton {
    min-height: 38px;
    padding: 0 8px;
  }

  .panel {
    padding: 14px;
  }

  .sectionHeader {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions,
  .workActions {
    flex-direction: column;
  }

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