* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
  background: #f5f7f5;
  color: #333;
  min-height: 100vh;
}

header {
  background: #2d7a4f;
  color: white;
  text-align: center;
  padding: 24px 16px 16px;
}

header h1 {
  font-size: 28px;
  letter-spacing: 4px;
}

header .subtitle {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 4px;
}

main {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px;
}

.input-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.btn {
  flex: 1;
  padding: 16px 8px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: bold;
  transition: opacity 0.2s;
}

.btn-primary {
  background: #2d7a4f;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  font-size: 13px;
  padding: 16px 4px;
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
}

.badge {
  font-size: 10px;
  background: #999;
  color: white;
  border-radius: 4px;
  padding: 2px 6px;
}

.btn-voice-recording {
  background: #dc2626 !important;
}

.btn-voice-processing {
  background: #6b7280 !important;
}

.voice-status-message {
  font-size: 0.9rem;
  color: #dc2626;
  text-align: center;
  margin-bottom: 16px;
}

.loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #2d7a4f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none;
}

.form-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.form-section h2 {
  font-size: 18px;
  color: #2d7a4f;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8f5ee;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #555;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fafafa;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2d7a4f;
  background: white;
}

.btn-save {
  width: 100%;
  background: #2d7a4f;
  color: white;
  padding: 16px;
  font-size: 16px;
  border-radius: 12px;
  margin-top: 8px;
}

.btn-save:hover {
  opacity: 0.85;
}

.save-message {
  text-align: center;
  color: #2d7a4f;
  font-weight: bold;
  margin-top: 12px;
}

.doc-preview-box {
  margin-bottom: 20px;
}
.doc-preview-box > label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #555;
  margin-bottom: 8px;
}
.doc-preview-inner {
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 16px;
  font-size: 13px;
}
.preview-badge {
  display: inline-block;
  background: #e8f5ee;
  color: #2d7a4f;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.preview-title {
  font-size: 16px;
  font-weight: bold;
  color: #2d7a4f;
  margin-bottom: 8px;
}
.preview-meta {
  display: flex;
  gap: 12px;
  color: #777;
  font-size: 12px;
  margin-bottom: 10px;
}
.preview-summary {
  background: #f5f7f5;
  border-radius: 8px;
  padding: 10px;
  color: #444;
  margin-bottom: 12px;
  line-height: 1.6;
}
.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.preview-table th {
  background: #2d7a4f;
  color: white;
  padding: 6px 10px;
  text-align: left;
  width: 35%;
}
.preview-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #eee;
  color: #333;
}
.save-format-section {
  margin-top: 24px;
}
.save-label {
  display: block;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  margin-bottom: 12px;
}
.save-format-buttons {
  display: flex;
  gap: 8px;
}
.btn-save-small {
  flex: 1;
  padding: 14px 8px;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  background: #2d7a4f;
  color: white;
}
.btn-save-small:hover {
  opacity: 0.85;
}

.paper-size-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.btn-paper {
  flex: 1;
  padding: 10px;
  border: 2px solid #2d7a4f;
  border-radius: 8px;
  background: white;
  color: #2d7a4f;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
}
.btn-paper.active {
  background: #2d7a4f;
  color: white;
}
.btn-color {
  flex: 1;
  padding: 10px;
  border: 2px solid #2d7a4f;
  border-radius: 8px;
  background: white;
  color: #2d7a4f;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
}
.btn-color.active {
  background: #2d7a4f;
  color: white;
}

.btn-back {
  background: none;
  border: 2px solid #2d7a4f;
  color: #2d7a4f;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 16px;
  display: block;
}
.btn-back:hover {
  background: #e8f5ee;
}

.btn-orient {
  flex: 1;
  padding: 10px;
  border: 2px solid #2d7a4f;
  border-radius: 8px;
  background: white;
  color: #2d7a4f;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
}
.btn-orient.active {
  background: #2d7a4f;
  color: white;
}

.btn-list-view {
  display: block;
  width: 100%;
  background: none;
  border: 2px solid #2d7a4f;
  color: #2d7a4f;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 24px;
}
.btn-list-view:hover {
  background: #e8f5ee;
}

.doc-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.doc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.btn-doc-delete {
  background: #dc2626;
  color: white;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  border: none;
}
.doc-card-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.doc-card-buttons .btn {
  flex: 1;
}

.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.edit-actions .btn-back {
  flex: 1;
  margin-bottom: 0;
  text-align: center;
}
.edit-actions .btn-save {
  flex: 1;
  margin-top: 0;
}

.doc-card-actions {
  display: flex;
  gap: 8px;
}
.btn-doc-edit {
  background: #2563eb;
  color: white;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  border: none;
}

.org-header {
  background: #2d6a4f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin: -24px -24px 20px -24px;
  border-radius: 16px 16px 0 0;
}
.org-header-back {
  color: white;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}
.org-header-title {
  color: white;
  font-size: 1.1rem;
  font-weight: bold;
}

.status-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.status-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 0.95rem;
}
.status-option input[type="radio"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: #2d6a4f;
  cursor: pointer;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  vertical-align: middle;
}
.status-option span {
  line-height: 1.4;
  vertical-align: middle;
}
.status-option:hover {
  border-color: #2d6a4f;
  background: #f0fdf4;
}
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.status-badge.private {
  background: #f3f4f6;
  color: #6b7280;
}
.status-badge.draft {
  background: #fef3c7;
  color: #d97706;
}
.status-badge.shared {
  background: #d1fae5;
  color: #065f46;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.btn-template {
  padding: 18px 16px;
  border: 2px solid #2d7a4f;
  border-radius: 12px;
  background: white;
  color: #2d7a4f;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  text-align: left;
}
.btn-template:hover {
  background: #e8f5ee;
}
