:root {
  color-scheme:light;
  --ink:#253832;
  --muted:#6d7b76;
  --teal:#246b59;
  --line:#dfe5dd;
  --paper:#fafbf7;
  --card:#fff;
  --soft:#eef3ec;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI","Noto Sans JP",sans-serif;
  font-size:14px;
  line-height:1.6;
}

a {
  color:var(--teal);
  text-decoration:none;
}

a:hover {
  text-decoration:underline;
}

button,input,select,textarea {
  font:inherit;
}

button,a,input,select,textarea,summary {
  outline-offset:4px;
}

:focus-visible {
  outline:2px solid var(--teal);
}

.site-header {
  max-width:1232px;
  margin:auto;
  padding:24px 32px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid var(--line);
}

.brand {
  font-size:23px;
  font-weight:750;
  letter-spacing:-1px;
  color:var(--ink);
  display:flex;
  align-items:center;
  gap:2px;
}

.brand span:first-child {
  font-weight:400;
}

.brand-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--teal);
  margin:2px 0 0 7px;
}

.site-header nav {
  display:flex;
  align-items:center;
  gap:26px;
  font-size:13px;
}

.site-header nav a {
  color:var(--muted);
}

.private-label,.eyebrow {
  font-size:10px;
  font-weight:700;
  letter-spacing:1.8px;
  color:var(--muted);
}

.shell {
  max-width:1232px;
  margin:auto;
  padding:36px 32px 64px;
}

.site-footer {
  max-width:1232px;
  margin:auto;
  padding:20px 32px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:11px;
  display:flex;
  justify-content:space-between;
}

h1,h2,h3,p {
  margin-top:0;
}

h1 {
  font-size:36px;
  line-height:1.3;
  letter-spacing:-1px;
  font-weight:620;
  margin-bottom:10px;
}

h1 span {
  font-size:15px;
  font-weight:400;
  letter-spacing:0;
  color:var(--muted);
  margin-left:12px;
}

h2 {
  font-size:17px;
  font-weight:650;
  margin-bottom:14px;
}

h3 {
  font-size:16px;
  line-height:1.6;
  margin-bottom:9px;
}

.eyebrow {
  margin-bottom:12px;
}

.muted {
  color:var(--muted);
}

.small {
  font-size:12px;
}

.day-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:28px;
  gap:18px;
}

.day-heading p:last-child {
  margin:0;
}

.date-nav {
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}

.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:9px 14px;
  border:1px solid var(--line);
  border-radius:7px;
  background:var(--card);
  color:var(--ink);
  font-size:12px;
  font-weight:550;
  cursor:pointer;
  text-align:center;
}

.button:hover {
  border-color:#a6b8ac;
  background:var(--soft);
  text-decoration:none;
}

.button.primary {
  color:#fff;
  background:var(--teal);
  border-color:var(--teal);
}

.button.primary:hover {
  background:#1c5848;
}

.inline-form {
  display:inline;
}

.text-button {
  border:0;
  background:none;
  padding:0;
  color:var(--muted);
  cursor:pointer;
  font-size:12px;
}

.clear-link {
  font-size:12px;
  white-space:nowrap;
}

.day-summary {
  display:flex;
  gap:26px;
  align-items:center;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  padding:18px 0;
  margin-bottom:32px;
}

.summary-total {
  display:flex;
  align-items:center;
  gap:16px;
  white-space:nowrap;
  border-right:1px solid var(--line);
  padding-right:26px;
}

.summary-total span {
  font-size:12px;
  color:var(--muted);
}

.summary-total strong {
  font-size:28px;
  font-weight:550;
}

.summary-types {
  display:flex;
  gap:12px 20px;
  flex-wrap:wrap;
  font-size:11px;
  color:var(--muted);
}

.summary-types b {
  font-size:13px;
  margin-left:5px;
  color:var(--ink);
}

.workspace {
  display:grid;
  grid-template-columns:minmax(0,1fr) 300px;
  gap:40px;
}

.filters {
  display:flex;
  align-items:flex-end;
  gap:10px;
  margin-bottom:28px;
  flex-wrap:wrap;
}

.filters label {
  min-width:120px;
}

.filters select {
  font-size:12px;
  padding:8px 10px;
}

.filters .clear-link {
  padding-bottom:9px;
}

.timeline-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:20px;
}

.timeline-heading h2 {
  margin:0;
}

.timeline {
  list-style:none;
  padding:0;
  margin:0;
}

.timeline-entry {
  display:grid;
  grid-template-columns:92px minmax(0,1fr);
  gap:15px;
  padding-bottom:24px;
}

.event-time {
  padding-top:14px;
  font-size:15px;
  font-variant-numeric:tabular-nums;
  position:relative;
}

.event-time span {
  display:block;
  font-size:10px;
  color:var(--muted);
  margin-top:6px;
  line-height:1.5;
}

.event-card {
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--card);
  padding:17px 20px;
  min-width:0;
  overflow-wrap:anywhere;
}

.event-meta {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
  font-size:10px;
}

.event-label {
  color:var(--teal);
  font-weight:700;
}

.event-label:before {
  content:"";
  display:inline-block;
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--teal);
  margin-right:7px;
}

.source-youtube .event-label {
  color:#956152;
}

.source-youtube .event-label:before {
  background:#ad7561;
}

.source-manual .event-label {
  color:#867748;
}

.source-manual .event-label:before {
  background:#9b8a55;
}

.collector {
  color:var(--muted);
  background:var(--soft);
  border-radius:4px;
  padding:2px 6px;
}

.author {
  font-size:12px;
  font-weight:600;
  color:var(--muted);
  margin-bottom:8px;
}

.event-text {
  font-size:13px;
  line-height:1.85;
  white-space:pre-wrap;
  margin-bottom:12px;
  overflow-wrap:anywhere;
}

.outbound {
  display:block;
  font-size:11px;
  margin-top:10px;
  overflow-wrap:anywhere;
}

.thumbnail {
  float:right;
  width:104px;
  max-height:80px;
  object-fit:cover;
  border-radius:5px;
  margin:0 0 10px 14px;
}

.resource-list {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:14px;
}

.resource-badge {
  font-size:10px;
  border:1px solid var(--line);
  border-radius:4px;
  padding:3px 7px;
  color:var(--muted);
}

.full-text summary {
  font-size:11px;
  color:var(--teal);
  cursor:pointer;
}

.full-text p {
  margin-top:12px;
}

.empty-state {
  padding:70px 20px;
  text-align:center;
  background:var(--soft);
  border:1px dashed #cfd9cd;
  border-radius:9px;
  color:var(--muted);
}

.empty-state h3 {
  font-size:14px;
  color:var(--ink);
}

.empty-state p {
  font-size:12px;
  margin-bottom:0;
}

.empty-mark {
  font-size:32px;
  display:block;
  margin-bottom:16px;
}

.panel {
  background:var(--card);
  border:1px solid var(--line);
  border-radius:9px;
  padding:22px;
  margin-bottom:20px;
}

.panel .eyebrow {
  font-size:9px;
}

.stack {
  display:flex;
  flex-direction:column;
  gap:13px;
}

.stack label,.filters label {
  display:block;
  font-size:11px;
  font-weight:600;
  color:var(--muted);
}

input,select,textarea {
  display:block;
  width:100%;
  margin-top:5px;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:5px;
  color:var(--ink);
  background:var(--paper);
}

textarea {
  resize:vertical;
  min-height:70px;
}

.optional {
  font-weight:400;
  font-size:10px;
  margin-left:7px;
}

.manual-section {
  border-top:1px solid var(--line);
  padding-top:13px;
  margin-top:18px;
}

.manual-section summary {
  font-size:12px;
  font-weight:600;
  cursor:pointer;
}

.manual-section .stack {
  margin-top:16px;
}

.export-panel {
  display:flex;
  flex-direction:column;
  gap:12px;
}

.export-panel p,.export-panel h2 {
  margin:0;
}

.export-panel form .button {
  width:100%;
}

.approx-help {
  color:var(--muted);
  line-height:1.8;
  padding:0 4px;
}

.login-card {
  max-width:430px;
  margin:62px auto 90px;
  padding:32px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--card);
}

.login-card h1 {
  font-size:29px;
  line-height:1.65;
}

.login-card .stack {
  margin:28px 0 20px;
}

.login-card .small:last-child {
  margin:0;
}

.source-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
}

.source-panel h2 {
  margin-bottom:8px;
}

.status-label {
  font-size:11px;
  color:var(--teal);
  margin-bottom:24px;
}

dl {
  margin:0;
}

dt {
  font-size:11px;
  color:var(--muted);
  margin-top:16px;
}

dd {
  font-size:12px;
  margin:4px 0 0;
  overflow-wrap:anywhere;
}

.source-counts {
  border-top:1px solid var(--line);
  margin-top:22px;
  padding-top:16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  font-size:10px;
  color:var(--muted);
}

.source-counts b {
  color:var(--ink);
}

.settings-panel {
  max-width:650px;
}

.settings-panel .small {
  margin:24px 0 0;
}

@media(max-width:950px) {
  .workspace {
    grid-template-columns:minmax(0,1fr) 270px;
    gap:22px;
  }
  .timeline-entry {
    grid-template-columns:74px minmax(0,1fr);
    gap:10px;
  }
  .event-card {
    padding:16px;
  }
  .source-grid {
    grid-template-columns:1fr;
  }
  .day-heading {
    align-items:flex-start;
  }
  h1 {
    font-size:30px;
  }
}

@media(max-width:720px) {
  .site-header {
    padding:20px;
    flex-wrap:wrap;
    gap:14px;
  }
  .site-header nav {
    gap:20px;
    font-size:11px;
    flex-basis:100%;
    flex-wrap:wrap;
  }
  .brand {
    font-size:21px;
  }
  .shell {
    padding:28px 20px 42px;
  }
  .site-footer {
    padding:20px;
    font-size:10px;
    gap:15px;
    flex-wrap:wrap;
  }
  .day-heading {
    flex-direction:column;
  }
  .workspace {
    grid-template-columns:minmax(0,1fr);
  }
  .timeline-panel,.side-panel {
    min-width:0;
  }
  .side-panel {
    margin-top:10px;
  }
  .day-summary {
    gap:15px;
  }
  .summary-total {
    padding-right:15px;
    gap:10px;
  }
  .summary-types {
    gap:7px 13px;
    min-width:0;
  }
  .filters label {
    flex:1 1 130px;
    min-width:0;
    max-width:100%;
  }
  input,select,textarea {
    min-width:0;
    max-width:100%;
  }
  .timeline-entry {
    grid-template-columns:64px minmax(0,1fr);
    gap:9px;
  }
  .event-time {
    font-size:13px;
  }
  .event-time span {
    font-size:9px;
  }
  .event-meta {
    align-items:flex-start;
    flex-direction:column;
    gap:7px;
  }
  .event-card {
    padding:15px;
  }
  .outbound {
    font-size:10px;
  }
  .login-card {
    margin:32px auto 60px;
    padding:25px;
  }
  .login-card h1 {
    font-size:26px;
  }
  .thumbnail {
    width:82px;
  }
  h1 span {
    font-size:13px;
    margin-left:6px;
  }
  .private-label {
    font-size:8px;
  }
}
