:root {
  --bg: #ffffff;
  --layer: #f4f4f4;
  --layer-hover: #e8e8e8;
  --border: #e0e0e0;
  --text: #161616;
  --text-2: #525252;
  --text-3: #8d8d8d;
  --btn: #393939;
  --btn-text: #ffffff;
  --btn-hover: #474747;
  --focus: #161616;
  --red: #da1e28;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161616;
    --layer: #262626;
    --layer-hover: #333333;
    --border: #393939;
    --text: #f4f4f4;
    --text-2: #c6c6c6;
    --text-3: #6f6f6f;
    --btn: #6f6f6f;
    --btn-text: #ffffff;
    --btn-hover: #8d8d8d;
    --focus: #ffffff;
    --red: #ff8389;
  }
}
* { box-sizing: border-box; }
html {
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.43;
  letter-spacing: 0.16px;
}
.toolbar {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.btn {
  appearance: none;
  border: 0;
  border-radius: 0;
  min-height: 48px;
  padding: 0 64px 0 16px;
  background: var(--layer);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: default;
}
.btn:hover { background: var(--layer-hover); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.btn-primary { background: var(--btn); color: var(--btn-text); }
.btn-primary:hover { background: var(--btn-hover); }

.grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: minmax(176px, 1fr);
}
.cell {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.label {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
}
.region { color: var(--text-3); }
.date {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.date-year, .date-month { font-size: 24px; }
.date-day { font-size: 56px; line-height: 1.1; }
.native {
  margin: 8px 0 0;
  text-align: left;
  font-size: 16px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.weekday { margin: 8px 0 0; color: var(--text-2); }
.weekend { color: var(--red); }
.empty {
  grid-column: 1 / -1;
  padding: 16px;
  color: var(--text-2);
}

.panel {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  background: var(--layer);
  border-right: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 10;
}
.panel[hidden] { display: none; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 {
  margin: 0;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
}
.options {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}
.options label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  cursor: default;
}
.options label:hover { background: var(--layer-hover); }
.options input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--text);
}

@media (max-width: 671px) {
  .grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .cell { border-right: 0; }
  .date-year, .date-month { font-size: 20px; }
  .date-day { font-size: 44px; }
}
