:root {
  color: #29241f;
  background: #f5f0e7;
  font-family: Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, transparent 50%, rgb(169 112 58 / 5%) 50%),
    radial-gradient(circle at 78% 12%, rgb(184 126 65 / 17%), transparent 23rem),
    #f5f0e7;
  background-size: 36px 36px, auto, auto;
}

.deployment-info {
  position: fixed;
  right: 0.75rem;
  bottom: 0.65rem;
  padding: 0.3rem 0.55rem;
  color: #796b5e;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  background: rgb(255 253 248 / 88%);
  border: 1px solid #ded4c7;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgb(64 45 28 / 8%);
}

.site-header {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 0 5vw;
  background: rgb(250 247 240 / 88%);
  border-bottom: 1px solid #ded4c7;
  backdrop-filter: blur(12px);
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.locale-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 0.75rem;
}

.locale-toggle {
  padding: 0.3rem 0.45rem;
  color: #7d4c28;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 750;
  background: transparent;
  border: 1px solid #d8ccbd;
  border-radius: 999px;
  cursor: pointer;
}

.button,
.auth-actions a,
.auth-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.9rem;
  color: #fffaf2;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
  background: #704628;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.guide-nav a {
  color: #7d4c28;
  font-size: 0.82rem;
  text-decoration: none;
}

.guide-nav {
  margin-left: 1.25rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.url-import-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.65rem;
}

.url-import-fields[hidden] {
  display: none;
}

.range-number {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  justify-self: stretch;
  padding: 0.25rem 0.35rem;
  text-align: right;
}

.brew-fields .form-field > input[type="text"],
.brew-fields .form-field > textarea {
  width: 100%;
}

.brew-fields > summary.brew-toggle {
  display: inline-flex;
  color: #fffaf2;
  cursor: pointer;
  list-style: none;
}

.brew-fields > summary.brew-toggle::-webkit-details-marker {
  display: none;
}

.brew-fields[open] > summary.brew-toggle {
  display: none;
}

.url-import-fields .form-status {
  grid-column: 1 / -1;
}

.auth-actions button {
  color: #5d4635;
  background: #ebe2d7;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #34291f;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: 1.2rem;
  text-decoration: none;
}

.brand-bean {
  width: 17px;
  height: 24px;
  background: #795033;
  border-radius: 55% 45% 52% 48%;
  box-shadow: inset 6px 0 0 #a87449;
  transform: rotate(25deg);
}

.brand-beta {
  margin-left: 0.25rem;
  padding: 0.18rem 0.42rem;
  color: #7d4c28;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  border: 1px solid #caa989;
  border-radius: 999px;
}

main {
  width: min(760px, 90vw);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 7rem) 0 5rem;
}

.profile-card,
.loading-card,
.message-card,
.notes-card,
.form-card {
  background: rgb(255 253 248 / 92%);
  border: 1px solid #ded4c7;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgb(64 45 28 / 9%);
}

.home-beans {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #ded4c7;
}

.home-beans h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.profile-card,
.loading-card,
.message-card,
.form-card {
  padding: clamp(1.6rem, 6vw, 3.5rem);
}

.form-card h1 {
  margin-bottom: 2rem;
}

.tasting-form {
  display: grid;
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
  color: #71665d;
  font-size: 0.78rem;
  font-weight: 750;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.72rem 0.8rem;
  color: #29241f;
  font: inherit;
  font-weight: 450;
  background: #fffdf8;
  border: 1px solid #d8ccbd;
  border-radius: 9px;
}

.form-field textarea {
  resize: vertical;
}

.range-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem;
  align-items: center;
  gap: 0.75rem;
}

.range-field input[type="range"] {
  width: 100%;
  padding: 0;
}

.range-value {
  min-width: 3.5rem;
  color: #5d3c25;
  font-weight: 750;
  text-align: right;
}

.brew-fields {
  display: grid;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid #d8ccbd;
  border-radius: 9px;
  background: #faf6ef;
}

.brew-fields summary {
  color: #5d3c25;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
}

.tag-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0.8rem;
  border: 1px solid #d8ccbd;
  border-radius: 9px;
}

.tag-field legend {
  width: 100%;
  padding: 0;
  color: #71665d;
  font-size: 0.78rem;
  font-weight: 750;
}

.equipment-field {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0.8rem;
  border: 1px solid #d8ccbd;
  border-radius: 9px;
}

.equipment-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.equipment-field legend {
  padding: 0;
  color: #71665d;
  font-size: 0.78rem;
  font-weight: 750;
}

.equipment-group-label {
  grid-column: 1 / -1;
  margin: 0;
  color: #887a6e;
  font-size: 0.7rem;
  font-weight: 750;
}

.equipment-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #685c53;
  font-size: 0.82rem;
}

.tag-field > input[type="search"] {
  width: 100%;
  padding: 0.72rem 0.8rem;
  color: #29241f;
  font: inherit;
  font-weight: 450;
  background: #fffdf8;
  border: 1px solid #d8ccbd;
  border-radius: 9px;
}

.tag-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.6rem;
  color: #5d4635;
  font-size: 0.78rem;
  background: #f3eee6;
  border-radius: 999px;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 1rem 2rem;
  color: #71665d;
  font-size: 0.8rem;
}

.site-footer a,
.legal-page a {
  color: #7d4c28;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible,
.legal-page a:hover,
.legal-page a:focus-visible {
  color: #4f301d;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.legal-page {
  width: min(42rem, calc(100% - 2rem));
  margin: 3rem auto;
  line-height: 1.8;
}

.legal-page h1,
.legal-page h2 {
  color: #29241f;
}

.legal-page h2 {
  margin-top: 2rem;
  font-size: 1.1rem;
}

.legal-page img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #dfd2c3;
  border-radius: 0.5rem;
}

.legal-page .button {
  min-width: 9rem;
  color: #fffaf2;
  line-height: 1.4;
  white-space: nowrap;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
}

.tag-remove {
  padding: 0;
  color: inherit;
  font: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.beans-field {
  display: flex;
  align-items: end;
  gap: 0.75rem;
}

.beans-field .form-field {
  flex: 1;
}

.beans-create-link {
  flex: none;
  margin-bottom: 0.72rem;
  color: #704628;
  background: #eadfce;
}

.score-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 1rem;
  background: #f3eee6;
  border-radius: 12px;
}

.score-form-grid .form-field input {
  background: #fffdf8;
}

.score-control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.65rem;
}

.score-form-grid input[type="range"] {
  padding: 0;
  accent-color: #9b612d;
}

.score-value {
  min-width: 1.5rem;
  color: #704628;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: #9b612d;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1rem;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: clamp(2.35rem, 9vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.04;
  overflow-wrap: anywhere;
}

/* Japanese Mincho glyphs appear visually heavier at the same size. */
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] .tasting-card h3,
html[lang="ja"] .empty-state strong {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0;
}

.profile-card h1 {
  max-width: 100%;
  margin-bottom: 0.65rem;
  font-size: clamp(1.65rem, 5vw, 2.6rem);
  letter-spacing: -0.035em;
}

.profile-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  width: 100%;
}

.profile-title-row h1 {
  min-width: 0;
}

.profile-title-row .back-link {
  flex: none;
  margin-left: auto;
  margin-top: 0;
  font-size: 0.76rem;
  text-align: right;
}

.bean-title-row {
  justify-content: flex-start;
}

.bean-visibility-badge {
  margin-bottom: 0.35rem;
}

.bean-title-row .button {
  margin-left: auto;
}

.profile-card {
  padding: clamp(1.25rem, 4vw, 2rem);
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #71665d;
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.1rem;
  max-width: 22rem;
}

.profile-actions .button {
  width: 100%;
  margin-top: 0;
}

.profile-card > .secondary-button {
  color: #704628;
  background: #eadfce;
}

.profile-editor {
  margin-top: 1.5rem;
  border-top: 1px solid #e8e0d5;
}

.profile-editor summary {
  padding-top: 1.2rem;
  color: #7d4c28;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.profile-settings {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.1rem;
  padding-top: 1.4rem;
}

.profile-settings label {
  display: grid;
  gap: 0.35rem;
  color: #71665d;
  font-size: 0.76rem;
  font-weight: 700;
}

.profile-settings label.visibility-field {
  display: flex;
  align-items: center;
}

.profile-settings input[type="text"] {
  width: 100%;
  padding: 0.75rem 0.85rem;
  color: inherit;
  font: inherit;
  background: #fffdf8;
  border: 1px solid #d8ccbd;
  border-radius: 9px;
}

.profile-settings .button {
  justify-self: start;
}

.form-status {
  margin: 0;
  color: #71665d;
  font-size: 0.76rem;
}

.badge {
  display: inline-flex;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
}

.badge.public {
  color: #704628;
  background: #ead8c1;
}

.badge.private {
  color: #245b3a;
  background: #dfede2;
}

.notes-card {
  margin-top: 1.5rem;
  padding: 1.5rem;
}

.notes-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e8e0d5;
}

.notes-heading h2 {
  margin-bottom: 0;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: 1.55rem;
  font-weight: 500;
}

.bean-link {
  color: inherit;
  text-decoration: none;
}

.bean-link:hover {
  color: #7d4c28;
}

.bean-meta {
  margin-bottom: 0.35rem;
  color: #71665d;
  font-size: 0.82rem;
}

.source-link {
  display: block;
  text-align: right;
}

.notes-heading span {
  color: #8a7e74;
  font-size: 0.72rem;
}

.empty-state {
  padding: 3.2rem 1rem;
  color: #776b61;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 0.45rem;
  color: #42372f;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: 1.1rem;
  font-weight: 500;
}

.tasting-list {
  display: grid;
  gap: 0;
}

.tasting-card {
  padding: 1.35rem 0.25rem;
  border-bottom: 1px solid #e8e0d5;
}

.tasting-card:last-child {
  border-bottom: 0;
}

.tasting-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.tasting-card-heading-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
}

.note-detail-link {
  color: #7d4c28;
  font-size: 0.72rem;
  text-decoration: none;
}

.note-detail-link:hover {
  text-decoration: underline;
}

.note-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.note-detail-actions .back-link {
  margin-left: auto;
}

.share-status {
  color: #71665d;
  font-size: 0.76rem;
}

.visibility-editor {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.75rem;
  margin: 1rem 0 0.5rem;
  padding: 0.9rem;
  background: #faf6ef;
  border: 1px solid #d8ccbd;
  border-radius: 9px;
}

.visibility-editor .form-field {
  flex: 1;
  margin: 0;
}

.visibility-toggle-button {
  min-height: 2.35rem;
  min-width: 5rem;
  padding: 0.55rem 0.9rem;
  color: #fffaf2;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  background: #704628;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.visibility-toggle-button[aria-pressed="false"] {
  color: #245b3a;
  background: #dfede2;
}

.visibility-toggle-button:focus-visible {
  outline: 2px solid #c98c50;
  outline-offset: 2px;
}

.visibility-switch {
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: #685c53;
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
}

.visibility-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.visibility-switch-track {
  position: relative;
  display: inline-block;
  width: 3.4rem;
  height: 1.85rem;
  background: #cfc5b8;
  border-radius: 999px;
  transition: background 150ms ease;
}

.visibility-switch-track::after {
  position: absolute;
  top: 0.225rem;
  left: 0.225rem;
  width: 1.4rem;
  height: 1.4rem;
  background: #fffdf8;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgb(64 45 28 / 20%);
  content: "";
  transition: transform 150ms ease;
}

.visibility-toggle:checked + .visibility-switch-track {
  background: #704628;
}

.visibility-toggle:checked + .visibility-switch-track::after {
  transform: translateX(1.5rem);
}

.visibility-toggle:focus-visible + .visibility-switch-track {
  outline: 2px solid #c98c50;
  outline-offset: 2px;
}

.visibility-editor .form-status {
  grid-column: 1 / -1;
  margin: 0;
}

.visibility-editor > .button {
  justify-self: end;
}

.note-detail-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.note-detail-actions .back-link {
  margin: 0;
}

.note-edit-card .danger-button {
  margin-top: 0.5rem;
}

.note-edit-heading .danger-button {
  margin-top: 0;
  margin-left: auto;
}

.note-detail-heading .danger-button {
  margin-left: auto;
}

.danger-button {
  min-height: 2.35rem;
  justify-self: end;
  padding: 0.55rem 0.9rem;
  color: #8a3428;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  background: transparent;
  border: 1px solid #c98c81;
  border-radius: 999px;
  cursor: pointer;
}

.danger-button:hover {
  background: #fff0ec;
}

.tasting-card h3 {
  margin: 0;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: 1.35rem;
  font-weight: 500;
}

.tasting-card time {
  flex: none;
  color: #8a7e74;
  font-size: 0.72rem;
}

.scores {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.score {
  padding: 0.55rem 0.35rem;
  text-align: center;
  background: #f3eee6;
  border-radius: 8px;
}

.score span,
.score strong {
  display: block;
}

.score span {
  margin-bottom: 0.25rem;
  color: #887a6e;
  font-size: 0.58rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score strong {
  color: #5d3c25;
  font-family: Georgia, serif;
  font-size: 1.15rem;
}

.tasting-note {
  margin: 1rem 0 0;
  padding-left: 0.8rem;
  color: #685c53;
  border-left: 2px solid #c98c50;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.brew-summary {
  margin-top: 1rem;
  padding: 0.8rem;
  color: #685c53;
  background: #faf6ef;
  border-left: 2px solid #9b7654;
  font-size: 0.78rem;
}

.brew-summary p {
  margin: 0.35rem 0 0;
}

.bean-attributes {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.bean-attribute-group {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.bean-attribute-label {
  flex: 0 0 4.5rem;
  color: #887a6e;
  font-size: 0.68rem;
  font-weight: 750;
}

.bean-attribute-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bean-attribute {
  padding: 0.24rem 0.5rem;
  color: #704628;
  font-size: 0.7rem;
  background: #f2e4d3;
  border-radius: 999px;
}

.flavor-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.flavor-note {
  padding: 0.28rem 0.55rem;
  color: #704628;
  font-size: 0.7rem;
  background: #f2e4d3;
  border-radius: 999px;
}

.message-card p:last-child,
.empty-state p:last-child {
  margin-bottom: 0;
}

.back-link {
  display: inline-block;
  margin-top: 1rem;
  color: #7d4c28;
  font-weight: 700;
  text-underline-offset: 0.2em;
}

@media (max-width: 540px) {
  .site-header {
    padding: 0 1rem;
  }

  main {
    width: min(100% - 2rem, 760px);
    padding-top: 2rem;
  }

  .profile-actions {
    max-width: none;
  }

  .profile-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }

  .notes-heading span {
    display: none;
  }

  .tasting-card-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
  }

  .scores {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
