/* @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&display=swap'); */


html, body {
  margin: 0;
  padding: 0;
  font-size: 16px;
  box-sizing: border-box;
  font-family: var(--font-stack-sans-serif);
  color: rgba(0, 0, 0, 0.85);
  line-height: 1.5;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body > main {
  flex-grow: 1;
}

html.development, body.development {
  border: 4px dashed var(--color-orange);
}

p {
  margin-bottom: var(--base-spacing);
  word-break: break-word;
}

select { 
  height: 40px;
  padding: 0 calc(var(--base-spacing)/4);
}

a {
  cursor: pointer;
  color: black;
}

a.is-link {
  text-decoration: underline;
}

main,
footer,
header,
nav {
  width: 100%;
  margin: 0;
}

/* Match main horizontal padding to nav so content isn't flush */
main {
  padding-left: var(--base-spacing);
  padding-right: var(--base-spacing);
}

main.is-narrow {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Full-page editor (notes, journal): no box, full height, terminal-style focus on content */
main.editor-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 75px);
  padding-top: calc(var(--base-spacing) / 2);
}

main.editor-page .field {
  margin-bottom: var(--base-spacing);
}

main.editor-page .editor-body,
.editor-body {
  font-family: var(--font-stack-monospace);
  line-height: 1.6;
  min-height: 12em;
  flex: 1 1 0;
}

/* Subtle auto-save indicator: hidden by default, only visible with --show after save */
.note-autosave-indicator {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.note-autosave-indicator--show {
  opacity: 0.6;
  pointer-events: auto;
}

@media (max-width: 768px) {
  main {
    padding-left: calc(var(--base-spacing) / 2);
    padding-right: calc(var(--base-spacing) / 2);
  }
}

.profile-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #ccc;
  &.is-large {
    width: 48px;
    height: 48px;
  }
}

#main-nav {
  width: 100%;
  min-width: 100%;
  margin-bottom: var(--base-spacing);
  padding: 0 var(--base-spacing);
  section {
    display: flex;
    align-items: center;
    margin: 0;
    max-width: none;
    height: 45px;
    width: 100%;
  }
  .logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    &:hover {
      background-color: transparent;
    }
  }
  .logo-40 {
    background-color: transparent;
  }
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  a {
    text-align: center;
    justify-content: center;
    line-height: 45px;
    color: rgba(0, 0, 0, 0.8);
    height: 100%;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    padding: 0 0.5rem;
    margin-right: calc(var(--base-spacing)/4);
    &:hover {
      background: rgba(0, 0, 0, 0.05);
    }
    &.selected {
      border-bottom: 2px solid black;
    }
    @media (max-width: 768px) {
      flex-grow: 1;
    }
  }
}

/* Modal tabs styling similar to main nav */
.button-group [data-toggle-target="tab"] {
  border: none;
  background: transparent;
  padding: 0 0.5rem;
  margin-right: 0.5rem;
  cursor: pointer;
}
.button-group [data-toggle-target="tab"].is-active {
  border-bottom: 2px solid black;
}

@media (max-width: 768px) {
  #main-nav {
    padding: 0 calc(var(--base-spacing)/2);
    a {
      padding: 0 0.25rem;
    }
  }

  #main-nav {
    .label { display: none; }
  }
}

footer {
  padding-bottom: 2rem;
}

.field {
  margin-bottom: calc(var(--base-spacing) * 2);

  .field_with_errors {
    label { color: var(--color-red); }
    input { border-color: var(--color-red); }
  }
}

.note-audio-player {
  max-width: 100%;
  width: 100%;
  display: block;
}

.note-audio-player--full {
  width: 100%;
  max-width: 480px;
}

.note-audio-panel .button.is-disabled {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 640px) {
  .note-audio-player--full {
    max-width: 100%;
  }
}

.field textarea,
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=number],
.field input[type=url],
.field input[type=tel],
.field input[type=date],
.field input[type=datetime-local],
.field input[type=time] {
  margin: 0.25rem 0;
  width: 100%;
}
.field input[type=checkbox],
.field input[type=radio] {
  margin-right: 0.5rem;
}

.field.field_with_errors {
  input {
    border-color: var(--color-red);
  }
}

input[type=checkbox],
input[type=radio] {
  width: auto;
  width: 25px !important;
  min-width: 25px !important;
}

.box {
  background-color: var(--color-box);
  color: rgba(0, 0, 0, 0.9);
  padding: calc(var(--base-spacing) * 2) calc(var(--base-spacing) * 4);
  border-radius: var(--form-radius);
  line-height: 1.5;
  box-shadow: 0 0.5rem 3rem -0.5rem rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.1);

  &.has-shadow {
    box-shadow: 4px 4px 0 0 rgba(0,0,0,0.30);
  }
}

.box:empty {
  display: none;
}

.box {
  &.is-narrow {
    padding: var(--base-spacing) calc(var(--base-spacing) * 2);
  }
  &.is-super-narrow {
    padding: var(--base-spacing) calc(var(--base-spacing) * 1);
  }

  &.is-red,
  &.is-danger {
    background-color: #efd1d1;
    border-color: #f3e1e1;
  }

  &.is-blue,
  &.notice {
    background-color: #d4dff6;
    @media (prefers-color-scheme: dark) {
      color: rgba(0, 0, 0, 0.7);
    }
  }
}

input {
  border-radius: var(--form-radius);
}

.input,
textarea,
input[type=tel],
input[type=time],
input[type=date],
input[type=datetime-local],
input[type=email],
input[type=password],
input[type=number],
input[type=url],
input[type=submit],
input[type=text] {
  display: block;
  box-shadow: inset 0 0.0625em 0.125em rgba(10, 10, 10, 0.05);
  max-width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.2);
  font-size: 1rem;
  height: 2.5em;
  justify-content: flex-start;
  line-height: 1.25;
  padding-bottom: calc(0.5em - 1px);
  padding-left: calc(0.75em - 1px);
  padding-right: calc(0.75em - 1px);
  padding-top: calc(0.5em - 1px);
  position: relative;
}

.input.is-invalid,
textarea.is-invalid,
input[type=tel].is-invalid,
input[type=time].is-invalid,
input[type=date].is-invalid,
input[type=datetime-local].is-invalid,
input[type=email].is-invalid,
input[type=password].is-invalid,
input[type=number].is-invalid,
input[type=submit].is-invalid,
input[type=text].is-invalid {
  border-color: var(--color-red);
}

.input.is-invalid:hover,
textarea.is-invalid:hover,
input[type=tel].is-invalid:hover,
input[type=time].is-invalid:hover,
input[type=date].is-invalid:hover,
input[type=datetime-local].is-invalid:hover,
input[type=email].is-invalid:hover,
input[type=password].is-invalid:hover,
input[type=number].is-invalid:hover,
input[type=submit].is-invalid:hover,
input[type=text].is-invalid:hover {
  border: 1px solid var(--color-red);
}

.input:hover,
textarea:hover,
input[type=tel]:hover,
input[type=time]:hover,
input[type=date]:hover,
input[type=datetime-local]:hover,
input[type=email]:hover,
input[type=password]:hover,
input[type=number]:hover,
input[type=submit]:hover,
input[type=text]:hover {
  border: 1px solid rgba(0, 0, 0, 0.2);
}

input[type=time],
input[type=date],
input[type=datetime-local] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: inherit;
  cursor: pointer;
  font-family: var(--font-stack-sans-serif);
  padding: 0.5rem 1rem;
  height: auto;
}

@media (prefers-color-scheme: dark) {
  input[type=time],
  input[type=date],
  input[type=datetime-local] {
    background-color: #555;
    color: white;
    border: 1px solid #666;
  }
}

input[type=time]:hover,
input[type=date]:hover,
input[type=datetime-local]:hover {
  filter: brightness(1.2);
}

.button-group {
  display: inline-flex;
}

.button-group .button {
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin: 0;
  border-radius: 0;
  padding: var(--base-spacing);
}

.button-group .button:first-child {
  border-radius: var(--button-radius) 0 0 var(--button-radius);
}

.button-group .button:last-child {
  border-radius: 0 var(--button-radius) var(--button-radius) 0;
}

.button-group .button:not(:last-child) {
  border-right: none;
}

.button-group .button:hover {
  border-color: rgba(0, 0, 0, 0.2);
  z-index: 1;
}

input[type=submit],
button,
.button {
  font-weight: 500;
  font-family: var(--font-stack-sans-serif);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  border-radius: var(--button-radius);
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  padding: 0.5rem 1rem;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;

  &:hover,
  &:focus {
    filter: brightness(1.2);
  }
}

button a,
.button a {
  text-decoration: none;
}

button[disabled],
.button[disabled],
button.disabled,
.button.disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.5;
}

button.is-primary,
.button.is-primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

button.is-small,
.button.is-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;

  &.is-tokens {
    padding: 0;
    .value {
      padding: 0.4rem 0.8rem;
    }
    .amount {
      padding: 0.4rem 0.8rem;
    }
  }
}

button.is-tiny,
.button.is-tiny {
  padding: 0.2rem 0.4rem;
  font-size: 0.6rem;
}

button.is-link,
.button.is-link {
  border-color: transparent;
  font-weight: 500;
  text-decoration: underline;
  color: black;
}

button.is-link:hover,
.button.is-link:hover {
  color: black;
  border-color: transparent;
}

button.is-danger,
.button.is-danger {
  background-color: var(--color-danger);
  border-color: var(--color-danger);
  color: white;
}

.highlight {
  background-color: var(--color-highlight);
  @media (prefers-color-scheme: dark) {
    color: black;
  }
}

.highlight-slant {
  position: relative;
  display: inline-block;
  z-index: 0;
  &:before {
    content: "";
    display: block;
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    transform: translateY(7%) skew(10deg) translateX(-2%) rotate(-1deg);
    height: 100%;
    background-color: yellow;
    z-index: -1;
  }
  @media (prefers-color-scheme: dark) {
    color: black;
  }
}


table {
  border-collapse: collapse;
  border: 1px solid rgba(0, 0, 0, 0.1);
  tr:nth-child(even) {
    background-color: rgba(0, 0, 0, .025);
  }
}

table th,
table td {
  text-align: left;
}

table td {
  padding: calc(var(--base-spacing) / 2);
}

.hint {
  font-family: var(--font-stack-sans-serif);
  opacity: 0.6;
  font-size: 0.8rem;
  line-height: 1.5;
  display: inline-block;
}

hr {
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  border-bottom: none;
}

.tag {
  border: 1px solid transparent;
  font-size: 0.6rem;
  display: inline-block;
  background-color: #e0e0e0;
  color: white;
  padding: 0.2rem 0.4rem;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.5px;
  border-radius: calc(var(--form-radius) / 2);
  font-family: var(--font-stack-sans-serif);
  text-decoration: none; /* ensure tags aren't underlined */
}

/* Deterministic color variants for tags */
.tag.tag--c1 { background-color: #2563eb; }
.tag.tag--c2 { background-color: #7c3aed; }
.tag.tag--c3 { background-color: #ea580c; }
.tag.tag--c4 { background-color: #16a34a; }
.tag.tag--c5 { background-color: #742558; }
.tag.tag--c6 { background-color: #0891b2; }
.tag.tag--c7 { background-color: #ca8a04; }
.tag.tag--c8 { background-color: #9333ea; }
.tag.tag--c9 { background-color: #65a30d; }
.tag.tag--c10 { background-color: #059669; }
.tag.tag--c11 { background-color: #1c9cb9; }
.tag.tag--c12 { background-color: #1d4ed8; }
.tag.tag--c13 { background-color: #d97706; }
.tag.tag--c14 { background-color: #8b5cf6; }
.tag.tag--c15 { background-color: #0d9488; }
.tag.tag--c16 { background-color: #61991c; }
.tag.tag--c17 { background-color: #4d7c0f; }
.tag.tag--c18 { background-color: #3730a3; }
.tag.tag--c19 { background-color: #a16207; }
.tag.tag--c20 { background-color: #166534; }

/* Interval tags */
.tag.tag--interval { margin-left: 0.25rem; }
.tag.tag--daily { background-color: #16a34a; }
.tag.tag--every-other-day { background-color: #059669; }
.tag.tag--weekly { background-color: #2563eb; }
.tag.tag--monthly { background-color: #7c3aed; }
.tag.tag--yearly { background-color: #ea580c; }

summary {
  cursor: pointer;
}

legend,
.legend,
label,
.label {
  display: block;
  font-weight: 500;
  font-family: var(--font-stack-sans-serif);
  font-size: 14px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.6);
}

details[open] > summary::marker {
  content: "-";
  color: rgba(255, 255, 255, 0.5);
}

details summary::marker {
  content: "+";
  color: rgba(255, 255, 255, 0.5);
 }

th {
  font-weight: 500;
  letter-spacing: 0.5px;
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  font-family: var(--font-stack-sans-serif);
  @media (prefers-color-scheme: dark) {
    color: rgba(255, 255, 255, 0.7);
  }
}


.logo-64 {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  background-size: cover;
  background-repeat: no-repeat;
  background-image: url("/images/logo-dark_300.png");
}
@media (prefers-color-scheme: dark) {
  .logo-64 {
    background-image: url("/images/logo-light_300.png");
  }
}


.modal-overlay {
  cursor: pointer;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9000;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal {
  /* Acts as a logical root; avoid clipping children */
  position: static;
  overflow: visible;
}

.modal .box {
  position: fixed;
  z-index: 9001; /* above overlay */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  max-width: 90vw;
  max-height: calc(90vh - 64px);
  overflow: auto;
}

/* Sidebar modal layout */
.sidebar-modal {
  position: fixed;
  z-index: 9001;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(520px, 100vw);
  max-width: 100%;
  background-color: var(--color-box);
  color: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: -0.5rem 0 3rem -0.5rem rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 200ms ease-out;
}

.modal:not([hidden]) .sidebar-modal { transform: translateX(0); }


.sidebar-modal__header {
  width: 100%;
  padding: 0; /* allow tabs to span full width edge-to-edge */
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-modal__header .button-group { display: flex; width: 100%; }
.sidebar-modal__header .button-group .button { flex: 1; border-radius: 0; }

.sidebar-modal__content {
  padding: calc(var(--base-spacing) * 2);
  flex: 1;
  overflow: auto;
}

.sidebar-modal__footer {
  padding: calc(var(--base-spacing) * 2);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background-color: inherit;
}

.sidebar-modal__footer .button,
.sidebar-modal__footer input[type=submit] {
  width: 100%;
}

@media (prefers-color-scheme: dark) {
  .sidebar-modal {
    background-color: #444;
    color: white;
    border-left-color: #555;
  }
  .sidebar-modal__header { border-bottom-color: #555; }
  .sidebar-modal__footer { border-top-color: #555; }
}

/* Wider variant for journal entry editing */
.sidebar-modal--wide {
  width: min(800px, 100vw);
}

/* Ensure hidden attribute works with flex elements */
[hidden] {
  display: none !important;
}

/* Mobile: full-screen modal */
@media (max-width: 640px) {
  .sidebar-modal {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    border-left: none;
    transform: translateY(-100%);
    box-shadow: none;
  }
  
  .modal:not([hidden]) .sidebar-modal {
    transform: translateY(0);
  }
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-family: var(--font-stack-headings);
}

h1 {
  letter-spacing: -1px;
  font-family: var(--font-stack-headings);
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem !important;
    line-height: 1.2;
  }
}


@media (prefers-color-scheme: dark) {
  body {
    background-color: #333;
    color: #fff;
    padding-bottom: 4rem;
  }

  #main-nav {
    a { color: rgba(255, 255, 255, 0.85); }
  }

  .notice {
    color: rgba(0, 0, 0, 0.7);
  }

  .box {
    background-color: #444;
    color: white;

    &.notice {
      color: black;
    }

    &.is-red,
    &.is-danger {
      background-color: #3a1c1c;
      border-color: #62312f;
    }
  }

  h1, h2, h3, h4, h5, h6 {
    color: white;
  }

  a {
    color: white;
  }

  label, legend {
    color: rgba(255, 255, 255, 0.5);
  }

  .button {
    background-color: #555;
    color: white;
  }

  .button.is-link {
    background: transparent;
    color: white;
  }

  .button.is-link:hover,
  .button.is-link:focus {
    color: white;
  }

  .tag {
    background-color: #555;
    color: white;
  }
  .tag.tag--c1 { background-color: #2f3e63; }
  .tag.tag--c2 { background-color: #4b3a63; }
  .tag.tag--c3 { background-color: #634d2f; }
  .tag.tag--c4 { background-color: #3a5f3a; }
  .tag.tag--c5 { background-color: #633a4f; }
  .tag.tag--c6 { background-color: #2f5163; }
  .tag.tag--c7 { background-color: #635a2f; }
  .tag.tag--c8 { background-color: #3a3a63; }
  /* Dark mode overrides for interval tags (ensure visibility) */
  .tag.tag--daily { background-color: #3a5f3a; }
  .tag.tag--every-other-day { background-color: #3a5a5f; }
  .tag.tag--weekly { background-color: #2f3e63; }
  .tag.tag--monthly { background-color: #4b3a63; }
  .tag.tag--yearly { background-color: #634d2f; }

  input, textarea, select {
    background-color: #555;
    color: white;
    border: 1px solid #666;
  }

  .sticky-character-footer {
    background-color: #333;
    color: white;
    border-color: #555;
  }

  .action-footer {
    background-color: #333;
    color: white;
    border-color: #555;
  }

  legend,
  .legend,
  label,
  .label {
    color: white;
  }
}



.pagination {
  font-family: var(--font-stack-sans-serif);
  .disabled { opacity: 0.5; pointer-events: none; }
  font-size: 1.2rem;
  a, em {
    padding: 0 calc(var(--base-spacing)/4);
  }
  em.current {
    font-style: normal;
    opacity: 0.6;
    pointer-events: none;
  }
}

input[type=file]:hover {
  filter: brightness(1.2);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  input[type=file] {
    background-color: #555;
    color: white;
    border: 1px solid #666;
  }
}


/* Style the "Choose File" button inside file inputs */
input[type=file]::-webkit-file-upload-button,
input[type=file]::file-selector-button {
  font-weight: 500;
  font-family: var(--font-stack-sans-serif);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  border-radius: var(--button-radius);
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.7);
  background: var(--color-primary);
  padding: 0.5rem 1rem;
  margin-right: 1rem;
  margin-inline-end: 1rem;
  color: white;
}

/* Hover state */
input[type=file]::-webkit-file-upload-button:hover,
input[type=file]::file-selector-button:hover {
  filter: brightness(1.2);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  input[type=file]::-webkit-file-upload-button,
  input[type=file]::file-selector-button {
    background-color: #555;
    color: white;
    border: 1px solid #666;
  }
}

.flashes {
  animation: flashes 5s forwards;
}

/* Flash message text colors, tuned for contrast in both themes */
.flash {
  font-weight: 500;
}
.flash--alert {
  color: #b3261e;
}
.flash--notice {
  color: #1b6e2e;
}
@media (prefers-color-scheme: dark) {
  .flash--alert {
    color: #f0a6a1;
  }
  .flash--notice {
    color: #7ddf97;
  }
}

/* Flashes shake and fade out */
@keyframes flashes {
  0% { transform: translateX(0); opacity: 1; display: none; }
  1% { transform: translateX(-10px); opacity: 1; display: block; }
  2% { transform: translateX(10px); opacity: 1; display: block; }
  3% { transform: translateX(-10px); opacity: 1; display: block; }
  4% { transform: translateX(0); opacity: 1; display: block; }
  80% { transform: translateX(0); opacity: 1; display: block; }
  100% { transform: translateX(0); opacity: 0; display: none; }
}


/* Task cards - mobile-first design */
.tasks-list {
  width: 100%;
}

.task-card {
  transition: background-color 0.15s ease;
}

.task-card:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
  .task-card:hover {
    background-color: rgba(255, 255, 255, 0.03);
  }
}

.task-complete-form {
  flex-shrink: 0;
}

.task-complete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  border-radius: var(--button-radius);
  cursor: pointer;
  font-size: 1.5rem;
  color: rgba(0, 0, 0, 0.3);
  transition: all 0.15s ease;
  padding: 0;
}

.task-complete-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.6);
}

.task-complete-btn.is-completed {
  color: var(--color-primary);
}

.task-complete-btn.is-completed:hover {
  color: var(--color-primary);
  opacity: 0.7;
}

@media (prefers-color-scheme: dark) {
  .task-complete-btn {
    color: rgba(255, 255, 255, 0.4);
  }
  .task-complete-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
  }
  .task-complete-btn.is-completed {
    color: var(--color-primary);
  }
}

.task-content {
  min-width: 0; /* Allows text truncation to work in flex */
}

.task-title {
  word-break: break-word;
  font-weight: 500;
}

.task-meta {
  font-size: 0.85rem;
}

.task-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  opacity: 0.3;
  transition: opacity 0.15s ease;
}

.task-card:hover .task-actions {
  opacity: 1;
}

/* Always show actions on touch devices */
@media (hover: none) {
  .task-actions {
    opacity: 0.6;
  }
}

.task-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--button-radius);
  cursor: pointer;
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.5);
  transition: all 0.15s ease;
  padding: 0;
  text-decoration: none;
}

.task-action-btn:hover {
  background-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.8);
}

@media (prefers-color-scheme: dark) {
  .task-action-btn {
    color: rgba(255, 255, 255, 0.5);
  }
  .task-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
  }
}

.task-details {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.task-card:hover .task-details {
  opacity: 0.5;
}

/* Mobile: show details always */
@media (max-width: 640px) {
  .task-details {
    opacity: 0.5;
  }
  
  .task-complete-btn {
    width: 48px;
    height: 48px;
    font-size: 1.75rem;
  }
  
  .task-action-btn {
    width: 40px;
    height: 40px;
  }

  .task-actions {
    display: grid;
    grid-template-columns: repeat(2, 40px);
    gap: 0.25rem;
  }
}

/* Filter panel */
.filters-panel {
  animation: slideDown 0.15s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Filter chips - same as .tag but with readable colors */
.filter-chip {
  border: 1px solid transparent;
  font-size: 0.6rem;
  display: inline-flex;
  align-items: center;
  background-color: #555;
  color: white;
  padding: 0.2rem 0.4rem;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.5px;
  border-radius: var(--tag-radius);
  text-decoration: none;
}

.filter-chip:hover {
  background-color: #333;
  color: white;
}

@media (prefers-color-scheme: dark) {
  .filter-chip {
    background-color: #888;
  }
  .filter-chip:hover {
    background-color: #aaa;
  }
}

/* Primary color for icons */
i.primary {
  color: var(--color-primary);
}

/* Contribution grid */
.contrib-grid {
  display: flex;
}
.contrib-grid .week { display: flex; flex-direction: column; margin-right: 4px; }
.contrib-grid .month-gap { width: 8px; }
.contrib-grid .day  {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 2px;
  margin-bottom: 4px;
}
.contrib-grid .lvl-0 { background: transparent; }
.contrib-grid .lvl-1 { background: rgba(255, 99, 0, 0.2); }
.contrib-grid .lvl-2 { background: rgba(255, 99, 0, 0.4); }
.contrib-grid .lvl-3 { background: rgba(255, 99, 0, 0.6); }
.contrib-grid .lvl-4 { background: rgba(255, 99, 0, 0.9); }

/* Future days in the current month: draw but mute visually */
.contrib-grid .day.is-future {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) {
  .contrib-grid .day.is-future {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.14);
  }
}

/* Simple spin animation for pending indicators */
.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Preserve line breaks and wrap text */
.pre-line {
  white-space: pre-line;
}

/* Journal entry obfuscation with Flow Block font */
.journal-obfuscated {
  font-family: 'Flow Block', cursive;
  font-size: 1em;
  line-height: 1.5;
  opacity: 0.6;
  transition: font-family 0.3s ease, opacity 0.3s ease;
  cursor: pointer;
  display: block;
  width: 100%;
  height: 1.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Make entire journal entry row trigger the reveal */
tr:hover .journal-obfuscated {
  font-family: var(--font-stack-sans-serif);
  font-size: 1em;
  line-height: 1.5;
  opacity: 1;
  height: 1.5em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
