:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #617085;
  --line: #d7dee8;
  --panel: #ffffff;
  --surface: #f3f6f9;
  --accent: #1f5f8b;
  --accent-strong: #184c70;
  --warn: #9b5b09;
  --font-title: "Nunito Sans", Arial, Helvetica, sans-serif;
  --font-text: "Noto Sans", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-text);
}

.shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  max-width: 1180px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  color: #17365d;
}

h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.status {
  min-width: 92px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  text-align: center;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
}

.status.ok {
  border-color: #9dcaad;
  color: #1b6b36;
}

.status.fail {
  border-color: #e7b3a9;
  color: #9f341e;
}

.grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
}

.field-hint {
  color: var(--muted);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

input,
select,
button {
  width: 100%;
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-family: var(--font-text);
  font-size: 14px;
}

input,
select {
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}

button {
  margin-top: 4px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-family: var(--font-title);
  font-weight: 800;
  cursor: pointer;
}

.timezone-preview,
.manual-timezone {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  color: var(--ink);
  font-size: 13px;
}

.timezone-preview {
  padding: 9px 10px;
  line-height: 1.4;
}

.timezone-preview.warn {
  border-color: #ead4a7;
  background: #fffaf0;
  color: var(--warn);
}

.manual-timezone {
  padding: 9px 10px;
}

.manual-timezone summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-family: var(--font-title);
  font-weight: 700;
}

.manual-timezone select {
  margin-top: 10px;
}

button:hover {
  background: var(--accent-strong);
}

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

.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
}

.metric strong {
  display: block;
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-strong);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.result {
  min-height: 310px;
  display: grid;
  gap: 12px;
}

.result.empty,
.result.loading,
.result.error {
  align-content: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
}

.result.error {
  border-color: #e7b3a9;
  color: #9f341e;
  background: #fff7f5;
}

.result-card,
.mini-card,
.tech-details {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 13px;
}

.result-card h3,
.mini-card strong {
  display: block;
  font-family: var(--font-title);
  font-weight: 800;
  margin: 6px 0 8px;
  font-size: 16px;
}

.friendly-card {
  border-color: #b8d7c4;
  background: #f7fbf8;
}

.friendly-card h3 {
  color: #1b5d38;
}

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

.forecast-card {
  border: 1px solid #ead4a7;
  border-radius: 6px;
  background: #fffaf0;
  padding: 14px;
}

.forecast-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 8px;
}

.forecast-head h3 {
  margin: 0;
  color: #764b0d;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 800;
}

.forecast-head span {
  flex: 0 0 auto;
  color: #806238;
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.forecast-card p {
  color: var(--ink);
  line-height: 1.5;
}

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

.action-calendar > p {
  color: var(--ink);
  line-height: 1.5;
}

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

.calendar-summary article {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 12px;
}

.calendar-summary strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-title);
  font-weight: 800;
  color: #17365d;
}

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

.day-chip,
.level-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-family: var(--font-title);
  font-weight: 800;
  line-height: 1.2;
}

.day-chip {
  gap: 6px;
  padding: 7px 9px;
  font-size: 12px;
}

.day-chip strong {
  display: inline;
  margin: 0;
  color: inherit;
}

.level-badge {
  padding: 6px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.excellent {
  background: #e8f7ef;
  color: #17633b;
}

.good {
  background: #eef6ff;
  color: #174f7a;
}

.neutral {
  background: #f1f3f6;
  color: #49566a;
}

.caution {
  background: #fff5df;
  color: #8a540b;
}

.avoid {
  background: #fff0ee;
  color: #9b2f22;
}

.calendar-table-wrap {
  overflow-x: auto;
}

.calendar-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 13px;
}

.calendar-table th,
.calendar-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.calendar-table th {
  color: #17365d;
  font-family: var(--font-title);
  font-weight: 800;
  background: #f7f9fc;
}

.calendar-table td:first-child strong,
.calendar-table small {
  display: block;
}

.calendar-table td:first-child span,
.calendar-table small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.professional-report {
  display: grid;
  gap: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #17365d;
  font-family: var(--font-title);
  font-weight: 800;
}

.section-title::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: var(--line);
}

.report-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 15px;
}

.report-section h3 {
  margin: 0 0 8px;
  color: #17365d;
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 800;
}

.report-section p {
  color: var(--ink);
  line-height: 1.5;
}

.result-card p {
  color: var(--ink);
  line-height: 1.45;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 800;
}

.pill.good {
  background: #eaf7ee;
  color: #1b6b36;
}

.pill.warn {
  background: #fff5df;
  color: var(--warn);
}

dl {
  margin: 0;
  display: grid;
  gap: 6px;
}

dl div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

dt {
  color: var(--muted);
  font-size: 13px;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

li {
  margin: 5px 0;
}

.tech-details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-family: var(--font-title);
  font-weight: 700;
}

.tech-details p {
  color: var(--ink);
  line-height: 1.5;
}

.tech-details dl {
  margin-top: 12px;
}

.tech-details dl div {
  grid-template-columns: 150px minmax(0, 1fr);
}

.next-steps {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.next-steps strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-title);
  font-weight: 800;
}

@media (max-width: 820px) {
  .shell {
    padding: 14px;
  }

  .topbar,
  .grid {
    display: block;
  }

  .status {
    display: inline-block;
    margin-top: 12px;
  }

  .panel {
    margin-bottom: 14px;
  }

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

  .result-grid,
  .forecast-grid,
  .calendar-summary,
  dl div {
    grid-template-columns: 1fr;
  }

  .forecast-head {
    display: block;
  }

  .forecast-head span {
    display: block;
    margin-top: 4px;
    text-align: left;
  }
}
