:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #64716b;
  --line: #d8e1db;
  --surface: #ffffff;
  --surface-alt: #eef5f1;
  --accent: #147d73;
  --accent-strong: #0f5e57;
  --warn: #b54834;
  --warn-soft: #fae8e3;
  --shadow: 0 18px 45px rgba(25, 48, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    linear-gradient(135deg, rgba(20, 125, 115, 0.11), transparent 42%),
    linear-gradient(0deg, #f6f2ea, #edf4f2);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(20, 125, 115, 0.28);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  min-height: 180px;
  padding: 30px 0 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  font-weight: 800;
}

h2 {
  font-size: 1.08rem;
}

.status-panel {
  display: grid;
  gap: 5px;
  min-width: 230px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
}

.status-label,
.summary-stat span {
  color: var(--muted);
  font-size: 0.86rem;
}

#current-status {
  font-size: 1.35rem;
}

#active-timer {
  color: var(--accent-strong);
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.primary-button,
.secondary-button {
  min-height: 68px;
  color: #ffffff;
  font-size: 1.22rem;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  box-shadow: 0 14px 28px rgba(20, 125, 115, 0.24);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.secondary-button {
  background: var(--warn);
  box-shadow: 0 14px 28px rgba(181, 72, 52, 0.18);
}

.secondary-button:hover:not(:disabled) {
  background: #913927;
}

.summary-band {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) repeat(2, minmax(180px, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-bottom: 18px;
}

.month-control,
.summary-stat,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.month-control,
.summary-stat {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.month-control label {
  color: var(--muted);
  font-size: 0.86rem;
}

.month-control input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--surface);
}

.summary-stat strong {
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: 18px;
}

.panel {
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(238, 245, 241, 0.72);
}

.ghost-button {
  min-width: 70px;
  min-height: 36px;
  border: 1px solid var(--line);
  color: var(--accent-strong);
  background: var(--surface);
  font-weight: 800;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

td {
  font-size: 0.95rem;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.time-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.delete-button {
  min-width: 58px;
  min-height: 34px;
  color: var(--warn);
  border: 1px solid #efc8be;
  background: var(--warn-soft);
  font-weight: 700;
}

.empty-cell {
  height: 92px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 24px, 680px);
    padding-top: 18px;
  }

  .hero,
  .summary-band,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: stretch;
    min-height: 0;
  }

  .status-panel {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .controls {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 12px 10px;
  }

  td {
    font-size: 0.9rem;
  }

  .record-date {
    min-width: 122px;
  }
}
