:root {
  --bg: #f5f1e8;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #ffffff;
  --ink: #1e2328;
  --muted: #697077;
  --line: rgba(30, 35, 40, 0.12);
  --gold: #9b7a34;
  --gold-deep: #70551f;
  --shadow: 0 24px 70px rgba(34, 31, 25, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(245, 241, 232, 0.2)),
    radial-gradient(circle at top left, rgba(155, 122, 52, 0.14), transparent 34rem),
    var(--bg);
}

button,
textarea {
  font: inherit;
}

.site-nav {
  width: min(1520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  border-color: rgba(155, 122, 52, 0.48);
  color: var(--gold-deep);
  background: rgba(255, 255, 255, 0.86);
  outline: none;
}

.page-layout {
  width: min(1520px, calc(100% - 32px));
  min-height: calc(100vh - 60px);
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  grid-template-columns: minmax(160px, 190px) minmax(0, 1120px) minmax(160px, 190px);
  gap: 28px;
  align-items: start;
}

.content-column {
  min-width: 0;
}

.app {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: stretch;
}

.workspace,
.stats,
.ad-space {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.workspace {
  border-radius: 8px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.header {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3.3rem);
  line-height: 1.08;
}

.status {
  min-width: 7em;
  min-height: 1.5em;
  color: var(--gold-deep);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.editor-wrap {
  flex: 1;
  min-height: 420px;
}

textarea {
  width: 100%;
  height: 100%;
  min-height: 420px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  line-height: 1.8;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

textarea:focus {
  border-color: rgba(155, 122, 52, 0.58);
  background: var(--panel-strong);
  box-shadow: 0 0 0 4px rgba(155, 122, 52, 0.12);
}

textarea::placeholder {
  color: rgba(105, 112, 119, 0.72);
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn {
  min-width: 116px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: 3px solid rgba(155, 122, 52, 0.25);
  outline-offset: 2px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 12px 24px rgba(112, 85, 31, 0.24);
}

.btn-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
}

.stats {
  border-radius: 8px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.stat-card {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.stat-value {
  color: var(--ink);
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1;
}

.ad-space {
  border-radius: 8px;
  overflow: hidden;
}

.ad-space-side {
  position: sticky;
  top: 48px;
  height: min(600px, calc(100vh - 96px));
  min-height: 500px;
}

.ad-space-mobile {
  display: none;
  margin-top: 24px;
  min-height: 100px;
}

.ad-inner {
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: 20px;
  display: grid;
  place-items: center;
  color: rgba(105, 112, 119, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.32)),
    repeating-linear-gradient(
      -45deg,
      rgba(155, 122, 52, 0.08) 0,
      rgba(155, 122, 52, 0.08) 1px,
      transparent 1px,
      transparent 12px
    );
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

.simple-page {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.content-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.content-page h1 {
  margin-bottom: 18px;
}

.content-page h2 {
  margin: 34px 0 12px;
  font-size: 1.25rem;
}

.content-page p,
.content-page li {
  color: var(--muted);
  line-height: 1.9;
}

.content-page ul,
.content-page ol {
  padding-left: 1.4em;
}

.content-page a {
  color: var(--gold-deep);
  font-weight: 700;
}

.contact-form {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  font-weight: 700;
}

.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

.form-field textarea {
  min-height: 180px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: rgba(155, 122, 52, 0.58);
  background: var(--panel-strong);
  box-shadow: 0 0 0 4px rgba(155, 122, 52, 0.12);
}

@media (max-width: 860px) {
  .site-nav {
    width: min(100% - 32px, 1120px);
  }

  .page-layout {
    width: min(100% - 32px, 1120px);
    padding: 24px 0;
    display: block;
  }

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

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ad-space-side {
    display: none;
  }

  .ad-space-mobile {
    display: block;
    height: 110px;
  }
}

@media (max-width: 560px) {
  .site-nav {
    width: min(100% - 20px, 1120px);
    justify-content: stretch;
  }

  .site-nav a {
    flex: 1 1 calc(50% - 8px);
    display: grid;
    place-items: center;
    padding: 9px 8px;
    font-size: 0.82rem;
    text-align: center;
  }

  .page-layout {
    width: min(100% - 20px, 1120px);
    padding: 10px 0;
  }

  .app {
    gap: 12px;
  }

  .workspace {
    padding: 18px;
  }

  .header {
    flex-direction: column;
    min-height: 0;
  }

  .status {
    text-align: left;
  }

  .editor-wrap,
  textarea {
    min-height: 320px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .btn {
    min-width: 0;
    width: 100%;
  }

  .stats {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 10px;
  }

  .stat-card {
    min-height: 104px;
    padding: 18px;
  }

  .ad-space-mobile {
    margin-top: 12px;
    height: 96px;
  }

  .ad-inner {
    padding: 16px;
  }

  .simple-page {
    width: min(100% - 20px, 920px);
    padding: 10px 0 28px;
  }

  .content-page {
    padding: 22px;
  }
}
