* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fdefdd;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: #3e2723;
}

.app {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.app-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 16px;
}

.mascot-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.mascot-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 15%;
  box-shadow: 0 1px 4px rgba(62, 39, 35, 0.25);
}

.mascot-bubble {
  position: relative;
  background: #ffffff;
  border: 1px solid #eadfce;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
}

.mascot-bubble::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 14px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-left: 1px solid #eadfce;
  border-bottom: 1px solid #eadfce;
  transform: rotate(45deg);
}

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.entry-details {
  border: 1px solid #eadfce;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fffaf3;
}

.entry-details summary {
  font-size: 13px;
  color: #9a5b28;
  cursor: pointer;
}

.entry-details-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.entry-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #7a6f63;
  flex: 1;
}

.entry-field input {
  padding: 8px 10px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}

.entry-field-row {
  display: flex;
  gap: 8px;
}

.sort-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.sort-button {
  padding: 6px 14px;
  border: 1px solid #e98a4c;
  background: #ffffff;
  color: #e98a4c;
  border-radius: 999px;
  font-size: 12px;
}

.sort-button.is-active {
  background: #e98a4c;
  color: #ffffff;
}

textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid #eadfce;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

button {
  padding: 10px 12px;
  border: 1px solid #e98a4c;
  background: #e98a4c;
  color: #ffffff;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

.entries-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-card {
  background: #ffffff;
  border: 1px solid #eadfce;
  border-radius: 12px;
  padding: 12px 14px;
}

.entry-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.category-group-header {
  font-size: 14px;
  font-weight: 600;
  color: #9a5b28;
  margin: 20px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid #eadfce;
}

.category-group-header:first-child {
  margin-top: 0;
}

.category-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.category-badge {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  border: none;
  white-space: nowrap;
}

.category-badge-major {
  background: #e98a4c;
  color: #ffffff;
  font-weight: 600;
}

.category-badge-middle {
  background: #f5b98a;
  color: #6b3410;
}

.category-badge-minor {
  background: #ffe6d1;
  color: #7a3a10;
}

.category-separator {
  color: #c9a479;
  font-size: 12px;
}

.entry-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-category-button {
  border: 1px solid #eadfce;
  background: #ffffff;
  color: #9a5b28;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.category-edit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.category-edit-input {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #eadfce;
  width: 90px;
  font-family: inherit;
}

.category-edit-save,
.category-edit-cancel {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.category-edit-save {
  border: 1px solid #e98a4c;
  background: #e98a4c;
  color: #ffffff;
}

.category-edit-cancel {
  border: 1px solid #eadfce;
  background: #ffffff;
  color: #7a6f63;
}

.entry-date {
  font-size: 12px;
  color: #9a8f83;
}

.entry-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}

.entry-text {
  font-size: 14px;
  margin: 0 0 10px;
  color: #5a4a3f;
}

.entry-section {
  margin-bottom: 8px;
}

.entry-section:last-child {
  margin-bottom: 0;
}

.section-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.section-pill-tech {
  background: #fbdcc9;
  color: #a1481a;
}

.section-pill-related {
  background: #eee0c8;
  color: #7a6030;
}

.section-body {
  font-size: 13px;
  color: #7a6f63;
  margin: 0;
  line-height: 1.5;
}

.recommendation-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.7;
}

.recommendation-list a {
  color: #c46a2b;
}

.recommendation-list a:hover {
  text-decoration: none;
}

.empty-state {
  font-size: 14px;
  color: #9a8f83;
  text-align: center;
  padding: 20px 0;
}
