/*


 */

body {
  font-family: system-ui, -apple-system, sans-serif;
  color: #222;
  margin: 0;
  padding: 0;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #eee;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.navbar-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.1rem;
  color: #2557a7;
}

.navbar-auth {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.login-btn {
  color: #2557a7;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid #2557a7;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.login-btn:hover {
  background: #2557a7;
  color: #fff;
  text-decoration: none;
}

.user-menu {
  position: relative;
  padding-bottom: 0.5rem;
}

.user-icon-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.user-icon-btn:hover {
  background: #f0f0f0;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% - 0.5rem);
  right: 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  min-width: 150px;
}

.user-menu:hover .user-menu-dropdown {
  display: block;
}

.logout-form {
  margin: 0;
}

.dropdown-link,
.logout-link {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  color: #2557a7;
  text-decoration: none;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
  border-bottom: none;
}

.dropdown-link:hover,
.logout-link:hover {
  background: #f9f9f9;
  text-decoration: none;
}

.navbar-spacer {
  height: 0;
}

main,
.content {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1 { margin-bottom: 0.25rem; }
h2 { margin-top: 2rem; }
.sub { color: #666; margin-top: 0; }

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.5rem;
  margin: 1.5rem 0;
}
dt { font-weight: 600; color: #555; }
dd { margin: 0; font-variant-numeric: tabular-nums; }

table { border-collapse: collapse; margin-top: 0.5rem; width: 100%; }
th, td {
  padding: 0.4rem 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-variant-numeric: tabular-nums;
  vertical-align: top;
}
th { font-weight: 600; color: #555; }

a:not([class]) { color: #2557a7; text-decoration: none; }
a:not([class]):hover { text-decoration: underline; }

code {
  background: #f4f4f4;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.empty {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  padding: 1rem;
  border-radius: 6px;
}

.meta {
  color: #666;
  font-size: 0.9rem;
  margin: 0.5rem 0 1.5rem;
}

.post-date {
  white-space: nowrap;
  color: #666;
  font-variant-numeric: tabular-nums;
  width: 7em;
}

.back-link { display: inline-block; margin-bottom: 1rem; font-size: 0.95rem; }

tr.is-read td        { color: #999; }
tr.is-read td a      { color: #888; }
.read-marker {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.05em 0.4em;
  font-size: 0.75rem;
  background: #eee;
  color: #666;
  border-radius: 3px;
  vertical-align: middle;
}

/* Landing Page */
.landing-hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  padding: 4rem 1rem;
  text-align: center;
}

.landing-content {
  max-width: 700px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #666;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-primary,
.cta-secondary,
.cta-large {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
}

.cta-primary {
  background: #2557a7;
  color: #fff;
  font-size: 1rem;
}

.cta-primary:hover {
  background: #1d4278;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 87, 167, 0.3);
}

.cta-secondary {
  background: transparent;
  color: #2557a7;
  border: 2px solid #2557a7;
  padding: 0.6rem 1.4rem;
}

.cta-secondary:hover {
  background: #f0f5ff;
  text-decoration: none;
}

.cta-large {
  background: #2557a7;
  color: #fff;
  font-size: 1.1rem;
  padding: 1rem 2rem;
}

.cta-large:hover {
  background: #1d4278;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 87, 167, 0.3);
}

.landing-stats {
  padding: 2.5rem 1rem;
  background: #1a1a1a;
}

.stats-container {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  text-align: center;
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 0.25rem;
}

.landing-how {
  padding: 4rem 1rem;
}

.how-container {
  max-width: 1000px;
  margin: 0 auto;
}

.how-container h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.how-subtitle {
  text-align: center;
  color: #666;
  font-size: 1.1rem;
  margin: 0 0 3rem;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.how-step {
  text-align: center;
}

.how-number {
  width: 2.5rem;
  height: 2.5rem;
  line-height: 2.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #2557a7;
  color: #fff;
  font-weight: 700;
}

.how-step h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  color: #1a1a1a;
}

.how-step p {
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.landing-features {
  padding: 4rem 1rem;
  background: #fafbfc;
}

.features-container {
  max-width: 1000px;
  margin: 0 auto;
}

.features-container h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 3rem;
  color: #1a1a1a;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin: 1rem 0 0.5rem;
  color: #1a1a1a;
}

.feature-card p {
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.landing-cta {
  padding: 4rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, #2557a7 0%, #1d4278 100%);
  color: #fff;
}

.cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.landing-cta h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #fff;
}

.landing-cta p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.6;
}

.landing-cta .cta-large {
  background: #fff;
  color: #2557a7;
}

.landing-cta .cta-large:hover {
  background: #f0f5ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Auth Pages */
.auth-container {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 2.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 400px;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 2rem;
  color: #1a1a1a;
  text-align: center;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: #333;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #2557a7;
  box-shadow: 0 0 0 3px rgba(37, 87, 167, 0.1);
}

.form-input:hover {
  border-color: #ccc;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.checkbox-group label {
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

.form-actions {
  margin-bottom: 1.5rem;
}

.btn-primary {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #2557a7;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #1d4278;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 87, 167, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.auth-links {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.auth-links a {
  display: inline-block;
  color: #2557a7;
  text-decoration: none;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-links p {
  margin: 0.5rem 0;
  color: #666;
  font-size: 0.9rem;
}

.error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.error-title {
  color: #dc2626;
  font-weight: 600;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.error-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.error-list li {
  color: #991b1b;
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.password-hint {
  display: block;
  color: #666;
  font-size: 0.85rem;
  font-weight: 400;
  margin-top: 0.25rem;
}

.pending-confirmation {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  color: #92400e;
  font-size: 0.9rem;
}

.delete-account-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.delete-account-section h3 {
  font-size: 1.1rem;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.delete-account-section p {
  color: #666;
  margin-bottom: 1rem;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-family: inherit;
}

.btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.back-link {
  margin-top: 2rem;
  text-align: center;
}

.back-link a {
  color: #2557a7;
  text-decoration: none;
}

.card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1.5rem;
}

ul, ol {
  margin: 1.5rem 0;
  padding-left: 1.75rem;
}

li {
  margin: 0.75rem 0;
  line-height: 1.6;
  color: #333;
}

ul li {
  list-style-type: disc;
}

ol li {
  list-style-type: decimal;
}

/* Submission cards (submissions#index) */
.submission-card {
  background: oklch(0.995 0.004 80);
  border: 1px solid oklch(0.87 0.015 70);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  transition: box-shadow 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.submission-card:hover {
  box-shadow: 0 6px 20px -6px oklch(0.4 0.03 60 / 0.22);
  transform: translateY(-2px);
  border-color: oklch(0.8 0.02 70);
}

.submission-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.submission-title {
  font-family: "Source Serif 4", ui-serif, Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  color: oklch(0.24 0.02 50);
  text-decoration: none;
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.submission-title:hover {
  color: oklch(0.4 0.1 75);
  text-decoration: underline;
}

.submission-meta {
  font-size: 12px;
  letter-spacing: 0.03em;
  color: oklch(0.55 0.02 60);
  margin-top: 8px;
}

.status-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

.status-toggle:disabled {
  cursor: default;
  opacity: 0.6;
}

.status-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 150ms ease, opacity 150ms ease;
}

.status-toggle.draft .status-label { color: oklch(0.5 0.08 75); }
.status-toggle.published .status-label { color: oklch(0.42 0.11 155); }
.status-toggle:hover .status-label { opacity: 0.8; }

.switch-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.status-toggle.draft .switch-track {
  background: oklch(0.89 0.035 75);
  justify-content: flex-start;
}

.status-toggle.published .switch-track {
  background: oklch(0.6 0.13 155);
  justify-content: flex-end;
}

.status-toggle.draft:hover .switch-track { background: oklch(0.84 0.05 75); }
.status-toggle.published:hover .switch-track { background: oklch(0.54 0.14 155); }
.status-toggle:active .switch-track { transform: scale(0.94); }

.switch-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: oklch(0.995 0.004 80);
  box-shadow: 0 1px 3px oklch(0.35 0.03 60 / 0.4);
  transition: box-shadow 150ms ease;
}

.status-toggle:hover .switch-thumb {
  box-shadow: 0 2px 6px oklch(0.35 0.03 60 / 0.5);
}

.new-submission-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: oklch(0.24 0.02 50);
  color: oklch(0.97 0.012 75);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 8px;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.new-submission-btn:hover {
  background: oklch(0.32 0.03 60);
  box-shadow: 0 4px 14px -4px oklch(0.3 0.03 60 / 0.35);
  transform: translateY(-1px);
  text-decoration: none;
}

.new-submission-btn:active {
  transform: translateY(0);
}

/* Profile page */
.profile-subtitle {
  color: oklch(0.55 0.02 60);
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
}

.profile-card {
  background: oklch(0.995 0.004 80);
  border: 1px solid oklch(0.87 0.015 70);
  border-radius: 14px;
  padding: 2rem;
}

.profile-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.profile-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 160px;
}

.avatar-upload {
  position: relative;
  width: 140px;
  height: 140px;
}

.avatar-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: oklch(0.97 0.012 75);
  border: 2px dashed oklch(0.8 0.02 70);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 150ms ease, background 150ms ease;
}

.avatar-icon {
  color: oklch(0.6 0.025 65);
  transition: color 150ms ease;
}

.avatar-upload:hover .avatar-circle {
  border-color: oklch(0.6 0.05 70);
  background: oklch(0.95 0.02 75);
}

.avatar-upload:hover .avatar-icon {
  color: oklch(0.4 0.1 75);
}

.avatar-edit-btn {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: oklch(0.24 0.02 50);
  color: oklch(0.97 0.012 75);
  border: 3px solid oklch(0.995 0.004 80);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px oklch(0.35 0.03 60 / 0.35);
  transition: background 150ms ease, transform 150ms ease;
}

.avatar-edit-btn:hover {
  background: oklch(0.32 0.03 60);
  transform: translateY(-1px);
}

.avatar-hint {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: oklch(0.55 0.02 60);
  text-align: center;
}

.profile-fields-col {
  flex: 1;
  min-width: 0;
}

.profile-field {
  margin-bottom: 1.5rem;
}

.profile-field:last-child {
  margin-bottom: 0;
}

.profile-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: oklch(0.24 0.02 50);
  margin-bottom: 0.5rem;
}

.profile-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid oklch(0.87 0.015 70);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: oklch(0.995 0.004 80);
  color: oklch(0.24 0.02 50);
  box-sizing: border-box;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.profile-input::placeholder {
  color: oklch(0.65 0.015 65);
}

.profile-input:focus {
  outline: none;
  border-color: oklch(0.6 0.1 75);
  box-shadow: 0 0 0 3px oklch(0.7 0.08 75 / 0.25);
}

.profile-input:hover {
  border-color: oklch(0.78 0.02 70);
}

.profile-textarea {
  resize: vertical;
  line-height: 1.6;
}

.profile-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid oklch(0.9 0.012 75);
  display: flex;
  justify-content: flex-end;
}

.save-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.7rem 1.5rem;
  background: oklch(0.24 0.02 50);
  color: oklch(0.97 0.012 75);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.save-profile-btn:hover {
  background: oklch(0.32 0.03 60);
  box-shadow: 0 4px 14px -4px oklch(0.3 0.03 60 / 0.35);
  transform: translateY(-1px);
}

.save-profile-btn:active {
  transform: translateY(0);
}

@media (max-width: 560px) {
  .profile-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-fields-col {
    width: 100%;
  }
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Avatar crop modal */
.crop-modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.2 0.02 50 / 0.55);
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.crop-modal {
  background: oklch(0.995 0.004 80);
  border-radius: 14px;
  padding: 1.5rem;
  width: min(90vw, 380px);
  box-shadow: 0 12px 32px oklch(0.2 0.03 50 / 0.3);
}

.crop-modal-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: oklch(0.24 0.02 50);
}

.crop-image-wrapper {
  width: 100%;
  height: 280px;
  background: oklch(0.15 0.01 50);
  border-radius: 8px;
  overflow: hidden;
}

.crop-image-wrapper img {
  display: block;
  max-width: 100%;
}

.crop-zoom-control {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.crop-zoom-icon {
  color: oklch(0.55 0.02 60);
  flex-shrink: 0;
}

.crop-zoom-icon-sm {
  width: 14px;
  height: 14px;
}

.crop-zoom-slider {
  flex: 1;
  accent-color: oklch(0.24 0.02 50);
}

.crop-modal-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.crop-btn {
  padding: 0.6rem 1.25rem;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 150ms ease, transform 150ms ease;
}

.crop-btn-secondary {
  background: oklch(0.995 0.004 80);
  border-color: oklch(0.87 0.015 70);
  color: oklch(0.24 0.02 50);
}

.crop-btn-secondary:hover {
  background: oklch(0.95 0.02 75);
}

.crop-btn-primary {
  background: oklch(0.24 0.02 50);
  color: oklch(0.97 0.012 75);
}

.crop-btn-primary:hover {
  background: oklch(0.32 0.03 60);
  transform: translateY(-1px);
}
