*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: system-ui, sans-serif;
  background: #f0f4f8;
  color: #202124;
  line-height: 1.6;
}
header {
  background: var(--accent);
  color: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
header h1 {
  font-size: 1.4rem;
  font-weight: 500;
}
.badge {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px;
}
details.article-box {
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 16px;
  overflow: hidden;
}
details.article-box summary {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none;
  color: var(--accent);
  user-select: none;
}
details.article-box summary::marker,
details.article-box summary::-webkit-details-marker {
  display: none;
}
details.article-box summary::before {
  content: '▶ ';
  font-size: 0.6rem;
}
details[open].article-box summary::before {
  content: '▼ ';
}
#article-content {
  padding: 0 16px 16px;
  max-height: 240px;
  overflow-y: auto;
  font-size: 0.86rem;
  white-space: pre-wrap;
  color: #444;
  border-top: 1px solid #f0f4f8;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tab-button {
  padding: 6px 14px;
  border: none;
  background: white;
  border-radius: 18px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: #5f6368;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.tab-button.active {
  background: var(--accent);
  color: white;
}
.panel {
  display: none;
}
.panel.active {
  display: block;
}
.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.card-header h2 {
  font-size: 1rem;
  font-weight: 600;
}
.availability-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.availability-available {
  background: #e6f4ea;
  color: #137333;
}
.availability-downloadable {
  background: #fff8e1;
  color: #8a4f00;
}
.availability-downloading {
  background: #e3f2fd;
  color: #0d47a1;
}
.availability-unavailable {
  background: #fce8e6;
  color: #c5221f;
}
.availability-unknown {
  background: #f1f3f4;
  color: #5f6368;
}
.card-description {
  font-size: 0.84rem;
  color: #5f6368;
  margin-bottom: 16px;
}
.card-description code {
  background: #f1f3f4;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.8rem;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.control {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.control label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #5f6368;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
select {
  padding: 6px 8px;
  border: 1.5px solid #dadce0;
  border-radius: 6px;
  font-size: 0.86rem;
  background: white;
  cursor: pointer;
  color: #202124;
}
select:focus {
  outline: none;
  border-color: var(--accent);
}
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #dadce0;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  color: #202124;
  margin-bottom: 10px;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.button-primary {
  background: var(--accent);
  color: white;
}
.button-primary:disabled {
  background: #dadce0;
  color: #9aa0a6;
  cursor: not-allowed;
}
.download-progress {
  display: none;
  margin: 8px 0;
}
.download-progress progress {
  width: 100%;
  height: 5px;
  border-radius: 3px;
}
.download-progress span {
  font-size: 0.76rem;
  color: #5f6368;
}
.output-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #5f6368;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 12px 0 5px;
}
.output {
  background: #f8f9fa;
  border: 1.5px solid #e8eaed;
  border-radius: 6px;
  padding: 12px;
  min-height: 60px;
  font-size: 0.86rem;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #202124;
}
.output.empty {
  color: #9aa0a6;
  font-style: italic;
}
.output.loading {
  color: var(--accent);
}
.tags-output {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 38px;
  padding: 8px;
  background: #f8f9fa;
  border: 1.5px solid #e8eaed;
  border-radius: 6px;
}
.tag-chip {
  background: #e8f0fe;
  color: #1a73e8;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 500;
}
.image-upload {
  border: 2px dashed #dadce0;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 10px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-upload img {
  max-height: 160px;
  max-width: 100%;
  border-radius: 4px;
}
.image-upload p {
  color: #5f6368;
  font-size: 0.88rem;
}
footer {
  text-align: center;
  padding: 20px;
  color: #9aa0a6;
  font-size: 0.8rem;
}
footer a {
  color: var(--accent);
  text-decoration: none;
}
