/* App theme tokens + Markdown preview/editor (default). */
:root {
  --eien-ui-font-body:
    var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  --eien-ui-font-mono:
    var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  --foreground: #171717;
  --background: #ffffff;

  /* SaturdayColor — 土曜が今日の見出し（現状ブルー系と同等） */
  --eien-day-saturday-today-row-bg: rgba(239, 246, 255, 0.2);
  --eien-day-saturday-today-row-bg-hover: rgba(239, 246, 255, 0.35);
  --eien-day-saturday-today-border-l: #93c5fd;
  /* SundayColor — 日曜が今日の見出し（現状レッド系と同等） */
  --eien-day-sunday-today-row-bg: rgba(254, 242, 242, 0.2);
  --eien-day-sunday-today-row-bg-hover: rgba(254, 242, 242, 0.35);
  --eien-day-sunday-today-border-l: #fca5a5;
  /* TodayColor — 平日が今日 / 「今日」バッジ / カレンダー今日枠（緑） */
  --eien-day-today-weekday-row-bg: rgba(236, 253, 245, 0.2);
  --eien-day-today-weekday-row-bg-hover: rgba(236, 253, 245, 0.35);
  --eien-day-today-weekday-border-l: #6ee7b7;
  --eien-day-today-pill-text: #047857;
  --eien-day-today-pill-ring: #a7f3d0;
  --eien-day-today-calendar-border: #059669;
  /* VirginColor — 未作成ドット（オレンジ系） */
  --eien-virgin-dot-fill: rgba(249, 115, 22, 0.05);
  --eien-virgin-dot-ring: rgba(251, 146, 60, 0.5);
}
:root.dark {
  --foreground: #ededed;
  --background: #0a0a0a;

  --eien-day-saturday-today-row-bg: rgba(23, 37, 84, 0.2);
  --eien-day-saturday-today-row-bg-hover: rgba(23, 37, 84, 0.35);
  --eien-day-saturday-today-border-l: #1d4ed8;
  --eien-day-sunday-today-row-bg: rgba(69, 10, 10, 0.2);
  --eien-day-sunday-today-row-bg-hover: rgba(69, 10, 10, 0.35);
  --eien-day-sunday-today-border-l: #b91c1c;
  --eien-day-today-weekday-row-bg: rgba(2, 44, 34, 0.2);
  --eien-day-today-weekday-row-bg-hover: rgba(2, 44, 34, 0.35);
  --eien-day-today-weekday-border-l: #047857;
  --eien-day-today-pill-text: #6ee7b7;
  --eien-day-today-pill-ring: #065f46;
  --eien-day-today-calendar-border: #34d399;
  --eien-virgin-dot-fill: rgba(251, 146, 60, 0.85);
  --eien-virgin-dot-ring: rgba(253, 186, 116, 0.45);
}

/* GitHub-ish Markdown (scoped) */

.md-root {
  color: #24292f;
  font-family: var(--eien-ui-font-body);
  font-size: 16px;
}

.dark .md-root {
  color: #e6edf3;
}

.md-root > :first-child {
  margin-top: 0 !important;
}
.md-root > :last-child {
  margin-bottom: 0 !important;
}

.md-root .md-h1,
.md-root .md-h2,
.md-root .md-h3,
.md-root .md-h4,
.md-root .md-h5,
.md-root .md-h6,
.md-root h1,
.md-root h2,
.md-root h3,
.md-root h4,
.md-root h5,
.md-root h6 {
  font-weight: 650;
  margin-top: 1.25em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

.md-root .md-h1,
.md-root h1 {
  font-size: 2em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.md-root .md-h2,
.md-root h2 {
  font-size: 1.5em;
  padding-bottom: 0.25em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.md-root .md-h3,
.md-root h3 {
  font-size: 1.25em;
}
.md-root .md-h4,
.md-root h4 {
  font-size: 1.1em;
}

.dark .md-root .md-h1,
.dark .md-root h1 {
  border-bottom-color: rgba(255, 255, 255, 0.14);
}
.dark .md-root .md-h2,
.dark .md-root h2 {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.md-root .md-p,
.md-root p {
  margin: 0.75em 0;
}

.md-root .md-ul,
.md-root .md-ol,
.md-root ul,
.md-root ol {
  padding-left: 1.5em;
  margin: 0.75em 0;
  list-style-position: outside;
}
.md-root .md-ul,
.md-root ul {
  list-style-type: disc;
}
.md-root .md-ol,
.md-root ol {
  list-style-type: decimal;
}
.md-root .md-li,
.md-root li {
  margin: 0.25em 0;
}
.md-root .md-li::marker,
.md-root li::marker {
  color: inherit;
}
.md-root.cm-typora-live .md-li {
  position: relative;
  padding-left: 1.6em; /* room for marker/number */
}
.md-root.cm-typora-live .md-li.md-indent-2 {
  padding-left: 2.6em;
}
.md-root.cm-typora-live .md-li.md-indent-4 {
  padding-left: 3.6em;
}
.md-root.cm-typora-live .md-li.md-indent-6 {
  padding-left: 4.6em;
}
.md-root.cm-typora-live .md-li.md-indent-8 {
  padding-left: 5.6em;
}
.md-root.cm-typora-live .cm-content {
  counter-reset: md-ol0 md-ol2 md-ol4 md-ol6 md-ol8;
}
.md-root.cm-typora-live .md-li.md-unordered::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: currentColor;
  width: 1.1em;
  text-align: center;
}
.md-root.cm-typora-live .md-li.md-ordered::before {
  position: absolute;
  left: 0;
  top: 0;
  color: currentColor;
  width: 1.1em;
  text-align: right;
}
.md-root.cm-typora-live .md-li.md-ordered.md-indent-0 {
  counter-increment: md-ol0;
  counter-reset: md-ol2 md-ol4 md-ol6 md-ol8;
}
.md-root.cm-typora-live .md-li.md-ordered.md-indent-2 {
  counter-increment: md-ol2;
  counter-reset: md-ol4 md-ol6 md-ol8;
}
.md-root.cm-typora-live .md-li.md-ordered.md-indent-4 {
  counter-increment: md-ol4;
  counter-reset: md-ol6 md-ol8;
}
.md-root.cm-typora-live .md-li.md-ordered.md-indent-6 {
  counter-increment: md-ol6;
  counter-reset: md-ol8;
}
.md-root.cm-typora-live .md-li.md-ordered.md-indent-8 {
  counter-increment: md-ol8;
}
.md-root.cm-typora-live .md-li.md-ordered.md-indent-0::before {
  content: counter(md-ol0) ".";
}
.md-root.cm-typora-live .md-li.md-ordered.md-indent-2::before {
  content: counter(md-ol2) ".";
}
.md-root.cm-typora-live .md-li.md-ordered.md-indent-4::before {
  content: counter(md-ol4) ".";
}
.md-root.cm-typora-live .md-li.md-ordered.md-indent-6::before {
  content: counter(md-ol6) ".";
}
.md-root.cm-typora-live .md-li.md-ordered.md-indent-8::before {
  content: counter(md-ol8) ".";
}

.md-root .md-blockquote,
.md-root blockquote {
  border-left: 4px solid rgba(0, 0, 0, 0.15);
  padding: 0.2em 0 0.2em 1em;
  margin: 0.9em 0;
  color: rgba(0, 0, 0, 0.7);
}
.dark .md-root .md-blockquote,
.dark .md-root blockquote {
  border-left-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.75);
}

.md-root .md-code {
  font-family: var(--eien-ui-font-mono);
  font-size: 0.9em;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  padding: 0.15em 0.35em;
}
.dark .md-root .md-code {
  background: rgba(255, 255, 255, 0.1);
}

.md-root .md-pre {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 0.9em 1em;
  overflow-x: auto;
  margin: 0.9em 0;
}
.dark .md-root .md-pre {
  background: rgba(255, 255, 255, 0.08);
}
.md-root .md-pre .md-code {
  background: transparent;
  padding: 0;
}

.md-root .md-a {
  color: #0969da;
  text-decoration: none;
  border-bottom: 1px solid rgba(9, 105, 218, 0.35);
}
.dark .md-root .md-a {
  color: #58a6ff;
  border-bottom-color: rgba(88, 166, 255, 0.45);
}
.md-root .md-a:hover {
  border-bottom-color: currentColor;
}

.md-root .md-hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  margin: 2px 15%;
}
.dark .md-root .md-hr {
  border-top-color: rgba(255, 255, 255, 0.14);
}

.md-root .md-table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.9em 0;
  font-size: 0.95em;
}
.md-root .md-th,
.md-root .md-td {
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0.45em 0.7em;
  text-align: left;
}
.dark .md-root .md-th,
.dark .md-root .md-td {
  border-color: rgba(255, 255, 255, 0.14);
}
.md-root .md-th {
  background: rgba(0, 0, 0, 0.04);
  font-weight: 650;
}
.dark .md-root .md-th {
  background: rgba(255, 255, 255, 0.08);
}

.md-root input[type="checkbox"] {
  margin-right: 0.4em;
}

.md-root .md-img {
  max-width: 100%;
  height: auto;
}

/* Invisible chars (editor) */
.cm-invisible-char {
  color: rgba(148, 163, 184, 0.55); /* light */
}
.dark .cm-invisible-char {
  color: rgba(148, 163, 184, 0.35); /* lighter */
}

/* Typora live mode (editor) */
.cm-typora-live {
  --typora-font: var(--eien-ui-font-body);
  --typora-text: #24292f;
  --typora-heading-line-height: 1.25;
  --typora-h1-size: 2em;
  --typora-h2-size: 1.5em;
  --typora-h3-size: 1.25em;
  --typora-h1-weight: 700;
  --typora-h2-weight: 650;
  --typora-h3-weight: 650;
}
.cm-typora-live .cm-content {
  font-family: var(--typora-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--typora-text);
}
.dark .cm-typora-live {
  --typora-text: #e6edf3;
}
