:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --card-bg: #ffffff;
  --accent: #388e3c;
  --accent-light: #e8f2ea;
  --text-main: #253229;
  --text-muted: #5f6b5c;
  --border: #e0e0e0;
  --error: #c62828;
  --plus-blue: #1565c0;
  --minus-red: #c62828;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
}

.viewer-body {
  background: linear-gradient(180deg, rgba(248, 248, 244, 0.4), rgba(244, 243, 239, 0.9));
}

.static-body {
  background: linear-gradient(180deg, rgba(248, 248, 244, 0.4), rgba(244, 243, 239, 0.9));
}

.app-header {
  background: var(--accent);
  color: #fff;
  padding: 16px 24px;
  text-align: center;
}

.app-header .brand {
  font-size: 1.5rem;
  font-weight: 700;
}

.app-header .tagline {
  margin-top: 4px;
  font-size: 0.95rem;
  opacity: 0.9;
}

.landing-main {
  flex: 1;
  width: min(100%, 1080px);
  margin: 32px auto;
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.viewer-main {
  flex: 1;
  width: min(100%, 960px);
  margin: 32px auto;
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.static-main {
  flex: 1;
  width: min(100%, 880px);
  margin: 32px auto;
  padding: 0 24px 40px;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(37, 50, 41, 0.08);
  border: 1px solid rgba(56, 142, 60, 0.08);
}

.static-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 40px);
  box-shadow: 0 18px 40px rgba(37, 50, 41, 0.08);
  border: 1px solid rgba(56, 142, 60, 0.12);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.static-card h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--accent);
}

.static-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.static-card dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.static-card dt {
  font-weight: 700;
  color: var(--text-main);
}

.static-card dd {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.static-card a {
  color: var(--plus-blue);
  text-decoration: none;
}

.static-card a:hover {
  text-decoration: underline;
}

.static-updated {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  align-self: flex-end;
}

.landing,
.viewer-card {
  background: var(--card-bg);
  border-radius: 24px;
  padding: clamp(32px, 4vw, 56px);
  box-shadow: 0 24px 60px rgba(37, 50, 41, 0.08);
  border: 1px solid rgba(56, 142, 60, 0.1);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(24px, 3vw, 40px);
  position: relative;
  overflow: visible;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-card h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 1.6rem);
  color: var(--text-main);
}

.contact-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.contact-form {
  display: grid;
  gap: 16px;
}

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

.form-field label {
  font-weight: 600;
  color: var(--text-main);
}

.form-field input,
.form-field textarea {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--text-main);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 142, 60, 0.15);
  outline: none;
}

.form-submit {
  align-self: flex-start;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 50, 41, 0.18);
}

.form-submit:active {
  transform: translateY(0);
  box-shadow: none;
}

.contact-note {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.contact-note a {
  color: var(--plus-blue);
  text-decoration: none;
}

.contact-note a:hover {
  text-decoration: underline;
}

.landing::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 10%, rgba(56, 142, 60, 0.12), transparent 55%),
    radial-gradient(circle at 90% 30%, rgba(21, 101, 192, 0.1), transparent 45%);
  pointer-events: none;
}

.landing-hero {
  position: relative;
  z-index: 1;
}

.landing-hero h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 16px;
  color: var(--text-main);
}

.landing-hero p {
  margin: 0 0 24px;
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  line-height: 1.7;
  color: var(--text-muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(56, 142, 60, 0.25);
}

.cta-link {
  align-self: center;
  font-weight: 600;
  color: var(--plus-blue);
  text-decoration: none;
  position: relative;
}

.cta-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: currentColor;
  opacity: 0.4;
}

.landing-features,
.viewer-main .landing-features {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

.landing-features article {
  background: rgba(232, 242, 234, 0.6);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(56, 142, 60, 0.12);
  backdrop-filter: blur(6px);
}

.landing-features h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--accent);
}

.landing-features p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-muted);
}

.landing-screens {
  position: relative;
  z-index: 1;
  display: flex;
  gap: clamp(16px, 2vw, 32px);
  margin-top: clamp(16px, 3vw, 32px);
  justify-content: center;
  flex-wrap: nowrap;
  grid-column: 1 / -1;
}

.landing-screens figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 0 0 clamp(240px, 26vw, 340px);
  max-width: clamp(240px, 26vw, 340px);
}

.landing-screens img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(37, 50, 41, 0.18);
  border: 1px solid rgba(56, 142, 60, 0.15);
}

.landing-screens figcaption {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}

.status-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 12px 32px rgba(37, 50, 41, 0.06);
  border: 1px solid rgba(56, 142, 60, 0.08);
  color: var(--text-main);
  font-size: 0.95rem;
  min-height: 1.2rem;
}

.status-card.error {
  color: var(--minus-red);
}

.sheet-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.sheet-header .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.sheet-header .chip {
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 600;
}

.sheet-table-wrapper {
  overflow-x: auto;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.sheet-table th,
.sheet-table td {
  border: 1px solid var(--border);
  padding: clamp(4px, 0.9vw, 10px);
  text-align: center;
  background: #fff;
  height: clamp(36px, 6vw, 60px);
  line-height: 1.3;
  font-size: clamp(0.8rem, 1vw + 0.5rem, 1rem);
  word-break: break-word;
}

.sheet-table thead th {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}

.sheet-table tbody tr:nth-child(even) td {
  background: #fafafa;
}

.sheet-table tfoot th,
.sheet-table tfoot td {
  background: var(--accent-light);
  font-weight: 700;
}

.pm-plus {
  color: var(--plus-blue);
}

.pm-minus {
  color: var(--minus-red);
}

.plus-label {
  color: var(--plus-blue);
}

.minus-label {
  color: var(--minus-red);
}

.score-positive {
  color: var(--plus-blue);
}

.score-negative {
  color: var(--minus-red);
}

.app-footer {
  text-align: center;
  padding: 12px 16px 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.app-footer a {
  color: var(--plus-blue);
  text-decoration: none;
  margin: 0 4px;
}

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

@media (max-width: 640px) {
  .landing-main,
  .viewer-main {
    padding: 0 16px 32px;
    gap: 20px;
  }

  .sheet-table {
    min-width: 100%;
  }

  .landing {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .landing-screens {
    gap: 12px;
    flex-wrap: wrap;
  }

  .landing-screens figure {
    flex: 1 1 280px;
    max-width: 320px;
  }
}
