:root {
  --bg: #f6fbf8;
  --surface: #ffffff;
  --surface-soft: #edf8f1;
  --green: #168a4a;
  --green-dark: #0d6335;
  --green-soft: #dff3e7;
  --mint: #75c98f;
  --text: #173326;
  --muted: #638273;
  --line: #d8eadf;
  --danger: #b3261e;
  --danger-soft: #fce7e3;
  --shadow: 0 18px 50px rgba(15, 82, 47, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(121, 205, 146, 0.22), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, var(--bg) 48%, #e9f7ef 100%);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, "Helvetica Neue", sans-serif;
  line-height: 1.5;
}

body.has-wallpaper {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(237, 248, 241, 0.88)),
    var(--account-wallpaper) center / cover fixed;
}

body.auth-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.app {
  width: min(1460px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0 42px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 8px 0 14px;
  backdrop-filter: blur(16px);
}

.language-select {
  position: relative;
  width: min(220px, 100%);
}

.language-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--green-dark);
  text-align: left;
  box-shadow: 0 10px 25px rgba(15, 82, 47, 0.08);
}

.language-button:hover,
.language-button:focus-visible,
.language-button[aria-expanded="true"] {
  border-color: var(--green);
  background: var(--surface-soft);
  outline: none;
}

.language-caption {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.language-button strong {
  display: block;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-button .icon {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.language-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 4px;
  width: 100%;
  max-height: min(340px, calc(100vh - 120px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.language-options button {
  min-height: 38px;
  border-radius: var(--radius);
  padding: 0 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 800;
}

.language-options button:hover,
.language-options button.active {
  background: var(--green);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(22, 138, 74, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(15, 82, 47, 0.12);
  flex: 0 0 auto;
}

.brand-logo {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
}

.brand-title {
  display: block;
}

.brand-title {
  font-size: clamp(1.22rem, 2vw, 1.9rem);
  line-height: 1.08;
  font-weight: 800;
  white-space: nowrap;
}

.nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(86px, 1fr)) minmax(138px, 1.18fr);
  align-items: center;
  gap: 8px;
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 12px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--green-dark);
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
}

.nav-link.special-nav {
  min-width: 138px;
}

.nav-menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--green-dark);
  box-shadow: 0 10px 28px rgba(15, 82, 47, 0.12);
}

.nav-link.active,
.nav-link:hover,
.nav-link:focus-visible {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  outline: none;
}

.nav-link.special-nav {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  background: linear-gradient(135deg, #f8d24a 0%, #168a4a 50%, #0d6335 100%);
  border-color: #f8d24a;
  color: #fff;
  box-shadow: 0 0 0 rgba(248, 210, 74, 0);
  animation: worldCupBlink 1.35s ease-in-out infinite;
}

.nav-link.special-nav::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: translateX(-120%);
  animation: worldCupShine 2.6s ease-in-out infinite;
}

.nav-link.special-nav svg,
.nav-link.special-nav span {
  position: relative;
  z-index: 1;
}

.auth-widget {
  flex: 0 0 auto;
  margin-left: 0;
}

.auth-entry {
  width: 100%;
  min-height: 46px;
  white-space: nowrap;
}

.auth-entry-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 8px;
  width: 246px;
}

.auth-account-stack {
  grid-template-columns: minmax(150px, 1fr) minmax(108px, 0.8fr);
  width: 280px;
}

.auth-account-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  line-height: 1.12;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  padding: 22px;
  background: rgba(23, 51, 38, 0.28);
  backdrop-filter: blur(5px);
}

.auth-dialog {
  width: min(460px, 100%);
  max-height: calc(100dvh - 44px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 82, 47, 0.24);
  overscroll-behavior: contain;
}

.auth-dialog-account {
  width: min(640px, 100%);
}

.auth-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.auth-dialog h2 {
  margin: 0;
  color: var(--green-dark);
  font-size: 1.28rem;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 700;
  outline: none;
}

.auth-form input[type="file"] {
  padding: 9px 12px;
}

.auth-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 138, 74, 0.12);
}

.auth-signed-in {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-signed-in {
  justify-content: flex-end;
  min-width: 0;
}

.auth-email {
  min-width: 0;
  overflow: hidden;
  color: var(--green-dark);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-status,
.auth-switch {
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.auth-switch button,
.auth-text-button {
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-weight: 800;
}

.auth-text-button {
  justify-self: center;
  min-height: 32px;
  padding: 0 4px;
}

.auth-switch button:hover,
.auth-text-button:hover,
.auth-switch button:focus-visible,
.auth-text-button:focus-visible {
  outline: none;
  text-decoration: underline;
}

.account-form {
  gap: 14px;
}

.account-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: linear-gradient(180deg, #fff, rgba(237, 248, 241, 0.52));
}

.account-card-head {
  display: grid;
  gap: 3px;
}

.account-card-head strong {
  color: var(--green-dark);
  font-size: 1rem;
  font-weight: 900;
}

.account-card-head span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.account-field {
  display: grid;
  gap: 7px;
}

.account-field > span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.account-preview {
  display: grid;
  min-height: 108px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(13, 99, 53, 0.04), rgba(13, 99, 53, 0.32)),
    var(--preview-wallpaper, linear-gradient(135deg, var(--surface-soft), #fff));
  background-position: center;
  background-size: cover;
  color: #fff;
  font-weight: 900;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.account-option-group {
  display: grid;
  gap: 8px;
}

.account-option-group > span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.account-file-status {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-soft);
  color: var(--green-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.custom-file-button {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--green-soft);
  color: var(--green-dark) !important;
  font-weight: 900 !important;
  cursor: pointer;
}

.custom-file-button:hover,
.custom-file-button:focus-within {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 138, 74, 0.12);
}

.custom-file-input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  border: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
}

.account-language-select {
  width: 100%;
}

@keyframes worldCupBlink {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(248, 210, 74, 0);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(248, 210, 74, 0.22), 0 0 26px rgba(22, 138, 74, 0.28);
    filter: brightness(1.12);
  }
}

@keyframes worldCupShine {
  45%,
  100% {
    transform: translateX(120%);
  }
}

.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex: 0 0 auto;
}

.icon.fill {
  fill: currentColor;
  stroke: none;
}

.pomodoro-clock-area {
  position: relative;
}

.sound-control {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.sound-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--green-dark);
  box-shadow: var(--shadow);
}

.sound-button:hover,
.sound-button:focus-visible {
  outline: 3px solid rgba(22, 138, 74, 0.16);
  background: var(--surface-soft);
}

.sound-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 166px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.sound-control:hover .sound-popover,
.sound-control.open .sound-popover,
.sound-control:focus-within .sound-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sound-popover input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 0;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title h1,
.panel-title h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
}

.panel-title svg {
  color: var(--green);
}

.panel-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.local-clock {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  padding: 24px;
  margin-bottom: 20px;
  min-height: 238px;
  overflow: hidden;
}

.clock-face {
  position: relative;
  width: clamp(150px, 20vw, 210px);
  aspect-ratio: 1;
  border: 10px solid var(--green-soft);
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) padding-box,
    conic-gradient(from 0deg, var(--green), var(--mint), var(--green)) border-box;
  box-shadow: inset 0 0 0 1px var(--line), 0 16px 35px rgba(22, 138, 74, 0.12);
}

.tick {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background:
    linear-gradient(var(--green-dark), var(--green-dark)) center 0 / 3px 11px no-repeat,
    linear-gradient(var(--green-dark), var(--green-dark)) center 100% / 3px 11px no-repeat,
    linear-gradient(90deg, var(--green-dark), var(--green-dark)) 0 center / 11px 3px no-repeat,
    linear-gradient(90deg, var(--green-dark), var(--green-dark)) 100% center / 11px 3px no-repeat;
  opacity: 0.8;
}

.hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 4px;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(0deg);
  border-radius: 999px;
  background: var(--text);
}

.hand.hour {
  height: 30%;
  width: 6px;
  background: var(--green-dark);
}

.hand.minute {
  height: 39%;
  background: var(--green);
}

.hand.second {
  height: 43%;
  width: 2px;
  background: #e05038;
}

.clock-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--green);
}

.local-info {
  min-width: 0;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface-soft);
  color: var(--green-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.local-time {
  margin: 12px 0 4px;
  font-size: clamp(2.4rem, 8vw, 5.2rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}

.local-date {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.search-panel {
  padding-bottom: 18px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  gap: 10px;
  padding: 18px 20px 10px;
  min-width: 0;
}

.search-box {
  position: relative;
  min-width: 0;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-box input,
.task-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.search-box input {
  padding-left: 44px;
}

.search-box input:focus,
.task-form input:focus,
.input-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(22, 138, 74, 0.12);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

.chip.active,
.chip:hover {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.world-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.world-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding: 0 20px 2px;
  scrollbar-color: var(--green) var(--green-soft);
  min-width: 0;
}

.zone-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
  min-width: 0;
}

.zone-card:hover {
  border-color: var(--mint);
  box-shadow: 0 10px 25px rgba(22, 138, 74, 0.09);
}

.zone-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.zone-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.zone-region {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.pin-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--green-dark);
  flex: 0 0 auto;
}

.pin-button.pinned {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.zone-time {
  margin-top: 12px;
  color: var(--green-dark);
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.zone-date {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.tool-page {
  max-width: 880px;
  margin: 34px auto 0;
}

.tool-body {
  padding: 18px 20px 20px;
}

.centered-tool {
  max-width: 760px;
  margin: 0 auto;
}

.display {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 248, 241, 0.9)),
    repeating-linear-gradient(90deg, rgba(22, 138, 74, 0.045) 0, rgba(22, 138, 74, 0.045) 1px, transparent 1px, transparent 18px);
  color: var(--green-dark);
  font-size: 3.9rem;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
  overflow-wrap: anywhere;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -18px 40px rgba(22, 138, 74, 0.07),
    0 18px 46px rgba(15, 82, 47, 0.09);
}

.hero-display {
  min-height: 178px;
  font-size: 6.1rem;
  letter-spacing: 0;
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.wide-controls {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
  color: var(--green-dark);
  background: var(--green-soft);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.btn:hover,
.btn:focus-visible {
  outline: 3px solid rgba(22, 138, 74, 0.14);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 12px 25px rgba(22, 138, 74, 0.18);
}

.btn.warning {
  background: var(--danger-soft);
  color: var(--danger);
}

.lap-list,
.task-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.92rem;
}

.wide-list {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.lap-list li,
.task-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #fff;
  font-variant-numeric: tabular-nums;
}

.task-list button {
  min-width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--green-dark);
  display: inline-grid;
  place-items: center;
}

.task-list .active-task {
  border-color: var(--green);
  background: var(--surface-soft);
}

.task-list .done {
  text-decoration: line-through;
  color: var(--muted);
}

.task-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.timer-inputs,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.settings-grid {
  margin: 18px 0 0;
}

.pomodoro-music-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.music-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.music-panel-head strong {
  color: var(--green-dark);
  white-space: nowrap;
}

.music-panel-head span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: right;
}

.music-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.music-choice-grid button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--green-dark);
  font-weight: 800;
}

.music-choice-grid button.active,
.music-choice-grid button:hover,
.music-choice-grid button:focus-visible {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  outline: none;
}

.music-choice-grid button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.youtube-music-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.youtube-music-form input {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--text);
  font-weight: 700;
  outline: none;
}

.youtube-music-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 138, 74, 0.12);
}

.youtube-player-frame {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.input-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.input-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.preset {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--green-dark);
  font-weight: 800;
}

.preset:hover {
  border-color: var(--green);
  background: var(--surface-soft);
}

.habit-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.habit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--green-dark);
}

.habit-head .btn {
  min-height: 38px;
}

.habit-list {
  display: grid;
  gap: 8px;
}

.habit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.habit-use {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.habit-use:hover,
.habit-use:focus-visible {
  border-color: var(--green);
  background: var(--surface-soft);
  outline: none;
}

.habit-use span {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.compact-empty {
  padding: 12px;
}

.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 28px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.status strong {
  color: var(--green-dark);
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(117, 201, 143, 0.55);
  flex: 0 0 auto;
}

.pulse.active {
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(117, 201, 143, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(117, 201, 143, 0);
  }
}

.pomodoro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: start;
  margin-top: 34px;
}

.pomodoro-main,
.task-panel {
  min-width: 0;
}

.phase-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 800;
}

.cycle-dots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.cycle-dot {
  min-height: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.cycle-dot.done {
  border-color: var(--green);
  background: var(--green);
}

.cycle-dot.current {
  border-color: var(--green);
  background: var(--green-soft);
}

.pomodoro-streak {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: min(360px, 100%);
  min-height: 58px;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
  color: #64748b;
  box-shadow: 0 10px 24px rgba(15, 82, 47, 0.08);
}

.pomodoro-streak[data-streak-level="red"] {
  color: #dc2626;
}

.pomodoro-streak[data-streak-level="orange"] {
  color: #f97316;
}

.pomodoro-streak[data-streak-level="pink"] {
  color: #db2777;
}

.pomodoro-streak[data-streak-level="purple"] {
  color: #7c3aed;
}

.pomodoro-streak[data-streak-level="green"] {
  color: var(--green);
}

.streak-flame {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: #f8fafc;
  background: color-mix(in srgb, currentColor 14%, #fff);
}

.streak-flame .icon {
  width: 23px;
  height: 23px;
}

.streak-copy {
  display: grid;
  min-width: 0;
  text-align: left;
}

.streak-copy strong {
  color: currentColor;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.streak-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

.hidden {
  display: none !important;
}

.wc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  gap: 20px;
  align-items: stretch;
  padding: 26px;
  margin-top: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(237, 248, 241, 0.96) 58%, rgba(255, 244, 190, 0.72) 100%);
}

.wc-hero-copy {
  min-width: 0;
}

.wc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: #0d6335;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.wc-hero h1 {
  max-width: 760px;
  margin: 16px 0 10px;
  color: #0d6335;
  font-size: clamp(2.1rem, 6vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.wc-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.wc-hero-panel {
  display: grid;
  align-content: center;
  gap: 10px;
  border: 1px solid rgba(22, 138, 74, 0.18);
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
  box-shadow: 0 16px 35px rgba(15, 82, 47, 0.1);
  min-width: 0;
}

.wc-next-label,
.wc-tz {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.wc-next-match {
  color: var(--green-dark);
  font-size: 1.35rem;
  line-height: 1.12;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.wc-countdown {
  color: #9b5c00;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wc-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  margin-top: 20px;
}

.wc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.wc-status-line {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 2px 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.wc-status-line a {
  color: var(--green-dark);
  font-weight: 800;
}

.wc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.55fr);
  gap: 20px;
  align-items: start;
}

.wc-match-panel,
.wc-detail-panel,
.wc-standings-panel {
  min-width: 0;
}

.wc-match-list {
  display: grid;
  gap: 16px;
  max-height: 760px;
  overflow: auto;
  padding: 18px 20px 20px;
  scrollbar-color: var(--green) var(--green-soft);
}

.wc-day-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.wc-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: linear-gradient(90deg, var(--surface-soft), #fff);
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

.wc-day-heading strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.wc-day-matches {
  display: grid;
  gap: 10px;
}

.wc-match-card {
  display: grid;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(237, 248, 241, 0.82)),
    #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.wc-match-card:hover,
.wc-match-card.active {
  border-color: var(--green);
  background: var(--surface-soft);
  box-shadow: 0 12px 30px rgba(15, 82, 47, 0.11);
}

.wc-match-card:hover {
  transform: translateY(-1px);
}

.wc-match-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wc-match-card-head .wc-follow-button {
  margin-left: auto;
}

.wc-round-pill {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-match-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.wc-match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.wc-team-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  min-width: 0;
  border-radius: var(--radius);
  padding: 6px 8px;
  background: rgba(22, 138, 74, 0.055);
}

.wc-team-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  padding: 3px;
}

.wc-team-name {
  display: block;
  font-weight: 800;
  line-height: 1.18;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-team-initials {
  display: grid;
  place-items: center;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.wc-team-tbd {
  display: grid;
  place-items: center;
  border-style: dashed;
  background: #fff;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0;
}

.wc-versus-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.wc-match-center {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #fff;
  color: var(--green-dark);
  text-align: center;
}

.wc-match-center strong {
  font-size: 0.96rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wc-match-center span {
  color: var(--green-dark);
  font-size: 1.24rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wc-follow-button {
  width: 32px;
  height: 32px;
}

.wc-match-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.wc-match-footer span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wc-detail-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.wc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.wc-badge.live {
  background: #d20a11;
  color: #fff;
  animation: worldCupBlink 1.2s ease-in-out infinite;
}

.wc-badge.done {
  background: #e9eef0;
  color: #385247;
}

.wc-detail-body {
  display: grid;
  gap: 14px;
  padding: 18px 20px 20px;
}

.wc-scoreboard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background:
    linear-gradient(145deg, #fff 0%, var(--surface-soft) 72%, rgba(248, 210, 74, 0.22) 100%);
}

.wc-scoreboard-teams {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) minmax(96px, auto) minmax(86px, 1fr);
  gap: 8px;
  align-items: start;
}

.wc-scoreboard-team {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  text-align: center;
  font-weight: 800;
}

.wc-scoreboard-team > span:not(.wc-team-initials) {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-scoreboard-team img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.wc-scoreboard-logo {
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  padding: 5px;
}

.wc-scoreboard-logo.wc-team-initials {
  padding: 0;
  font-size: 1rem;
}

.wc-scoreboard-score {
  color: var(--green-dark);
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  align-self: center;
  white-space: nowrap;
}

.wc-team-follow-action {
  min-height: 36px;
  padding: 0 10px;
  gap: 6px;
  font-size: 0.86rem;
  white-space: nowrap;
}

.wc-team-follow-action .icon {
  width: 16px;
  height: 16px;
}

.wc-mini-info {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.wc-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wc-info-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
  min-width: 0;
}

.wc-info-box span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.wc-info-box strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.wc-section-title {
  margin: 4px 0 0;
  color: var(--green-dark);
  font-size: 1rem;
}

.wc-stat-list,
.wc-lineup-grid,
.wc-incident-list {
  display: grid;
  gap: 8px;
}

.wc-stat-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.wc-stat-name {
  color: var(--text);
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

.wc-stat-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: var(--home, 50%) var(--away, 50%);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--green-soft);
}

.wc-stat-bar span:first-child {
  background: var(--green);
}

.wc-stat-bar span:last-child {
  background: #f8d24a;
}

.wc-lineup-grid {
  grid-template-columns: 1fr 1fr;
}

.wc-lineup-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
  min-width: 0;
}

.wc-lineup-card h4 {
  margin: 0 0 8px;
  color: var(--green-dark);
}

.wc-player-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.88rem;
}

.wc-player-list li {
  overflow-wrap: anywhere;
}

.wc-incident-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wc-incident-list li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 0.88rem;
}

.wc-standings-panel {
  margin-top: 20px;
}

.wc-standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
  padding: 18px 20px 20px;
}

.wc-table-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.wc-table-card h3 {
  margin: 0;
  padding: 11px 12px;
  background: var(--surface-soft);
  color: var(--green-dark);
  font-size: 1rem;
}

.wc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.wc-table th,
.wc-table td {
  padding: 7px 8px;
  border-top: 1px solid var(--line);
  text-align: right;
}

.wc-table th:first-child,
.wc-table td:first-child {
  text-align: left;
}

.wc-table th {
  color: var(--muted);
  font-weight: 800;
}

.wc-team-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-weight: 800;
}

.wc-team-cell img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}

.wc-loading {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  font-weight: 800;
}

.calendar-app {
  width: min(1480px, calc(100% - 32px));
}

.calendar-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 14px;
}

.calendar-sidebar {
  display: grid;
  gap: 20px;
  padding: 18px;
  position: sticky;
  top: 88px;
}

.calendar-create {
  width: fit-content;
  min-width: 130px;
}

.calendar-toolbox {
  display: grid;
  gap: 10px;
}

.calendar-search input {
  min-height: 42px;
}

.calendar-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.calendar-import {
  position: relative;
  overflow: hidden;
}

.calendar-import input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.mini-cal {
  display: grid;
  gap: 12px;
}

.mini-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 0.82rem;
}

.mini-day-name,
.mini-day {
  display: grid;
  min-height: 30px;
  place-items: center;
  border-radius: 999px;
}

.mini-day-name {
  color: var(--muted);
  font-weight: 800;
}

.mini-day {
  background: transparent;
  color: var(--text);
}

.mini-day:hover,
.mini-day.selected {
  background: var(--green);
  color: #fff;
}

.mini-day.muted {
  color: #9ab1a5;
}

.calendar-list-block {
  display: grid;
  gap: 10px;
}

.calendar-list-title {
  color: var(--green-dark);
  font-weight: 800;
}

.calendar-color-list {
  display: grid;
  gap: 8px;
}

.calendar-color-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
}

.calendar-color-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color);
  border-radius: 4px;
  background: color-mix(in srgb, var(--color) 16%, #fff);
}

.calendar-color-row input {
  min-width: 0;
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-weight: 800;
  outline: none;
}

.calendar-color-row input:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 138, 74, 0.12);
}

.calendar-insights {
  display: grid;
  gap: 12px;
}

.calendar-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.calendar-insight-grid div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.calendar-insight-grid strong {
  color: var(--green-dark);
  font-size: 1.55rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.calendar-insight-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.calendar-agenda {
  display: grid;
  gap: 8px;
}

.calendar-agenda button {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--event-color);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.calendar-agenda button:hover,
.calendar-agenda button:focus-visible {
  border-color: var(--green);
  border-left-color: var(--event-color);
  background: var(--surface-soft);
  outline: none;
}

.calendar-agenda span {
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-agenda small {
  color: var(--muted);
  font-weight: 750;
}

.calendar-main {
  min-width: 0;
  overflow: hidden;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.calendar-toolbar h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.calendar-nav-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-view-menu {
  position: relative;
  min-width: 146px;
}

.custom-select {
  position: relative;
  min-width: 146px;
}

.calendar-view-button,
.custom-select-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 800;
}

.calendar-view-button[aria-expanded="true"],
.calendar-view-button:hover,
.calendar-view-button:focus-visible,
.custom-select-button[aria-expanded="true"],
.custom-select-button:hover,
.custom-select-button:focus-visible {
  border-color: var(--green);
  background: var(--surface-soft);
  outline: none;
}

.calendar-view-options,
.custom-select-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.calendar-view-options button,
.custom-select-options button {
  min-height: 38px;
  border-radius: var(--radius);
  padding: 0 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 800;
}

.calendar-view-options button:hover,
.calendar-view-options button.active,
.custom-select-options button:hover,
.custom-select-options button.active {
  background: var(--green);
  color: #fff;
}

.calendar-view {
  min-height: 720px;
  padding: 16px 18px 20px;
  overflow: auto;
  scrollbar-color: var(--green) var(--green-soft);
}

.cal-week-grid {
  display: grid;
  grid-template-columns: 64px repeat(7, minmax(130px, 1fr));
  min-width: 900px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.cal-week-grid.day-view {
  grid-template-columns: 64px minmax(520px, 1fr);
}

.cal-corner,
.cal-day-head {
  min-height: 74px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.cal-corner {
  display: grid;
  place-items: end center;
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.cal-day-head {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.cal-day-head strong {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin: 4px auto 0;
  border-radius: 50%;
  color: var(--text);
  font-size: 1.5rem;
}

.cal-day-head.today strong {
  background: var(--green);
  color: #fff;
}

.cal-time-axis {
  position: relative;
  height: 1200px;
  background: #fff;
}

.cal-time-label {
  position: absolute;
  right: 10px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.cal-day-col {
  position: relative;
  height: 1200px;
  border-left: 1px solid var(--line);
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 49px, var(--line) 50px),
    #fff;
}

.cal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #d93025;
  z-index: 3;
}

.cal-now-line::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d93025;
}

.cal-event {
  position: absolute;
  left: 6px;
  right: 6px;
  min-height: 28px;
  border-radius: 6px;
  padding: 6px 8px;
  overflow: hidden;
  background: var(--event-color);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 82, 47, 0.14);
  text-align: left;
  font-weight: 800;
}

.cal-event small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 700;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  min-width: 900px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.month-head,
.month-cell {
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.month-head {
  padding: 10px;
  border-top: 0;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.month-head:first-child,
.month-cell:nth-child(7n + 1) {
  border-left: 0;
}

.month-cell {
  min-height: 132px;
  padding: 8px;
  background: #fff;
  text-align: left;
}

.month-cell.muted {
  background: #f7faf8;
  color: var(--muted);
}

.month-cell.today .month-day-number {
  background: var(--green);
  color: #fff;
}

.month-day-number {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
}

.month-events {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.month-event {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  padding: 3px 5px;
  color: var(--text);
  font-size: 0.82rem;
  text-align: left;
}

.month-event::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--event-color);
  flex: 0 0 auto;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 18px;
}

.year-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.year-card h3 {
  margin: 0 0 10px;
  color: var(--green-dark);
}

.year-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  font-size: 0.76rem;
}

.year-mini-day {
  display: grid;
  min-height: 23px;
  place-items: center;
  border-radius: 50%;
}

.year-mini-day.has-event {
  color: #fff;
  background: var(--green);
}

.calendar-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 51, 38, 0.22);
  backdrop-filter: blur(4px);
}

.quick-event-card,
.event-editor-card {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 82, 47, 0.24);
}

.quick-event-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.quick-event-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.quick-event-card input,
.event-editor-card input,
.event-editor-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.quick-event-head input,
.editor-top input {
  border-width: 0 0 2px;
  border-radius: 0;
  padding-left: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.quick-grid,
.editor-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
}

.quick-actions,
.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.event-editor-card {
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
}

.editor-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.editor-layout {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.editor-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

.editor-check input {
  width: 20px;
  height: 20px;
}

.editor-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-choice {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--event-color);
}

.color-choice.active {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(22, 138, 74, 0.16);
}

.color-palette.large .color-choice {
  width: 34px;
  height: 34px;
}

@media (max-width: 980px) {
  .app {
    padding-top: 8px;
  }

  .topbar {
    position: sticky;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px 0 12px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .nav-menu-button {
    display: inline-flex;
    order: 2;
  }

  .nav {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    order: 5;
    display: none;
    grid-template-columns: 1fr;
    width: 100%;
    margin-left: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
  }

  body.nav-open .nav {
    display: grid;
  }

  .auth-widget {
    order: 3;
    flex: 0 0 auto;
    margin-left: 0;
  }

  .auth-entry-stack,
  .auth-account-stack {
    width: min(100%, 280px);
  }

  .local-clock,
  .pomodoro-layout,
  .wc-hero,
  .wc-layout,
  .calendar-shell {
    grid-template-columns: 1fr;
  }

  .wc-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-sidebar {
    order: 2;
    position: static;
  }

  .clock-face {
    margin: 0 auto;
  }

  .local-info {
    text-align: center;
  }
}

@media (max-width: 640px) {
  .app {
    width: calc(100% - 22px);
    max-width: 1180px;
    padding-top: 8px;
  }

  .language-select {
    width: 100%;
  }

  .topbar {
    align-items: center;
  }

  .brand {
    justify-content: flex-start;
    width: auto;
  }

  .auth-widget {
    width: 100%;
    flex-basis: 100%;
  }

  .auth-entry-stack,
  .auth-account-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .nav-link {
    justify-content: flex-start;
    gap: 9px;
    padding: 0 12px;
    font-size: 0.95rem;
    text-align: left;
  }

  .sound-popover {
    transform: translateY(6px);
  }

  .panel-header,
  .tool-body,
  .search-row,
  .chip-row,
  .world-meta,
  .world-list,
  .calendar-view {
    padding-left: 14px;
    padding-right: 14px;
  }

  .local-clock {
    padding: 18px;
  }

  .search-row,
  .world-list,
  .timer-inputs,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .world-meta {
    flex-wrap: wrap;
  }

  .controls,
  .wide-controls,
  .preset-row,
  .habit-head,
  .task-form,
  .youtube-music-form,
  .wc-toolbar,
  .wc-info-grid,
  .wc-lineup-grid {
    grid-template-columns: 1fr;
  }

  .music-panel-head {
    display: grid;
  }

  .music-panel-head span {
    text-align: left;
  }

  .music-choice-grid {
    grid-template-columns: 1fr;
  }

  .habit-head {
    align-items: stretch;
    flex-direction: column;
  }

  .wc-hero {
    padding: 18px;
  }

  .wc-hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.2rem);
    line-height: 1.05;
  }

  .wc-status-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .wc-match-list,
  .wc-detail-body,
  .wc-standings-grid {
    padding-left: 14px;
    padding-right: 14px;
  }

  .calendar-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 14px;
  }

  .calendar-view-menu,
  .calendar-nav-buttons {
    justify-content: flex-start;
  }

  .calendar-view-menu {
    width: 100%;
  }

  .calendar-sidebar {
    padding: 14px;
  }

  .calendar-action-row,
  .calendar-insight-grid {
    grid-template-columns: 1fr;
  }

  .cal-week-grid.day-view {
    grid-template-columns: 54px minmax(250px, 1fr);
    min-width: 0;
  }

  .cal-week-grid {
    grid-template-columns: 54px repeat(7, minmax(112px, 1fr));
    min-width: 840px;
  }

  .month-grid {
    grid-template-columns: repeat(7, minmax(92px, 1fr));
    min-width: 644px;
  }

  .cal-corner,
  .cal-day-head {
    min-height: 64px;
  }

  .wc-match-card {
    grid-template-columns: 1fr;
  }

  .wc-match-card-head,
  .wc-match-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .wc-match-card-head .wc-follow-button {
    margin-left: 0;
  }

  .wc-versus-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .wc-match-center {
    width: 100%;
  }

  .wc-scoreboard-teams {
    grid-template-columns: 1fr;
  }

  .wc-scoreboard-score {
    order: 2;
  }

  .year-grid {
    grid-template-columns: 1fr;
  }

  .quick-grid,
  .editor-row,
  .editor-top {
    grid-template-columns: 1fr;
  }

  .hero-display {
    min-height: 132px;
    font-size: 3.2rem;
  }

  body[data-page="stopwatch"] .hero-display {
    font-size: 2.45rem;
  }

  .phase-line {
    align-items: flex-start;
    flex-direction: column;
  }
}
