@font-face { font-family: "DM Sans"; src: url("./dm-sans.ttf") format("truetype"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Calendar Color Picks"; src: url("./color-picks.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Calendar Color Library"; src: url("./color-catalog.woff2") format("woff2"); font-display: swap; }
:root {
  color-scheme: light;
  --ink: #19202b;
  --quiet: #5c6575;
  --line: #dce0e7;
  --accent: #264cd1;
  --wash: #edf1ff;
  --page: #fafbfc;
  --surface: #ffffff;
  --subtle: #f2f4f7;
  --hover: #e9eef7;
  --accent-text: white;
  --negative: #a3312b;
  --negative-bg: #ffe8e6;
  --emoji: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  font: 16px/1.45 "DM Sans",system-ui,sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
html, body { overscroll-behavior-x: none; }
body, h1, h2, h3, p { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible { outline: 3px solid #5476ff; outline-offset: 2px; z-index: 1; }
main { max-width: 1184px; margin: 0 auto; padding: clamp(20px,5vh,62px) clamp(16px,4.3vw,58px) 20px; }
.topline, .monthbar, .dialog-head, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#year { font-size: 16px; color: var(--quiet); font-variant-numeric: tabular-nums; }
.account, nav button, .secondary, .close { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.account { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 9px 14px; min-height: 39px; font-size: 14px; font-weight: 550; }
.account svg { width: 18px; height: 18px; }
#account-label { max-width: 180px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.monthbar { align-items: flex-end; margin: 13px 0 25px; }
h1, h2 { font-family: Georgia,"Times New Roman",serif; font-weight: 400; }
h1 { font-size: clamp(50px,7.1vw,93px); letter-spacing: -.07em; line-height: 1.02; }
nav { display: flex; gap: 5px; padding-bottom: 4px; }
nav button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 7px 13px; font-size: 14px; }
.tools, .bottom-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tools { justify-content: flex-end; }
.bottom-line { justify-content: space-between; margin-top: 12px; }
.bottom-line .hint { margin: 0; }
#this-month { background: none; color: var(--accent); border: 0; padding: 4px; font-size: 13px; }
.embedded #theme, .embedded #account, .embedded #signout, [hidden] { display: none !important; }
.embedded main { padding-top: 9px; }
.account:hover, .close:hover, .secondary:hover, nav button:hover { background: var(--hover); }
.arrow { width: 9px; height: 9px; border-top: 1.7px solid; border-right: 1.7px solid; }
.prev { transform: rotate(-135deg); }
.next { transform: rotate(45deg); }
.weekdays, .grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.weekdays { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.weekdays span { padding: 12px 12px 10px; font-size: 12px; font-weight: 650; color: var(--quiet); }
.grid { border-left: 1px solid var(--line); }
.grid, .grid .cell { touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.swipe-hint { display: none; }
@media (pointer: coarse) { .swipe-hint { display: inline; } }
.cell { position: relative; display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-width: 0; height: clamp(78px,11.7vh,125px); padding: 8px; border: solid var(--line); border-width: 0 1px 1px 0; background: var(--surface); }
.cell.outside { color: var(--quiet); background: var(--subtle); }
.cell.current { background: var(--wash); box-shadow: inset 0 2px var(--accent); }
.cell:focus-visible { outline-offset: -3px; }
.num { flex-shrink: 0; min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; font-size: 15px; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; }
.current .num { background: var(--accent); color: var(--accent-text); }
.preview {
  flex: 1 1 0; width: 100%; min-height: 0; margin-top: 3px;
  display: grid; gap: 2px; grid-template-columns: repeat(var(--cols),minmax(0,1fr));
  grid-template-rows: repeat(var(--rows),minmax(0,1fr)); overflow: hidden;
}
.slot { min-width: 0; min-height: 0; container-type: size; display: grid; place-items: center; overflow: hidden; }
.glyph { display: inline-grid; place-content: center; width: 1.25em; height: 1.25em; overflow: hidden; font-family: var(--emoji); }
.glyph-ink { display: block; width: max-content; line-height: 1.12; white-space: nowrap; }
.curated-art { font-family: "Apple Color Emoji","Calendar Color Picks",var(--emoji); }
.catalog-art { font-family: "Apple Color Emoji","Calendar Color Library",var(--emoji); }
.slot > .glyph { font-size: min(var(--size), 76cqw, 76cqh); }
.combined { position: relative; isolation: isolate; }
.combined > .glyph { position: absolute; font-size: 64%; left: 0; top: 0; }
.combined > .glyph:nth-child(2) { inset: auto 0 0 auto; }
.combined[data-parts="3"] > .glyph { font-size: 54%; }
.combined[data-parts="3"] > .glyph:nth-child(2) { inset: 0 0 auto auto; }
.combined[data-parts="3"] > .glyph:nth-child(3) { inset: auto auto 0 23%; }
.slot .more { font-size: min(12px, 70cqh, calc(135cqw / var(--digits))); line-height: 1.1; font-weight: 600; color: var(--quiet); }
@media (hover: hover) {
  .cell:hover { background: var(--hover); }
}
.hint, #notice { font-size: 13px; color: var(--quiet); margin-top: 14px; }
#notice, #feedback, #account-feedback { color: var(--negative); }
dialog { max-height: 92dvh; width: min(440px,calc(100% - 24px)); padding: 25px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 16px 90px #10152329; overscroll-behavior: contain; }
dialog::backdrop { background: #1c273c45; }
.dialog-head { align-items: start; margin-bottom: 22px; }
.eyebrow, #remove-hint, .empty, .profile-note { color: var(--quiet); font-size: 13px; }
h2 { font-size: 34px; letter-spacing: -.05em; line-height: 1.18; }
.close { display: grid; place-content: center; width: 34px; height: 34px; border: 0; background: var(--subtle); border-radius: 50%; font: 24px/1 Arial,sans-serif; }
h3 { font-size: 15px; font-weight: 650; }
.entries { display: flex; flex-wrap: wrap; gap: 6px; min-height: 60px; max-height: 25dvh; overflow: auto; align-content: start; padding: 8px; background: var(--subtle); border-radius: 11px; margin: 8px 0 22px; }
.empty { padding: 12px 6px; }
.pick, .token, .categories button { display: grid; place-content: center; font-family: var(--emoji); border: 0; background: transparent; border-radius: 9px; min-width: 0; min-height: 43px; padding: 0; overflow: hidden; }
.token { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 3px; min-width: 44px; padding-inline: 6px; height: 44px; font-size: 26px; background: var(--surface); }
.token-count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding-inline: 4px; border-radius: 999px; background: var(--subtle); color: var(--quiet); font: 600 11px/1 "DM Sans",system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.token:hover { background: var(--negative-bg); }
.token { touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.selecting .token { touch-action: none; }
.token[aria-pressed=true], .token.drop-target { background: var(--wash); box-shadow: inset 0 0 0 2px var(--accent); }
.token.dragging, .token[aria-disabled=true] { opacity: .55; }
.merge-link, #confirm-merge { background: transparent; color: var(--accent); border: 0; padding: 5px 8px; font-size: 13px; font-weight: 600; }
#remove-hint { margin-inline-start: auto; }
#merge-bar:not([hidden]) { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
#merge-preview { display: grid; place-items: center; flex: 0 0 36px; height: 36px; font-size: 25px; background: var(--subtle); border-radius: 8px; }
.merge-help { flex: 1; font-size: 13px; }
.merge-help small { display: block; font-size: 11px; color: var(--quiet); }
#confirm-merge { border-radius: 7px; background: var(--accent); color: var(--accent-text); }
#confirm-merge:disabled { cursor: default; }
.favorite-star::before { content: "☆"; font: 25px/1 Arial,sans-serif; }
.categories { display: flex; gap: 1px; margin: 5px 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.categories button { flex: 1 0 32px; font-size: 19px; }
.recent-clock { display: block; width: 20px; height: 20px; border: 1.8px solid currentColor; border-radius: 50%; position: relative; }
.recent-clock::before, .recent-clock::after { content: ""; position: absolute; left: calc(50% - 1px); bottom: calc(50% - 1px); width: 2px; height: 6px; background: currentColor; border-radius: 2px; transform-origin: 50% calc(100% - 1px); }
.recent-clock::after { height: 5px; transform: rotate(120deg); }
.categories button[aria-pressed=true] { background: var(--wash); box-shadow: inset 0 -2px var(--accent); }
.palette { height: clamp(176px,38dvh,352px); overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; border-block: 1px solid var(--line); scrollbar-width: thin; }
.emoji-block { display: grid; grid-template-columns: repeat(var(--emoji-columns,7),minmax(0,1fr)); grid-auto-rows: 44px; align-content: start; }
.palette > section:last-child { min-height: 100%; }
.emoji-heading { display: flex; align-items: center; justify-content: space-between; min-height: 30px; padding-inline: 4px; color: var(--quiet); }
.emoji-heading h4 { font: 600 13px/1.3 "DM Sans",system-ui,sans-serif; margin: 0; }
.emoji-heading h4 { flex: 1; overflow-wrap: anywhere; }
.emoji-heading button { border: none; background: transparent; color: var(--accent); font: 550 13px/1.3 "DM Sans",system-ui,sans-serif; padding: 5px 6px; }
.pick { position: relative; font-size: 26px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pick.has-tones::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 0; height: 0; border: 3px solid transparent; border-bottom-color: var(--quiet); border-right-color: var(--quiet); opacity: .65; }
.pick:hover, .categories button:hover { background: var(--hover); }
#search { display: block; width: 100%; margin-top: 8px; font-size: 16px; }
.palette .empty { grid-column: 1 / -1; }
input { min-width: 0; flex: 1; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.primary, .secondary { min-height: 40px; border-radius: 9px; padding: 8px 15px; font-weight: 550; font-size: 14px; }
.primary { border: 0; background: var(--accent); color: var(--accent-text); }
.primary:hover { filter: brightness(1.08); }
#feedback, #account-feedback { font-size: 13px; }
#feedback:not(:empty), #account-feedback:not(:empty) { margin-top: 9px; }
#account-name { overflow-wrap: anywhere; }
.profile-note { margin-top: 5px; }
#transfer { margin-top: 18px; padding: 12px; border-radius: 9px; background: var(--wash); font-size: 14px; }
#transfer button, #signout { margin-top: 12px; }
@media (max-width: 650px) {
  main { padding: 17px 12px 18px; }
  .monthbar { margin: 18px 0; }
  h1 { font-size: clamp(40px,10.2vw,64px); }
  nav { padding: 0; }
  nav button { gap: 6px; padding-inline: 9px; min-height: 38px; font-size: 13px; }
  .account, .tools .secondary { padding: 7px 10px; font-size: 13px; }
  .weekdays span { padding: 9px 0; text-align: center; }
  .cell { height: clamp(67px,11.4vh,94px); padding: 4px 2px; }
  .num { min-width: 22px; height: 22px; font-size: 13px; }
  dialog { padding: 18px; }
}
@media (max-width: 350px) {
  main { padding-inline: 8px; }
  .monthbar { flex-wrap: wrap; gap: 4px; }
  #remove-hint { font-size: 11px; }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #141715;
  --ink: #e8ede9;
  --quiet: #aeb9b3;
  --surface: #1c221f;
  --subtle: #232a26;
  --hover: #303a35;
  --line: #39423c;
  --accent: #b0c2ff;
  --accent-text: #172139;
  --wash: #293246;
  --negative: #ffaaa2;
  --negative-bg: #52332f;
}
@media (max-width: 420px) {
  .monthbar { flex-wrap: wrap; align-items: center; row-gap: 9px; }
  #account-label { max-width: 130px; }
  .section-head { flex-wrap: wrap; gap: 2px 8px; }
}
