/* Bookify browser controls and responsive adaptations, GPL-3.0. */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #fff;
  color: var(--text-color);
  font:
    16px/1.5 system-ui,
    sans-serif;
}
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
}
header {
  margin-bottom: 24px;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 10px 0;
}
h2 {
  font-size: 1.4rem;
  margin: 0 0 12px;
}
h3 {
  font-size: 1.1rem;
  margin: 0 0 12px;
}
p {
  margin: 8px 0 16px;
}
.eyebrow {
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 750;
  color: var(--main-color);
}
.muted,
small {
  color: var(--text-muted);
}
nav,
.actions,
.calendar-title {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
nav {
  margin: 20px 0;
}
button,
.button {
  font: inherit;
  font-size: 14px;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--input-border-color);
  border-radius: 9px;
  background: #fff;
  color: var(--text-color);
  cursor: pointer;
  overflow-wrap: anywhere;
}
button:hover {
  background: var(--surface-hover);
}
button.primary,
nav button[aria-current="page"] {
  background: var(--main-color);
  border-color: var(--main-color);
  color: #fff;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: var(--main-color);
}
:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}
.panel {
  padding: 22px;
  border: 1px solid var(--box-border-color);
  border-radius: 16px;
  margin: 20px 0;
  background: #fff;
  box-shadow: var(--box-shadow);
}
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
}
input,
select,
textarea {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  border: 1px solid var(--input-border-color);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  color: var(--text-color);
  background: #fff;
  min-height: 42px;
}
textarea {
  resize: vertical;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.check input {
  width: 18px;
  min-height: 18px;
  flex: 0 0 18px;
}
.wide {
  grid-column: 1/-1;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.table-wrap {
  overflow: auto;
  max-width: 100%;
  margin: 15px 0;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 630px;
}
th,
td {
  text-align: left;
  border-bottom: 1px solid var(--box-border-color);
  padding: 12px;
  vertical-align: top;
  font-size: 14px;
}
th {
  color: var(--text-muted);
  font-size: 12px;
}
td button {
  margin: 3px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.stat {
  border: 1px solid var(--box-border-color);
  border-radius: 12px;
  padding: 16px;
  background: #f8faff;
}
.stat strong {
  display: block;
  margin-bottom: 8px;
}
.price {
  font-variant-numeric: tabular-nums;
}
.subscription {
  cursor: default;
}
.subscription-main > .name {
  justify-content: flex-start;
  text-align: left;
  overflow-wrap: anywhere;
}
.subscription-main > .cycle,
.subscription-main > .next {
  font-size: 13px;
  color: var(--text-muted);
}
.subscription-main > .price {
  flex-basis: 20%;
  font-weight: 650;
}
.subscription-main {
  flex-wrap: wrap;
}
.subscription-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--box-border-color);
  padding-top: 10px;
}
.subscription.archived {
  opacity: 0.7;
}
.calendar-title {
  justify-content: space-between;
  margin: 20px 0;
}
.calendar-scroll {
  overflow: auto;
}
.calendar {
  min-width: 560px;
}
.calendar-event {
  max-width: 100%;
  min-height: 28px;
  border: 0;
}
.calendar-event:focus {
  white-space: normal;
}
.calendar-cell-content {
  overflow-wrap: anywhere;
}
#error {
  background: #fff0ed;
  border: 1px solid #f0b9aa;
  color: #922710;
  padding: 12px;
  border-radius: 10px;
}
#status {
  font-size: 14px;
  color: #315e41;
}
footer {
  margin: 32px 0;
  font-size: 13px;
  color: var(--text-muted);
}
details {
  margin: 16px 0;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
.selected-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 20px;
}
.empty {
  padding: 25px;
  border: 1px dashed var(--input-border-color);
  border-radius: 12px;
}
pre {
  white-space: pre-wrap;
}
.note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.calendar-note {
  font-size: 13px;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  main {
    padding: 16px;
  }
  .panel {
    padding: 15px;
  }
  .fields,
  .stats,
  .selected-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .subscription-main > .name {
    flex-basis: 100%;
  }
  .subscription-main > .cycle,
  .subscription-main > .next,
  .subscription-main > .price {
    flex-basis: calc(50% - 12px);
    justify-content: flex-start;
    text-align: left;
  }
  .calendar-title {
    align-items: flex-start;
  }
  .calendar-title h2 {
    flex-basis: 100%;
  }
  .actions > button {
    flex: 1 0 130px;
  }
  nav button {
    flex: 1 0 40%;
  }
  .wide {
    grid-column: auto;
  }
  input[type="date"],
  input[type="month"] {
    appearance: none;
    -webkit-appearance: none;
    min-width: 0;
  }
}
