:root {
  --ink: #243c32;
  --muted: #7b817b;
  --green: #365d49;
  --line: #e3e7df;
  --bg: #f6f7f2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font:
    14px/1.65 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Meiryo,
    sans-serif;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #dce2d7;
  background: white;
  color: var(--ink);
  border-radius: 7px;
  padding: 9px 14px;
  transition: background 0.15s;
}
button:hover {
  background: #edf2e9;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #80a885;
  outline-offset: 2px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.primary {
  color: white;
  background: var(--green);
  border-color: var(--green);
}
.primary:hover {
  background: #294b39;
}
aside {
  width: 225px;
  position: fixed;
  top: 0;
  bottom: 0;
  background: #fcfcf8;
  border-right: 1px solid var(--line);
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
}
.logo {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-weight: 650;
}
.logo > span {
  font-size: 30px;
  font-family: serif;
  width: 44px;
  height: 48px;
  text-align: center;
  border: 1px solid #b9c6b5;
  border-radius: 5px;
  line-height: 44px;
}
.logo small {
  display: block;
  font: 8px/2 sans-serif;
  letter-spacing: 1.3px;
  color: #84917f;
}
.workspace {
  font-size: 11px;
  color: #8a9384;
  padding: 40px 10px 12px;
}
nav {
  display: grid;
  gap: 6px;
}
nav button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 13px 12px;
}
nav button.active {
  background: #e6eddf;
  color: #2a4f36;
  font-weight: 600;
}
.aside-bottom {
  margin-top: auto;
  font-size: 12px;
}
.aside-bottom small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 10px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a4af69;
  margin-right: 7px;
}
main {
  margin-left: 225px;
  padding: 0 32px 48px;
  max-width: 1900px;
}
header {
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.eyebrow {
  font-size: 10px;
  color: #8a9784;
  letter-spacing: 2px;
  font-weight: 650;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.header-actions > span {
  font-size: 11px;
  color: #83917e;
  margin-right: 8px;
}
.trial {
  font-size: 12px;
  color: #6f775f;
  background: #eff1e5;
  border: 1px solid #e5e8d9;
  border-radius: 6px;
  margin: 22px 0 30px;
  padding: 11px 15px;
}
.trial > span {
  background: #e0e6ca;
  font-size: 10px;
  padding: 3px 7px;
  margin-right: 10px;
  border-radius: 3px;
}
.editor-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  margin-bottom: 24px;
}
.editor-top h2 {
  font-size: 23px;
  font-weight: 600;
}
.editor-top p,
.section-heading p {
  color: var(--muted);
  margin-top: 5px;
}
.editor-top button {
  font-size: 12px;
}
.subject-label {
  display: block;
  font-size: 12px;
  color: #75816f;
  margin-bottom: 24px;
}
input {
  display: block;
  width: 100%;
  border: 1px solid #dce2d7;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 12px;
  margin-top: 6px;
}
.subject-label input {
  font-size: 16px;
}
.compose-grid {
  display: grid;
  grid-template-columns: minmax(350px, 1fr) minmax(350px, 1fr);
  gap: 24px;
  align-items: start;
}
.compose,
.preview-wrap {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  overflow: hidden;
}
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 19px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.panel-title > span {
  font-size: 11px;
  color: var(--muted);
}
.tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 15px 15px 0;
}
.tools button {
  font-size: 12px;
  padding: 6px 10px;
}
.tools > span {
  font-size: 10px;
  color: #8b9685;
}
#dropzone {
  border: 1px dashed #b7c7ad;
  background: #f7f9f3;
  text-align: center;
  margin: 16px;
  padding: 19px 8px;
  border-radius: 7px;
  cursor: pointer;
}
#dropzone b {
  display: block;
  font-size: 13px;
  font-weight: 600;
}
#dropzone span {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: #8b9682;
}
#dropzone.drag {
  background: #e5efda;
  border-color: #496e3b;
}
#blocks {
  height: 650px;
  overflow-y: auto;
  padding: 0 15px 15px;
}
.block {
  position: relative;
  border: 1px solid #e5e9e1;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 11px;
  background: white;
  scroll-margin: 16px;
}
.block.selected {
  border-color: #81a273;
  box-shadow: 0 0 0 1px #81a27333;
}
.block-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8a9584;
  font-size: 10px;
  margin-bottom: 6px;
}
.block-actions {
  display: flex;
  gap: 2px;
}
.block-actions button {
  padding: 1px 6px;
  border: 0;
  font-size: 12px;
  background: transparent;
}
.block textarea {
  width: 100%;
  border: 0;
  resize: vertical;
  min-height: 60px;
  line-height: 1.85;
  color: #354b3f;
  background: transparent;
  display: block;
  outline-offset: 0;
  padding: 3px;
}
.block.heading textarea {
  font-weight: 600;
}
.block img {
  display: block;
  max-height: 160px;
  max-width: 100%;
  margin: 9px auto;
  object-fit: contain;
  border-radius: 3px;
}
.block .filename {
  font-size: 9px;
  overflow-wrap: anywhere;
  color: #8e9789;
}
.block input {
  font-size: 11px;
  padding: 7px;
}
.seg {
  display: flex;
  padding: 2px;
  background: #f3f5ee;
  border-radius: 5px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  font-size: 10px;
}
.seg .selected {
  background: white;
  box-shadow: 0 1px 3px #0001;
}
.preview-bg {
  background: #e9ece4;
  padding: 22px 12px;
  display: flex;
  justify-content: center;
  height: 835px;
}
.preview-wrap {
  position: sticky;
  top: 15px;
}
iframe {
  width: 375px;
  max-width: 100%;
  height: 100%;
  background: white;
  border: 0;
  box-shadow: 0 3px 20px #263d3210;
  border-radius: 4px;
}
.preview-note {
  font-size: 10px;
  color: #8a9584;
  padding: 12px 16px;
  display: grid;
  gap: 3px;
}
.hidden {
  display: none !important;
}
.section-heading {
  margin: 0 0 28px;
}
.section-heading h2 {
  font-size: 28px;
  margin-top: 8px;
  font-weight: 550;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 22px;
}
.card h3 {
  font-size: 16px;
  margin-bottom: 12px;
}
.card p {
  margin-bottom: 15px;
  color: #7c8775;
}
.card label {
  display: block;
  margin-top: 17px;
  color: #76836e;
  font-size: 12px;
}
.muted {
  font-size: 11px;
  color: #8a9584 !important;
  margin-top: 15px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.setup-list {
  list-style: none;
  counter-reset: setup;
  padding: 0;
  display: grid;
  gap: 20px;
  margin-top: 25px;
}
.setup-list li {
  counter-increment: setup;
  position: relative;
  padding-left: 36px;
}
.setup-list li:before {
  content: counter(setup);
  position: absolute;
  left: 0;
  background: #f0f3ea;
  color: #7f946f;
  width: 25px;
  height: 25px;
  line-height: 25px;
  text-align: center;
  border-radius: 50%;
  font-size: 11px;
}
.setup-list b {
  display: block;
  font-size: 13px;
  font-weight: 500;
}
.setup-list span {
  display: block;
  font-size: 11px;
  color: #8c9685;
  margin-top: 2px;
}
.send-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.send-card p {
  margin: 0;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.stat-grid > div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  font-size: 12px;
  color: #86927e;
}
.stat-grid b {
  font-size: 29px;
  display: block;
  color: var(--ink);
  font-weight: 500;
}
.table-scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 12px;
}
th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf0e8;
}
th {
  font-weight: 500;
  color: #8a9482;
}
.badge {
  background: #edf1e5;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10px;
}
.badge.stop {
  background: #f5e9df;
  color: #a27555;
}
.cost-result {
  padding: 35px;
}
.cost-result #totalCost {
  font-size: 46px;
  line-height: 1.8;
  margin: 22px 0 8px;
  letter-spacing: -2px;
}
.cost-result #budget {
  padding: 14px;
  border-radius: 6px;
  background: #eef4e7;
  font-size: 13px;
  color: #587441;
}
.cost-result a {
  font-size: 11px;
  color: #587441;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #294735;
  color: white;
  padding: 11px 22px;
  border-radius: 8px;
  box-shadow: 0 3px 20px #0002;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 9;
  max-width: 90vw;
}
#toast.show {
  opacity: 1;
}
#importResult {
  font-size: 12px;
  margin-top: 15px;
  color: #496c3b;
}
@media (min-width: 1600px) {
  main {
    padding-left: 48px;
    padding-right: 48px;
  }
  .compose-grid {
    gap: 32px;
  }
}
@media (max-width: 1150px) {
  aside {
    width: 185px;
    padding: 30px 15px;
  }
  main {
    margin-left: 185px;
    padding: 0 20px 35px;
  }
  .header-actions > span {
    display: none;
  }
  .header-actions button {
    font-size: 11px;
    padding: 9px;
  }
  .compose-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .preview-wrap {
    position: static;
  }
  #blocks {
    height: 550px;
  }
  .preview-bg {
    height: 700px;
  }
}
@media (max-width: 700px) {
  aside {
    position: static;
    width: 100%;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .logo > span {
    font-size: 23px;
    width: 34px;
    height: 36px;
    line-height: 34px;
  }
  .logo {
    font-size: 13px;
  }
  .workspace,
  .aside-bottom {
    display: none;
  }
  nav {
    display: flex;
    gap: 4px;
    overflow: auto;
    margin-top: 14px;
  }
  nav button {
    white-space: nowrap;
    padding: 8px;
    font-size: 11px;
  }
  main {
    margin: 0;
    padding: 0 14px 24px;
  }
  header {
    height: auto;
    padding: 22px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
  }
  h1 {
    font-size: 21px;
  }
  .header-actions {
    width: 100%;
  }
  .header-actions button {
    flex: 1;
  }
  .trial {
    margin: 17px 0 24px;
    font-size: 11px;
  }
  .editor-top {
    align-items: flex-start;
    flex-direction: column;
  }
  .editor-top h2 {
    font-size: 21px;
  }
  .compose-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
  .preview-bg {
    height: 650px;
    padding: 12px 5px;
  }
  .section-heading h2 {
    font-size: 23px;
  }
  .card {
    padding: 20px;
  }
  .stat-grid {
    gap: 8px;
  }
  .stat-grid > div {
    padding: 12px;
    font-size: 10px;
  }
  .stat-grid b {
    font-size: 23px;
  }
  .send-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .panel-title {
    padding: 14px;
  }
  #blocks {
    height: 500px;
  }
}
textarea {
  display: block;
  width: 100%;
  border: 1px solid #dce2d7;
  border-radius: 6px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
  line-height: 1.7;
  margin: 8px 0 16px;
  background: white;
}
.checkline {
  display: flex !important;
  align-items: center;
  gap: 8px;
}
.checkline input {
  width: auto;
  margin: 0;
}
.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 15px 0;
}
.status-grid > div {
  border: 1px solid #e3e7df;
  padding: 12px;
  border-radius: 5px;
  font-size: 12px;
}
.status-grid b {
  display: block;
  font-weight: 500;
  color: #849279;
  font-size: 11px;
}
.campaign-item {
  border-bottom: 1px solid #e4e8de;
  padding: 20px 0;
}
.campaign-item h4 {
  margin: 0 0 8px;
  font-size: 14px;
}
.campaign-item p {
  margin-bottom: 8px;
  font-size: 12px;
}
.campaign-item button {
  margin-right: 5px;
  padding: 6px 10px;
  font-size: 11px;
}
.note-warning {
  background: #f9f3df;
  border-radius: 5px;
  padding: 12px;
  font-size: 12px;
  color: #81743d;
  margin: 12px 0;
}
.audit-row {
  font-size: 11px;
  border-bottom: 1px solid #e3e7df;
  padding: 10px 0;
  color: #7a8771;
}
.header-actions {
  flex-wrap: wrap;
}
.header-actions button {
  font-size: 11px;
  padding: 8px 10px;
}
.card textarea {
  font-size: 12px;
}
#noticeResult {
  margin-top: 15px;
  font-size: 13px;
  color: #496c3b;
}
@media (max-width: 700px) {
  .status-grid {
    grid-template-columns: 1fr;
  }
  .header-actions button {
    flex: 1 1 40%;
  }
}

/* ---- VPS版で追加 ---- */
.account {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.account span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account button {
  padding: 4px 10px;
  font-size: 12px;
  flex: none;
  color: var(--ink);
}
.trial > span.ok {
  background: #365d49;
  color: white;
}
.row-list {
  margin-top: 10px;
}
.row-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.row-list button {
  padding: 4px 10px;
  font-size: 12px;
  flex: none;
}
.uncertain-list {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #fbf6ea;
  border: 1px solid #ecdcae;
  border-radius: 7px;
}
.uncertain-list > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  font-size: 13px;
}
.uncertain-list .addr {
  flex: 1 1 220px;
  overflow-wrap: anywhere;
}
.uncertain-list button {
  padding: 3px 9px;
  font-size: 12px;
  margin: 0;
}
.hold-note {
  margin: 6px 0;
  padding: 7px 10px;
  border-radius: 6px;
  background: #eef3ea;
  font-size: 13px;
}
.hold-note.attention {
  background: #fbeceb;
  color: #8c2f25;
}
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px 26px;
}
.login-card h1 {
  font-size: 20px;
  margin: 0 0 4px;
}
.login-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}
.login-card label {
  display: block;
  font-size: 13px;
  margin-bottom: 14px;
}
.login-card input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 11px;
  border: 1px solid #dce2d7;
  border-radius: 7px;
  font-size: 16px;
}
.login-card button {
  width: 100%;
  padding: 11px;
}
.login-card .error {
  min-height: 1.6em;
  margin: 12px 0 0;
  color: #8c2f25;
  font-size: 13px;
}
