:root {
  --bg: #fff8ec;
  --card: #ffffff;
  --text: #2b2118;
  --muted: #6f5b49;
  --accent: #8b5a2b;
  --accent-dark: #65401f;
  --leaf: #5f8f4e;
  --paw: #d9a15f;
  --border: #ead7bd;
  --shadow: 0 18px 45px rgba(83, 54, 28, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(217, 161, 95, 0.28), transparent 28%),
    linear-gradient(145deg, #fff8ec 0%, #f2e3ca 100%);
}

button {
  font: inherit;
}

.shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.hero,
.home-view,
.viewer-view {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 24px;
  margin-bottom: 18px;
}

.hero__badge {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 24px 24px 34px 34px;
  background: #c98745;
  font-size: 2.35rem;
  box-shadow: inset 0 -10px 0 rgba(77, 48, 23, 0.14);
}

.eyebrow,
.subtitle,
.branch,
.viewer-kicker,
.status-message {
  color: var(--muted);
}

.eyebrow,
.branch,
.viewer-kicker {
  margin: 0 0 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 1;
}

.subtitle {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.home-view,
.viewer-view {
  padding: 22px;
}

.section-heading,
.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2,
.viewer-header h2 {
  margin-bottom: 0;
}

.tail-label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px 999px 999px 24px;
  background: #7d4a25;
  color: #fff8ec;
  font-weight: 700;
  white-space: nowrap;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  overflow: hidden;
}

.tool-card::after {
  content: "〰";
  position: absolute;
  right: 18px;
  top: 10px;
  color: rgba(139, 90, 43, 0.22);
  font-size: 4rem;
  transform: rotate(-18deg);
}

.tool-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fff1d8;
  font-size: 1.8rem;
}

.tool-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

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

.open-button,
.back-button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.open-button {
  margin-top: auto;
  width: 100%;
}

.open-button:hover,
.back-button:hover,
.open-button:focus-visible,
.back-button:focus-visible {
  background: var(--accent-dark);
}

.back-button {
  padding: 0 18px;
}

.tool-frame {
  display: block;
  width: 100%;
  min-height: 640px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
}

.status-message {
  margin: 14px 0 0;
}

@media (max-width: 640px) {
  .shell {
    padding: 12px;
  }

  .hero,
  .section-heading,
  .viewer-header {
    align-items: stretch;
    flex-direction: column;
  }

  .hero,
  .home-view,
  .viewer-view {
    border-radius: 20px;
    padding: 16px;
  }

  .hero__badge {
    width: 60px;
    height: 60px;
  }

  .tail-label,
  .back-button {
    justify-content: center;
    width: 100%;
  }

  .tool-frame {
    min-height: 560px;
  }
}
