@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&display=swap');
*{box-sizing:border-box}html,body{height:100%}
html{scrollbar-gutter:stable}
body{margin:0;font-family:'Quicksand',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,'Apple Color Emoji','Segoe UI Emoji',sans-serif;color:#1f2937;background:#ffffff}
.page{display:grid;grid-template-rows:auto auto 1fr auto auto;gap:16px;max-width:960px;margin:0 auto;padding:16px}
.row{width:100%}

.row-header{display:grid;grid-template-columns:1fr auto;align-items:center}
.logo,.footer-logo{font-weight:700;text-decoration:none;color:#111827;font-size:20px;letter-spacing:.5px}
.header-right{display:flex;align-items:center;gap:8px}
.header-actions{display:flex;align-items:center;gap:8px}
.header-right nav a{margin-left:12px;text-decoration:none;color:#374151;font-weight:600}
.header-right nav a:hover{color:#111827}

/* Buttons */
.btn{width:auto;height:auto;padding:8px 12px;display:inline-flex;gap:6px;align-items:center;border:1px solid #e5e7eb;background:#ffffff;color:#374151;border-radius:8px;text-decoration:none;font-size:14px;line-height:1;font-family:inherit;font-weight:400;appearance:none;-webkit-appearance:none}
.btn:hover{background:#f3f4f6;border-color:#e5e7eb;color:#111827}

/* User dropdown */
.user-dropdown{position:relative}
.user-dropdown details{position:relative}
.user-dropdown summary{list-style:none;display:flex;align-items:center;gap:8px;cursor:pointer;padding:6px 10px;border:1px solid #e5e7eb;border-radius:10px;background:#ffffff;color:#374151}
.user-dropdown summary::-webkit-details-marker{display:none}
.user-dropdown .avatar{width:28px;height:28px;border-radius:10px;background:#111827;color:#ffffff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px}
.user-dropdown .username{font-weight:600}
.user-dropdown .chev{color:#6b7280}
.user-dropdown .dropdown-menu{position:absolute;right:0;top:calc(100% + 8px);background:#ffffff;border:1px solid #e5e7eb;border-radius:12px;min-width:180px;box-shadow:0 10px 20px rgba(0,0,0,.08);padding:6px;z-index:50}
.user-dropdown .dropdown-menu li{list-style:none}
.user-dropdown .dropdown-menu a{display:block;padding:8px 10px;color:#374151;text-decoration:none;border-radius:8px}
.user-dropdown .dropdown-menu a:hover{background:#f3f4f6;color:#111827}

.row-banner .banner{width:100%;min-height:140px;border-radius:12px;background:linear-gradient(135deg,#f3f4f6 0%,#e5e7eb 100%);display:flex;align-items:center;justify-content:center;border:1px solid #e5e7eb}
.banner-content h1{margin:0;font-size:22px;color:#111827;text-align:center}

.row-main .haiku-list{display:grid;grid-template-columns:1fr;gap:16px}
.haiku-card{border:1px solid #e5e7eb;border-radius:12px;padding:16px;background:#ffffff;display:grid;grid-template-columns:1fr 3.6fr 1fr;gap:8px;align-items:stretch}
.haiku-left{display:flex;align-items:flex-start;justify-content:flex-start}
.haiku-center{display:flex;align-items:center;justify-content:center}
.haiku-right{display:flex;flex-direction:column;gap:8px;align-items:flex-end;justify-content:space-between}
.haiku-title{margin:0 0 6px 0;font-size:18px;color:#111827}
.haiku-author{font-size:13px;color:#6b7280;margin-bottom:10px;text-align:center}
.haiku-meta{font-size:13px;color:#6b7280;margin-bottom:10px;text-align:center}
.haiku-text{margin:0;font-family:'Quicksand',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,'Apple Color Emoji','Segoe UI Emoji',sans-serif;font-size:24px;white-space:pre-wrap;line-height:1.7;color:#111827;text-align:center}
.tags{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.metadata{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.tag{display:inline-block;padding:4px 8px;border:1px solid #e5e7eb;border-radius:9999px;font-size:12px;color:#374151;background:#ffffff}
.date-badge{display:inline-block;padding:4px 8px;border:1px solid #e5e7eb;border-radius:9999px;font-size:12px;color:#374151;background:#ffffff}
.lang-badge{text-align:center}
.action-btn{width:36px;height:36px;border-radius:10px;border:1px solid #e5e7eb;background:#ffffff;color:#9ca3af;display:flex;align-items:center;justify-content:center;cursor:pointer}
.stat-btn{height:36px;border-radius:10px;border:1px solid #e5e7eb;background:#ffffff;color:#9ca3af;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 10px;cursor:default}
.action-btn:hover,.stat-btn:hover{background:#f3f4f6;color:#374151}
.action-btn svg,.stat-btn svg{width:20px;height:20px;display:block}

@media (max-width:640px){
  .haiku-card{grid-template-columns:1fr;gap:12px}
  .haiku-left{order:2;justify-content:center}
  .haiku-center{order:1}
  .haiku-right{order:3;flex-direction:row;justify-content:center}
  .lang-badge{display:inline-block;position:relative;left:50%;transform:translateX(-50%);margin-top:4px}
  .date-badge{display:inline-block;position:relative;left:50%;transform:translateX(-50%)}
  .tags{flex-direction:row;flex-wrap:wrap;gap:6px;justify-content:center;align-items:center}
  .metadata{flex-direction:row;flex-wrap:wrap;gap:6px;justify-content:center;align-items:center}
}
.empty{padding:24px;text-align:center;color:#6b7280;border:1px dashed #e5e7eb;border-radius:12px;background:#fafafa}

.row-pagination .pagination{list-style:none;display:flex;gap:8px;padding:0;margin:0;justify-content:center}
.page-item a{display:inline-block;padding:8px 12px;border:1px solid #e5e7eb;border-radius:8px;text-decoration:none;color:#374151;background:#ffffff}
.page-item.active a{background:#111827;color:#ffffff;border-color:#111827}
.page-item.disabled a{opacity:.5;pointer-events:none}

.row-footer{display:grid;grid-template-columns:1fr 1fr 1fr;align-items:stretch;padding-top:12px;gap:12px}
.footer-col{display:flex;align-items:center;justify-content:center;text-align:center;border:1px solid #e5e7eb;border-radius:12px;background:#f3f4f6;padding:12px;height:100%}
.footer-left{background:#FFDD00}
.footer-center{justify-content:center}

/* Account layout */
.account-grid{display:grid;grid-template-columns:1fr 3fr;gap:16px}
.account-sidebar{border:1px solid #e5e7eb;border-radius:12px;background:#ffffff;padding:16px}
.account-content{border:1px solid #e5e7eb;border-radius:12px;background:#ffffff;padding:16px}
.account-user{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.account-avatar{width:36px;height:36px;border-radius:10px;background:#111827;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700}
.account-username{font-weight:700;color:#111827}
.account-menu{display:flex;flex-direction:column;gap:8px}
.account-menu-item{display:block;padding:10px 12px;border:1px solid #e5e7eb;border-radius:8px;color:#374151;text-decoration:none;background:#fff}
.account-menu-item:hover{background:#f3f4f6;color:#111827}
.account-menu-item.active{background:#111827;color:#ffffff;border-color:#111827}
.account-menu-item.danger{border-color:#fecaca;color:#991b1b}
.account-menu-item.danger:hover{background:#fee2e2;color:#7f1d1d}

@media (max-width:640px){
  .account-grid{grid-template-columns:1fr}
}
.footer-right{justify-content:center}
.footer-center a,.social a{color:#374151;text-decoration:none;margin-left:12px}
.footer-center a:hover,.social a:hover{color:#111827}

@media (max-width:640px){
  .row-header{grid-template-columns:1fr;justify-items:center}
  .header-right{margin-top:8px;justify-content:center}
  .row-footer{grid-template-columns:1fr}
  .footer-right,.footer-center{justify-content:flex-start;margin-top:8px}
}
