:root {
  --bg: #f5efe3;
  --panel: rgba(255, 252, 246, 0.88);
  --panel-strong: #fffaf1;
  --line: rgba(35, 43, 69, 0.1);
  --text: #1f2740;
  --muted: #5b647d;
  --accent: #d0632d;
  --accent-strong: #b84e1d;
  --accent-soft: rgba(208, 99, 45, 0.12);
  --shadow: 0 24px 60px rgba(48, 44, 35, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-heading: "Avenir Next", "Yu Gothic", sans-serif;
  --font-body: "IBM Plex Sans JP", "Hiragino Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(208, 99, 45, 0.26), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(52, 103, 165, 0.16), transparent 24%),
    linear-gradient(160deg, #f6efe1 0%, #f0f2f9 52%, #e8eef5 100%);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  margin-bottom: 24px;
}

.hero-copy,
.timer-card,
.panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy,
.panel {
  border-radius: var(--radius-lg);
}

.hero-copy {
  padding: 36px;
}

.eyebrow,
.card-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-heading);
}

h1 {
  font-size: clamp(2.1rem, 3vw, 3.8rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  max-width: 11ch;
}

.hero-text {
  max-width: 66ch;
  margin: 18px 0 0;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
}

.stack-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  padding: 28px;
}

.panel-heading,
.timer-actions,
.form-actions,
.library-actions {
  display: flex;
  gap: 12px;
}

.panel-heading {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 360px);
  gap: 24px;
  align-items: start;
}

.memo-form,
.field,
.record-list,
.record-card,
.timer-card {
  display: flex;
  flex-direction: column;
}

.memo-form,
.record-list {
  gap: 18px;
}

.field {
  gap: 8px;
}

.field span {
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(35, 43, 69, 0.14);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

input {
  min-height: 50px;
  padding: 0 14px;
}

textarea {
  min-height: 320px;
  padding: 16px 18px;
  resize: vertical;
  line-height: 1.8;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(208, 99, 45, 0.65);
  box-shadow: 0 0 0 4px rgba(208, 99, 45, 0.12);
}

.thoughts-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.thoughts-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thoughts-note,
.timer-copy,
.record-date,
.record-created-at,
.library-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.library-message.is-error {
  color: #a6302e;
}

.library-message.is-success {
  color: #237a57;
}

.timer-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  gap: 18px;
  position: sticky;
  top: 24px;
}

.timer-ring {
  --progress: 360deg;
  width: min(240px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background:
    conic-gradient(var(--accent) var(--progress), rgba(255, 255, 255, 0.65) 0),
    radial-gradient(circle at center, #fff9f2 62%, transparent 63%);
  display: grid;
  place-items: center;
}

.timer-ring__inner {
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid rgba(35, 43, 69, 0.08);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
}

.timer-value {
  display: block;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.timer-status {
  display: block;
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

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

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #df7340 0%, #be4e21 100%);
  box-shadow: 0 14px 24px rgba(190, 78, 33, 0.22);
}

.ghost-button {
  color: var(--text);
  background: rgba(35, 43, 69, 0.07);
}

.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-chip,
.record-count,
.record-genre {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-chip {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.record-count,
.record-genre {
  background: rgba(35, 43, 69, 0.08);
  color: var(--text);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.record-list:empty::before {
  content: "条件に合う記録はまだない。最初の1件を書き出す。";
  display: block;
  padding: 24px;
  border-radius: var(--radius-md);
  background: rgba(35, 43, 69, 0.05);
  color: var(--muted);
}

.record-card {
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid rgba(35, 43, 69, 0.09);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.record-card:hover {
  transform: translateY(-1px);
  border-color: rgba(208, 99, 45, 0.35);
}

.record-card.is-selected {
  border-color: rgba(208, 99, 45, 0.72);
  box-shadow: 0 0 0 4px rgba(208, 99, 45, 0.12);
  background: rgba(255, 248, 241, 0.98);
}

.record-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.record-title {
  font-size: 1.2rem;
  line-height: 1.4;
}

.record-body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.8;
  color: var(--muted);
}

.record-selection-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.danger-button {
  color: #fff;
  background: linear-gradient(135deg, #ca4d42 0%, #a6302e 100%);
  box-shadow: 0 12px 22px rgba(166, 48, 46, 0.2);
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.record-card.is-new {
  animation: fadeUp 420ms ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .compose-grid,
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .panel,
  .timer-card {
    padding: 24px;
  }

  .timer-card {
    position: static;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding: 20px 0 32px;
  }

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

  .library-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  textarea {
    min-height: 260px;
  }
}
