:root {
  --bg: #f7f1e6;
  --card-bg: #fffdf8;
  --accent: #7a5c3e;
  --accent-dark: #5a4028;
  --text: #3a2f22;
  --text-soft: #6b5b47;
  --border: #e6dcc8;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  overflow-wrap: break-word;
}

.app-header {
  background: var(--accent);
  color: #fff8ec;
  padding: 32px 16px 28px;
  text-align: center;
}

.app-header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: normal;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.app-header h1:focus-visible {
  outline: 2px solid #fff8ec;
  outline-offset: 4px;
}

.header-home-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}

.header-home-link:focus-visible h1 {
  outline: 2px solid #fff8ec;
  outline-offset: 4px;
}

.subtitle {
  margin: 10px 0 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

main {
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.about-notice {
  background: #f2e9d8;
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.about-admin {
  margin: 0 0 8px;
  font-weight: bold;
  color: var(--accent-dark);
}

.about-admin a {
  color: var(--accent-dark);
}

.about-notice p:last-child {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.8;
}

.today-card, .keyword-card, .story-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.today-label, .keyword-label {
  margin: 0 0 8px;
  font-weight: bold;
  color: var(--accent-dark);
}

.date-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.keyword-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.keyword-search-row input[type="text"] {
  flex: 1;
  font-size: 1.05rem;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  font-family: inherit;
  color: var(--text);
}

.keyword-search-row button,
.keyword-clear-btn {
  min-height: 44px;
  padding: 0 18px;
  font-size: 1rem;
  font-family: inherit;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.keyword-clear-btn {
  width: 100%;
  margin-top: 6px;
  background: var(--accent-dark);
}

.keyword-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.category-chip {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--card-bg);
  color: var(--accent-dark);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.category-chip.active {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: white;
}

.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-chip {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f2e9d8;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.keyword-chip:hover, .keyword-chip:active {
  background: var(--accent);
  color: white;
}

.crisis-notice {
  background: #fbeeee;
  border: 1px solid #e0b4b4;
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 20px;
  color: #6b2b2b;
}

.crisis-title {
  font-weight: bold;
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.crisis-notice p {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.crisis-notice ul {
  margin: 0 0 10px;
  padding-left: 1.2em;
  font-size: 0.95rem;
  line-height: 1.9;
}

.crisis-notice a {
  color: #6b2b2b;
  font-weight: bold;
}

.crisis-sub {
  font-size: 0.82rem;
  color: #8a5555;
}

.story-illustration {
  display: block;
  width: 100%;
  max-width: 260px;
  margin: 0 auto 20px;
}

.story-day {
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.story-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: normal;
  margin: 0 0 6px;
  color: var(--accent-dark);
}

.story-theme {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 24px;
}

.story-body p {
  font-size: 1.08rem;
  margin: 0 0 1.1em;
  text-indent: 1em;
}

.story-reflection {
  margin-top: 24px;
  padding: 16px 18px;
  background: #f2e9d8;
  border-radius: 6px;
  font-size: 0.98rem;
  color: var(--text-soft);
  border-left: 3px solid var(--accent);
}

.placeholder {
  text-align: center;
  color: var(--text-soft);
  padding: 30px 10px;
  font-size: 1.02rem;
}

.app-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.app-footer a {
  color: var(--text-soft);
}

.faq-item {
  margin-bottom: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.faq-q {
  font-size: 1.15rem;
  font-weight: normal;
  color: var(--accent-dark);
  margin: 0 0 10px;
}

.faq-a {
  font-size: 1rem;
  margin: 0;
  color: var(--text);
}

.faq-link, .back-link {
  text-align: center;
  margin: 4px 0 20px;
}

.faq-link a, .back-link a {
  color: var(--accent-dark);
  font-size: 0.95rem;
}
