:root {
  color-scheme: light;
  --bg: #f4f6f1;
  --surface: #ffffff;
  --surface-strong: #eef2ea;
  --text: #15201b;
  --muted: #66736b;
  --line: #d8dfd5;
  --accent: #14746f;
  --accent-strong: #0b5f5a;
  --danger: #a33b32;
  --shadow: 0 16px 42px rgba(23, 37, 32, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

.app-shell {
  width: min(960px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 36px;
  line-height: 1.1;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

.status-pill {
  min-width: 104px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.status-pill.ok {
  border-color: #88b8a7;
  background: #e6f4ec;
  color: #176342;
}

.panel,
.history {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.panel-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: right;
}

.stack {
  display: grid;
  gap: 10px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(20, 116, 111, 0.15);
}

.inline-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0 16px;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

button.secondary {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

button.secondary:hover {
  background: #dfe7dc;
}

button.danger {
  border: 1px solid rgba(163, 59, 50, 0.25);
  background: #fbebe9;
  color: var(--danger);
}

.import-list {
  display: grid;
  gap: 12px;
}

.import-item {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  overflow: hidden;
}

.cover {
  width: 112px;
  height: 100%;
  min-height: 96px;
  background: var(--surface-strong);
  object-fit: cover;
}

.fallback-cover {
  display: grid;
  place-items: center;
  width: 112px;
  min-height: 96px;
  background: var(--surface-strong);
  color: var(--accent);
  font-weight: 800;
}

.import-body {
  min-width: 0;
  padding: 12px 12px 12px 0;
}

.import-title {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.import-url,
.import-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.import-url {
  display: block;
  margin-bottom: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #15201b;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 960px);
    padding-top: 18px;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-head p {
    text-align: left;
  }

  h1 {
    font-size: 30px;
  }

  .inline-row {
    grid-template-columns: 1fr;
  }

  .import-item {
    grid-template-columns: 88px 1fr;
  }

  .cover,
  .fallback-cover {
    width: 88px;
  }
}

