/* ==========================================================================
   Shared styles for the sun, moon and timer tools — scoped under .as
   ========================================================================== */
.as {
  --ease: cubic-bezier(.23, 1, .32, 1);
  --fill: rgba(118, 118, 128, .10);
  --fill-2: rgba(118, 118, 128, .16);
  --card: #fff;
  max-width: 1080px; margin: 0 auto; padding: 0 22px 64px;
}
.as *, .as *::before, .as *::after { box-sizing: border-box; }
.as [hidden] { display: none !important; }
.as button { font: inherit; -webkit-tap-highlight-color: transparent; }
.as .tnum { font-variant-numeric: tabular-nums; }

/* page hero */
.as-top { padding-top: clamp(40px, 6vw, 80px); padding-bottom: 22px; }
.as-top h1 { margin: 0 0 10px; font-weight: 700; font-size: clamp(2.25rem, 5.2vw, 3.75rem); line-height: 1.04; letter-spacing: -.035em; }
.as-top p { margin: 0; color: var(--text-2); font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.45; letter-spacing: -.01em; max-width: 36em; text-wrap: pretty; }
.as-lang { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; margin-left: 8px; border-radius: 999px; background: var(--fill); color: var(--text); font-size: .75rem; font-weight: 600; vertical-align: 1px; text-decoration: none; }

/* place picker */
.as-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-bottom: 16px; }
.as-place { flex: 1 1 420px; min-width: 0; }
.as-search { position: relative; display: flex; align-items: center; height: 48px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-sm); }
.as-search > svg { flex: none; width: 20px; height: 20px; margin: 0 4px 0 14px; fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; }
.as-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font: inherit; font-size: 1rem; color: var(--text); outline: none; padding: 0 8px; }
.as-search:focus-within { box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm); }
.as-me { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; margin-right: 6px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--fill); color: var(--text); font-size: .8125rem; font-weight: 600; cursor: pointer; }
.as-me svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.as-me.busy svg { animation: as-spin 1s linear infinite; }
@keyframes as-spin { to { transform: rotate(360deg); } }
.as-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: #fff; border-radius: 14px; box-shadow: var(--shadow-md), 0 0 0 1px var(--line); max-height: 320px; overflow: auto; }
.as-results li { padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.as-results li b { display: block; font-weight: 600; font-size: .9375rem; }
.as-results li span { font-size: .8125rem; color: var(--text-2); }
.as-results li:hover, .as-results li.on { background: var(--fill); }
.as-results li.msg { color: var(--text-2); cursor: default; }
.as-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.as-chip { height: 32px; padding: 0 13px; border: 0; border-radius: 999px; background: var(--fill); color: var(--text); font-size: .8125rem; font-weight: 600; cursor: pointer; transition: background-color 160ms ease, transform 140ms var(--ease); }
.as-chip:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) { .as-chip:hover { background: var(--fill-2); } }
.as-chip[aria-pressed="true"] { background: var(--text); color: #fff; }

/* date stepper */
.as-date { display: flex; align-items: center; gap: 6px; }
.as-date input { height: 48px; padding: 0 12px; border-radius: 14px; border: 0; background: var(--card); box-shadow: var(--shadow-sm); font: inherit; font-size: .9375rem; font-weight: 600; color: var(--text); }
.as-step { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-sm); color: var(--text); cursor: pointer; display: grid; place-items: center; font-size: 1.125rem; }
.as-step:active { transform: scale(.92); }
.as-link { border: 0; background: none; padding: 0 6px; color: var(--accent); font-size: .875rem; font-weight: 600; cursor: pointer; }

/* cards & stats */
.as-card { background: var(--card); border-radius: 24px; padding: 22px; box-shadow: var(--shadow-sm); }
.as-card + .as-card, .as-grid + .as-card, .as-card + .as-grid { margin-top: 16px; }
.as-card h2, .as-card h3 { margin: 0 0 14px; font-size: 1.1875rem; font-weight: 700; letter-spacing: -.02em; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.as-card h2 small, .as-card h3 small { font-size: .8125rem; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.as-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.as-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.as-stat { background: var(--fill); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.as-stat span { display: block; font-size: .8125rem; color: var(--text-2); margin-bottom: 2px; }
.as-stat strong { display: block; font-size: 1.375rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.as-stat strong small { font-size: .8125rem; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.as-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: #fff7e6; color: #8a4b00; font-size: .875rem; }

/* tables */
.as-tablewrap { overflow-x: auto; margin: 0 -6px; }
.as-table { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; }
.as-table th { text-align: left; font-weight: 600; color: var(--text-2); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.as-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.as-table tr.today td { background: color-mix(in srgb, var(--accent) 8%, #fff); font-weight: 600; }
.as-table tr.wkend td:first-child { color: #d70015; }
.as-up { color: #248a3d; } .as-down { color: #d70015; }

/* pills (actions) */
.as-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.as-pill { height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--fill); color: var(--text); font-size: .8125rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background-color 160ms ease, transform 140ms var(--ease); }
.as-pill:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) { .as-pill:hover { background: var(--fill-2); } }
.as-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.as-help { margin-top: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.as-help div { padding: 18px; border-radius: 20px; background: var(--fill); }
.as-help h4 { margin: 0 0 6px; font-size: .9375rem; font-weight: 650; letter-spacing: -.01em; }
.as-help p { margin: 0; font-size: .875rem; color: var(--text-2); line-height: 1.5; }
.as-ad { margin: 24px 0 0; }
.as-tip { position: fixed; z-index: 30; pointer-events: none; padding: 6px 10px; border-radius: 10px; background: #fff; box-shadow: var(--shadow-md), 0 0 0 1px var(--line); font-size: .8125rem; white-space: nowrap; transform: translate(-50%, -120%); }

@media (max-width: 820px) { .as-help { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .as { padding: 0 16px 48px; }
  .as-card { padding: 16px; border-radius: 20px; }
  .as-me span { display: none; }
  .as-stats { grid-template-columns: 1fr 1fr; }
  .as-stat strong { font-size: 1.125rem; }
  .as-date { width: 100%; }
  .as-date input { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .as *, .as *::before, .as *::after { animation: none !important; transition-property: opacity, background-color, color, box-shadow !important; }
}
