:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #0f172a;
  --muted: #64748b;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --accent: #f8fafc;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after { box-sizing: border-box; }

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.25) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: rgba(15, 23, 42, 0.25);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(15, 23, 42, 0.35);
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  margin: 0;
  color: var(--foreground);
  background: var(--background);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

footer {
  padding: 28px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

footer {
  border-top: 1px solid var(--border);
  border-bottom: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

footer .footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr);
  gap: 32px;
  margin: 0 auto 20px;
  border-bottom: 1px solid #f1f1f1;
  padding-bottom: 22px;
  width: 100%;
  max-width: 1100px;
}

footer .footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

footer .footer-logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--foreground);
}

footer .footer-description {
  color: var(--muted);
  max-width: 420px;
  line-height: 1.5;
}

footer .footer-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

footer .footer-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}

footer .footer-title {
  color: var(--foreground);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

footer .footer-column a {
  color: var(--foreground);
}

footer .footer-column a:hover {
  text-decoration: underline;
}

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

footer .meta a {
  color: #000;
  text-decoration: underline;
}

@media (max-width: 700px) {
  footer .footer-grid {
    grid-template-columns: 1fr;
  }
  footer .footer-columns {
    grid-template-columns: 1fr;
  }
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 20;
}

:root {
  --header-height: 35px;
}

.site-header {
  min-height: var(--header-height);
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  margin: 0;
}

.logo { font-weight: 600; }

.logo a {
  display: inline-flex;
  align-items: center;
}

.logo-image {
  height: 1rem;
  width: auto;
  display: block;
}

.nav { display: flex; align-items: center; gap: 8px; position: relative; }

.nav-trigger {
  border: 1px solid transparent;
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.nav-trigger.soft {
  background: #f5f5f5;
  border-color: transparent;
  color: #0f172a;
}

.nav-trigger.soft:hover {
  background: #ececec;
}

.nav-trigger.soft[aria-expanded="true"] {
  background: #e7e7e7;
}

.nav-trigger:hover {
  background: var(--accent);
  border-color: var(--border);
}

.nav-trigger[aria-expanded="true"] {
  background: var(--accent);
  border-color: var(--border);
}

@media (max-width: 640px) {
  .language-trigger .lang-text {
    display: none;
  }
}

.not-found {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  max-width: 560px;
  margin: 40px auto 0;
}

.not-found-hero {
  width: 100%;
  padding: 18px 12px;
  border-radius: 16px;
  background-color: #fff;
  background-image: radial-gradient(circle at 10px 10px, rgba(15, 23, 42, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  position: relative;
}

.not-found-code {
  font-size: clamp(64px, 12vw, 120px);
  font-weight: 800;
  letter-spacing: -2px;
  color: #111;
}

.not-found-dot {
  color: #f97316;
}

.not-found-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.not-found-copy {
  font-size: 1rem;
  color: var(--muted-foreground);
  margin: 0;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn-primary {
  background: #111827;
  color: #fff;
}

.btn-primary:hover {
  background: #0f172a;
}

.btn-outline {
  background: #fff;
  color: #111827;
  border-color: #e5e7eb;
}

.btn-outline:hover {
  background: #f8fafc;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--foreground);
}

.checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.checkbox input[type="checkbox"]:checked {
  background: #0f172a;
  border-color: #0f172a;
}

.checkbox input[type="checkbox"]::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform 120ms ease;
  margin-top: -1px;
}

.checkbox input[type="checkbox"]:checked::after {
  transform: rotate(-45deg) scale(1);
}

.dropdown {
  position: fixed;
  top: calc(100% + 10px);
  left: 0;
  min-width: 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  will-change: transform, opacity;
}

.dropdown.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown.is-top {
  transform: translateY(4px);
}

.dropdown-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px;
  display: grid;
  gap: 2px;
  max-height: inherit;
  overflow: auto;
  min-width: 320px;
}

.utc-panel {
  min-width: 520px;
}

.dropdown-panel.columns-1 { grid-template-columns: 1fr; }
.dropdown-panel.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dropdown-panel.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dropdown-panel.columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dropdown-panel.columns-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dropdown-panel.columns-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.dropdown-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.dropdown-item {
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--foreground);
  font-size: 14px;
}

.dropdown-item:hover {
  background: var(--accent);
}

.language-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.language-trigger .lang-text {
  font: inherit;
  color: inherit;
}

.language-trigger .flag {
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.language-panel {
  min-width: 0;
  width: 205px;
  max-height: 320px;
  overflow: auto;
}

.language-item {
  display: grid;
  grid-template-columns: 20px 1fr 16px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  background: transparent;
  border: none;
}

.language-item .text {
  line-height: 1.2;
  font-weight: 400;
}

.language-item .check {
  opacity: 0;
  color: var(--foreground);
  font-size: 14px;
}

.language-item.is-selected {
  background: transparent;
}

.language-item.is-selected .check {
  opacity: 1;
}

.language-item.is-selected .text {
  font-weight: 600;
}

@media (max-width: 900px) {
  .dropdown { left: 0; right: 0; min-width: 0; }
  .dropdown-panel.columns-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .dropdown-panel.columns-2,
  .dropdown-panel.columns-3,
  .dropdown-panel.columns-4,
  .dropdown-panel.columns-5,
  .dropdown-panel.columns-6 {
    grid-template-columns: 1fr;
  }
}

.page { min-height: 100vh; display: flex; flex-direction: column; justify-content: start; }

main {
  padding: 32px 24px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}


.meta {
    color: var(--muted-foreground);
    font-size: 1.2rem;
    font-weight: 500;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted-foreground);
  background: var(--accent);
}

.code-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.code-container .code-text {
  flex: 1;
  min-width: 0;
}


.code-container .copy-button {
  margin-left: auto;
}

.event-form {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-announce {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.event-announce-inner {
  display: flex;
  flex-direction: column;
  gap: 0px;
  text-align: center;
}

.event-announce h1 {
  font-size: 0.95rem;
  margin: 0;
}

.event-name {
  font-size: 2.7rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
}

.event-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.event-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.event-card-title {
  font-weight: 600;
  color: var(--foreground);
}

.event-card-sub {
  color: var(--muted);
  font-size: 14px;
}

.event-clock {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.event-time {
  font-size: 36px;
  font-weight: 700;
  color: var(--foreground);
}

.event-abbr {
  font-size: 13px;
  color: var(--muted-foreground);
  text-transform: uppercase;
}

.event-date {
  color: var(--muted-foreground);
  font-size: 14px;
}

.event-current {
  color: var(--muted-foreground);
  font-size: 13px;
}

.event-next {
  color: var(--muted-foreground);
  font-size: 14px;
}

.event-link {
  margin-top: auto;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}

.event-link:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .event-cards {
    grid-template-columns: 1fr;
  }
}

.event-form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field input,
.dropdown-input {
  width: 100%;
}

.field-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  justify-content: space-between;
  display: flex;
  align-items: center;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--background);
  color: var(--foreground);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  outline: none;
}

input[readonly] {
  background: var(--accent);
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--foreground);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

input[type="text"]:focus-visible,
input[type="date"]:focus-visible,
input[type="time"]:focus-visible,
input[type="number"]:focus-visible,
select:focus-visible {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.18);
}

.event-output {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-output .meta {
  font-size: 0.85rem;
  line-height: 1.4;
  font-weight: normal;
  color: var(--muted-foreground);
}

.embed-preview .embed-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--foreground);
}

.embed-preview .embed-link {
  color: inherit;
  text-decoration: none;
}

.row-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.row-fields .field {
  flex: 1 1 0;
  min-width: 0;
}

.row-fields input {
  flex: 1 1 180px;
}

.is-hidden {
  display: none;
}

.event-output-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: none;
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.copy-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}

.copy-button:hover {
  background: var(--accent);
  border-color: var(--foreground);
}

.copy-button .copy-text {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--accent);
}

.weekday-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekday-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.weekday-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  user-select: none;
}

.weekday-input:checked + .weekday-label {
  background: var(--foreground);
  border-color: var(--foreground);
  color: var(--background);
}

.recurrence {
  position: relative;
}

.recurrence-trigger {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-size: 14px;
  color: var(--foreground);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.recurrence-summary {
  color: var(--muted);
  font-size: 12px;
}

.recurrence-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, 100%);
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  display: none;
  z-index: 20;
}

.recurrence-popover.is-open {
  display: block;
}

.recurrence-head {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 12px;
}

.recurrence-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.recurrence-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.recurrence-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}


.recurrence-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.recurrence-cancel,
.recurrence-done {
  border: none;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
}

.recurrence-done {
  color: var(--foreground);
  font-weight: 600;
}

.dropdown-input {
  position: relative;
}

.dropdown-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow: auto;
  display: none;
  z-index: 10;
}

.dropdown-list.is-open {
  display: block;
}

.dropdown-option {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--foreground);
}

.dropdown-option:hover {
  background: var(--accent);
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.hero { display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; text-align: center; min-height: calc(100vh - 140px); }

.hero-title { font-size: 2rem; color: var(--muted); font-weight: 500; }
.hero-title strong { color: var(--foreground); font-weight: 600; }

.hero-time {
  font-size: clamp(3.5rem, 18vw, 10rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--foreground);
  max-width: 100%;
  white-space: nowrap;
}

.hero-sub { font-size: 20px; color: var(--foreground); }

.country-locations {
  margin: 32px auto 0;
  max-width: 1100px;
}

.country-locations-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.country-locations-header {
  background: #f8fafc;
  color: var(--foreground);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.country-locations-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.country-locations-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-right: 1px solid var(--border);
}

.country-locations-list:last-child {
  border-right: none;
}

.country-locations-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.country-locations-row a {
  color: var(--primary);
  text-decoration: none;
}

.country-locations-row a:hover {
  text-decoration: underline;
}

.country-time {
  color: var(--muted-foreground);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.city-details {
  margin: 32px auto 0;
  width: 100%;
}

.city-details-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.city-details-header {
  background: #f8fafc;
  color: var(--foreground);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.city-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.3fr) minmax(0, 0.7fr);
}

.city-details-list {
  display: flex;
  flex-direction: column;
}

.city-details-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.city-details-row:last-child {
  border-bottom: none;
}

.city-details-row span:first-child {
  color: var(--muted-foreground);
  font-weight: 500;
}

.city-details-row a {
  color: var(--primary);
  text-decoration: none;
}

.city-details-row a:hover {
  text-decoration: underline;
}

.city-details-map {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-left: 1px solid var(--border);
  background: #f8fafc;
}

.city-details-map img,
.city-details-map iframe {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: cover;
  aspect-ratio: 7 / 4;
}

@media (max-width: 900px) {
  .city-details-grid {
    grid-template-columns: 1fr;
  }

  .city-details-map {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 900px) {
  .country-locations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .country-locations-grid {
    grid-template-columns: 1fr;
  }
}

.favorites { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.fav-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-width: 96px;
  text-align: center;
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-sm);
}

.fav-city { font-size: 12px; color: var(--muted-foreground); }
.fav-time { font-size: 18px; font-weight: 600; color: var(--foreground); }

.divider { height: 1px; background: var(--border); margin: 18px 0; width: 100%; }

@media (max-width: 600px) {
  .hero-title { font-size: 1.5rem; }
  .hero-sub { font-size: 16px; }
}
