* {
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", system-ui, sans-serif;
    margin: 0;
    color: #1a1a1a;
    background: #f6f4f1;
    line-height: 1.5;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
}

.site-header {
    background: #3d4f5f;
    color: #fff;
    padding-bottom: 0.5rem;
}

.site-title {
    margin: 0;
    font-size: 1.75rem;
}

.site-title a {
    color: inherit;
    text-decoration: none;
}

.site-tagline {
    margin: 0.25rem 0 0.75rem;
    opacity: 0.9;
}

nav a {
    color: #dce8f2;
    margin-right: 1rem;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

.site-footer {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #ddd;
    color: #666;
}

.recipe-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.recipe-table th,
.recipe-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.recipe-table th {
    background: #eef2f5;
    font-weight: 600;
}

.recipe-table .col-thumb {
    width: 90px;
}

.recipe-thumb {
    display: block;
    max-width: 80px;
    max-height: 110px;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
}

.btn {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: #3d4f5f;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn:hover {
    background: #2f3d49;
}

.empty-state {
    background: #fff;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    border: 1px dashed #ccc;
}

.help-line {
    margin-top: 0.75rem;
    color: #444;
    font-size: 0.95rem;
}

.search-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 0.35rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.search-label {
    font-weight: 600;
    margin-right: 0.25rem;
}

.search-input {
    flex: 1 1 12rem;
    min-width: 12rem;
    padding: 0.4rem 0.55rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.search-form .search-help {
    margin-top: 0;
    margin-bottom: 1rem;
}

.search-results {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result {
    background: #fff;
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.search-result-title {
    font-weight: 600;
    color: #2f3d49;
    text-decoration: none;
}

.search-result-title:hover {
    text-decoration: underline;
}

.search-result-snippet {
    margin: 0.35rem 0 0;
    color: #444;
    font-size: 0.95rem;
}

.upload-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.upload-label {
    font-weight: 600;
    margin-right: 0.25rem;
}

.thumb-error-log {
    white-space: pre-wrap;
    font-size: 0.8rem;
    max-height: 12rem;
    overflow: auto;
    background: #f8f8f8;
    padding: 0.5rem;
    border-radius: 4px;
}

.upload-error {
    color: #8b1a1a;
    background: #fdeaea;
    border: 1px solid #e8b4b4;
    padding: 0.65rem 0.85rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.status-list dt {
    font-weight: 600;
    margin-top: 0.75rem;
}

.status-list dd {
    margin: 0.15rem 0 0;
}

.hint {
    margin-top: 1.5rem;
    color: #555;
}

.back-link {
    margin-bottom: 1rem;
}

.back-link a {
    color: #3d4f5f;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

.recipe-table tr.recipe-row {
    cursor: pointer;
}

.recipe-table tr.recipe-row:hover {
    background: #f8fafc;
}

.recipe-thumb-link,
.recipe-title-link {
    color: inherit;
    text-decoration: none;
}

.recipe-title-link:hover {
    text-decoration: underline;
}

.recipe-detail {
    background: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.recipe-detail-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.recipe-detail-header h2 {
    margin: 0;
    flex: 1 1 auto;
}

.btn-share-open {
    flex: 0 0 auto;
}

.share-dialog {
    border: none;
    border-radius: 8px;
    padding: 0;
    max-width: 28rem;
    width: calc(100% - 2rem);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.share-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.share-dialog-inner {
    margin: 0;
    padding: 0;
}

.share-dialog-header,
.share-dialog-body,
.share-dialog-footer {
    padding: 1rem 1.25rem;
}

.share-dialog-header {
    border-bottom: 1px solid #eee;
}

.share-dialog-header h3 {
    margin: 0;
    font-size: 1.15rem;
}

.share-dialog-footer {
    border-top: 1px solid #eee;
    text-align: right;
}

.share-code-line {
    margin: 0 0 0.75rem;
    word-break: break-all;
}

.share-code-label {
    font-weight: 600;
}

.share-help {
    color: #555;
    font-size: 0.95rem;
    margin: 1rem 0;
}

.share-copy-feedback,
.share-email-feedback {
    min-height: 1.25rem;
    margin: 0.35rem 0 0;
    color: #2d6a4f;
    font-size: 0.95rem;
}

.share-status-error {
    color: #a4161a;
}

.share-dialog input[type="email"],
.share-dialog input[type="text"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.5rem;
}

.hent-share {
    background: #fff;
    padding: 1.5rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    max-width: 28rem;
}

.hent-lead {
    margin-top: 0;
}

.hent-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.hent-form input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.75rem;
}

.recipe-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
    margin: 0 0 1.25rem;
}

.recipe-meta dt {
    font-weight: 600;
    color: #555;
}

.recipe-meta dd {
    margin: 0;
}

.recipe-pdf-panel h3,
.recipe-comments h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.recipe-pdf-frame {
    width: 100%;
    min-height: 480px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.pdf-actions {
    margin: 0 0 0.75rem;
}

.recipe-comments {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #eee;
}

.comment-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.comment-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-body {
    margin: 0 0 0.35rem;
    white-space: pre-wrap;
}

.comment-meta {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.comment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.comment-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.comment-form textarea {
    width: 100%;
    max-width: 100%;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.comment-form-add {
    margin-top: 1rem;
}

.comment-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inline-form {
    display: inline;
}

.empty-comments {
    color: #666;
    margin: 0 0 1rem;
}

.btn-secondary {
    background: #eef2f5;
    color: #1a1a1a;
}

.btn-secondary:hover {
    background: #dde4ea;
}

.btn-danger {
    background: #8b1a1a;
}

.btn-danger:hover {
    background: #6d1414;
}

.recipe-delete {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid #eee;
}

.delete-confirm summary {
    list-style: none;
    cursor: pointer;
    display: inline-block;
}

.delete-confirm summary::-webkit-details-marker {
    display: none;
}

.delete-confirm-body {
    margin-top: 0.75rem;
    padding: 1rem;
    background: #fdeaea;
    border: 1px solid #e8b4b4;
    border-radius: 4px;
    max-width: 28rem;
}

.delete-confirm-text {
    margin: 0 0 0.75rem;
    font-weight: 600;
}

.delete-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.nav-auth {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.nav-user {
    font-weight: 600;
}

.nav-role {
    opacity: 0.85;
    font-size: 0.9rem;
}

.btn-nav {
    padding: 0.25rem 0.65rem;
    font-size: 0.9rem;
}

.nav-logout {
    margin: 0;
}

.login-prompt,
.login-lead,
.login-hint {
    color: #444;
}

.login-form {
    max-width: 22rem;
    background: #fff;
    padding: 1.25rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.login-form .form-field {
    margin-bottom: 1rem;
}

.login-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.login-form .form-control {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font: inherit;
}

.validation-summary {
    color: #a32020;
    margin-bottom: 1rem;
}

.field-validation {
    color: #a32020;
    font-size: 0.9rem;
}

.user-admin-actions {
    margin-bottom: 1rem;
}

.user-table .user-row-actions {
    white-space: nowrap;
}

.user-table .user-row-actions .btn,
.user-table .user-row-actions details {
    margin-right: 0.35rem;
    margin-bottom: 0.35rem;
}

.user-edit-form {
    max-width: 28rem;
    background: #fff;
    padding: 1.25rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.user-edit-form .form-field {
    margin-bottom: 1rem;
}

.user-edit-form .form-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.field-hint {
    font-size: 0.9rem;
    color: #555;
    margin: 0.35rem 0 0;
}
