/* Adapted card, ratio and timer styles from Beanconqueror contributors.
   GPL-3.0-only; Bookify browser and white-palette changes, October 2026. */
:root {
  --ion-text-color: #282013;
  --ion-color-light: #fff;
  --ion-color-accent: #f1e7d9;
  --padding-top: 16px;
  --line: #d9d4cb;
  font-family: system-ui, sans-serif;
  color: var(--ion-text-color);
  background: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  max-width: 1180px;
  padding: 28px;
  margin: auto;
}
h1 {
  font-size: 30px;
  line-height: 1.2;
  margin: 8px 0 18px;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 23px;
  margin: 22px 0 16px;
}
h3 {
  font-size: 18px;
  margin: 0 0 14px;
}
h4 {
  margin: 16px 0 8px;
}
p {
  line-height: 1.65;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a.button {
  border: 1px solid #c2b9ab;
  border-radius: 8px;
  padding: 11px 16px;
  color: #332b20;
  background: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
button:hover {
  background: #f5f0e7;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button.primary {
  background: #493f30;
  border-color: #493f30;
  color: #fff;
}
button[aria-pressed="true"] {
  background: #f1e7d9;
  border-color: #7e6e56;
}
a {
  color: #493f30;
  text-underline-offset: 3px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #95815e;
  outline-offset: 3px;
}
.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: #75674f;
  font-weight: 700;
}
.help,
small {
  font-size: 13px;
  color: #736b5f;
  line-height: 1.55;
}
.actions,
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0;
}
fieldset {
  padding: 0;
  border: 0;
  min-width: 0;
  margin: 0;
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0;
  min-width: 0;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #b8b0a4;
  border-radius: 7px;
  padding: 10px 12px;
  background: white;
  color: inherit;
  font-weight: 400;
}
.field textarea {
  line-height: 1.5;
  resize: vertical;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  margin: 16px 0;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: #756449;
}
form {
  margin: 20px 0;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin: 20px 0;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
  font-weight: 600;
}
#error {
  color: #842c1e;
  background: #fff1ec;
  border: 1px solid #deb5a6;
  border-radius: 8px;
  padding: 12px 16px;
}
#status {
  font-size: 14px;
}
ion-grid,
ion-row,
ion-col,
ion-card,
ion-card-header,
ion-card-content,
ion-item,
ion-label {
  display: block;
  min-width: 0;
}
ion-row {
  display: flex;
  gap: 16px;
}
ion-col {
  flex: 1;
}
ion-card {
  background: var(--ion-color-light);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin: 18px 0;
}
ion-card-content {
  padding: 20px;
}
ion-card-header {
  padding: 20px;
}
.card-background {
  background: var(--ion-color-accent) !important;
  color: var(--ion-text-color);
}
.small-card {
  max-width: 340px;
  margin: 20px auto;
  text-align: center;
}
.small-card ion-card-header {
  font-size: 2em;
}
.small-card ion-card-content {
  padding-top: 16px !important;
}
.brew-layout {
  width: 100%;
  margin: 0;
}
.brew-layout ion-card-content {
  padding: 8px;
  padding-top: var(--padding-top);
}
.brew-title {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.dashboard-layout .dashboard-time-center {
  display: grid;
  height: 100%;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}
.dashboard-layout .date-column {
  position: relative;
  flex: 0 0 110px;
}
.dashboard-layout .vr {
  border-right: 2px solid var(--ion-color-accent);
  height: 60%;
  position: absolute;
  top: 20%;
  bottom: 20%;
  right: 0;
}
.dashboard-layout .details-column {
  padding: 20px 20px 20px 0;
}
.favourite-brew {
  border: 2px solid #05c793;
}
.best-brew {
  border: 2px solid #ae9f87;
}
.brew-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.brew-card-grid ion-card {
  margin: 0;
}
.brew-card-grid .actions {
  margin-bottom: 0;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 14px;
}
.timer {
  background: var(--ion-color-light);
  padding: 0;
}
.timer output {
  font-size: 64px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  display: block;
  text-align: center;
  margin: 20px 0;
}
.timer .actions {
  justify-content: center;
}
.rating-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.badge {
  background: #f1e7d9;
  border-radius: 6px;
  padding: 3px 8px;
}
.notes {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.table-scroll {
  overflow: auto;
  max-width: 100%;
  margin: 20px 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 650px;
  font-size: 14px;
}
th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  vertical-align: top;
  max-width: 280px;
  overflow-wrap: anywhere;
}
thead {
  background: #faf7f1;
}
footer {
  margin-top: 35px;
  font-size: 12px;
  text-align: right;
}
input[type="file"] {
  max-width: 100%;
}
.muted {
  color: #756d61;
}
@media (max-width: 640px) {
  main {
    padding: 16px;
  }
  h1 {
    font-size: 25px;
  }
  .fields,
  .brew-card-grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 16px;
  }
  .timer output {
    font-size: 50px;
  }
  .dashboard-layout .date-column {
    flex-basis: 82px;
  }
  .dashboard-layout .details-column {
    padding: 16px 12px 16px 0;
  }
  ion-row {
    gap: 10px;
  }
  .field input[type="date"] {
    min-inline-size: 0;
  }
}
@media print {
  nav,
  .actions,
  form,
  footer,
  #status,
  #error,
  .help {
    display: none;
  }
  .panel,
  ion-card {
    break-inside: avoid;
  }
  main {
    padding: 0;
  }
  .table-scroll {
    overflow: visible;
  }
}
