/* SemioMed Pomodoro: compact, responsive study timer. */
.semiomed-pomodoro-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 35, 61, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.semiomed-pomodoro-overlay[hidden] {
  display: none;
}

.semiomed-pomodoro-dialog {
  display: flex;
  width: min(980px, 100%);
  max-height: calc(100dvh - 32px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #c9d8e8;
  border-radius: 8px;
  background: #f7f9fc;
  color: #17243a;
  box-shadow: 0 24px 70px rgba(16, 56, 104, 0.24);
}

.semiomed-pomodoro-header {
  display: flex;
  min-height: 68px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid #dbe5ef;
  background: #ffffff;
}

.semiomed-pomodoro-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.semiomed-pomodoro-brand {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 8px;
}

.semiomed-pomodoro-brand-symbol {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.semiomed-pomodoro-brand-wordmark {
  width: auto;
  height: 25px;
  max-width: 118px;
  object-fit: contain;
}

.semiomed-pomodoro-eyebrow,
.semiomed-pomodoro-section-label {
  margin: 0;
  color: #174375;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.semiomed-pomodoro-title {
  margin: 2px 0 0;
  color: #17243a;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.semiomed-pomodoro-icon-button {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cad7e5;
  border-radius: 8px;
  background: #ffffff;
  color: #40536a;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.semiomed-pomodoro-icon-button:hover {
  border-color: #9eb5cf;
  background: #edf3f9;
  color: #103868;
}

.semiomed-pomodoro-icon-button:focus-visible,
.semiomed-pomodoro-mode button:focus-visible,
.semiomed-pomodoro-stepper button:focus-visible,
.semiomed-pomodoro-stepper input:focus-visible,
.semiomed-pomodoro-primary-action:focus-visible,
.semiomed-pomodoro-secondary-action:focus-visible {
  outline: 3px solid rgba(34, 91, 154, 0.2);
  outline-offset: 2px;
}

.semiomed-pomodoro-content {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 14px;
  padding: 14px;
}

.semiomed-pomodoro-main,
.semiomed-pomodoro-side {
  min-height: 0;
  border: 1px solid #d6e1ec;
  border-radius: 8px;
  background: #ffffff;
}

.semiomed-pomodoro-main {
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.semiomed-pomodoro-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid #d7e2ed;
  border-radius: 8px;
  background: #f3f6fa;
}

.semiomed-pomodoro-mode button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.semiomed-pomodoro-mode button:hover {
  background: #e6eef7;
  color: #103868;
}

.semiomed-pomodoro-mode button[aria-selected="true"],
.semiomed-pomodoro-mode button[aria-selected="true"]:hover {
  border-color: #103868 !important;
  background: #103868 !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(16, 56, 104, 0.16) !important;
}

.semiomed-pomodoro-settings {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) minmax(120px, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #f8fafc;
}

.semiomed-pomodoro-duration {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.semiomed-pomodoro-duration > span {
  color: #52657b;
  font-size: 11px;
  font-weight: 750;
}

.semiomed-pomodoro-stepper {
  display: grid;
  width: 112px;
  grid-template-columns: 32px 48px 32px;
  overflow: hidden;
  border: 1px solid #cbd8e5;
  border-radius: 7px;
  background: #ffffff;
}

.semiomed-pomodoro-stepper button,
.semiomed-pomodoro-stepper input {
  height: 34px;
  border: 0;
  background: #ffffff;
  color: #173f70;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.semiomed-pomodoro-stepper button {
  cursor: pointer;
}

.semiomed-pomodoro-stepper button:hover {
  background: #eaf1f8;
}

.semiomed-pomodoro-stepper input {
  width: 48px;
  border-right: 1px solid #dbe4ed;
  border-left: 1px solid #dbe4ed;
  outline: 0;
  appearance: textfield;
}

.semiomed-pomodoro-stepper input::-webkit-inner-spin-button,
.semiomed-pomodoro-stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.semiomed-pomodoro-clock {
  display: grid;
  min-height: 270px;
  flex: 1 1 auto;
  place-items: center;
  padding: 12px 0 8px;
}

.semiomed-pomodoro-ring {
  position: relative;
  width: min(238px, 42vh);
  aspect-ratio: 1;
}

.semiomed-pomodoro-ring svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.semiomed-pomodoro-ring-track,
.semiomed-pomodoro-ring-progress {
  fill: none;
  stroke-width: 10;
}

.semiomed-pomodoro-ring-track {
  stroke: #dfe8f2;
}

.semiomed-pomodoro-ring-progress {
  stroke: #1b4f86;
  stroke-linecap: round;
  transition: stroke-dashoffset 400ms linear;
}

.semiomed-pomodoro-time {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.semiomed-pomodoro-time strong {
  color: #101b31;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(42px, 6vw, 58px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
}

.semiomed-pomodoro-time span {
  margin-top: 10px;
  color: #66768a;
  font-size: 12px;
  font-weight: 700;
}

.semiomed-pomodoro-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
}

.semiomed-pomodoro-primary-action,
.semiomed-pomodoro-secondary-action {
  min-height: 46px;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.semiomed-pomodoro-primary-action {
  border: 1px solid #103868;
  background: #103868;
  color: #ffffff;
}

.semiomed-pomodoro-primary-action:hover {
  border-color: #173f70;
  background: #173f70;
}

.semiomed-pomodoro-secondary-action {
  border: 1px solid #cad8e6;
  background: #ffffff;
  color: #40536a;
}

.semiomed-pomodoro-secondary-action:hover {
  border-color: #9eb5cf;
  background: #edf3f9;
  color: #103868;
}

.semiomed-pomodoro-side {
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.semiomed-pomodoro-side h3 {
  margin: 4px 0 0;
  color: #17243a;
  font-size: 18px;
  font-weight: 800;
}

.semiomed-pomodoro-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.semiomed-pomodoro-stat {
  padding: 12px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #f5f8fb;
}

.semiomed-pomodoro-stat span {
  display: block;
  color: #7a8ba0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.semiomed-pomodoro-stat strong {
  display: block;
  margin-top: 6px;
  color: #103868;
  font-size: 24px;
  font-weight: 850;
}

.semiomed-pomodoro-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e0e8f0;
}

.semiomed-pomodoro-history-head h4 {
  margin: 0;
  color: #25374d;
  font-size: 13px;
  font-weight: 800;
}

.semiomed-pomodoro-clear {
  border: 0;
  background: transparent;
  color: #738399;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.semiomed-pomodoro-clear:hover:not(:disabled) {
  color: #a33b4b;
}

.semiomed-pomodoro-clear:disabled {
  cursor: default;
  opacity: 0.4;
}

.semiomed-pomodoro-history {
  min-height: 90px;
  margin-top: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.semiomed-pomodoro-history-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.semiomed-pomodoro-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e0e7ef;
  border-radius: 7px;
  background: #f8fafc;
}

.semiomed-pomodoro-history-item strong {
  display: block;
  color: #24364b;
  font-size: 12px;
}

.semiomed-pomodoro-history-item span {
  color: #75869a;
  font-size: 10px;
  font-weight: 650;
}

.semiomed-pomodoro-empty {
  display: grid;
  min-height: 94px;
  place-items: center;
  padding: 18px;
  border: 1px dashed #cdd9e5;
  border-radius: 8px;
  color: #718197;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.semiomed-pomodoro-status {
  min-height: 18px;
  margin: 10px 0 0;
  color: #5d6f84;
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

@media (max-width: 760px) {
  .semiomed-pomodoro-overlay {
    padding: 0;
  }

  .semiomed-pomodoro-dialog {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .semiomed-pomodoro-header {
    min-height: 62px;
    padding: 10px 12px;
  }

  .semiomed-pomodoro-brand {
    height: 32px;
    gap: 6px;
  }

  .semiomed-pomodoro-brand-symbol {
    width: 29px;
    height: 29px;
  }

  .semiomed-pomodoro-brand-wordmark {
    height: 21px;
    max-width: 98px;
  }

  .semiomed-pomodoro-eyebrow {
    display: none;
  }

  .semiomed-pomodoro-content {
    display: block;
    overflow-y: auto;
    padding: 10px;
  }

  .semiomed-pomodoro-main,
  .semiomed-pomodoro-side {
    padding: 12px;
  }

  .semiomed-pomodoro-side {
    margin-top: 10px;
  }

  .semiomed-pomodoro-settings {
    grid-template-columns: 1fr 1fr;
  }

  .semiomed-pomodoro-settings .semiomed-pomodoro-section-label {
    grid-column: 1 / -1;
  }

  .semiomed-pomodoro-duration {
    align-items: flex-start;
    flex-direction: column;
  }

  .semiomed-pomodoro-stepper {
    width: 100%;
    grid-template-columns: 34px minmax(42px, 1fr) 34px;
  }

  .semiomed-pomodoro-stepper input {
    width: 100%;
  }

  .semiomed-pomodoro-clock {
    min-height: 235px;
  }

  .semiomed-pomodoro-ring {
    width: min(212px, 58vw);
  }

  .semiomed-pomodoro-time strong {
    font-size: 44px;
  }
}

@media (max-height: 680px) and (min-width: 761px) {
  .semiomed-pomodoro-clock {
    min-height: 225px;
  }

  .semiomed-pomodoro-ring {
    width: 205px;
  }

  .semiomed-pomodoro-main,
  .semiomed-pomodoro-side {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .semiomed-pomodoro-ring-progress,
  .semiomed-pomodoro-icon-button,
  .semiomed-pomodoro-mode button,
  .semiomed-pomodoro-primary-action,
  .semiomed-pomodoro-secondary-action {
    transition: none;
  }
}
