* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f1e8;
  --card: #fffdf7;
  --text: #263238;
  --muted: #667;
  --main: #2f6f73;
  --main-dark: #24575b;
  --line: #ddd4c5;
  --danger: #b74d4d;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 16px 14px;
  background: linear-gradient(135deg, #2f6f73, #6ca39a);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}

.app-header h1 {
  margin: 0;
  font-size: 20px;
}

.app-header p {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: .92;
}

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin: 0 0 14px;
  box-shadow: 0 2px 10px rgba(89, 71, 45, .08);
}

h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

label {
  display: block;
  min-width: 0;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  background: white;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.grid {
  display: grid;
  gap: 10px;
}

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

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

button {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  color: white;
  background: var(--main);
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

button.ghost {
  color: var(--main-dark);
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(47,111,115,.35);
}

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

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-row.small button {
  padding: 8px 10px;
  font-size: 13px;
}

.hidden {
  display: none;
}

.lane-box {
  margin: 0 0 14px;
}

.lane-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.lane {
  position: relative;
  height: 170px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #c9b99f;
  background:
    repeating-linear-gradient(90deg, rgba(70,50,25,.08) 0, rgba(70,50,25,.08) 1px, transparent 1px, transparent 7.6px),
    linear-gradient(#e6c887, #d7b471);
}

.pin-deck {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.85);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 12px;
  color: #8a5a2b;
}

.board-line {
  position: absolute;
  bottom: 54px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(47,111,115,.55);
}

.dots {
  position: absolute;
  bottom: 20px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(0,0,0,.55);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.summary-grid div {
  background: #f4efe2;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
}

.summary-grid strong {
  display: block;
  font-size: 24px;
}

.summary-grid span {
  font-size: 12px;
  color: var(--muted);
}

.hint {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.log-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: white;
}

.log-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 700;
}

.log-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.log-memo {
  margin: 8px 0 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.log-actions {
  margin-top: 10px;
}

.log-actions button {
  padding: 8px 10px;
  font-size: 13px;
}

footer {
  max-width: 820px;
  margin: 0 auto;
  padding: 4px 16px 30px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 620px) {
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

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

  .app-header {
    align-items: flex-start;
  }

  .app-header h1 {
    font-size: 18px;
  }
}
