:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: #18212f;
  background: #f4f7fb;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(32, 86, 216, 0.08), transparent 32%),
    #f4f7fb;
  display: flex;
  flex-direction: column;
}

a {
  color: #2056d8;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid #d8e0ee;
  backdrop-filter: blur(10px);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  font-size: 1.08rem;
  font-weight: 700;
  color: #18212f;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.nav a,
.link-button {
  color: #2056d8;
  text-decoration: none;
  font: inherit;
}

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0 3rem;
}

.page > .flash {
  width: min(100%, 980px);
  margin-left: auto;
  margin-right: auto;
}

.page-layout {
  width: 100%;
  margin: auto 0;
  display: grid;
  gap: 1.25rem;
}

.page-layout-narrow {
  width: min(100%, 560px);
}

.page-layout-medium {
  width: min(100%, 860px);
}

.page-layout-wide {
  width: min(100%, 980px);
}

.page-layout > * {
  width: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-header-compact {
  margin-bottom: 1rem;
  align-items: flex-start;
}

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

.card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d8e0ee;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(24, 33, 47, 0.08);
}

.auth-card,
.form-card {
  width: 100%;
}

.form-card-wide {
  max-width: none;
}

.slot-list {
  display: grid;
  gap: 1rem;
}

.slot-card {
  display: grid;
  gap: 1rem;
}

.slot-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.slot-subtitle {
  margin: 0.15rem 0 0;
}

.slot-title-emphasis {
  font-size: 1.15rem;
  font-weight: 700;
}

.slot-meta {
  display: grid;
  gap: 0.9rem;
}

.slot-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slot-meta div {
  display: grid;
  gap: 0.2rem;
}

.slot-meta-full {
  grid-column: 1 / -1;
}

.slot-meta dt {
  font-size: 0.82rem;
  font-weight: 700;
  color: #5c6880;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.slot-meta dd {
  margin: 0;
}

.public-slot-meta {
  margin-bottom: 1.5rem;
}

.slot-actions,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.8rem 1rem;
  border: 1px solid #c7d3e4;
  border-radius: 14px;
  background: #ffffff;
  color: #18212f;
  text-decoration: none;
}

.danger-zone {
  border-color: #f0c4cb;
  background: rgba(255, 241, 243, 0.72);
}

.inline-action-form {
  margin: 0;
  align-self: flex-start;
}

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

.form label {
  font-weight: 600;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: 52px;
  padding: 0.9rem 1rem;
  border: 1px solid #c7d3e4;
  border-radius: 16px;
  background: #ffffff;
  color: #18212f;
}

.form textarea {
  min-height: 132px;
  resize: vertical;
}

.field-block {
  display: grid;
  gap: 0.55rem;
}

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

.subtle-panel {
  padding: 1.15rem;
  border: 1px solid #d8e0ee;
  border-radius: 20px;
  background: #fbfcfe;
  display: grid;
  gap: 0.95rem;
}

.subtle-panel h2 {
  margin: 0;
  font-size: 1.02rem;
}

.form-hint {
  margin: 0;
}

.date-control,
.time-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: stretch;
}

.date-control {
  position: relative;
}

.picker-button,
.time-shortcuts,
.calendar-select {
  min-width: 138px;
  border: 1px solid #c7d3e4;
  border-radius: 16px;
  background: #ffffff;
  color: #18212f;
}

.time-shortcuts,
.calendar-select {
  padding: 0 0.9rem;
}

.picker-button {
  min-height: 52px;
  padding: 0 1rem;
  cursor: pointer;
}

.calendar-popover {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 0;
  z-index: 20;
  width: min(100%, 340px);
  padding: 1rem;
  border: 1px solid #d8e0ee;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 18px 40px rgba(24, 33, 47, 0.1);
  backdrop-filter: blur(14px);
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.calendar-select {
  min-height: 42px;
  border-radius: 14px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.calendar-weekdays {
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #5c6880;
  text-align: center;
}

.calendar-day {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  color: #18212f;
}

.calendar-day:hover,
.calendar-day:focus-visible {
  border-color: #b9c4d6;
  outline: none;
}

.calendar-day.is-today {
  border-color: #d7dde6;
}

.calendar-day.is-selected {
  background: #ffffff;
  border-color: #18212f;
  color: #18212f;
}

.calendar-day.is-disabled {
  color: #b2bccd;
  cursor: not-allowed;
  border-color: transparent;
}

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

.recurrence-panel {
  gap: 0.85rem;
}

.form button,
.button-link,
.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.1rem;
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.form button,
.button-link {
  background: #2056d8;
}

.button-danger {
  background: #b42318;
}

.flash {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid transparent;
}

.flash-success {
  color: #135a2f;
  background: #edf9f1;
  border-color: #bfe8cd;
}

.flash-error {
  color: #8a2230;
  background: #fff1f3;
  border-color: #f0c4cb;
}

.flash-warning {
  color: #7a3d00;
  background: #fff6e8;
  border-color: #f4d49a;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: lowercase;
}

.status-free {
  color: #14532d;
  background: #dcfce7;
}

.status-booked {
  color: #9a3412;
  background: #ffedd5;
}

.muted,
.footnote {
  color: #5c6880;
}

@media (max-width: 860px) {
  .slot-editor-grid,
  .recurrence-grid,
  .slot-meta-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .header-row,
  .page-header,
  .slot-card-header,
  .slot-actions,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .date-control,
  .time-control {
    grid-template-columns: minmax(0, 1fr);
  }

  .picker-button,
  .time-shortcuts,
  .secondary-link,
  .form button,
  .button-danger,
  .button-link {
    width: 100%;
  }

  .page {
    padding-top: 1.5rem;
  }
}
